Repository navigation
Allow prerequisite checks to use a restrictive kubectl credential plugin policy - #7318
freeqaz-openai wants to merge 6 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR adds --require-kuberc so prerequisite diagnosis and EKS address collection can enforce an approved kubectl credential plugin policy. Example: An operator uses kubectl v1.36.4 with KUBERC=/secure/occ/operator-policy.json allowing only aws.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this maintainer-authored draft open: it adds a useful capability absent from main, and the reviewed diff has no actionable correctness or security findings. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe optional deployment diagnostic accepts an operator plan, kubeconfig and policy, reads Kubernetes resources and optional AWS inventory, and emits prerequisite results or verified address inventory. flowchart TD
A[Operator plan and credentials] --> B[Diagnostic CLI]
B --> C[Validate client and policy]
C --> D[Kubectl credential enforcement]
D --> E[Private proxy and Kubernetes reads]
B --> F[AWS inventory reads]
E --> G[Diagnostic or address report]
F --> G
Technical reviewBest possible solution: Land the focused policy-preserving mode when its owner considers the draft ready and the remaining checks complete. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the limitation: exec credentials require disabling preferences, preventing use where the credential owner requires kubectl policy enforcement. Is this the best way to solve the issue? The change extends the existing diagnostic owner, delegates plugin authorization to kubectl, preserves default behavior and documents its deliberately narrow supported inputs. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 26e99a634c50. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 24, 2026, 11:27 PM ET / November 25, 2026, 04:27 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Use
--require-kubercwhen the optional prerequisite checks or EKS address inventory must enforce a kubectl credential plugin policy. SetKUBERCto the absolute path of the policy supplied by the credential owner. Without the flag, the existing credential rules still apply.Kubectl enforces the original policy. The diagnostic checks its private copy, the original file and the client before each read. It waits for the private proxy to accept a connection, then sends one GET. It never retries a disconnected request or falls back to disabled preferences.
Review before merge
Please confirm the supported client and policy limits. This mode accepts an approved policy-only JSON Preference with
DenyAllor a nonempty name allowlist. It refuses aliases, command defaults, unsupported fields and mixed exec and static credentials. Do not convert a managed policy or remove restrictions to use this mode.Supported clients are stock Linux amd64 kubectl v1.35.0, v1.36.2 and v1.36.4. The operator must trust the original executable, PATH, kubeconfig and plugin. A policy cannot revoke a request in flight, restrict plugin arguments or govern direct AWS CLI calls.
Verification
At
0d078526, the loopback transport suite and EKS command fixtures passed on the supported clients. The transport suite uses genuine kubectl and synthetic credentials. It covers a permitted plugin, denial, a changed policy, a bound socket that cannot yet accept connections and a disconnect after an accepted GET. The last case returns unknown without sending the request again. The final change shortens the startup guide. No real EKS account or credentials were used.