Skip to content

Hosted connection grants

The exact access you give untrust for hosted (server-side) scanning and live detections, per cloud. The lists below are read from the templates the console's connect wizard hands out, so they match what you deploy. Values the console fills in for your connection, such as the external ID or the untrust delegate, appear as parameter names.

Source

Generated from untrust 1.3.0 (commit ba733ed56760).

Grant Template Allowed Denied or never granted
AWS server scan aws-readonly-scan.cfn.json, aws-readonly-scan.tf 46 actions 45 actions (explicit Deny)
AWS live detections aws-event-reader.cfn.json 6 actions 12 actions (explicit Deny)
GCP server scan gcp-readonly-scan.tf 18 project permissions, 4 optional organization permissions, one log view 28 permissions (never included)
Azure server scan azure-readonly-scan.role.json 6 actions 7 actions (never included)
Azure live detections none (you create the pieces) Azure Event Hubs Data Receiver on one hub send, manage and every other scope

AWS

Server scan: the UntrustReadOnlyScan role

You deploy one IAM role, UntrustReadOnlyScan, from aws-readonly-scan.cfn.json (CloudFormation) or aws-readonly-scan.tf (Terraform). The two files grant exactly the same; the generator checks this. The role has one inline policy, untrust-passive-scan, with one Allow statement and one explicit Deny.

Parameters

The Terraform module takes the same two values as the variables external_id and untrust_scan_broker_role_arn.

Parameter Meaning
ExternalId The ExternalId the untrust console shows for this connection. Hidden in the CloudFormation console (NoEcho).
UntrustScanBrokerRoleArn The untrust scan broker role ARN shown in the console. Must be a role named untrust-scan-broker; any other role is refused at deploy.

Trust relationship

Only the role you pass as UntrustScanBrokerRoleArn, whose value the console shows, may assume this role. Statement UntrustServerScan allows sts:AssumeRole only when all of these hold:

  • the request carries your connection's external ID (sts:ExternalId);
  • sts:RoleSessionName matches untrust-scan-*;
  • sts:SourceIdentity matches untrust-scan-*.

Statement UntrustServerScanSourceIdentity allows sts:SetSourceIdentity for the same role, only with a source identity matching untrust-scan-*. It is a separate statement because AWS checks each action of the call on its own, and the external ID is not part of the sts:SetSourceIdentity check. A role created from the older single-statement template refuses every untrust session; the console reports it as an outdated trust policy (trust_policy_outdated). Update the stack to fix it.

The role's maximum session length is 3600 seconds.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "UntrustServerScan",
      "Effect": "Allow",
      "Principal": {
        "AWS": "<untrust scan broker role ARN, shown in the console>"
      },
      "Action": "sts:AssumeRole",
      "Condition": {
        "StringEquals": {
          "sts:ExternalId": "<ExternalId: your connection's external ID, shown in the console>"
        },
        "StringLike": {
          "sts:RoleSessionName": "untrust-scan-*",
          "sts:SourceIdentity": "untrust-scan-*"
        }
      }
    },
    {
      "Sid": "UntrustServerScanSourceIdentity",
      "Effect": "Allow",
      "Principal": {
        "AWS": "<untrust scan broker role ARN, shown in the console>"
      },
      "Action": "sts:SetSourceIdentity",
      "Condition": {
        "StringLike": {
          "sts:SourceIdentity": "untrust-scan-*"
        }
      }
    }
  ]
}

Allowed actions (46)

Statement UntrustPassiveScanRead, on all resources. Every action is a read of configuration or metadata.

Service Action
cloudtrail cloudtrail:DescribeTrails
cloudtrail cloudtrail:GetEventSelectors
cloudtrail cloudtrail:GetTrailStatus
cloudtrail cloudtrail:LookupEvents
dynamodb dynamodb:DescribeContinuousBackups
dynamodb dynamodb:DescribeTable
dynamodb dynamodb:GetResourcePolicy
ec2 ec2:DescribeInstances
ec2 ec2:DescribeRegions
ec2 ec2:DescribeSecurityGroups
ec2 ec2:DescribeTransitGatewayVpcAttachments
ec2 ec2:DescribeVpcPeeringConnections
ec2 ec2:GetInstanceUefiData
elasticfilesystem elasticfilesystem:DescribeBackupPolicy
elasticfilesystem elasticfilesystem:DescribeFileSystemPolicy
elasticfilesystem elasticfilesystem:DescribeFileSystems
iam iam:GenerateServiceLastAccessedDetails
iam iam:GetAccessKeyLastUsed
iam iam:GetInstanceProfile
iam iam:GetPolicy
iam iam:GetPolicyVersion
iam iam:GetRole
iam iam:GetRolePolicy
iam iam:GetServiceLastAccessedDetails
iam iam:ListAccessKeys
iam iam:ListAttachedRolePolicies
iam iam:ListRolePolicies
iam iam:ListRoles
iam iam:ListUsers
iam iam:SimulatePrincipalPolicy
kms kms:DescribeKey
kms kms:GetKeyPolicy
kms kms:ListGrants
rds rds:DescribeDBInstances
rds rds:DescribeDBSnapshotAttributes
rds rds:DescribeDBSnapshots
s3 s3:GetBucketLogging
s3 s3:GetBucketObjectLockConfiguration
s3 s3:GetBucketPolicy
s3 s3:GetBucketPublicAccessBlock
s3 s3:GetBucketVersioning
s3 s3:GetEncryptionConfiguration
secretsmanager secretsmanager:DescribeSecret
secretsmanager secretsmanager:GetResourcePolicy
ssm ssm:DescribeParameters
sts sts:GetCallerIdentity

Explicit Deny (45)

Statement UntrustNeverDataOrExec, on all resources. A Deny wins over any Allow, so these stay blocked even if a broader policy is attached to the role later. A trailing * covers every action with that prefix.

Service Denied action
cloudformation cloudformation:GetTemplate
codebuild codebuild:BatchGetProjects
dynamodb dynamodb:BatchExecuteStatement
dynamodb dynamodb:BatchGetItem
dynamodb dynamodb:ExecuteStatement
dynamodb dynamodb:GetItem
dynamodb dynamodb:PartiQLSelect
dynamodb dynamodb:Query
dynamodb dynamodb:Scan
ec2-instance-connect ec2-instance-connect:*
ec2 ec2:DescribeInstanceAttribute
ec2 ec2:GetConsoleOutput
ec2 ec2:GetConsoleScreenshot
ec2 ec2:GetLaunchTemplateData
ec2 ec2:GetPasswordData
ecr ecr:BatchGetImage
ecr ecr:GetDownloadUrlForLayer
ecs ecs:DescribeTaskDefinition
glue glue:GetConnection
glue glue:GetConnections
kinesis kinesis:GetRecords
kms kms:Decrypt
kms kms:GenerateDataKey*
kms kms:ReEncrypt*
lambda lambda:GetFunction
lambda lambda:GetFunctionConfiguration
logs logs:FilterLogEvents
logs logs:GetLogEvents
logs logs:GetLogRecord
logs logs:GetQueryResults
logs logs:StartLiveTail
logs logs:StartQuery
logs logs:Unmask
s3 s3:DeleteObject*
s3 s3:GetObject*
s3 s3:PutObject*
secretsmanager secretsmanager:BatchGetSecretValue
secretsmanager secretsmanager:GetSecretValue
sqs sqs:ReceiveMessage
ssm ssm:GetParameter
ssm ssm:GetParameterHistory
ssm ssm:GetParameters
ssm ssm:GetParametersByPath
ssm ssm:SendCommand
ssm ssm:StartSession

Outputs

Output What to do with it
RoleArn Paste this into the untrust console.

Revoke

Delete the UntrustReadOnlyScan role, or use IAM Revoke active sessions on it. This needs nothing from untrust.

Live detections: the CloudTrail feed and the UntrustEventReader role

aws-event-reader.cfn.json is a separate CloudFormation stack, deployed in the account and region that own the trail. It sends CloudTrail's log-file notifications to a queue you own, and creates a second role, UntrustEventReader, that can read only the trail's log files and that queue. It is separate from the scan role and is assumed by a separate untrust role.

Parameters

Parameter Meaning
ExternalId The ExternalId the untrust console shows for this feed. Hidden in the CloudFormation console (NoEcho).
UntrustFeedBrokerRoleArn The untrust feed broker role ARN shown in the console. Must be a role named untrust-feed-broker; any other role is refused at deploy.
TrailArn ARN of the (organization) trail to read.
TrailBucketName The trail's S3 bucket.
TrailLogPrefix Key prefix the trail writes under, ending in AWSLogs/. Default AWSLogs/.
TrailKmsKeyArn The trail's KMS key ARN if SSE-KMS; empty if SSE-S3. Optional; empty by default.
ExistingTrailTopicArn If the trail already notifies an SNS topic (aws cloudtrail get-trail --name <trail> --query Trail.SnsTopicARN), put it here: the queue subscribes to it and the trail is left unchanged. Empty creates one. Optional; empty by default.

What the stack creates

Resource Type Purpose
untrust-cloudtrail-delivery AWS::SNS::Topic Topic CloudTrail notifies for each log file it delivers. Only when CreateTopic.
DeliveryTopicPolicy AWS::SNS::TopicPolicy Lets cloudtrail.amazonaws.com call sns:Publish, aws:SourceArn StringEquals <TrailArn>. Only when CreateTopic.
untrust-cloudtrail-feed-dlq AWS::SQS::Queue Queue in your account, SQS-managed encryption, 14-day retention.
untrust-cloudtrail-feed AWS::SQS::Queue Queue in your account, SQS-managed encryption, 14-day retention. Moves a message to the untrust-cloudtrail-feed-dlq queue after 5 receives.
FeedQueuePolicy AWS::SQS::QueuePolicy Lets sns.amazonaws.com call sqs:SendMessage, aws:SourceArn ArnEquals the untrust-cloudtrail-delivery topic, or <ExistingTrailTopicArn>.
FeedSubscription AWS::SNS::Subscription Subscribes the untrust-cloudtrail-feed queue to the untrust-cloudtrail-delivery topic, or <ExistingTrailTopicArn>.
UntrustEventReader AWS::IAM::Role The reader role untrust assumes.
untrust-trail-feed-decrypt AWS::IAM::RolePolicy Adds policy untrust-trail-feed-decrypt to the reader role. Only when Encrypted.

Trust relationship

Only the role you pass as UntrustFeedBrokerRoleArn, whose value the console shows, may assume this role. Statement UntrustFeedBroker allows sts:AssumeRole only when all of these hold:

  • the request carries your connection's external ID (sts:ExternalId);
  • sts:RoleSessionName matches untrust-feed-*;
  • sts:SourceIdentity matches untrust-feed-*.

Statement UntrustFeedBrokerSourceIdentity allows sts:SetSourceIdentity for the same role, only with a source identity matching untrust-feed-*. It is a separate statement because AWS checks each action of the call on its own, and the external ID is not part of the sts:SetSourceIdentity check.

The role's maximum session length is 3600 seconds.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "UntrustFeedBroker",
      "Effect": "Allow",
      "Principal": {
        "AWS": "<untrust feed broker role ARN, shown in the console>"
      },
      "Action": "sts:AssumeRole",
      "Condition": {
        "StringEquals": {
          "sts:ExternalId": "<ExternalId: your connection's external ID, shown in the console>"
        },
        "StringLike": {
          "sts:RoleSessionName": "untrust-feed-*",
          "sts:SourceIdentity": "untrust-feed-*"
        }
      }
    },
    {
      "Sid": "UntrustFeedBrokerSourceIdentity",
      "Effect": "Allow",
      "Principal": {
        "AWS": "<untrust feed broker role ARN, shown in the console>"
      },
      "Action": "sts:SetSourceIdentity",
      "Condition": {
        "StringLike": {
          "sts:SourceIdentity": "untrust-feed-*"
        }
      }
    }
  ]
}

