mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2024-11-10 07:04:24 +00:00
fixing incorrect acct num id for some aws keys (#2332)
This commit is contained in:
parent
443ef98e41
commit
05d189c977
1 changed files with 3 additions and 0 deletions
|
@ -61,6 +61,9 @@ func GetAccountNumFromAWSID(AWSID string) (string, error) {
|
|||
if len(AWSID) < 4 {
|
||||
return "", fmt.Errorf("AWSID is too short")
|
||||
}
|
||||
if AWSID[4] == 'I' || AWSID[4] == 'J' {
|
||||
return "", fmt.Errorf("Can't get account number from AKIAJ/ASIAJ or AKIAI/ASIAI keys")
|
||||
}
|
||||
trimmedAWSID := AWSID[4:]
|
||||
decodedBytes, err := base32.StdEncoding.WithPadding(base32.NoPadding).DecodeString(strings.ToUpper(trimmedAWSID))
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue