Skip to content

Commit bd1c65f

Browse files
authored
Merge branch 'master' into master
2 parents 5b70a6e + 8450ad7 commit bd1c65f

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

README.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ by ``git`` when running ``git secrets``.
4141
\*nix (Linux/macOS)
4242
~~~~~~~~~~~~~~~~~
4343

44-
You can use the ``install`` target of the provided Makefile to install
45-
``git secrets`` and the man page. You can customize the install path
46-
using the PREFIX and MANPREFIX variables.
44+
You can use the ``install`` target of the provided Makefile to install ``git secrets`` and the man page.
45+
You can customize the install path using the PREFIX and MANPREFIX variables.
4746

4847
::
4948

@@ -161,7 +160,7 @@ Each of these options must appear first on the command line.
161160
in ``~/.aws/credentials`` are not found in any commit. The following
162161
checks are added:
163162

164-
- AWS Access Key IDs (strings matching ``[A-Z0-9]{20}``)
163+
- AWS Access Key IDs via ``(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}``
165164
- AWS Secret Access Key assignments via ":" or "=" surrounded by optional
166165
quotes
167166
- AWS account ID assignments via ":" or "=" surrounded by optional quotes

git-secrets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ register_aws() {
235235
local aws="(AWS|aws|Aws)?_?" quote="(\"|')" connect="\s*(:|=>|=)\s*"
236236
local opt_quote="${quote}?"
237237
add_config 'secrets.providers' 'git secrets --aws-provider'
238-
add_config 'secrets.patterns' '[A-Z0-9]{20}'
238+
add_config 'secrets.patterns' '(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'
239239
add_config 'secrets.patterns' "${opt_quote}${aws}(SECRET|secret|Secret)?_?(ACCESS|access|Access)?_?(KEY|key|Key)${opt_quote}${connect}${opt_quote}[A-Za-z0-9/\+=]{40}${opt_quote}"
240240
add_config 'secrets.patterns' "${opt_quote}${aws}(ACCOUNT|account|Account)_?(ID|id|Id)?${opt_quote}${connect}${opt_quote}[0-9]{4}\-?[0-9]{4}\-?[0-9]{4}${opt_quote}"
241241
add_config 'secrets.allowed' 'AKIAIOSFODNN7EXAMPLE'

test/git-secrets.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ load test_helper
278278
repo_run git-secrets --register-aws
279279
git config --local --get secrets.providers
280280
repo_run git-secrets --list
281-
echo "$output" | grep -F '[A-Z0-9]{20}'
281+
echo "$output" | grep -F '(A3T[A-Z0-9]|AKIA|AGPA|AIDA|AROA|AIPA|ANPA|ANVA|ASIA)[A-Z0-9]{16}'
282282
echo "$output" | grep "AKIAIOSFODNN7EXAMPLE"
283283
echo "$output" | grep "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
284284
}

0 commit comments

Comments
 (0)