Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Two existing Vault tests still expect the removed error format and need updated assertions.
1 open finding
What changed in this PR
Sanitizes AWS and Vault secret-resolution errors to avoid logging fetched secret content.
Changes:
- Replaces secret values and response bodies with lookup identifiers.
- Adds regression tests checking that sensitive content is absent from error logs.
| File | Description |
|---|---|
t/secret/vault.t |
Adds response-body logging regression coverage. |
t/secret/aws.t |
Adds plaintext-secret logging regression coverage. |
apisix/secret/vault.lua |
Reports the Vault path instead of the response body. |
apisix/secret/aws.lua |
Reports secret and field identifiers instead of the secret value. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
When a
$secret://reference can't be resolved,apisix/secret.lualogs the provider's error at error level. Two providers put the fetched content into that error:$secret://aws/<id>/<secret>/<field>) but the stored secret string isn't JSON, the decode error included the whole secret string, i.e. the plaintext secret ended up inerror.log.datafield, the error included the raw response body.Both errors now carry only identifiers: the AWS secret name and field, and the vault path. Nothing else changes, the lookup logic and return values are the same. One visible side effect: a vault request rejected with 403 no longer carries vault's
{"errors":["permission denied"]}body in the error either, so the existing TEST 8 and TEST 9 assertions int/secret/vault.tare updated to the new message.The new cases in
t/secret/aws.tandt/secret/vault.tresolve such a reference throughfetch_secretsand assert the error is logged without the secret value or response body. Both fail on current master and pass with this change. The aws case uses the existingapisix/full/pathlocalstack fixture; the vault case serves the response from a test location, so it doesn't need a vault server.Heads-up: #14047 also touches
apisix/secret/aws.luaandapisix/secret/vault.lua. This diff is limited to the two error-message lines so the two should merge cleanly; whichever lands second should merge master and re-check.Which issue(s) this PR fixes:
N/A
Checklist