You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you run grant list it returns the full list of all licenses (SPDX and non-SPDX).
When you run grant list --non-spdx it returns the list of all non-SPDX licenses.
When you run grant check it checks the SPDX licenses ONLY.
When you run grant check --non-spdx it checks the non-SPDX licenses ONLY.
Point 3 here is a problem. I assumed that because grant list worked on all licenses, that grant check would as well.
What you expected to happen:
I expected grant check to run on the same licenses that grant list showed me, no matter the value of non-spdx.
Steps to reproduce the issue:
Run grant on the SBOM below (note: I have removed the metadata.component field, but grant was still happy to run on this).
format: tableshow-packages: truenon-spdx: falseosi-approved: falserules:
- pattern: "Apache *"name: "allow-all-non-spdx-apache"mode: "allow"
- pattern: "BSD-*"name: "allow-all-bsd"mode: "allow"
- pattern: "LGPL*"name: "allow-all-LGPL"mode: "allow"
- pattern: "MIT"name: "allow-mit"mode: "allow"
- pattern: "MPL-*"name: "allow-mpl"mode: "allow"
- pattern: "OpenSSL"name: "allow-openssl"mode: "allow"
- pattern: "Zlib"name: "allow-zlib"mode: "allow"# Reject the rest.
- pattern: "*"name: "default-deny-all"mode: "deny"reason: "All licenses need to be explicitly allowed"exceptions:
- "pkg-resources"# Inclusion of this is an Ubuntu bug
- "setuptools"# Setuptools is MIT, it just doesn't detect it
For completeness, this SBOM was generated using syft on a Python .venv which was created from this requirements.txt:
# Direct
requests==2.18.4
# Inherited
certifi==2025.1.31
chardet==3.0.4
idna==2.6
urllib3==1.22
Note: Yes, I'm aware these versions are ancient. This was used to demo the functionality of syft / grype / grant to senior colleagues so I can push for adoption of the whole suite of tools 😊
FYI, syft does not correctly identify the licenses of these versions of:
requests
"Apache 2.0" instead of "Apache-2.0"
chardet
"LGPL" instead of "LGPL-2.1-only" (I think)
idna
"BSD-like" instead of "BSD-3-Clause"
But I've put that down to the licenses in those repos not being the exact SPDX license match.
requests and chardet have since changed their LICENSE text to more closely match the actual license, so I imagine those should match properly in newer versions.
Thanks @domWalters! Also I appreciate the callout for the licenses not exactly matching for those packages. I'll take a look over in syft when I have a second.
I'll get this reported bug fixed asap.
Thank you for trying out the tools!
For some stuff coming down the pipe in grant please see: #176
I didn't try with the newest requests but it looks like they changed the license since the version I'm using, so it might get the right name in the newest version:
One final thing I noticed, that is already reported.
syft on a python project only gets licenses if you call it on a venv. Calling on the requirements.txt file isn't enough. I think this should at least be documented somewhere. The requirements.txt is listed against python in the list of stuff you can call against, but it technically doesn't give you everything at the moment.
What happened:
grant list
it returns the full list of all licenses (SPDX and non-SPDX).grant list --non-spdx
it returns the list of all non-SPDX licenses.grant check
it checks the SPDX licenses ONLY.grant check --non-spdx
it checks the non-SPDX licenses ONLY.Point 3 here is a problem. I assumed that because
grant list
worked on all licenses, thatgrant check
would as well.What you expected to happen:
I expected
grant check
to run on the same licenses thatgrant list
showed me, no matter the value ofnon-spdx
.Steps to reproduce the issue:
Run
grant
on the SBOM below (note: I have removed themetadata.component
field, butgrant
was still happy to run on this).Syft generated SBOM
`grant` configuration file
For completeness, this SBOM was generated using
syft
on a Python.venv
which was created from thisrequirements.txt
:Note: Yes, I'm aware these versions are ancient. This was used to demo the functionality of
syft
/grype
/grant
to senior colleagues so I can push for adoption of the whole suite of tools 😊FYI,
syft
does not correctly identify the licenses of these versions of:requests
chardet
idna
But I've put that down to the licenses in those repos not being the exact SPDX license match.
requests
andchardet
have since changed their LICENSE text to more closely match the actual license, so I imagine those should match properly in newer versions.Anything else we need to know?:
Environment:
grant version
: 0.2.6The text was updated successfully, but these errors were encountered: