Skip to content

Commit

Permalink
Merge pull request #5 from jones910/patch-2
Browse files Browse the repository at this point in the history
Create README.md
  • Loading branch information
morga471 committed May 5, 2026
2 parents dc4ebc5 + f64f1bc commit 13aae21
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 0 deletions.
91 changes: 91 additions & 0 deletions examples/RDS MFA Test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@

1. **Enable IAM authentication on the Postgres DB instance or Aurora Postgres Cluster**

**Terraform:**

Set iam\_database\_authentication\_enabled = true within the Instance or the Cluster resource and apply.

**Console:**

* 1. Enable IAM Authentication on the DB Instance
1. Go to **RDS Console** → Select your **DB instance or the Cluster**.
2. Choose **Modify**.
3. Scroll to **Database Authentication**.
4. Set **IAM DB authentication** to **Enabled**.
5. Click **Continue****Apply Immediately** or during the next maintenance window.
6. This allows the DB instance to accept IAM token-based logins

**CLI:**

aws rds modify-db-instance \
--db-instance-identifier <your-db-instance-identifier> \
--enable-iam-database-authentication \
--apply-immediately

aws rds modify-db-cluster \
--db-cluster-identifier your-aurora-cluster-identifier \
--enable-iam-database-authentication \
--apply-immediately

1. **Create IAM User/Role and assign IAM Policy (Please Confirm with Matt Morgan from SCT - INC000003161057)**

Policy:

For RDS:

{
"Version" : "2012-10-17",
"Statement" :
[
{
"Effect" : "Allow",
"Action" : ["rds-db:connect"],
"Resource" : ["arn:aws:rds-db:us-east-1:123456789012:dbuser:db-ABCDEFGHIJKL01234/mydbuser"]
}
]
}
For Aurora:

{
"Version" : "2012-10-17",
"Statement" :
[
{
"Effect" : "Allow",
"Action" : ["rds-db:connect"],
"Resource" : ["arn:aws:rds-db:us-east-1:123456789012:dbuser:cluster-ABCDEFGHIJKL01234/mydbuser"]
}
]
}

1. **Enable IAM authentication for the database JBID user**

Grant rds\_iam to <JBID>;

1. Launch the URL from production network to access AWS Console using Identity Center

<https://start.us-gov-east-1.us-gov-home.awsapps.com/directory/d-c2672d0b4e#/>

![](images/image_1.png)

Once verified via the phone Okta verify app, successfully logged in.

![](images/image_2.png)

![](images/image_3.png)

Retrieve the Access keys:

![](images/image_4.png)

Generate DB token after setting the keys in Power shell or Command prompt.

![](images/image_5.png)

![](images/image_6.png)

Copy the token and paste in the password box in PGADMIN or DBeaver tools.

Token can be obtained only after getting authenticated with MFA.

Login should be successful.
Binary file added examples/RDS MFA Test/images/image_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/RDS MFA Test/images/image_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/RDS MFA Test/images/image_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/RDS MFA Test/images/image_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/RDS MFA Test/images/image_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/RDS MFA Test/images/image_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions examples/RDS MFA Test/images/temp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

0 comments on commit 13aae21

Please sign in to comment.