mirror of
https://gitlab.opencode.de/bmi/opendesk/deployment/opendesk.git
synced 2025-12-07 07:51:38 +01:00
37 lines
1.2 KiB
YAML
37 lines
1.2 KiB
YAML
# Source: https://github.com/kyverno/policies/tree/main/pod-security
|
|
# License: Apache-2.0
|
|
apiVersion: kyverno.io/v1
|
|
kind: ClusterPolicy
|
|
metadata:
|
|
name: restrict-external-ips
|
|
labels:
|
|
opendesk.eu/security-id: net-mgt-001
|
|
annotations:
|
|
policies.kyverno.io/title: Restrict External IPs
|
|
policies.kyverno.io/category: Best Practices
|
|
policies.kyverno.io/minversion: 1.6.0
|
|
policies.kyverno.io/severity: medium
|
|
policies.kyverno.io/subject: Service
|
|
policies.kyverno.io/description: >-
|
|
Service externalIPs can be used for a MITM attack (CVE-2020-8554).
|
|
Restrict externalIPs or limit to a known set of addresses.
|
|
See: https://github.com/kyverno/kyverno/issues/1367. This policy validates
|
|
that the `externalIPs` field is not set on a Service.
|
|
spec:
|
|
validationFailureAction: Audit
|
|
background: true
|
|
rules:
|
|
- name: check-ips
|
|
match:
|
|
any:
|
|
- resources:
|
|
kinds:
|
|
- Service
|
|
validate:
|
|
message: "externalIPs are not allowed."
|
|
pattern:
|
|
spec:
|
|
# restrict external IP addresses
|
|
# you can alternatively restrict to a known set of addresses using:
|
|
# =(externalIPs): ["37.10.11.53", "153.10.20.1"]
|
|
X(externalIPs): "null" |