fix(security): sanitize ApiException in secret retrieval path - #15
Open
spbsoluble wants to merge 1 commit into
Open
Conversation
GetStaticSecret let a failed GetSecretValuesAsync call propagate its raw ApiException, whose SDK-generated Message can echo back request content including the live auth token, into Command's logs via the wrapping AggregateException. Catch it and rethrow a sanitized InvalidSecretConfigurationException, matching the existing pattern in InitClient. Closes #13
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.
Summary
GetStaticSecretlet a failedGetSecretValuesAsynccall propagate its rawApiException. The Akeyless SDK'sApiException.Messagecan echo back portions of the request, including the live auth token, and this exception was reaching Keyfactor Command's logs unsanitized (wrapped inAggregateExceptionviaGetPassword's.Result).catch (ApiException ex)block inGetStaticSecret(akeyless-pam/AkeylessPam.cs) that logs onlyex.ErrorCode(HTTP status) and the secret name, then throws a sanitizedInvalidSecretConfigurationException— mirroring the existing pattern inInitClient.CHANGELOG.md,docsource/testing.md, andtests/AkeylessPam.Unit.Tests/README.mdto keep the test matrix in sync.Opened against
feature/env-var-credential-overrides(PR #11) per request, since that's the currently open change toAkeylessPam.csand this fix should land before/alongside it rather than againstmain.Test plan
dotnet build akeyless-pam/akeyless-pam.csproj -c Release— succeedsdotnet test tests/AkeylessPam.Unit.Tests/— 63/63 passing (1 new test)