Last active
May 9, 2023 16:46
-
-
Save RickCraig/59fb14f2d60ddb80fdc1bd0b30137103 to your computer and use it in GitHub Desktop.
Options for blocking connectors that aren't artifactory
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
package connector | |
# Block saves on any connector but Artifactory | |
deny[msg] { | |
# Check that the type is artifactory | |
input.entity.type != "Artifactory" | |
# Show a human-friendly error message | |
msg := sprintf("Artifactory is the only connector allowed, you have tried to create %s", [input.entity.type]) | |
} |
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
package connector | |
# Deny any connectors that fall into the list of not_allowed | |
deny[msg] { | |
# If the connector type matches anything in our list... deny | |
contains(not_allowed, input.entity.type) | |
# Show a human-friendly error message | |
msg := sprintf("%s is not allowed, please use Artifactory only", [input.entity.type]) | |
} | |
# All of the blocked connector types | |
not_allowed = ["Jenkins", "DockerRegistry", "HttpHelmRepo", "Nexus", "OciHelmRepo"] | |
contains(arr, elem) { | |
arr[_] = elem | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment