-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refine rule behavior for exceptions and config presenters (#13)
--------- Signed-off-by: Christopher Phillips <[email protected]>
- Loading branch information
Showing
9 changed files
with
123 additions
and
70 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,14 +1,11 @@ | ||
#.grant.yaml | ||
format: json | ||
import: | ||
- ../local-policy.json | ||
- git@githubcom:anchore/central-policy.git@main#./org/*.policy.json | ||
- allowed: [] | ||
denied: [] | ||
# grant -o json alpine:latest=osi.arrpoved.json enterprisesystemsengineering:latest=special.approved.json | ||
# grant myimage:latest ./local-policy.json | ||
|
||
# .gitignore vs .gitconfig distinction (don't mix the what and how) | ||
|
||
# .grantpolicy.yaml | ||
# .grantpolicy/*.yaml | ||
show-packages: true | ||
rules: | ||
- pattern: "*gpl*" | ||
mode: "deny" | ||
reason: "GPL licenses are not allowed" | ||
exceptions: | ||
- "lib*" | ||
- pattern: "*gfdl*" | ||
mode: "deny" | ||
reason: "GPL licenses are not allowed" |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,9 +1,17 @@ | ||
package evalutation | ||
|
||
import ( | ||
"github.com/anchore/grant/grant" | ||
) | ||
|
||
type Reason string | ||
|
||
var ( | ||
ReasonNoLicenseFound Reason = "no license found" | ||
ReasonLicenseDenied Reason = "license denied by policy" | ||
ReasonLicenseAllowed Reason = "license allowed by policy" | ||
) | ||
|
||
func NewRuleReason(rule grant.Rule) Reason { | ||
return Reason(rule.Reason) | ||
} |
This file contains 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
This file contains 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