Skip to content

fix(config): whitelist AWS region and sanitize S3 bucket name - #34

Open
Bartok9 wants to merge 1 commit into
Auromix:ros2-humblefrom
Bartok9:aerial/aws-region-bucket-sanitize
Open

fix(config): whitelist AWS region and sanitize S3 bucket name#34
Bartok9 wants to merge 1 commit into
Auromix:ros2-humblefrom
Bartok9:aerial/aws-region-bucket-sanitize

Conversation

@Bartok9

@Bartok9 Bartok9 commented Jul 22, 2026

Copy link
Copy Markdown

Summary

Adds fail-closed sanitizers for AWS region (allowlist) and S3 bucket DNS rules in UserConfig, so poisoned environment variables cannot push arbitrary region/bucket strings into AWS SDK paths used by Transcribe/Polly/S3.

Changes

  • sanitize_aws_region — common-region allowlist; unknown values fall back to ap-southeast-1
  • sanitize_s3_bucket — DNS naming rules (length, charset, no .. / _)
  • Apply at config init (AWS_REGION / AWS_S3_BUCKET env optional)
  • Offline unit tests (llm_config/test/test_aws_region_bucket.py)

Motivation

Dormant ROS-LLM still wires AWS IAM/S3 directly from config. Hardening config edges keeps demos safer without changing the happy path (default demo bucket retained on invalid env).

Verification

python3 llm_config/test/test_aws_region_bucket.py -v

AI-assisted; human-reviewed.

Claim: bartok
Operator: bartok
Campaign: aerial-drone

Fail-closed helpers so poisoned env cannot inject free-form region/bucket
strings into AWS SDK paths. Fallback region ap-southeast-1; invalid
bucket env falls back to demo auromixbucket.

Signed-off-by: Bartok9 <danielrpike9@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant