Skip to content

Mask st2-api-key and blacklisted keys in logs and execution API responses - #6427

Open
farhanmallik05 wants to merge 1 commit into
StackStorm:masterfrom
farhanmallik05:fix-mask-st2-api-key
Open

farhanmallik05 wants to merge 1 commit into
StackStorm:masterfrom
farhanmallik05:fix-mask-st2-api-key

Conversation

@farhanmallik05

Copy link
Copy Markdown

Fixes #5804.

When passing st2-api-key or x-auth-token in core.http headers (or using auth), values leaked in API execution responses and mixed-case headers could bypass log masking.

Changes:

  • Added st2-api-key and x-auth-token to MASKED_ATTRIBUTES_BLACKLIST (st2common/constants/secrets.py).
  • Extracted mask_blacklisted_value / mask_blacklisted_parameters in st2common/util/secrets.py so both st2common/logging/formatters.py and ActionExecutionDB/LiveActionDB.mask_secrets mask blacklisted keys case-insensitively across nested dicts/lists (honoring [log].mask_secrets_blacklist).
  • Made query-parameter blacklist matching case-insensitive in st2common/middleware/logging.py.
  • Marked auth as secret: true in contrib/core/actions/http.yaml.
  • Added unit tests and updated CHANGELOG.rst.

Copilot AI balanced review requested due to automatic review settings December 1, 2026 20:08
@pull-request-size pull-request-size Bot added the size/L PR that changes 100-499 lines. Requires some effort to review. label Dec 1, 2026
@CLAassistant

CLAassistant commented Dec 1, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

…nses

Add st2-api-key and x-auth-token to MASKED_ATTRIBUTES_BLACKLIST, make log and query-parameter blacklist matching case-insensitive, mark core.http auth as secret, and apply blacklisted key masking to ActionExecutionDB and LiveActionDB parameters.

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

Labels

size/L PR that changes 100-499 lines. Requires some effort to review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

st2-api-key not obfuscated when using core.http?

3 participants