Datasets:
AutoOntologyBench / source_data /pinned /gatekeeper-library /commit-a8d4799d8daf /src /general /externalip /src.rego
Download source_data/pinned/gatekeeper-library/commit-a8d4799d8daf/src/general/externalip/src.rego from Vinyeh/AutoOntologyBench: direct link, hf CLI and curl.
- Browser
- Download file 396 Bytes
-
https://huggingface.co/datasets/Vinyeh/AutoOntologyBench/resolve/main/source_data/pinned/gatekeeper-library/commit-a8d4799d8daf/src/general/externalip/src.rego
- Command line
-
hf download hf://datasets/Vinyeh/AutoOntologyBench/source_data/pinned/gatekeeper-library/commit-a8d4799d8daf/src/general/externalip/src.rego
-
curl -L -o src.rego https://huggingface.co/datasets/Vinyeh/AutoOntologyBench/resolve/main/source_data/pinned/gatekeeper-library/commit-a8d4799d8daf/src/general/externalip/src.rego
396 Bytes
| package k8sexternalips | |
| violation[{"msg": msg}] { | |
| input.review.kind.kind == "Service" | |
| input.review.kind.group == "" | |
| allowedIPs := {ip | ip := input.parameters.allowedIPs[_]} | |
| externalIPs := {ip | ip := input.review.object.spec.externalIPs[_]} | |
| forbiddenIPs := externalIPs - allowedIPs | |
| count(forbiddenIPs) > 0 | |
| msg := sprintf("service has forbidden external IPs: %v", [forbiddenIPs]) | |
| } | |