Skip to content

Conversation

@ddl-ebrown
Copy link
Contributor

  • Allow GCP tokens with a custom audience matching the string
    {deploy_id}-flyte-gcp-{random_id} to access Flyte blobs

    Inspired by policy definition at
    https://jason-umiker.medium.com/cross-cloud-identities-between-gcp-and-aws-from-gke-and-or-eks-182652bddadb

    NOTE: jwt validation usually takes into account several factors

    • issuer
    • audience
    • signature
    • subject
    • scope
    • custom claims

    This policy verifies only the "aud" claim in the token, which in
    theory is spoofable by anyone using GCP to produce tokens. Therefore,
    include a random piece of data in the "aud" value that only the
    control plane will know. When generating executions on remote data
    planes (by dispatcher / workload operator), this value will be passed
    so that tokens produced from GCP will have this shared value.

    To do so requires exporting the value from the terraform code into
    the catalog and through to Nucleus

"accounts.google.com:aud": "${local.deploy_id}-flyte-gcp-${random_id.server.hex}"
}
}
},
Copy link
Contributor Author

@ddl-ebrown ddl-ebrown Oct 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Azure will look something like this

{
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Principal": {
            "Federated": "arn:aws:iam::<AWS_ACCOUNT_ID>:oidc-provider/sts.windows.net/<AZURE_AD_TENANT_ID>/"
          },
          "Action": "sts:AssumeRoleWithWebIdentity",
          "Condition": {
            "StringEquals": {
              "sts.windows.net/<AZURE_AD_TENANT_ID>/:aud": "<AZURE_AD_APPLICATION_ID>"
            }
          }
        }
      ]
    }

OR

{
    "Version": 2012-10-17",
    "Statement": [{
        "Effect": "Allow",
        "Principal": {
            "Federated": "arn:aws:iam::<AWS Account ID>:oidc-provider/sts.windows.net/<Microsoft Entra Tenant ID>/"
        },
        "Action": "sts:AssumeRoleWithWebIdentity",
        "Condition": {
            "StringEquals": {
                "sts.windows.net/<Microsoft Entra Tenant ID>/:aud": "<Application ID URI>",
                "sts.windows.net/<Microsoft Entra Tenant ID>/:sub": "<Managed Identity’s Object (Principal)ID>"
            }
        }
    }]
}

More details in https://aws.amazon.com/blogs/security/how-to-access-aws-resources-from-microsoft-entra-id-tenants-using-aws-security-token-service/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened up a separate PR at #412 for that since it will generally be a pain

@ddl-ebrown ddl-ebrown marked this pull request as ready for review October 25, 2025 00:49
@ddl-ebrown ddl-ebrown requested a review from a team as a code owner October 25, 2025 00:49
@ddl-ebrown ddl-ebrown force-pushed the DOM-54018-update-flyte-iam-policy branch 2 times, most recently from f37e20c to beb3e70 Compare October 25, 2025 01:06
Copy link
Collaborator

@Secretions Secretions left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing tf-lint had an effect on the docs again. :( General changes lgtm, just need to tweak that doc before merge.

 - Allow GCP tokens with a custom audience matching the string
   {deploy_id}-flyte-gcp-{random_id} to access Flyte blobs

   Inspired by policy definition at
   https://jason-umiker.medium.com/cross-cloud-identities-between-gcp-and-aws-from-gke-and-or-eks-182652bddadb

   NOTE: jwt validation usually takes into account several factors

   - issuer
   - audience
   - signature
   - subject
   - scope
   - custom claims

   This policy verifies only the "aud" claim in the token, which in
   theory is spoofable by anyone using GCP to produce tokens. Therefore,
   include a random piece of data in the "aud" value that only the
   control plane will know. When generating executions on remote data
   planes (by dispatcher / workload operator), this value will be passed
   so that tokens produced from GCP will have this shared value.

   To do so requires exporting the value from the terraform code into
   the catalog and through to Nucleus
@ddl-ebrown ddl-ebrown force-pushed the DOM-54018-update-flyte-iam-policy branch from beb3e70 to 92a91a4 Compare October 25, 2025 01:10
@ddl-ebrown
Copy link
Contributor Author

Confirmed in a test environment with an infra upgrade that things check out with the 16 character id at the end

{
            "Effect": "Allow",
            "Principal": {
                "Federated": "accounts.google.com"
            },
            "Action": "sts:AssumeRoleWithWebIdentity",
            "Condition": {
                "StringEquals": {
                    "accounts.google.com:aud": "flyte-awscp-flyte-gcp-a1e35ce69bb0ee86"
                }
            }
        }

@ddl-ebrown ddl-ebrown merged commit 252b6ad into main Oct 25, 2025
15 checks passed
@ddl-ebrown ddl-ebrown deleted the DOM-54018-update-flyte-iam-policy branch October 25, 2025 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants