AgentSkillsCN

owasp-kubernetes-top-10

OWASP大语言模型应用安全十大风险——涵盖LLM与生成式AI的安全防护、检测与修复。适用于LLM应用的构建与评审:从提示词注入、信息泄露、训练数据与供应链安全,到中毒攻击、输出处理、代理行为过度扩张、系统提示词外泄、向量与嵌入表示、虚假信息传播,以及无限制的资源消耗等问题。

SKILL.md
--- frontmatter
name: owasp-kubernetes-top-10
description: "OWASP Kubernetes Top 10 - prevention, detection, and remediation for Kubernetes security. Use when designing or reviewing K8s workloads and clusters - workload config, supply chain, RBAC, policy enforcement, logging, authentication, network segmentation, secrets, cluster components, vulnerable components."

OWASP Kubernetes Top 10

This skill encodes the OWASP Kubernetes Top 10 for secure cluster and workload design and review. References are loaded per risk. Based on OWASP Kubernetes Top 10 2022.

When to Read Which Reference

RiskRead
K01 Insecure Workload Configurationsreferences/k01-insecure-workload-configurations.md
K02 Supply Chain Vulnerabilitiesreferences/k02-supply-chain-vulnerabilities.md
K03 Overly Permissive RBACreferences/k03-permissive-rbac.md
K04 Lack of Centralized Policy Enforcementreferences/k04-policy-enforcement.md
K05 Inadequate Logging and Monitoringreferences/k05-logging-monitoring.md
K06 Broken Authentication Mechanismsreferences/k06-broken-authentication.md
K07 Missing Network Segmentationreferences/k07-network-segmentation.md
K08 Secrets Management Failuresreferences/k08-secrets-management.md
K09 Misconfigured Cluster Componentsreferences/k09-misconfigured-cluster-components.md
K10 Outdated and Vulnerable Componentsreferences/k10-vulnerable-components.md

Quick Patterns

  • Run workloads as non-root with read-only filesystem where possible; use image signing and supply chain controls. Apply least-privilege RBAC and network policies; centralize policy (e.g. OPA); secure secrets and audit logging.

Quick Reference / Examples

TaskApproach
Harden podNon-root, read-only rootfs, drop capabilities. See K01.
Secure imagesSign images, scan for CVEs, use trusted registries. See K02.
Limit RBACLeast privilege, no cluster-admin for workloads. See K03.
Network policiesDefault deny, explicit allow per namespace. See K07.
Manage secretsUse external secrets manager or encrypted secrets. See K08.

Safe - hardened SecurityContext:

yaml
securityContext:
  runAsNonRoot: true
  runAsUser: 1000
  readOnlyRootFilesystem: true
  allowPrivilegeEscalation: false
  capabilities:
    drop: ["ALL"]

Unsafe - privileged container:

yaml
securityContext:
  privileged: true  # NEVER in production - full host access

Network policy - default deny ingress:

yaml
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: default-deny-ingress
spec:
  podSelector: {}
  policyTypes: ["Ingress"]

Workflow

Load the reference for the risk you are addressing. See OWASP Kubernetes Top 10 for the official list.