Skip to content

Add Kubernetes privileged workload matcher#112

Open
jadenfix wants to merge 3 commits into
vercel-labs:mainfrom
jadenfix:jaden/k8s-privileged-workload
Open

Add Kubernetes privileged workload matcher#112
jadenfix wants to merge 3 commits into
vercel-labs:mainfrom
jadenfix:jaden/k8s-privileged-workload

Conversation

@jadenfix

@jadenfix jadenfix commented Jul 19, 2026

Copy link
Copy Markdown

What changed

Adds and registers a reusable k8s-privileged-workload matcher for privileged execution, host access, root UID, unmasked proc mounts, and dangerous Linux capabilities.

The matcher now:

  • limits findings to recognized Kubernetes workload documents and their real top-level spec
  • handles multi-document YAML while preserving global line numbers
  • detects inline and block-list dangerous capabilities under capabilities.add
  • scans first-party Helm charts
  • ignores ConfigMaps, capabilities.drop, annotations, and YAML-looking block-scalar data

Why

DeepSec already reviews Kubernetes secret handling but had no built-in workload privilege coverage. Document and spec scoping keeps this high-value rule in the precise noise tier instead of flagging configuration text that only resembles a workload setting.

Verification

  • pnpm --filter @deepsec/scanner build passes
  • 1,859 scanner matcher and matcher-example tests pass
  • Biome passes on the changed TypeScript files
  • git diff --check passes
  • Adversarial cases cover Helm paths, block capabilities, mixed YAML documents, ConfigMaps, dropped capabilities, block scalars, and source line preservation

Notes for reviewer

Generated dependencies and workflow paths remain excluded; first-party charts/**/templates manifests are intentionally scanned. The branch is based on the current main.

@vercel

vercel Bot commented Jul 19, 2026

Copy link
Copy Markdown

@jadenfix is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@jadenfix
jadenfix force-pushed the jaden/k8s-privileged-workload branch from 8b9856f to 355fd8a Compare July 19, 2026 21:09
@jadenfix
jadenfix marked this pull request as ready for review July 19, 2026 21:10
@jadenfix

jadenfix commented Jul 19, 2026

Copy link
Copy Markdown
Author

Ready for review at e1c02cd. The scanner package builds, all 1,859 matcher and matcher-example tests pass, Biome passes on the changed TypeScript, and git diff --check is clean. Adversarial coverage now includes first-party Helm charts, block-list capabilities, mixed YAML documents, ConfigMaps, dropped capabilities, annotations, block scalars, and exact source lines. GitHub Actions remain action_required for this fork, and Vercel previews require Vercel Labs authorization; an upstream maintainer must approve those service gates.

Comment thread packages/scanner/src/matchers/k8s-privileged-workload.ts Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant