Skip to content

fix(deploy-artifact): anchor kind=Secret grep to prevent SecretStore over-match#73

Merged
jorisjonkers-dev-agents[bot] merged 2 commits into
mainfrom
fix/deploy-artifact-anchored-secret-grep
Jul 12, 2026
Merged

fix(deploy-artifact): anchor kind=Secret grep to prevent SecretStore over-match#73
jorisjonkers-dev-agents[bot] merged 2 commits into
mainfrom
fix/deploy-artifact-anchored-secret-grep

Conversation

@jorisjonkers-dev-agents

Copy link
Copy Markdown
Contributor

Summary

Fixes #66

actions/deploy-artifact/run.sh used an unanchored grep -rl 'kind: Secret' in its reject_secret_kind guard (E_FORBIDDEN_KIND), causing false-positive rejections of manifests containing SecretStore and ClusterSecretStore kinds (External Secrets Operator patterns).

The fix applies the same anchored ERE pattern already used in actions/deploy-preview/run.sh since #62:

grep -rlE '^kind:[[:space:]]*Secret[[:space:]]*$'
  • SecretStore and ClusterSecretStore manifests pass through without rejection
  • Bare kind: Secret manifests still fail E_FORBIDDEN_KIND with the offending file named

Tests added (T-DA1 in tests/test_scorecard.py)

Four new tests covering reject_secret_kind directly by sourcing deploy-artifact/run.sh:

  • test_secretstore_passeskind: SecretStore is not rejected
  • test_clustersecretstore_passeskind: ClusterSecretStore is not rejected
  • test_raw_secret_fails_and_names_filekind: Secret fails and names the file
  • test_anchored_pattern_in_run_sh — drift guard asserting the anchored pattern is present in source

…SecretStore kinds

Replaces the unanchored `grep -rl 'kind: Secret'` in reject_secret_kind
with an anchored ERE `grep -rlE '^kind:[[:space:]]*Secret[[:space:]]*$'`,
matching the pattern applied to deploy-preview/run.sh in #62.

SecretStore and ClusterSecretStore manifests no longer produce false-positive
E_FORBIDDEN_KIND rejections; bare `kind: Secret` still fails with the file
named.

Adds T-DA1 tests in tests/test_scorecard.py covering:
- SecretStore passes
- ClusterSecretStore passes
- raw Secret fails and names the file
- drift guard: anchored pattern present in run.sh
@jorisjonkers-dev-agents jorisjonkers-dev-agents Bot added the type: bug Something is broken or behaving incorrectly. label Jul 12, 2026
…red pattern

Updates DeployArtifactRunShTest.test_reject_secret_kind to assert the
anchored ERE pattern (^kind:[[:space:]]*Secret[[:space:]]*$) is present
in deploy-artifact/run.sh, rather than the bare 'kind: Secret' substring
which survives in comments and doesn't verify the functional guard.
@jorisjonkers-dev-agents jorisjonkers-dev-agents Bot merged commit 8e57f62 into main Jul 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug Something is broken or behaving incorrectly.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deploy-artifact: unanchored 'kind: Secret' grep over-matches SecretStore kinds (E_FORBIDDEN_KIND)

1 participant