Repository navigation
Filter String-keyed sensitive params from logs - #3515
Merged
Merged
Conversation
ParamFilter compared parameter keys against the generated SENSITIVE lists, which hold Symbols. The SDK accepts String member keys, so a sensitive member passed as a String (e.g. "logins" for Cognito Identity) was written to the request log unredacted. Compare keys as Symbols in both the structure and map paths, and normalize the :filter option the same way. Output keys keep their original type. Bump MINIMUM_CORE_VERSION and MINIMUM_CORE_VERSION_S3 to 3.274.0, the release expected to ship this fix, so updated service gems require it.
String#to_sym raises EncodingError for a String that is not validly encoded, so a map or document key like that made ParamFilter raise, breaking request logging (after the request was sent) and Structure#to_s. Such a key cannot match a member name, so compare it as-is.
Bumping MINIMUM_CORE_VERSION to 3.274.0 needs a minor release of aws-sdk-core. An Issue entry produces a patch release (3.273.1), so the minimum core gem would not exist. Per the V3 versioning policy, any MINIMUM_CORE_VERSION bump uses a Feature entry.
ashishdhingra
requested review from
jterapin,
richardwang1124,
sankettangade and
siddsriv
December 3, 2026 18:15
richardwang1124
approved these changes
Dec 3, 2026
sankettangade
approved these changes
Dec 3, 2026
Contributor
|
Can we trigger a dry run before merging? Thanks |
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.
Important
Check the version before merging and releasing. This PR sets
MINIMUM_CORE_VERSIONandMINIMUM_CORE_VERSION_S3inbuild_tools/services.rbto3.274.0, the minor release theFeaturechangelog entry produces. If another core change lands first and this fix ships in a different version, update both constants to that version.Problem
Aws::Log::ParamFilterchecks parameter keys against the generatedSENSITIVElists, which hold Symbols. The SDK also accepts String member keys, so a sensitive member passed with a String key was not matched and was written to the request log unredacted. For example, with Cognito Identityget_id:Change
filter_hash(structure members) andfilter_map(map keys vs. the:filteroption).:filteroption to Symbols, sofilter: ['password']andfilter: [:password]behave the same.to_symraises for them and they cannot match a member name.MINIMUM_CORE_VERSIONandMINIMUM_CORE_VERSION_S3to3.274.0so service gems built in the next release require a core with the fix. The changelog entry is aFeatureto produce that minor release.Compatibility
"body","name"or"type", the same way Symbol keys already were.:filteroption, never the global list.filter_sensitive_params: falsestill turns off all filtering. Symbol-key behavior is unchanged.Testing
ShapeRef,:filtergiven as Symbols and as Strings against both key types, keys that are not validly encoded (includingStructure#to_s), and a formatter end-to-end case.param_filter_spec.rb,formatter_spec.rbandstructure_spec.rb: 75 examples, 0 failures.aws-sdk-coresuite: no new failures compared withversion-3.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.