kubernetes hardening kubesecmanifest detect

DevOps Community

Skill notes

Overview

Kubesec is an open-source security risk analysis tool developed by ControlPlane that inspects Kubernetes resource manifests for common exploitable risks such as privilege escalation, writable host mounts, and excessive capabilities. It assigns a numerical security score to each resource and provides actionable recommendations for hardening. Kubesec can be used as a CLI binary, Docker container, kubectl plugin, admission webhook, or REST API endpoint.

When to Use

When conducting security assessments that involve scanning kubernetes manifests with kubesec When following incident response procedures for related security events When performing scheduled security testing or auditing activities When validating security controls through hands-on testing

Prerequisites

Kubernetes manifest files (YAML/JSON) for Deployments, Pods, DaemonSets, StatefulSets Docker or Go runtime for local installation kubectl access for scanning live cluster resources CI/CD pipeline access for automated scanning integration

Security Scoring System

Kubesec assigns a score to each Kubernetes resource based on security checks: Positive scores: Awarded for security-enhancing configurations (readOnlyRootFilesystem, runAsNonRoot) Zero or negative scores: Indicate missing security controls or dangerous configurations Critical advisories: Flagged configurations that represent immediate security risks

Check Categories

Privilege Controls: Checks for privileged containers, host PID/network access, root execution Capabilities: Identifies excessive Linux capabilities (SYS_ADMIN, NET_RAW) Volume Mounts: Detects dangerous host path mounts and writable sensitive paths Resource Limits: Validates presence of CPU/memory resource constraints Security Context: Verifies seccomp profiles, AppArmor annotations, SELinux contexts

Fluxly profile Runtime and permissions are inferred by Fluxly static checks, not author declarations or runtime test results.
Domain
DevOps
Author-declared agents
No explicit declaration found; this is not inferred or tested compatibility
Static check
88 / 100 · heuristic scan, not runtime safety proof
Runtime evidence
Not run; no isolated runtime test evidence is currently recorded
Author / version / license
@tomevault-io · no license declared
Token usage
Lean
Setup complexity
Manual integration
External API key
Not required
Operating systems
macOS · Linux · Docker
Runtime requirements
Docker
Detected file/system behavior
  • Read-only
  • Write / modify
  • Shell exec
Network behavior
External requests
Install commands
None (reference only)

Heads up: Tool permissions are not declared; actual access depends on the runtime.

Output preview kubernetes-hardening-kubesecmanifest-detect.preview
# Sample Output

[
  {
    "object": "Pod/web-app.default",
    "valid": true,
    "fileName": "pod.yaml",
    "message": "Passed with a score of 3 points",
    "score": 3,
    "scoring": {
      "passed": [
        {
          "id": "ReadOnlyRootFilesystem",
          "selector": "containers[] .securityContext .readOnlyRootFilesystem == true",
          "reason": "An immutable root filesystem prevents applications from writing to their local disk",
          "points": 1
        },
        {
          "id": "RunAsNonRoot",
          "selector": "containers[] .securityContext .runAsNonRoot == true",
          "reason": "Force the running image to run as a non-root user",
          "points": 1
        },
        {
          "id": "LimitsCPU",
          "selector": "containers[] .resources .limits .cpu",
          "reason": "Enforcing CPU limits prevents DOS via resource exhaustion",
          "points": 1
        }
      ],
      "advise": [
        {
          "id": "ApparmorAny",
          "selector": "metadata .annotations .\"container.apparmor.security.beta.kubernetes.io/nginx\"",
          "reason": "Well defined AppArmor policies reduce the attack surface of the container",
          "points": 3
        },
        {
          "id": "ServiceAccountName",
          "selector": ".spec .serviceAccountName",
          "reason": "Service accounts restrict Kubernetes API access and should be configured",
          "points": 3
        }
      ]
    }
  }
]

Discussion

Powered by GitHub Discussions. Sign in with GitHub to comment, react, or subscribe.