feat(analyzer): detect privileged Kubernetes workload deployment as TM4#220
Open
CharmingGroot wants to merge 1 commit into
Open
feat(analyzer): detect privileged Kubernetes workload deployment as TM4#220CharmingGroot wants to merge 1 commit into
CharmingGroot wants to merge 1 commit into
Conversation
tool_misuse (TM1-TM3) did not cover privileged Kubernetes workloads. A skill deploying a privileged DaemonSet (privileged/hostPath/host-namespaces via kubectl/helm) is a node-takeover vector but scored 0/SAFE (NVIDIA#219). Add TM4_PATTERNS to the tool_misuse analyzer (is_code_example filter, strong isolation-breaking signals only) with pattern_defaults entries and 9 tests. Signed-off-by: CharmingGroot <ohyes9711@gmail.com>
rng1995
approved these changes
Jun 27, 2026
rng1995
left a comment
Collaborator
There was a problem hiding this comment.
Approving — additive TM4 (privileged Kubernetes workload) detection for privileged: true, hostPath, host namespaces, kubectl run --privileged, and helm privileged overrides. Patterns are line-bounded (no catastrophic backtracking), doc examples are filtered, and a benign DaemonSet is not flagged. Good test coverage.
Non-blocking:
- A bare
hostPath:(0.55) is fairly common in legitimate logging/monitoring DaemonSets but surfaces at HIGH severity — watch for FP noise; the low confidence helps temper scoring. pattern_defaults.pyoverlaps #218 (E5) — expect a small rebase.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
tool_misuseanalyzer (TM1–TM3) does not cover privileged Kubernetes workload deployment. A skill that deploys a privileged DaemonSet —privileged: true,hostPath, host namespaces viakubectl/helm— owns every node in the cluster, yet scored 0/100 SAFE with zero findings (#219). This adds TM4.Changes
static_patterns_tool_misuse.pygainsTM4_PATTERNS(privileged: true,hostPath:,host{PID,Network,IPC}: true,kubectl run … --privileged,helm --set …privileged=true) and a TM4 pass filtered through the sharedis_code_example()helper (these fields appear in SKILL.md docs).pattern_defaults.pyregisters the TM4 explanation, category, message, and remediation alongside TM1–TM3.Before / After
A "node optimizer" skill that deploys a privileged DaemonSet with
hostPath: /and host namespaces:0/100 SAFE, 0 findings — node-takeover deployment entirely invisible34/100 CAUTION, TM4 ×6 HIGH across the manifest and deploy scriptWith the LLM layer (Qwen3.6-35B-A3B-FP8 via vLLM) the same skill scores
100/CRITICAL(SQP-2: "kubectl run with --privileged, hostPID, hostNetwork … grant full host access"), so--no-llm/ air-gapped deployments were the exposed surface this closes.Design Decisions
tool_misuse(not privilege_escalation)tool_misuse(dangerous tool/config usage) keeps this PR self-contained. Open to a different placement if preferred.privileged,hostPath, host namespaces). Barekubectl apply, a plainDaemonSet, and non-privilegedhelm installare intentionally excluded — normal deployments do not fire.Testing
9 new tests: 6 detection cases (
privileged: true,hostPath,hostPID,hostNetwork,kubectl run --privileged,helm --set privileged=true), severity-HIGH assertion, a benign-workload negative (plain DaemonSet), and a documentation-example exclusion.make formatandmake lintpass;uv run pytest -m "not integration and not provider"reports 998 passed, 0 failed.Closes #219