Skip to content

fix(bmc-discovery): Narrow the credential Role and check its namespace - #223

Draft
scotwells wants to merge 3 commits into
feat/manual-inventory-recordsfrom
fix/bmc-discovery-credential-scope
Draft

scotwells wants to merge 3 commits into
feat/manual-inventory-recordsfrom
fix/bmc-discovery-credential-scope

Conversation

@scotwells

Copy link
Copy Markdown
Contributor

Related to #182, as a follow-up to its review.

BMC discovery could read every Secret in its namespace, and RBAC can't limit it to the labelled credentials. Discovery now has list and watch only, and CI fails when any other Secret lands in a credential namespace.

The discovery guide says why the Role stays namespace-wide.

Test plan

  • Every validate step at the head, except the Docker build-context test, which had no local Docker daemon and is left to CI
  • The new check fails on a stray Secret in each kind of credential namespace, from any root, and passes the real roots
  • An envtest runs discovery's Secret cache and its one-shot list under the shipped Role, and a read by name is refused

Decisions for a person

  • Narrowing further means discovery reads each Device's Secret by a derived name, with a Role built from the enrolled Devices. That changes the credential naming contract for every deploying repository and loses the instant pin approval. Should Fleet take that on?
  • The new credential-namespace label on Namespaces is a public contract that deploying repositories would copy. Confirm its name, or drop it.

🤖 Generated with Claude Code

scotwells and others added 3 commits November 25, 2026 21:15
Discovery reads credential Secrets only through its label-selected cache
and the --once list, so the Role's get verb was never used. Drop it and
pin the Role with a manifest test and an envtest that runs the real
Secret cache and --once list under the shipped Role, and checks that a
get by name and another namespace are refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RBAC cannot narrow discovery's Secret Role to the labelled credential
Secrets, so any Secret in its namespace is readable by discovery. Render
every Kustomize entry point under config/ and fail when a Secret without
the credential label and Device annotations lands in a namespace that
holds discovery, a credential Secret, or the new credential-namespace
label, which the site's Redfish credential namespace now carries. A
namespace found in any root is checked in every root, and discovery's
own Milo kubeconfig is admitted only beside discovery.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Record why the Secret Role stays namespace-wide, what the render check
enforces, and how a sidecar deployment keeps its credential namespace
separate from the host pod's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@scotwells
scotwells requested review from ecv and kevwilliams November 26, 2026 03:36
Base automatically changed from feat/device-custody-cutover to feat/manual-inventory-records November 28, 2026 14:54
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