Skip to content

Commit

Permalink
add user agent 'aws-sdk-go-v2' to regex file
Browse files Browse the repository at this point in the history
  • Loading branch information
akhil-jay committed May 9, 2024
1 parent cd52910 commit af14b9b
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
21 changes: 20 additions & 1 deletion regexes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ user_agent_parsers:

# AWS S3 Clients
# must come before "Bots General matcher" to catch "boto"/"boto3" before "bot"
- regex: '\b(Boto3?|JetS3t|aws-(?:cli|sdk-(?:cpp|go|java|nodejs|ruby2?|dotnet-(?:\d{1,2}|core)))|s3fs)/(\d+)\.(\d+)(?:\.(\d+)|)'
- regex: '\b(Boto3?|JetS3t|aws-(?:cli|sdk-(?:cpp|go|go-v\d{1}|java|nodejs|ruby2?|dotnet-(?:\d{1,2}|core)))|s3fs)/(\d+)\.(\d+)(?:\.(\d+)|)'

# SAFE FME
- regex: '(FME)\/(\d+\.\d+)\.(\d+)\.(\d+)'
Expand Down Expand Up @@ -1360,6 +1360,25 @@ os_parsers:
# Box Drive and Box Sync on Mac OS X use OSX version numbers, not Darwin
- regex: '^Box.{0,200};(Darwin)/(10)\.(1\d)(?:\.(\d+)|)'
os_replacement: 'Mac OS X'

##########
# Amazon S3 client boto3
# Hasicorp API
# Boto3/1.28.62 md/Botocore#1.31.62 ua/2.0 os/macos#22.4.0 md/arch#arm64 lang/python#3.11.6 md/pyimpl#CPython cfg/retry-mode#legacy Botocore/1.31.62
# APN/1.0 HashiCorp/1.0 Terraform/1.8.1 (+https://www.terraform.io) terraform-provider-aws/4.67.0 (+https://registry.terraform.io/providers/hashicorp/aws) aws-sdk-go-v2/1.18.0 os/macos lang/go/1.19.8 md/GOOS/darwin md/GOARCH/arm64 api/identitystore/1.16.11
##########
- regex: 'os\/macos[#]?(\d*)[.]?(\d*)[.]?(\d*)'
os_replacement: 'Mac OS X'
os_v1_replacement: '$1'
os_v2_replacement: '$2'
os_v3_replacement: '$3'

##########
# Hashicorp API
# APN/1.0 HashiCorp/1.0 Terraform/1.8.0 (+https://www.terraform.io) terraform-provider-aws/4.67.0 (+https://registry.terraform.io/providers/hashicorp/aws) aws-sdk-go/1.44.261 (go1.19.8; darwin; arm64)
##########
- regex: 'darwin; arm64'
os_replacement: 'Mac OS X'

##########
# iOS
Expand Down
2 changes: 1 addition & 1 deletion tests/regexes.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ suite('redos', function(){
'""+"Android-1.1;AA_;"*5000+"! _1SLQ_2"',
'""+"Android-1.1;-;"*5000+"! _1SLQ_2"',
'""+"Android 1; Build"*3000+"! _1SLQ_2"',
'""+"Android 1; Build"*3000+"! _1SLQ_2"'
'""+"Android 1; Build"*3000+"! _1SLQ_2"',
]

function buildAttackString (attackString) {
Expand Down
22 changes: 22 additions & 0 deletions tests/test_os.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3237,3 +3237,25 @@ test_cases:
minor: '1'
patch: '1'
patch_minor:

- user_agent_string: 'Boto3/1.28.62 md/Botocore#1.31.62 ua/2.0 os/macos#22.4.0 md/arch#arm64 lang/python#3.11.6 md/pyimpl#CPython cfg/retry-mode#legacy Botocore/1.31.62'
family: 'Mac OS X'
major: '22'
minor: '4'
patch: '0'
patch_minor:

- user_agent_string: 'APN/1.0 HashiCorp/1.0 Terraform/1.8.1 (+https://www.terraform.io) terraform-provider-aws/4.67.0 (+https://registry.terraform.io/providers/hashicorp/aws) aws-sdk-go-v2/1.18.0 os/macos lang/go/1.19.8 md/GOOS/darwin md/GOARCH/arm64 api/identitystore/1.16.11'
family: 'Mac OS X'
major:
minor:
patch:
patch_minor:

- user_agent_string: 'APN/1.0 HashiCorp/1.0 Terraform/1.8.0 (+https://www.terraform.io) terraform-provider-aws/4.67.0 (+https://registry.terraform.io/providers/hashicorp/aws) aws-sdk-go/1.44.261 (go1.19.8; darwin; arm64)'
family: 'Mac OS X'
major:
minor:
patch:
patch_minor:

6 changes: 6 additions & 0 deletions tests/test_ua.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8031,6 +8031,12 @@ test_cases:
major: '1'
minor: '4'
patch: '12'

- user_agent_string: 'aws-sdk-go-v2/1.24.1 os/linux lang/go#1.20.4 md/GOOS#linux md/GOARCH#arm64 api/sts#1.26.7'
family: 'aws-sdk-go-v2'
major: '1'
minor: '24'
patch: '1'

- user_agent_string: 'aws-sdk-nodejs/2.141.0 win32/v8.4.0'
family: 'aws-sdk-nodejs'
Expand Down

0 comments on commit af14b9b

Please sign in to comment.