agentleFS
andypitcherandypitcher/ponytail-sec/skills/k8s-securitycontext/SKILL.md

k8s-securitycontext

Skill12 starsChanged 5 days agoMITView on GitHub

Binary Kubernetes securityContext hardening check. Use when reviewing Pods, Deployments, StatefulSets, DaemonSets, Jobs, CronJobs, Helm templates, or Kubernetes manifests that define containers. Minimal output only: OK or NOT_OK: RULE, RULE.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Ask once before enforcing:

    line 10
  2. Distinctive:

    If yes: inspect locally first.

    line 16
  3. Distinctive:

    No severity. No advisory text.

    line 27
  4. Distinctive:

    All rules are mandatory for every application container.

    line 32

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Ask once before enforcing:

Enforce k8s-securitycontext skill? (yes / no)

If no: stop.

If yes: inspect locally first. Do not web-search by default. Web-search only if Kubernetes securityContext semantics are missing or ambiguous, and prefer the official Kubernetes docs.

Contract

Return exactly one line:

  • OK
  • NOT_OK: RULE, RULE

No severity. No advisory text. No maybes. If a rule cannot be verified, it is not OK.

Rules

All rules are mandatory for every application container. Apply to init and ephemeral containers when present too.

  • SC_NON_ROOT — require runAsNonRoot: true and no explicit root user (runAsUser: 0 is not OK).
  • SC_NO_PRIV_ESC — require allowPrivilegeEscalation: false.
  • SC_DROP_CAPS — require capabilities.drop: ["ALL"]; adding capabilities is not OK unless the manifest proves the workload needs them.
  • SC_SEC_PROFILE — require seccompProfile.type: RuntimeDefault or a stricter local profile.
  • SC_READ_ONLY_FS — require readOnlyRootFilesystem: true.
  • SC_SELINUX_TYPE — when the workload targets an SELinux-enforcing node class, OpenShift, SELinux-labeled volumes, or policy says SELinux is required, require seLinuxOptions.type. Missing type is not OK.

Output examples

OK

NOT_OK: SC_NON_ROOT, SC_NO_PRIV_ESC, SC_SELINUX_TYPE

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.