AWS Security ChangesHomeSearch

AWS datasync: Add OIDC federated identity docs for Google Cloud Storage

Service: datasync · 2026-11-06 · Documentation medium

File: datasync/latest/userguide/tutorial_transfer-google-cloud-storage.md · Type: iam

Summary

Adds a new 'Federated identity (OIDC)' section explaining how DataSync can authenticate to Google Cloud Storage using short-lived tokens via AWS STS GetWebIdentityToken and Google Workload Identity Federation, including IAM role trust policy, sts:GetWebIdentityToken permission, GCP workload identity pool/provider setup, attribute mapping, bucket access grant, and create-location-object-storage CLI example. Also notes Basic vs Enhanced mode credential options.

Security assessment

The added content documents a security feature/best practice: replacing long-lived GCS access/secret keys with short-lived OIDC tokens obtained via AWS STS GetWebIdentityToken and Google Workload Identity Federation. It includes IAM trust policy with aws:SourceAccount/aws:SourceArn conditions and a least-privilege sts:GetWebIdentityToken permission, reducing credential exposure risk. No specific vulnerability, CVE, or incident is referenced, so it is security documentation/hardening rather than a fix.

Evidence

+Using temporary short-lived credentials is often a preferred alternative to using long-lived credentials. While long-lived credentials are usually private (and must be stored securely to assure privacy), short-lived temporary credentials can be obtained at runtime without having to leverage any private information.

Diff

