AWS aurora-dsql medium security documentation change
Summary
Updated token expiration defaults to 15 minutes for all methods, added note about local token generation without credential validation, corrected code examples across SDKs, and fixed contractions in documentation text.
Security assessment
The change reduces default token expiration from 1 hour (console) to 15 minutes for all methods, improving security by shortening token lifespan. Added note clarifies security risk: tokens can be generated with expired/invalid credentials (local signing doesn't validate credentials), which could lead to connection failures if credentials aren't refreshed. This highlights a security consideration for token generation.
Diff
diff --git a/aurora-dsql/latest/userguide/SECTION_authentication-token.md b/aurora-dsql/latest/userguide/SECTION_authentication-token.md index 4148d94e2..a8f2879e6 100644 --- a//aurora-dsql/latest/userguide/SECTION_authentication-token.md +++ b//aurora-dsql/latest/userguide/SECTION_authentication-token.md @@ -11 +11 @@ To connect to Amazon Aurora DSQL with a SQL client, generate an authentication t -If you create an authentication token using the AWS console, the token automatically expires in one hour by default. If you use the AWS CLI or SDKs to create the token, the default is 15 minutes. The maximum duration is 604,800 seconds, which is one week. To connect to Aurora DSQL from your client again, you can use the same authentication token if it hasn't expired, or you can generate a new one. +If you create an authentication token using the AWS console, the AWS CLI, or SDKs, the token automatically expires in 15 minutes by default. The maximum duration is 604,800 seconds, which is one week. To connect to Aurora DSQL from your client again, you can use the same authentication token if it hasn't expired, or you can generate a new one. @@ -99,0 +100,4 @@ When your cluster is `ACTIVE`, you can generate an authentication token on the C +###### Note + +Token generation is a local operation that signs the request using your current IAM credentials. It does not contact AWS to validate the credentials. If your credentials are expired or invalid, the token generation still succeeds, but the connection attempt fails. Ensure that your IAM credentials are valid before generating a token. + @@ -152 +156 @@ You can generate the token in the following ways: - * If you're connecting with the `admin` role, use `generate_db_connect_admin_auth_token`. + * If you are connecting with the `admin` role, use `generate_db_connect_admin_auth_token`. @@ -154 +158 @@ You can generate the token in the following ways: - * If you're connecting with a custom database role, use `generate_connect_auth_token`. + * If you are connecting with a custom database role, use `generate_connect_auth_token`. @@ -159,0 +164,2 @@ You can generate the token in the following ways: + import boto3 + @@ -172 +178 @@ You can generate the token in the following ways: - * If you're connecting with the `admin` role, use `GenerateDBConnectAdminAuthToken`. + * If you are connecting with the `admin` role, use `GenerateDBConnectAdminAuthToken`. @@ -174 +180 @@ You can generate the token in the following ways: - * If you're connecting with a custom database role, use `GenerateDBConnectAuthToken`. + * If you are connecting with a custom database role, use `GenerateDBConnectAuthToken`. @@ -188,2 +193,0 @@ You can generate the token in the following ways: - Aws::SDKOptions options; - Aws::InitAPI(options); @@ -203,0 +208,2 @@ You can generate the token in the following ways: + return token; + } @@ -204,0 +211,5 @@ You can generate the token in the following ways: + int main() { + Aws::SDKOptions options; + Aws::InitAPI(options); + // Replace with your cluster endpoint and region + std::string token = generateToken("your_cluster_endpoint.dsql.us-east-1.on.aws", "us-east-1"); @@ -206 +217 @@ You can generate the token in the following ways: - return token; + return 0; @@ -214 +225 @@ You can generate the token in the following ways: - * If you're connecting with the `admin` role, use `getDbConnectAdminAuthToken`. + * If you are connecting with the `admin` role, use `getDbConnectAdminAuthToken`. @@ -216 +227 @@ You can generate the token in the following ways: - * If you're connecting with a custom database role, use `getDbConnectAuthToken`. + * If you are connecting with a custom database role, use `getDbConnectAuthToken`. @@ -245 +256 @@ You can generate the token in the following ways: - * If you're connecting with the `admin` role, use `generateDbConnectAdminAuthToken`. + * If you are connecting with the `admin` role, use `generateDbConnectAdminAuthToken`. @@ -247 +258 @@ You can generate the token in the following ways: - * If you're connecting with a custom database role, use `generateDbConnectAuthToken`. + * If you are connecting with a custom database role, use `generateDbConnectAuthToken`. @@ -261 +272 @@ You can generate the token in the following ways: - .credentialsProvider(DefaultCredentialsProvider.create()) + .credentialsProvider(DefaultCredentialsProvider.builder().build()) @@ -280 +291 @@ You can generate the token in the following ways: - * If you're connecting with the `admin` role, use `db_connect_admin_auth_token`. + * If you are connecting with the `admin` role, use `db_connect_admin_auth_token`. @@ -282 +293 @@ You can generate the token in the following ways: - * If you're connecting with a custom database role, use `db_connect_auth_token`. + * If you are connecting with a custom database role, use `db_connect_auth_token`. @@ -312 +323 @@ You can generate the token in the following ways: - * If you're connecting with the `admin` role, use `generate_db_connect_admin_auth_token`. + * If you are connecting with the `admin` role, use `generate_db_connect_admin_auth_token`. @@ -314 +325 @@ You can generate the token in the following ways: - * If you're connecting with a custom database role, use `generate_db_connect_auth_token`. + * If you are connecting with a custom database role, use `generate_db_connect_auth_token`. @@ -349 +360 @@ You can generate the token in the following ways: - * If you're connecting with the `admin` role, use `DbConnectAdmin`. + * If you are connecting with the `admin` role, use `DbConnectAdmin`. @@ -351 +362 @@ You can generate the token in the following ways: - * If you're connecting with a custom database role, use `DbConnect`. + * If you are connecting with a custom database role, use `DbConnect`. @@ -361 +371,0 @@ The following example uses the `DSQLAuthTokenGenerator` utility class to generat - using Amazon.Runtime; @@ -365,3 +375,2 @@ The following example uses the `DSQLAuthTokenGenerator` utility class to generat - AWSCredentials credentials = FallbackCredentialsFactory.GetCredentials(); - - var token = DSQLAuthTokenGenerator.GenerateDbConnectAdminAuthToken(credentials, RegionEndpoint.USEast1, yourClusterEndpoint); + // Use `DSQLAuthTokenGenerator.GenerateDbConnectAuthToken` if you are _not_ logging in as `admin` user + var token = DSQLAuthTokenGenerator.GenerateDbConnectAdminAuthToken(RegionEndpoint.USEast1, yourClusterEndpoint);