Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missingNetworkPolicy should not check ingress/egress rule count #1088

Open
2 tasks done
mblaschke-daimlertruck opened this issue Nov 29, 2024 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working triage This bug needs triage

Comments

@mblaschke-daimlertruck
Copy link

What happened?

the missingNetworkPolicy check is currently enforcing at least one ingress/egress rule.

for plain webservers i don't want to allow any egress rule, also we have jobs which only have egress traffic.

What did you expect to happen?

the check should only over the policyTypes as it's automatically denying traffic if no rules are defined.

How can we reproduce this?

use netpol like:

---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: webserver
spec:
  podSelector:
    matchLabels:
      app: webserver
  policyTypes:
  - Ingress
  - Egress
  ingress:
  # Ingress
  - from:
    - namespaceSelector:
        matchLabels:
          kubernetes.io/metadata.name: ingress
    ports:
    - protocol: TCP
      port: 8000

Version

9.6.0

Search

  • I did search for other open and closed issues before opening this.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Additional context

No response

@mblaschke-daimlertruck mblaschke-daimlertruck added bug Something isn't working triage This bug needs triage labels Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage This bug needs triage
Projects
None yet
Development

No branches or pull requests

1 participant