diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f42d20e..c45484b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### **Changed** - replaced exporting metadata with seedfarmer command +- storage/buckets - added `usedforsecurity=False` to the sha1 creation of bucket names ### **Removed** diff --git a/modules/storage/buckets/stack.py b/modules/storage/buckets/stack.py index cb851aa3..a0f64b01 100755 --- a/modules/storage/buckets/stack.py +++ b/modules/storage/buckets/stack.py @@ -53,7 +53,9 @@ def __init__( Tags.of(scope=cast(IConstruct, self)).add(key="Deployment", value=full_dep_mod) artifact_bucket_name = f"{project_name}-{deployment_name}-artifacts-bucket-{hash}" - unique_ab = (hashlib.sha1(module_name.encode("UTF-8")).hexdigest())[: (60 - len(artifact_bucket_name))] + unique_ab = ( + hashlib.sha1(module_name.encode("UTF-8"), usedforsecurity=False).hexdigest() # type: ignore[call-arg] + )[: (60 - len(artifact_bucket_name))] artifacts_bucket = aws_s3.Bucket( self, @@ -72,7 +74,9 @@ def __init__( ) log_bucket_name = f"{project_name}-{deployment_name}-logs-bucket-{hash}" - unique_log = (hashlib.sha1(module_name.encode("UTF-8")).hexdigest())[: (60 - len(log_bucket_name))] + unique_log = ( + hashlib.sha1(module_name.encode("UTF-8"), usedforsecurity=False).hexdigest() # type: ignore[call-arg] + )[: (60 - len(log_bucket_name))] logs_bucket = aws_s3.Bucket( self,