Files
ivanfetch-fwandGitHub e5b9236268 FWI-2476: Add missingNetworkPolicy, automountServiceAccountToken, and linuxHardening checks (#816)
* Add missingNetworkPolicy, automountServiceAccountToken, and linuxHardening checks
2022-08-05 09:44:18 -06:00

42 lines
767 B
YAML

# This succeeds because the NetworkPolicy contains and enables egress and ingress rules, and targets the pod's label.
apiVersion: v1
kind: Pod
metadata:
name: test-pod
labels:
security: medium
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: test
spec:
podSelector:
matchLabels:
security: medium
policyTypes:
- Egress
- Ingress
ingress:
- from:
- ipBlock:
cidr: 0.0.0.0/0
ports:
- protocol: TCP
port: 8080
egress:
- to:
- podSelector:
matchLabels:
# Allow outbound with other medium-security pods.
security: medium
ports:
- protocol: TCP
port: 80