Created
June 6, 2019 18:10
-
-
Save lucperkins/21b610a5f5a973ea63b4a3b6d5002a34 to your computer and use it in GitHub Desktop.
Open Policy Agent CI example
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
package ci | |
# The package.json is presumed faulty | |
default allow = false | |
# Packages that aren't allowed | |
blacklist = { | |
"event-stream", | |
"left-pad" | |
} | |
# Records dependencies that are on the blacklist | |
violations[pkg] { | |
input.dependencies[pkg] | |
blacklist[pkg] | |
} | |
# Returns true only if there are no violations | |
allow { | |
count(violations) == 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment