Skip to content

Restore case-insensitive credential scan #975

Description

@sehkone

Restore case-insensitive credential scan

Context

The registrar-redteam scenario proves that the manifest-defined registrar client bundle contains no copied OpenBao or AppRole credentials. Its credential-scan expression previously matched conventional credential labels case-insensitively. The current command at scripts/impl/lib/registrar-docker.sh no longer uses grep -i, so casing variants of the conventional token and AppRole labels can evade the label branch unless an independent bare-value pattern happens to match.

Scope

  • Restore case-insensitive matching for the conventional credential-label alternatives in registrar_docker_assert_no_backend_credentials.
  • Preserve the direct bare-value alternatives, the recursive scan's staged-bundle boundary, and the manifest regular-file-set assertion.
  • Extend the focused non-Docker bundle-scan test to prove that casing variants of X-Vault-Token, X-OpenBao-Token, OPENBAO_TOKEN, VAULT_TOKEN, role_id, and secret_id are rejected when paired with values that do not independently match a bare-value alternative.
  • Keep the existing exact-cased and bare-value regression cases.

Acceptance criteria

  • The staged-bundle scan rejects conventional OpenBao-token and AppRole labels regardless of casing.
  • Each new labelled-form regression input is rejected because of its label, not because its value matches a separate bare token or UUID pattern.
  • The focused fixture still accepts the credential-free registrar certificate, key, endpoint configuration, pin, and CA inputs.
  • The scan remains recursive only within the read-only manifest-staged bundle, and the manifest regular-file-set assertion remains intact.
  • The live registrar-redteam scenario continues to pass.

Constraints

  • Scan only the manifest-defined registrar-leak bundle; do not scan the container, daemon-private material, or unrelated host files.
  • Do not add production test hooks, inspection APIs, or fault-injection seams.
  • Do not change registrar endpoint authorization, the Python client architecture, or the unknown-operation assertion.
  • Do not decide or broaden the supported bare OpenBao token-prefix set; that question is outside this issue.

Out of scope

  • Recognizing additional bare OpenBao token families.
  • Changes to the registrar endpoint protocol, certificate pinning, socket checks, or audit/capacity assertions.

Test plan

  • Run the focused bundle-scan coverage through registrar_redteam_boundary_assertions_are_conclusive_without_docker.
  • Run scripts/preflight/ci/e2e-matrix.sh where the environment supports the registrar-redteam Docker scenario; otherwise record the root prerequisite that prevents the local run and rely on its CI gate.
  • Run cargo fmt -- --check --config group_imports=StdExternalCrate and cargo clippy --all-targets -- -D warnings.

Dependencies

Part of #972. No implementation prerequisite.

Pointers

  • scripts/impl/lib/registrar-docker.shregistrar_docker_assert_no_backend_credentials
  • tests/e2e/registrar/registrar_redteam_assertions_test.sh — focused staged-bundle scan coverage
  • tests/registrar_redteam_assertions.rs — non-Docker test entry point

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions