Allow correction / overwrite of license information
- Dominant language
- Go
- Stars
- 9.6k
- Forks
- 954
- Avg merge
- 23h 27m
- Merged PRs (30d)
- 48
Description
**What would you like to be added**:
It would be beneficial to have a feature in Syft that allows users to override and correct license information for packages.
Looking at the configuration options, I couldn't find any option related to correcting license information.
**Why is this needed**:
In cases where no license or incorrect license information is found. I have observed this issue particularly with npm packages. Generally, this is due to package publishers not maintaining correct license information in their package.json files. However, a glance at the repository or the node_modules folder often reveals the correct license under which the package is published.
Of course it would be good to solve this at the source - in the repositories of the package maintainers, but it would only affect future package versions and might be outside the sphere of influence.
I found other inconsistency, were license information were wrong or misleading. So I think a solution to overwrite might be a valid solution?
What do you think?
**Additional context**:
I could imagine something like:
```yaml
licenseOverwrite:
- purl: pkg:npm/%40ogma/common@1.2.0 # Maybe allow things like 1.x >1.0.0<1.5.0
data:
value: "MIT"
spdxExpression: "MIT"
type: "declared" # Maybe "concluded"
urls:
- https://www.npmjs.com/package/@ogma/common?activeTab=code
```
Contributor guide
Research direction
Start by reviewing Syft's existing configuration options and how npm package license information is handled. Define the behavior for matching packages by purl, including version ranges, and for overriding value, SPDX expression, type, and URLs; done means users can reliably correct a package's license metadata through configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100