Skip to content

feat(redact): close crypto-suffix identifier + webhook-URL gaps#79

Open
swarit-stepsecurity wants to merge 1 commit into
step-security:mainfrom
swarit-stepsecurity:swarit/chore/redact-gaps
Open

feat(redact): close crypto-suffix identifier + webhook-URL gaps#79
swarit-stepsecurity wants to merge 1 commit into
step-security:mainfrom
swarit-stepsecurity:swarit/chore/redact-gaps

Conversation

@swarit-stepsecurity
Copy link
Copy Markdown
Member

Two narrow extensions to the redactor, motivated by a stress-test audit:

  1. Identifiers that contain a credential word but don't end on it (passwordHash, apiKeyDigest, accessTokenHmac, ...) slipped past secret_assignment because the existing rule anchored on the credential word ending the identifier. New rule secret_assignment_crypto_suffix matches the same prefix shape with a tight allowed-suffix list (HASH/HASHED/DIGEST/HMAC/ CIPHER/ENCRYPTED/SIGNATURE/SALT/SALTED). The suffix list is intentionally narrow so non-credential names like passwordless, tokenize, secretary, and tokenization_enabled stay non-redacted (covered by TestStringPreservesNonCredentialNeighbors).

  2. Webhook URLs carry their auth in the path; the URL itself is credential-grade. Added three rules: - slack_webhook_url: hooks.slack.com/{services,workflows}/...

    • discord_webhook_url: discord.com/api/webhooks//
    • teams_webhook_url: *.webhook.office.com / outlook.office.com

Tests cover both directions — the new shapes are redacted, and the adjacent-but-non-credential shapes stay intact.

What does this PR do?

Type of change

  • Bug fix
  • Enhancement
  • Documentation

Testing

  • Tested on macOS (version: ___)
  • Binary runs without errors: ./stepsecurity-dev-machine-guard --verbose
  • JSON output is valid: ./stepsecurity-dev-machine-guard --json | python3 -m json.tool
  • No secrets or credentials included
  • Lint passes: make lint
  • Tests pass: make test

Related Issues

Two narrow extensions to the redactor, motivated by a stress-test
audit:

1. Identifiers that *contain* a credential word but don't end on it
   (passwordHash, apiKeyDigest, accessTokenHmac, ...) slipped past
   secret_assignment because the existing rule anchored on the
   credential word ending the identifier. New rule
   `secret_assignment_crypto_suffix` matches the same prefix shape
   with a tight allowed-suffix list (HASH/HASHED/DIGEST/HMAC/
   CIPHER/ENCRYPTED/SIGNATURE/SALT/SALTED). The suffix list is
   intentionally narrow so non-credential names like `passwordless`,
   `tokenize`, `secretary`, and `tokenization_enabled` stay
   non-redacted (covered by TestStringPreservesNonCredentialNeighbors).

2. Webhook URLs carry their auth in the path; the URL itself is
   credential-grade. Added three rules:
     - slack_webhook_url:  hooks.slack.com/{services,workflows}/...
     - discord_webhook_url: discord.com/api/webhooks/<id>/<token>
     - teams_webhook_url:  *.webhook.office.com / outlook.office.com

Tests cover both directions — the new shapes are redacted, and the
adjacent-but-non-credential shapes stay intact.
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