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

Include packages in application SBOM #85

Closed
nscuro opened this issue Oct 6, 2021 · 0 comments
Closed

Include packages in application SBOM #85

nscuro opened this issue Oct 6, 2021 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@nscuro
Copy link
Member

nscuro commented Oct 6, 2021

By using go list, we get to know which packages are actually used, but we currently don't include this information in the SBOM.

Using the info we already have, we can construct a structure according to modules > packages > files, for example:

{
    "bom-ref": "pkg:golang/github.com/ProtonMail/go-crypto@v0.0.0-20210428141323-04723f9f07d7",
    "type": "library",
    "name": "github.com/ProtonMail/go-crypto",
    "version": "v0.0.0-20210428141323-04723f9f07d7",
    "scope": "required",
    "hashes": [
        {
            "alg": "SHA-256",
            "content": "62825b7a72bd0baed29339037e642e5659f4e328078f7be365f77d14bf869904"
        }
    ],
    "purl": "pkg:golang/github.com/ProtonMail/go-crypto@v0.0.0-20210428141323-04723f9f07d7",
    "components": [
        {
            "bom-ref": "pkg:golang/github.com/ProtonMail/go-crypto#bitcurves@v0.0.0-20210428141323-04723f9f07d7",
            "type": "library",
            "name": "bitcurves",
            "version": "v0.0.0-20210428141323-04723f9f07d7",
            "scope": "required",
            "purl": "pkg:golang/github.com/ProtonMail/go-crypto#bitcurves@v0.0.0-20210428141323-04723f9f07d7",
            "components": [
                {
                    "type": "file",
                    "name": "bitcurve.go",
                    "version": "v0.0.0-2472c8e5f796",
                    "scope": "required",
                    "hashes": [
                        {
                            "alg": "MD5",
                            "content": "b4689d8871aa46bb387ef148944f8da8"
                        },
                        {
                            "alg": "SHA-1",
                            "content": "2472c8e5f796d8463738938fea98398dabba08ad"
                        }
                        // ...
                    ]
                }
            ]
        }
    ]
}

Including the packages should probably be enabled per default, but including individual files should still be optional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant