Skip to content

817 structured cybersecurity skills for AI agents · Mapped to 6 frameworks: MITRE ATT&CK, NIST CSF 2.0, MITRE ATLAS, D3FEND, NIST AI RMF & MITRE F3 (Fight Fraud) · agentskills.io standard · Works with Claude Code, GitHub Copilot, Codex CLI, Cursor, Gemini CLI & 20+ platforms · 29 security domains · Apache 2.0

1.4 KB
Raw Blame

API Reference: Implementing Network Policies for Kubernetes

Default Deny-All Policy

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: default-deny
  namespace: production
spec:
  podSelector: {}
  policyTypes: [Ingress, Egress]

Allow Specific Ingress

spec:
  podSelector:
    matchLabels: { app: backend }
  ingress:
    - from:
        - podSelector: { matchLabels: { app: frontend } }
      ports:
        - port: 8080

kubectl Commands

# List all network policies
kubectl get networkpolicy --all-namespaces
# Describe policy
kubectl describe networkpolicy default-deny -n production
# Apply policy
kubectl apply -f netpol.yaml

Policy Types

Type Behavior when present
Ingress Restrict inbound traffic
Egress Restrict outbound traffic
Both empty Default deny all

Common Patterns

Pattern Description
Default deny Empty podSelector, no rules
Allow DNS Egress to kube-system:53
Allow same namespace namespaceSelector match
Allow from ingress controller Label-based ingress

References