-
Notifications
You must be signed in to change notification settings - Fork 1
Replace realistic-looking DB credentials and hostnames with generic placeholders #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e3995eb
9165237
7625f57
3aa25da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -9,13 +9,14 @@ replace github.com/GoCodeAlone/modular => ../../ | |||
| replace github.com/GoCodeAlone/modular/modules/eventbus => ../../modules/eventbus | ||||
|
|
||||
| require ( | ||||
| github.com/GoCodeAlone/modular v1.11.11 | ||||
| github.com/GoCodeAlone/modular v1.12.0 | ||||
| github.com/GoCodeAlone/modular/modules/eventbus v1.7.0 | ||||
| ) | ||||
|
|
||||
| require ( | ||||
| github.com/BurntSushi/toml v1.6.0 // indirect | ||||
| github.com/DataDog/datadog-go/v5 v5.4.0 // indirect | ||||
| github.com/GoCodeAlone/modular/modules/eventbus/v2 v2.5.1 // indirect | ||||
|
||||
| github.com/GoCodeAlone/modular/modules/eventbus/v2 v2.5.1 // indirect |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,7 @@ go 1.25 | |
| toolchain go1.25.0 | ||
|
|
||
| require ( | ||
| github.com/GoCodeAlone/modular v1.11.11 | ||
| github.com/GoCodeAlone/modular v1.12.0 | ||
| github.com/GoCodeAlone/modular/modules/chimux v1.1.0 | ||
| github.com/GoCodeAlone/modular/modules/httpserver v0.1.1 | ||
| github.com/GoCodeAlone/modular/modules/reverseproxy v1.1.0 | ||
|
Comment on lines
7
to
11
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -20,9 +20,9 @@ When AWS IAM authentication is enabled, **any password in the DSN is ignored and | |||||
|
|
||||||
| ```yaml | ||||||
| # All of these DSN formats work identically with IAM auth: | ||||||
| dsn: "postgresql://chimera_app:$TOKEN@host.rds.amazonaws.com:5432/mydb" | ||||||
| dsn: "postgresql://chimera_app:PLACEHOLDER@host.rds.amazonaws.com:5432/mydb" | ||||||
| dsn: "postgresql://chimera_app@host.rds.amazonaws.com:5432/mydb" | ||||||
| dsn: "postgresql://myapp_user:$TOKEN@host.rds.amazonaws.com:5432/mydb" | ||||||
| dsn: "postgresql://myapp_user:PLACEHOLDER@host.rds.amazonaws.com:5432/mydb" | ||||||
| dsn: "postgresql://myapp_user@host.rds.amazonaws.com:5432/mydb" | ||||||
| ``` | ||||||
|
|
||||||
| The password portion (`$TOKEN`, `PLACEHOLDER`, or empty) is completely ignored when IAM auth is enabled. | ||||||
|
|
@@ -33,7 +33,7 @@ The database username is extracted from the DSN or can be explicitly specified: | |||||
|
|
||||||
| ```yaml | ||||||
| # Option 1: Username in DSN (extracted automatically) | ||||||
| dsn: "postgresql://chimera_app:$TOKEN@host.rds.amazonaws.com:5432/mydb" | ||||||
| dsn: "postgresql://myapp_user:$TOKEN@host.rds.amazonaws.com:5432/mydb" | ||||||
| aws_iam_auth: | ||||||
| enabled: true | ||||||
| region: us-east-1 | ||||||
|
|
@@ -43,7 +43,7 @@ dsn: "postgresql://ignored_user:$TOKEN@host.rds.amazonaws.com:5432/mydb" | |||||
| aws_iam_auth: | ||||||
| enabled: true | ||||||
| region: us-east-1 | ||||||
| db_user: chimera_app # This takes precedence | ||||||
| db_user: myapp_user # This takes precedence | ||||||
| ``` | ||||||
|
|
||||||
| ### 3. Token Generation Flow | ||||||
|
|
@@ -66,7 +66,7 @@ database: | |||||
| writer: | ||||||
| driver: postgres | ||||||
| # DSN with $TOKEN placeholder - will be automatically stripped | ||||||
| dsn: "postgresql://chimera_app:$TOKEN@shared-chimera-dev-backend.cluster-xyz.us-east-1.rds.amazonaws.com:5432/chimera_backend?sslmode=require" | ||||||
| dsn: "postgresql://myapp_user:$TOKEN@mydb-instance.cluster-xyz.us-east-1.rds.amazonaws.com:5432/myappdb?sslmode=require" | ||||||
| max_open_connections: 25 | ||||||
| max_idle_connections: 10 | ||||||
| connection_max_lifetime: 1h | ||||||
|
|
@@ -82,7 +82,7 @@ database: | |||||
|
|
||||||
| ```bash | ||||||
| export DB_WRITER_DRIVER=postgres | ||||||
| export DB_WRITER_DSN="postgresql://chimera_app:$TOKEN@host.rds.amazonaws.com:5432/mydb?sslmode=require" | ||||||
| export DB_WRITER_DSN="postgresql://myapp_user:$TOKEN@host.rds.amazonaws.com:5432/mydb?sslmode=require" | ||||||
| export DB_WRITER_AWS_IAM_AUTH_ENABLED=true | ||||||
| export DB_WRITER_AWS_IAM_AUTH_REGION=us-east-1 | ||||||
| export DB_WRITER_MAX_OPEN_CONNECTIONS=25 | ||||||
|
|
@@ -102,15 +102,15 @@ Create a database user configured for IAM authentication: | |||||
|
|
||||||
| **PostgreSQL:** | ||||||
| ```sql | ||||||
| CREATE USER chimera_app WITH LOGIN; | ||||||
| GRANT rds_iam TO chimera_app; | ||||||
| GRANT ALL PRIVILEGES ON DATABASE chimera_backend TO chimera_app; | ||||||
| CREATE USER myapp_user WITH LOGIN; | ||||||
| GRANT rds_iam TO myapp_user; | ||||||
| GRANT ALL PRIVILEGES ON DATABASE myappdb TO myapp_user; | ||||||
| ``` | ||||||
|
|
||||||
| **MySQL:** | ||||||
| ```sql | ||||||
| CREATE USER chimera_app IDENTIFIED WITH AWSAuthenticationPlugin AS 'RDS'; | ||||||
| GRANT ALL PRIVILEGES ON chimera_backend.* TO chimera_app@'%'; | ||||||
| CREATE USER myapp_user IDENTIFIED WITH AWSAuthenticationPlugin AS 'RDS'; | ||||||
| GRANT ALL PRIVILEGES ON myappdb.* TO myapp_user@'%'; | ||||||
| ``` | ||||||
|
|
||||||
| ### 3. IAM Policy | ||||||
|
|
@@ -125,7 +125,7 @@ The AWS principal (user/role) must have `rds-db:connect` permission: | |||||
| "Effect": "Allow", | ||||||
| "Action": ["rds-db:connect"], | ||||||
| "Resource": [ | ||||||
| "arn:aws:rds-db:us-east-1:123456789012:dbuser:cluster-XXXXX/chimera_app" | ||||||
| "arn:aws:rds-db:us-east-1:123456789012:dbuser:cluster-XXXXX/myapp_user" | ||||||
| ] | ||||||
| } | ||||||
| ] | ||||||
|
|
@@ -135,7 +135,7 @@ The AWS principal (user/role) must have `rds-db:connect` permission: | |||||
| **Finding your Resource ARN:** | ||||||
| - Format: `arn:aws:rds-db:REGION:ACCOUNT:dbuser:RESOURCE_ID/DB_USERNAME` | ||||||
| - Get RESOURCE_ID from RDS console (cluster identifier starts with `cluster-`) | ||||||
| - Example: `arn:aws:rds-db:us-east-1:123456789012:dbuser:cluster-ABC123DEF456/chimera_app` | ||||||
| - Example: `arn:aws:rds-db:us-east-1:123456789012:dbuser:cluster-ABC123DEF456/myapp_user` | ||||||
|
|
||||||
| ### 4. AWS Credentials | ||||||
|
|
||||||
|
|
@@ -155,7 +155,7 @@ database: | |||||
| connections: | ||||||
| writer: | ||||||
| driver: postgres | ||||||
| dsn: "postgresql://myuser:MySecretPassword123@host.rds.amazonaws.com:5432/mydb" | ||||||
| dsn: "postgresql://myuser:MySecretP@ssword@host.rds.amazonaws.com:5432/mydb" | ||||||
|
||||||
| dsn: "postgresql://myuser:MySecretP@ssword@host.rds.amazonaws.com:5432/mydb" | |
| dsn: "postgresql://myuser:MySecretPassword@host.rds.amazonaws.com:5432/mydb" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This adds an indirect dependency on github.com/GoCodeAlone/modular/modules/eventbus/v2 alongside the direct requirement on modules/eventbus v1.7.0. If this wasn’t intentional, run
go mod tidyto drop the extra major-version module; if it is intentional, please document why v2 is needed in this example.