Allowed (6 actions)

Statement Actions Resource Condition
ReadTrailLogFiles s3:GetObject S3 objects matching <TrailBucketName>/<TrailLogPrefix>*/CloudTrail/*
ConsumeFeedQueue sqs:ReceiveMessage, sqs:DeleteMessage, sqs:GetQueueAttributes, sqs:ChangeMessageVisibility the untrust-cloudtrail-feed queue
ReadDeadLetterDepth sqs:GetQueueAttributes the untrust-cloudtrail-feed-dlq queue
DecryptTrailLogsViaS3Only kms:Decrypt <TrailKmsKeyArn> Only when Encrypted. kms:ViaService StringLike s3.*.amazonaws.com; kms:EncryptionContext:aws:cloudtrail:arn StringEquals <TrailArn>

Explicit Deny (12 actions)

Statement Denied actions Resource Condition
NeverWriteOrReadElsewhere s3:PutObject*, s3:DeleteObject*, s3:PutBucket*, s3:DeleteBucket*, sqs:SendMessage, sqs:PurgeQueue, sqs:DeleteQueue, sqs:SetQueueAttributes, kms:Encrypt, kms:ReEncrypt*, kms:GenerateDataKey* all resources
NoObjectsOutsideTheTrailPrefix s3:GetObject* everything except S3 objects matching <TrailBucketName>/<TrailLogPrefix>*/CloudTrail/*

Outputs

Output What to do with it
RoleArn Paste into the untrust console.
QueueUrl Paste into the untrust console.
PointTheTrailAtTheTopic Run once in the trail's home account and region. It refuses to replace a topic the trail already notifies: if it prints EXISTING, redeploy with ExistingTrailTopicArn set instead. Only when CreateTopic.
BucketPolicyStatementIfBucketIsElsewhere Add to the trail bucket's policy if it is in another account.
KeyPolicyStatementIfKeyIsElsewhere Add to the trail key's policy if the key is in another account. Only when Encrypted.

The two policy-statement outputs grant the reader role the following, for a trail bucket or key that lives in another account:

BucketPolicyStatementIfBucketIsElsewhere, for principal <UntrustEventReader role ARN>:

Statement Actions Resource Condition
UntrustEventReaderGetTrailLogs s3:GetObject S3 objects matching <TrailBucketName>/<TrailLogPrefix>*/CloudTrail/*

KeyPolicyStatementIfKeyIsElsewhere, for principal <UntrustEventReader role ARN>:

Statement Actions Resource Condition
UntrustEventReaderDecryptTrailLogs kms:Decrypt all resources kms:ViaService StringLike s3.*.amazonaws.com; kms:EncryptionContext:aws:cloudtrail:arn StringEquals <TrailArn>

GCP

Server scan: the keyless service account and its custom roles

You apply gcp-readonly-scan.tf (Terraform) to the project. It creates:

Terraform resource What it grants
google_service_account.untrust_scan A service account with ID untrust-scan in your project. The template creates no keys for it.
google_project_iam_custom_role.untrust_passive_scan Custom role untrustPassiveScan with the 18 project permissions below.
google_project_iam_member.untrust_passive_scan Grants untrustPassiveScan to the service account on the project.
google_logging_log_view.untrust_integrity Log view untrust-shielded-integrity on bucket projects/<project_id>/locations/global/buckets/_Default, holding only entries matching LOG_ID("compute.googleapis.com/shielded_vm_integrity").
google_project_iam_member.untrust_integrity_view Grants roles/logging.viewAccessor to the service account, with an IAM condition limiting it to that one log view. There is no project-wide log read.
google_organization_iam_custom_role.untrust_passive_scan_org Optional. Custom role untrustPassiveScanOrg at your organization, with the 4 permissions below. Created only when you set organization_id.
google_organization_iam_member.untrust_passive_scan_org Optional. Grants untrustPassiveScanOrg to the service account at your organization.
google_service_account_iam_member.untrust_delegate Grants roles/iam.serviceAccountTokenCreator on the service account to the delegate in untrust_delegate only.

Variables

Variable Meaning
project_id The project the untrust console connection names.
untrust_delegate The connection-specific untrust delegate shown in the console.
organization_id Optional: your organization ID, for the folder and organization checks. Empty by default.

Trust relationship

untrust holds no key for the service account. It mints short-lived tokens for it by impersonation, which needs roles/iam.serviceAccountTokenCreator. The template grants that role to one principal: the connection-specific untrust delegate you pass as untrust_delegate, shown in the console. Do not grant it to any other untrust identity: verification fails if untrust's shared identity can mint tokens for the account directly.

Project permissions (18)

Custom role untrustPassiveScan, granted on the project.

Service Permission
artifactregistry artifactregistry.repositories.getIamPolicy
cloudkms cloudkms.cryptoKeys.getIamPolicy
compute compute.firewalls.list
compute compute.instances.get
compute compute.instances.getEffectiveFirewalls
compute compute.instances.getIamPolicy
compute compute.instances.list
compute compute.regions.get
iam iam.serviceAccountKeys.list
iam iam.serviceAccounts.getIamPolicy
iam iam.workloadIdentityPoolProviders.get
iam iam.workloadIdentityPoolProviders.list
orgpolicy orgpolicy.policy.get
resourcemanager resourcemanager.projects.get
resourcemanager resourcemanager.projects.getIamPolicy
secretmanager secretmanager.secrets.getIamPolicy
storage storage.buckets.get
storage storage.buckets.getIamPolicy

Organization permissions, optional (4)

Custom role untrustPassiveScanOrg. A project-level custom role cannot hold these. Without them the folder and organization checks report an error, never a pass.

Service Permission
accesscontextmanager accesscontextmanager.servicePerimeters.list
resourcemanager resourcemanager.folders.get
resourcemanager resourcemanager.folders.getIamPolicy
resourcemanager resourcemanager.organizations.getIamPolicy

Permissions the roles never include (28)

GCP custom roles have no deny. These permissions are excluded from both roles; the product's tests keep the roles and this list disjoint. Do not also grant the service account a broader role.

Service Never granted
bigquery bigquery.tables.getData
cloudkms cloudkms.cryptoKeyVersions.useToDecrypt
cloudkms cloudkms.cryptoKeyVersions.useToEncrypt
cloudkms cloudkms.cryptoKeyVersions.useToSign
cloudkms cloudkms.cryptoKeyVersions.viewPublicKey
cloudsql cloudsql.instances.connect
compute compute.instances.getScreenshot
compute compute.instances.getSerialPortOutput
compute compute.instances.setMetadata
compute compute.projects.setCommonInstanceMetadata
datastore datastore.entities.get
iam iam.serviceAccountKeys.create
iam iam.serviceAccounts.actAs
iam iam.serviceAccounts.getAccessToken
iam iam.serviceAccounts.getOpenIdToken
iam iam.serviceAccounts.implicitDelegation
iam iam.serviceAccounts.signBlob
iam iam.serviceAccounts.signJwt
logging logging.logEntries.list
logging logging.privateLogEntries.list
pubsub pubsub.subscriptions.consume
secretmanager secretmanager.versions.access
spanner spanner.databases.read
storage storage.objects.create
storage storage.objects.delete
storage storage.objects.get
storage storage.objects.list
storage storage.objects.update

Outputs

Output What to do with it
service_account_email Paste this into the untrust console.

Azure

Server scan: an Entra app with a federated credential and a custom role

You grant access through an app registration in your tenant and a custom role:

What you create Details
App registration A single-tenant app with no secrets or certificates. The console names it per connection.
Federated credential on the app Issuer https://accounts.google.com, audience api://AzureADTokenExchange, and a subject shown in the console. Only this connection's untrust delegate can present that subject.
Custom role From azure-readonly-scan.role.json, named untrust read-only scan ({subscriptionId}). Create it with az role definition create; role names are unique per tenant, so the name carries the subscription ID.
Role assignment The custom role, assigned to the app's service principal at scope /subscriptions/{subscriptionId}.

Trust relationship

The app has no secret. untrust signs in by presenting a token from its connection-specific delegate, which Entra accepts only because the federated credential names that delegate's subject. untrust asks Entra only for a token for management.azure.com, so key material, secrets and blobs are unreachable with it.

Allowed actions (6)

Actions in the role. NotActions, DataActions and NotDataActions are empty: the role has no data actions.

Provider Action
Microsoft.Attestation Microsoft.Attestation/attestationProviders/read
Microsoft.Compute Microsoft.Compute/virtualMachines/read
Microsoft.Insights Microsoft.Insights/diagnosticSettings/read
Microsoft.KeyVault Microsoft.KeyVault/vaults/keys/read
Microsoft.Resources Microsoft.Resources/subscriptions/read
Microsoft.Resources Microsoft.Resources/subscriptions/resources/read

Actions the role never includes (7)

Azure has no deny you can attach to the app. These are left out of the role on purpose. Do not also assign the app Reader or a broader role: another role would widen what the app may read.

Provider Never granted
Microsoft.Attestation Microsoft.Attestation/attestationProviders/write
Microsoft.Compute Microsoft.Compute/disks/beginGetAccess/action
Microsoft.Compute Microsoft.Compute/virtualMachines/runCommand/action
Microsoft.KeyVault Microsoft.KeyVault/vaults/keys/*/action
Microsoft.KeyVault Microsoft.KeyVault/vaults/secrets/getSecret/action
Microsoft.KeyVault Microsoft.KeyVault/vaults/secrets/readMetadata/action
Microsoft.Storage Microsoft.Storage/*/listKeys/action

Revoke

Delete the federated credential or the role assignment; Entra tokens already issued stay valid until they expire (60 to 90 minutes), while a scan stops after 12 minutes.

Live detections: an Event Hub and a second app

There is no template for the Azure feed. You create these yourself; the console's Live detection feed panel takes the hub and the app.

What you create Details
Event Hubs namespace and hub In the connection's own subscription. A hub in another subscription is refused.
Consumer group untrust, a group nothing else reads (Standard tier or higher), or $Default on the Basic tier, where nothing else may read it.
Feed app A second single-tenant app with no secrets or certificates. It must not be the scan app.
Federated credential on the feed app Issuer https://accounts.google.com, audience api://AzureADTokenExchange, and the subject of this connection's untrust feed delegate, which is a different delegate from the scan's.
Role assignment The built-in role Azure Event Hubs Data Receiver, on the hub only. It can receive from that hub and nothing else: no send, no manage, no other hub.
Diagnostic setting On the subscription, sending the Administrative category of the Activity Log to the hub. Optionally, the gated Key Vault's AuditEvent logs to the same hub.

untrust requests a token for eventhubs.azure.net only, and uses each for at most 15 minutes. It reads events in memory, keeps only the evidence of a detection, and never stores the raw log.

Revoke

Delete the feed app's role assignment or federated credential, or the diagnostic setting. A token already issued is used for at most 15 minutes.

Disconnecting in the console

Disconnect stops new Untrust verification and rejects pending results. Remove the customer-side grant separately. Previously issued provider sessions and IAM propagation may take time to expire.