-
Notifications
You must be signed in to change notification settings - Fork 3
Migrate from Fossa to local Trivy license check #735
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b8a17a4
chore(checks): add license category export from Fossa as reference
JoergSiebahn dae4935
chore(checks): add license check with Trivy allowing only licenses de…
JoergSiebahn a77646d
chore(checks): add license mapping to match licenses as identified by…
JoergSiebahn 1ea8058
chore(checks): handle licenses that are identified wrong or are not c…
JoergSiebahn bab06cb
chore(checks): Attach SBOM files to release
JoergSiebahn 0fa674e
chore: fix command
JoergSiebahn a8b4730
chore(checks): Include all severities in license check as we ignore e…
JoergSiebahn 77a41d1
chore(checks): bump cyclonedx plugin to 1.8.2
JoergSiebahn 93e7815
chore(checks): rename fossa export
JoergSiebahn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
package trivy | ||
import data.lib.trivy | ||
|
||
default ignore := false | ||
|
||
# permissive licenses from export of backend definition in Fossa, | ||
# see policy-backend-fossa for reference | ||
default permissive := { | ||
"0BSD", | ||
"AFL-3.0", # Permissive license which is perfectly safe to use provided proper attribution is given and retained. | ||
"android-sdk", | ||
"Apache-1.1", # Permissive license which is perfectly safe to use provided proper attribution is given and retained. | ||
"Apache-2.0", # Permissive license which is perfectly safe to use provided proper attribution is given and retained. | ||
"Artistic-1.0", # Safe if code isn’t modified and notice requirements are followed. Otherwise, you must state and disclose the source code of modifications/derivative works. | ||
"BouncyCastle", | ||
"BSD-1-Clause", # Permissive license which is perfectly safe to use provided proper attribution is given and retained. | ||
"BSD-2-Clause", # Permissive license which is perfectly safe to use provided proper attribution is given and retained. | ||
"BSD-3-Clause", # Permissive license which is perfectly safe to use provided proper attribution is given and retained. | ||
"BSD-3-Clause-No-Nuclear-Warranty", | ||
"BSD-4-Clause", # Permissive license which is perfectly safe to use provided proper attribution is given and retained. | ||
"CC-BY-2.5", | ||
"CC-BY-3.0", | ||
"CC0-1.0", | ||
"CDDL-1.0", # Safe if code isn’t modified and notice requirements are followed. Otherwise, you must state and disclose the source code of modifications/derivative works. | ||
"CDDL-1.1", | ||
"CPL-1.0", | ||
"EPL-1.0", | ||
"EPL-2.0", | ||
"GPL-2.0-with-classpath-exception", # Safe to include or link in an executable provided that source availability/attribution requirements are followed. | ||
"ICU", | ||
"ISC", # Permissive license which is perfectly safe to use provided proper attribution is given and retained. | ||
"JSON", | ||
"LGPL-2.0-only", # Requires you to (effectively) disclose your source code if the library is statically linked to your project. Not triggered if dynamically linked or a separate process. | ||
"LGPL-2.0-or-later", # Requires you to (effectively) disclose your source code if the library is statically linked to your project. Not triggered if dynamically linked or a separate process. | ||
"LGPL-2.1-only", # Requires you to (effectively) disclose your source code if the library is statically linked to your project. Not triggered if dynamically linked or a separate process. | ||
"LGPL-2.1-or-later", # Requires you to (effectively) disclose your source code if the library is statically linked to your project. Not triggered if dynamically linked or a separate process. | ||
"LGPL-3.0-only", # Requires you to (effectively) disclose your source code ifthe library is statically linked to your project. Not triggered if dynamically linked or a separate process. | ||
"LGPL-3.0-or-later", # Requires you to (effectively) disclose your source code ifthe library is statically linked to your project. Not triggered if dynamically linked or a separate process. | ||
"MIT", # Permissive license which is perfectly safe to use provided proper attribution is given and retained. | ||
"MPL-1.1", # Safe if code isn’t modified and notice requirements are followed. Otherwise, you must state and disclose the source code of modifications/derivative works. | ||
"MPL-2.0", # Safe if code isn’t modified and notice requirements are followed. Otherwise, you must state and disclose thesource code of modifications/derivative works. | ||
"OpenSSL", | ||
"public-domain", | ||
"SAX-PD", | ||
"Unlicense", | ||
"W3C", # Permissive license which is perfectly safe to use provided proper attribution is given and retained. | ||
"WTFPL", # Permissive license which is perfectly safe to use provided proper attribution is given and retained. | ||
"X11", | ||
"Zlib", # Permissive license which is perfectly safe to use provided proper attribution is given and retained. | ||
} | ||
|
||
# mapping of licenses identified by cyclonedx to known license keys | ||
default licenseMapping := { | ||
"Unicode/ICU License": "ICU", | ||
"Bouncy Castle Licence": "BouncyCastle", | ||
# both licenses are permissive, we pick one | ||
"(CDDL-1.0 OR GPL-2.0-with-classpath-exception)": "GPL-2.0-with-classpath-exception", | ||
"Apache License, 2.0": "Apache-2.0", | ||
"The GNU General Public License (GPL), Version 2, With Classpath Exception": "GPL-2.0-with-classpath-exception", | ||
"Public Domain": "public-domain", | ||
"Eclipse Public License (EPL) 2.0": "EPL-2.0", | ||
"GNU Lesser General Public License": "LGPL", | ||
} | ||
|
||
# default: allow everything defined in the list of permissive licenses | ||
ignore { | ||
input.Name == permissive[_] | ||
} | ||
|
||
# allow licenses that are only named different due to the used tooling | ||
ignore { | ||
licenseMapping[input.Name] == permissive[_] | ||
} | ||
|
||
# false identification, it's Apache 2, see https://github.com/facebook/rocksdb/blob/main/LICENSE.Apache | ||
ignore { | ||
wurstbrot marked this conversation as resolved.
Show resolved
Hide resolved
|
||
input.PkgName == "org.rocksdb:rocksdbjni" | ||
input.Name == "GNU General Public License, version 2" | ||
} | ||
|
||
# MIT-0 is even more permissive than MIT, see https://github.com/aws/mit-0 | ||
ignore { | ||
input.PkgName == "org.reactivestreams:reactive-streams" | ||
input.Name == "MIT-0" | ||
} | ||
|
||
# ch.qos.logback:logback-classic is dual licensed as LGPL 2.1 or Eclipse Public License v1.0 | ||
# see https://github.com/qos-ch/logback/blob/master/LICENSE.txt | ||
# cyclonedx identifies GNU Lesser General Public License | ||
ignore { | ||
input.PkgName == "ch.qos.logback:logback-classic" | ||
input.Name == "GNU Lesser General Public License" | ||
} | ||
|
||
# ch.qos.logback:logback-core is dual licensed as LGPL 2.1 or Eclipse Public License v1.0 | ||
# see https://github.com/qos-ch/logback/blob/master/LICENSE.txt | ||
# cyclonedx identifies GNU Lesser General Public License | ||
ignore { | ||
input.PkgName == "ch.qos.logback:logback-core" | ||
input.Name == "GNU Lesser General Public License" | ||
} | ||
|
||
# ch.qos.logback.contrib:logback-jackson is dual licensed as LGPL 2.1 or Eclipse Public License v1.0 | ||
# see https://github.com/qos-ch/logback-contrib/blob/master/license-template.txt | ||
# cyclonedx identifies GNU Lesser General Public License | ||
ignore { | ||
input.PkgName == "ch.qos.logback.contrib:logback-jackson" | ||
input.Name == "GNU Lesser General Public License" | ||
} | ||
|
||
# ch.qos.logback.contrib:logback-json-classic is dual licensed as LGPL 2.1 or Eclipse Public License v1.0 | ||
# see https://github.com/qos-ch/logback-contrib/blob/master/license-template.txt | ||
# cyclonedx identifies GNU Lesser General Public License | ||
ignore { | ||
input.PkgName == "ch.qos.logback.contrib:logback-json-classic" | ||
input.Name == "GNU Lesser General Public License" | ||
} | ||
|
||
# ch.qos.logback.contrib:logback-json-core is dual licensed as LGPL 2.1 or Eclipse Public License v1.0 | ||
# see https://github.com/qos-ch/logback-contrib/blob/master/license-template.txt | ||
# cyclonedx identifies GNU Lesser General Public License | ||
ignore { | ||
input.PkgName == "ch.qos.logback.contrib:logback-json-core" | ||
input.Name == "GNU Lesser General Public License" | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.