Skip to content

Allow prerequisite checks to use a restrictive kubectl credential plugin policy - #7318

Open
freeqaz-openai wants to merge 6 commits into
mainfrom
codex/diagnostic-kuberc-policy
Open

freeqaz-openai wants to merge 6 commits into
mainfrom
codex/diagnostic-kuberc-policy

Conversation

@freeqaz-openai

@freeqaz-openai freeqaz-openai commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Use --require-kuberc when the optional prerequisite checks or EKS address inventory must enforce a kubectl credential plugin policy. Set KUBERC to 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 DenyAll or 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.

@clawsweeper

clawsweeper Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. impact:auth-provider This issue is about auth, provider routing, model choice, or SecretRef resolution. clawsweeper:intake:feature Preliminary submission classification; full source review pending. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 25, 2026
@clawsweeper

clawsweeper Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: Using the AWS credential plugin requires permission to disable kubectl preferences.
  • After: Adding --require-kuberc preserves and enforces the approved plugin allowlist.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful and source-reviewed with meaningful integration coverage; execution confidence rests on reported harness runs, and no target code was run during this review.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the contributor proof gate; its body reports genuine-kubectl CLI integration runs at 0d07852 using synthetic credentials and TLS endpoints, without standalone execution output or live EKS verification.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Operators required to retain a credential plugin policy cannot use the existing prerequisite commands with exec credentials.
Reason: The established feature owner provides an opt-in solution to a concrete operator restriction and specifies the supported client and policy limits.

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: 895e90b817f3279fef3440363074657a811b0c0d

Before merge

None.

Findings

None.

Agent review details

How this fits together

The 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
Loading

Technical review

Best 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

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on maintainer: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-25T00:16:58.378Z sha 68a3401 :: ready, awaiting a maintainer decision. :: none

Reviewed November 24, 2026, 11:27 PM ET / November 25, 2026, 04:27 UTC (Revision 2).

@freeqaz-openai

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on maintainer Only explicit maintainer approvals or decisions remain; merge is still blocked. labels Nov 25, 2026
@freeqaz-openai
freeqaz-openai marked this pull request as ready for review November 25, 2026 04:38
@freeqaz-openai
freeqaz-openai requested a review from a team as a code owner November 25, 2026 04:38

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact:auth-provider This issue is about auth, provider routing, model choice, or SecretRef resolution. P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant