Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

specification for sbom filename #32

Open
ctcpip opened this issue Aug 1, 2023 · 5 comments
Open

specification for sbom filename #32

ctcpip opened this issue Aug 1, 2023 · 5 comments

Comments

@ctcpip
Copy link
Member

ctcpip commented Aug 1, 2023

re: https://github.com/ossf/sbom-everywhere/blob/main/reference/sbom_naming.md

to minimize guesswork and prevent false positives or negatives, can we harden the naming conventions to be more standardized and thus validate conformity with the expected format for the filename?

for example, based on the current recommendation:

sbom.<projectName>-v<versionNumber>-<sbomFormat>.<extension>

which then could be regex validated via:

/sbom\.[a-z0-9-_]+[-_]v\d.+\d.+\d+([-_][a-z]+)?[-_][a-z]+\.[a-z]{3,4}/

or implementations can be more strict, using a list of known or supported types:

/sbom\.[a-z0-9\-_]+[-_]v\d.+\d.+\d+([-_][a-z]+)?[-_]((spdx)|(cdx)|(cyclonedx))\.((json|spdx|xml))/
@stevespringett
Copy link

@lumjjb
Copy link

lumjjb commented Aug 2, 2023 via email

@lumjjb
Copy link

lumjjb commented Aug 2, 2023 via email

@zvr
Copy link

zvr commented Aug 25, 2023

The SPDX standard mentions these naming conventions, depending on the format used:

Format Extension
Tag:Value *.spdx
RDF *.spdx.rdf
JSON *.spdx.json
XML *.spdx.xml
YAML *.spdx.yaml or *.spdx.yml

@david-a-wheeler
Copy link

@zvr lists the SPDX file extensions above.

@stevespringett referred to https://cyclonedx.org/specification/overview/#recognized-file-patterns which lists these file names and file extensions:

  • bom.json
  • bom.xml
  • *.cdx.json
  • *.cdx.xml

You'll typically want conventional file extensions, not a single filename:

  • It's nice to be able to know the filetype by looking at its extension. You can double-click on the file (to have it do the right thing), HTTP servers can select the correct MIME extension based on the file extension, etc.
  • You can't change the contents of a digitally-signed file without invalidating its signature. I expect many SBOMs to refer to other SBOMs, transitively, so that their digital signatures trivially stay valid (people have tried to have digital signatures over "parts of files" but in practice that is often too fragile).

So I expect in many cases you're going to have a set of SBOM files for "the SBOM", with conventional file extensions.

I would suggest the "sbom" directory when storing SBOMs in source repositories or archives (e.g., zip, .tar.gz, and various package formats that are really archives). Then systems can look at the root directory or the "sbom" directory" for these files. Thoughts?

@ctcpip ctcpip mentioned this issue Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants