Skip to content

Commit 34e192d

Browse files
committed
added aws security group and bucket anonymization
1 parent 8573959 commit 34e192d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

anonymize.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
sys.exit(4)
9191

9292
__author__ = 'Hari Sekhon'
93-
__version__ = '0.10.0'
93+
__version__ = '0.10.1'
9494

9595
ip_regex = r'(?!127\.0\.0\.)' + ip_regex
9696
subnet_mask_regex = r'(?!127\.0\.0\.)' + subnet_mask_regex
@@ -296,6 +296,8 @@ def __init__(self):
296296
'aws4': r'\b[A-Za-z0-9][A-Za-z0-9/+=-]{38}[A-Za-z0-9]\b', # secret key
297297
'aws5': r'\b[A-Za-z0-9][A-Za-z0-9/+=-]{238,}', # STS token - no \b at end as it'll stop before '==' suffix
298298
'aws6': r'\bASIA[A-Za-z0-9]{16}\b', # sts temporary access key
299+
'aws7': r'\bsg-[a-z0-9]{8}(?!\w)', # security group id
300+
'aws8': r'(\bs3a?)://[^/]+/', # s3 bucket name
299301
# don't change hostname or fqdn regex without updating hash_hostnames() option parse
300302
# since that replaces these replacements and needs to match the grouping captures and surrounding format
301303
'hostname2': r'({aws_host_ip})(?!-\d)'.format(aws_host_ip=aws_host_ip_regex),
@@ -407,6 +409,8 @@ def __init__(self):
407409
'aws4': r'<secret_key>',
408410
'aws5': r'<sts_token>',
409411
'aws6': r'<sts_access_key>',
412+
'aws7': r'<security_group>',
413+
'aws8': r'\1://<bucket>/',
410414
'hostname': r'<hostname>:\2',
411415
#'hostname2': '<aws_hostname>',
412416
'hostname2': r'<ip-x-x-x-x>',

0 commit comments

Comments
 (0)