diff --git a/datasync/latest/userguide/tutorial_transfer-google-cloud-storage.md b/datasync/latest/userguide/tutorial_transfer-google-cloud-storage.md
index 6668637..3e047a2 100644
--- a//datasync/latest/userguide/tutorial_transfer-google-cloud-storage.md
+++ b//datasync/latest/userguide/tutorial_transfer-google-cloud-storage.md
@@ -7 +7 @@
-OverviewCostsPrerequisitesCreating an HMAC key for your Google Cloud Storage bucketStep 2: Configure your networkStep 3: Create a DataSync agent (optional)Step 4: Create a DataSync source location for your Google Cloud Storage bucketStep 5: Create a DataSync destination location for your S3 bucketStep 6: Create and start a DataSync task
+OverviewCostsPrerequisitesCreating an HMAC key for your Google Cloud Storage bucketFederated identity (OIDC)Step 2: Configure your networkStep 3: Create a DataSync agent (optional)Step 4: Create a DataSync source location for your Google Cloud Storage bucketStep 5: Create a DataSync destination location for your S3 bucketStep 6: Create and start a DataSync task
@@ -39,0 +40,4 @@ When you use an agent for transfers, you can deploy it in Google Cloud Storage o
+When you use Basic mode for transfers, you need to authenticate to Google Cloud Storage using long-lived access and secret keys.
+
+When you use Enhanced mode for transfer, DataSync has two options for authenticating to Google Cloud Storage: authentication with long-lived access key and secret key, or authentication with short-lived Google access token. The first option is discussed in detail below. The second option is discussed further in Federated identity (OIDC).
+
@@ -122,0 +127,133 @@ You'll need these items later to configure your DataSync source location.
+## Federated identity (OIDC)
+
+Some third-party cloud storage object storage systems support use of temporary credentials to access the storage, and they also integrate with AWS Security Token Service (STS) to allow AWS services to obtain cloud storage access tokens using AWS credentials. This type of integration is often referred to as identity federation across cloud providers. DataSync supports identity federation with Google Cloud Storage. 
+
+###### Note
+
+Federated identity access to Google Cloud Storage is supported only for Enhanced mode tasks. You can't create a Basic mode task that uses a location configured with federated identity.
+
+For a location, provide either federated identity parameters (`FederatedIdentity`) or an access key and secret key (`AccessKey` and `SecretKey`), but not both.
+
+Using temporary short-lived credentials is often a preferred alternative to using long-lived credentials. While long-lived credentials are usually private (and must be stored securely to assure privacy), short-lived temporary credentials can be obtained at runtime without having to leverage any private information. Cloud services can obtain and refresh the temporary credentials (access tokens) at runtime to assure uninterrupted access to cloud storage. 
+
+DataSync can access Google Cloud Storage (GCS) locations without having to store long-lived credentials. Instead, DataSync can obtain a short-lived signed AWS STS JWT (web token) and can leverage Google Workload Identity Federation to exchange the web token for an OpenId Connect (OIDC) access token via Google STS. The token exchange flow is as follows:
+
+  * DataSync assumes your IAM role
+
+  * DataSync calls AWS STS GetWebIdentityToken with assumed role's credentials to get a signed JWT
+
+  * DataSync exchanges the JWT via Google STS for GCP access token
+
+  * DataSync uses GCP access token to access GCS location
+
+
+
+
+To configure GCS object storage location with federated identity parameters, follow these steps.
+
+  1. Create AWS IAM role for DataSync with the following trust policy and permissions:
+    
+        {
+        "Version": "2012-10-17",
+        "Statement": [
+            {
+                "Effect": "Allow",
+                "Principal": {
+                    "Service": "datasync.amazonaws.com"
+                },
+                "Action": "sts:AssumeRole",
+                "Condition": {
+                    "StringEquals": {
+                        "aws:SourceAccount": "CUSTOMER_AWS_ACCOUNT_ID"
+                    },
+                    "ArnLike": {
+                        "aws:SourceArn": "arn:aws:datasync:REGION:CUSTOMER_AWS_ACCOUNT_ID:*"
+                    }
+                }
+            }
+        ]
+    }
+
+and 
+    
+        {
+        "Version": "2012-10-17",
+        "Statement": [
+            {
+                "Effect": "Allow",
+                "Action": "sts:GetWebIdentityToken",
+                "Resource": "*"
+            }
+        ]
+    }
+
+  2. Create a GCP Workload Identity Pool (or use an existing one):
+
+     * Go to GCP **IAM and Admin** → **Workload Identity Federation**
+
+     * Click **Create Pool**
+
+     * Enter name and description, e.g. Name: datasync-pool, Description: Workload Identity Pool for DataSync
+
+     * Click **Continue**
+
+  3. Obtain the issuer URL for your AWS account. DataSync federates outbound using an account-specific issuer that hosts the OpenID Connect (OIDC) discovery endpoints. You register this issuer with your identity provider.
+
+    1. Enable outbound web identity federation for your AWS account. This is a one-time, account-wide setting. If the feature is already enabled, this call returns an error that you can ignore.
+        
+                % aws iam enable-outbound-web-identity-federation
+
+    2. Retrieve the issuer URL for your account:
+        
+                % aws iam get-outbound-web-identity-federation-info
+
+The result is similar to
+        
+                {
+            "IssuerIdentifier": "https://a1755d5f-34cd-4f3c-9353-0ab65648e333.tokens.sts.global.api.aws",
+            "JwtVendingEnabled": true
+        }
+
+The `IssuerIdentifier` value is your issuer URL. The subject (`sub`) that your identity provider must trust is the ARN of the IAM role you created in the previous step, in the form `arn:aws:iam::CUSTOMER_ACCOUNT:role/ROLE_NAME`.
+
+  4. Add an OIDC provider to the pool. Click **Add Provider** and select the **OpenID Connect (OIDC)** provider type, then enter the **Provider details** :
+
+     * Provider name: e.g. aws-oidc-provider
+
+     * Issuer (URL): the issuer URL obtained above
+
+     * Audiences: select **Allowed audiences** and enter: //iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_NAME/providers/PROVIDER_NAME
+
+     * Click **Continue**
+
+  5. Under **Attribute mapping** , add:
+
+     * google.subject = assertion.sub
+
+     * attribute.aws_role = assertion.sub
+
+     * Click **Save**
+
+  6. Grant GCS bucket access:
+
+     * Go to **Cloud Storage** → **Buckets** → your bucket → **Permissions**
+
+     * Click **Grant Access**
+
+     * In **New principals** , enter: principalSet://iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_NAME/attribute.aws_role/arn:aws:iam::AWS_ACCOUNT_ID:role/ROLE_NAME
+
+     * For **Role** , select a role with sufficient access rights, e.g. Storage Object Admin
+
+     * Click **Save**
+
+  7. Configure the DataSync location, e.g. using DataSync CLI:
+    
+        % aws datasync create-location-object-storage \
+    --server-hostname storage.googleapis.com \
+    --subdirectory prefix-within-the-bucket \
+    --bucket-name bucket-name \
+    --federated-identity 'AwsIamRole=arn:aws:iam::CUSTOMER_ACCOUNT:role/ROLE_NAME,ExternalIdentity={GoogleOidc={ProjectName=PROJECT_NAME,ProjectNumber=PROJECT_NUMBER,IdentityPoolName=POOL_NAME,IdentityProviderName=PROVIDER_NAME}}'
+
+
+
+