detect_aws_credentials hook raises a false positive match when AWS credential values contain only a space character(s) · Issue #258 · pre-commit/pre-commit-hooks · GitHub
Skip to content

detect_aws_credentials hook raises a false positive match when AWS credential values contain only a space character(s) #258

Description

@PVSec

The detect_aws_credentials hook raises a false positive match when AWS credential values contain only a space character(s). For example, if the ~/.aws/credentials file contains the following:

[test]
aws_access_key_id = ggfgafg
aws_secret_access_key = 

By having a space character after the "=" for the aws_secret_access_key variable it results in:

Detect AWS Credentials...................................................Failed
hookid: detect-aws-credentials

AWS secret found in test.txt: ****************************

Which is technically true, but in essence the hook should trim (remove) the space(s) in the values for the variables prior to checking the file(s) to prevent this confusing issue from occurring.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions