bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
23.06k stars 4.04k forks source link

Feature: Improve bzlmod metadata.json model with minimal information for compliance/security #14778

Open heliocastro opened 2 years ago

heliocastro commented 2 years ago

Current metadata.json model has limited information, enough to provide data for project itself, but can be extended to provide better assessment to compliance and scanning tools.

Information, like license, description, upstream source and cpe string would be the minimal necessary for current existing tooling like Ort or Scancode have minimal details to process.

There's a reason to include such information as become the normative to be required instead be optional, for generating legal documentation ( i.e. SPDX )

An example of possible layout desirable on metadata.json ( using zlib bazel registry as example )

{
    "homepage": "https://zlib.net",
    "maintainers": [
        {
            "email": "bazel-dev@googlegroups.com",
            "name": "The Bazel Team"
        }
      "description": "lib is designed to be a free, general-purpose, legally unencumbered -- that is, not covered by any patents -- lossless data-compression library..."
      "license": "ZLib"
    ],
    "versions": [
        { 
             "version": "1.2.11",
             "source_url": "https://zlib.net/zlib-1.2.11.tar.gz",
             "cpeId": "cpe:2.3:a:gnu:zlib:1.2.11:*:*:*:*:*:*:*"
        },
    ],
    "yanked_versions": {}
}

So, brief explanation behind new elements:

tsteenbe commented 2 years ago

@heliocastro I would rather see purl than cpeid being support here. PURLs can be generated and have been adopted by various open source communities for example OSV used purl in its schema to uniquely identify packages and their known security vulnerabilities.

hobofan commented 1 year ago

There is some parallel discussion in the BCR repo: https://github.com/bazelbuild/bazel-central-registry/issues/131