SV-257555r1208206_rule
V-257555
SRG-APP-000246-CTR-000605
CNTR-OS-000630
CAT II
10
Add the "haproxy.router.openshift.io/rate-limit-connections= true" annotation to any routes outside the kube-* or openshift-* namespaces.
oc annotate route <route_name> -n <namespace> --overwrite=true " haproxy.router.openshift.io/rate-limit-connections= true "
https://docs.openshift.com/container-platform/4.9/networking/routes/route-configuration.html
Verify that all namespaces except those that start with kube-* or openshift-* use the rate-limiting annotation by executing the following:
oc get routes --all-namespaces -o json | jq '[.items[] | select(.metadata.namespace | startswith("kube-") or startswith("openshift-") | not) | select(.metadata.annotations["haproxy.router.openshift.io/rate-limit-connections"] == "true" | not) | .metadata.name]'
If the above command returns any namespaces, this is a finding.
V-257555
False
CNTR-OS-000630
Verify that all namespaces except those that start with kube-* or openshift-* use the rate-limiting annotation by executing the following:
oc get routes --all-namespaces -o json | jq '[.items[] | select(.metadata.namespace | startswith("kube-") or startswith("openshift-") | not) | select(.metadata.annotations["haproxy.router.openshift.io/rate-limit-connections"] == "true" | not) | .metadata.name]'
If the above command returns any namespaces, this is a finding.
M
5547