mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(iam): check STS requests on the resources the generated table gives them (#9033)
STS was built by hand: ResourceArnBuilder checked AssumeRole on the role its RoleArn named and every other operation on *, IamEnforcementFilter sent STS requests there by action, and the request resources table held no STS operation. sts moves from HAND_BUILT to NAMESPACES, so the table gives each operation what the Service Reference and botocore give it: AssumeRole the role its RoleArn names, as before, GetFederationToken the federated user its Name names and AssumeRoot the root user, where the hand builder checked both on *, and the operations that act on no resource type * as before. StsStoredResourceArns answers that a role IAM holds in the account its ARN names is assumed there, as the handler finds it, so a cross-account AssumeRole is checked on that role alone and not also on the caller's role of that name. ResourceArnBuilder's STS section and the filter's STS case go. Only STS's operations change in the table.
This commit is contained in:
1 parent
a769b77124
commit
1a888867ad
9 files changed
+165
-49
No files matched your search
@@ -2332,8 +2332,8 @@ requests retain HTTP 403 XML `AccessDenied` responses, except SNS's, which retur
|
||||
action is denied. The routed protocol determines the status, not just the request's content type.
|
||||
|
||||
A request is checked against the resources it names. Floci builds their ARNs itself for S3,
|
||||
DynamoDB, SSM, KMS, IAM, Resource Groups, EKS, API Gateway, CloudWatch Logs
|
||||
and STS. For Secrets Manager, Elastic Load Balancing, ECR,
|
||||
DynamoDB, SSM, KMS, IAM, Resource Groups, EKS, API Gateway
|
||||
and CloudWatch Logs. For Secrets Manager, Elastic Load Balancing, ECR,
|
||||
Step Functions, EventBridge, EventBridge Scheduler, Amazon Cognito user pools and identity pools, Amazon Data Firehose, Cloud
|
||||
Map, ACM, CodePipeline, CodeBuild, Amazon Managed Service for Apache Flink (Kinesis Data Analytics v2),
|
||||
Application Auto Scaling, AWS Budgets, Cost and Usage Reports, Service Quotas, Amazon Textract, Amazon Translate, Amazon Athena,
|
||||
@@ -2341,7 +2341,7 @@ AWS Data Exports, AWS Pricing Calculator, Cost Explorer, CloudTrail, Global Acce
|
||||
Timestream for InfluxDB, Amazon Redshift, the Amazon Redshift Data API, AWS Payment Cryptography, AWS DataSync, Amazon EMR,
|
||||
Amazon Rekognition, IAM Identity Center, Amazon Inspector, Amazon Macie, AWS Fault Injection Service, AWS Resource
|
||||
Access Manager, CloudWatch Observability Access Manager, AWS Resource Explorer, AWS Account Management, AWS Control
|
||||
Catalog, Amazon OpenSearch Service, IAM Access Analyzer, AWS Security Hub, Amazon GuardDuty, Lambda, AWS Glue, Amazon SQS, Amazon SNS, Amazon Kinesis Data Streams, Amazon EventBridge Pipes and Aurora DSQL they come from a table generated from AWS's Service Reference and botocore, `src/main/resources/aws/iam-request-resources.json`, which gives each
|
||||
Catalog, Amazon OpenSearch Service, IAM Access Analyzer, AWS Security Hub, Amazon GuardDuty, Lambda, AWS Glue, Amazon SQS, Amazon SNS, Amazon Kinesis Data Streams, Amazon EventBridge Pipes, Aurora DSQL and STS they come from a table generated from AWS's Service Reference and botocore, `src/main/resources/aws/iam-request-resources.json`, which gives each
|
||||
operation's action, the resource types that action acts on with their ARN formats, and the request
|
||||
members that name them: a member holding a resource's ARN, which counts when it matches the format
|
||||
of a type the action acts on, or members filling the variables of a type's format. Nothing in it is
|
||||
|
||||
@@ -1801,10 +1801,10 @@ public class IamEnforcementFilter implements ContainerRequestFilter {
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs, Secrets Manager and KMS targets depend on the serving operation and the request's partition, STS
|
||||
* targets on the serving operation; API Gateway's path ARNs on the request's partition, which that service mints
|
||||
* them in; and the targets of a namespace the table of request resources reads on {@code operation}, the one the
|
||||
* request is dispatched as (see {@link RequestResources}).
|
||||
* Logs, Secrets Manager and KMS targets depend on the serving operation and the request's partition; API
|
||||
* Gateway's path ARNs on the request's partition, which that service mints them in; and the targets of a
|
||||
* namespace the table of request resources reads on {@code operation}, the one the request is dispatched as (see
|
||||
* {@link RequestResources}).
|
||||
*/
|
||||
private List<String> targetResources(String credentialScope, String action, String operation,
|
||||
ContainerRequestContext ctx, String region, String accountId) {
|
||||
@@ -1814,9 +1814,6 @@ public class IamEnforcementFilter implements ContainerRequestFilter {
|
||||
if ("kms".equals(credentialScope)) {
|
||||
return arnBuilder.buildKmsResources(action, ctx, region, accountId, requestPartition());
|
||||
}
|
||||
if ("sts".equals(credentialScope)) {
|
||||
return arnBuilder.buildStsResources(action, ctx);
|
||||
}
|
||||
if ("apigateway".equals(credentialScope)) {
|
||||
return arnBuilder.buildResources(credentialScope, ctx, region, accountId, requestPartition());
|
||||
}
|
||||
|
||||
@@ -165,9 +165,10 @@ public interface StoredResourceArns {
|
||||
/**
|
||||
* Whether an ARN naming another account than the caller's, {@code accountId}, names a resource the service holds
|
||||
* in that account and acts on there, never as the caller's resource of that name (the sink an OAM link is made
|
||||
* to, a RAM invitation sent to the caller or a share another account owns), so a request naming it is checked on
|
||||
* that ARN alone; false when that account holds no such resource. Whether the caller may use it is the handler's
|
||||
* to answer after the check. Read by the ARN alone, as it runs on every such request.
|
||||
* to, a RAM invitation sent to the caller, a share another account owns or a role STS assumes in its account), so
|
||||
* a request naming it is checked on that ARN alone; false when that account holds no such resource. Whether the
|
||||
* caller may use it is the handler's to answer after the check. Read by the ARN alone, as it runs on every such
|
||||
* request.
|
||||
*/
|
||||
default boolean reachedInItsAccount(String arn, String accountId) {
|
||||
return false;
|
||||
|
||||
@@ -1614,22 +1614,6 @@ public class ResourceArnBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
// ── STS ─────────────────────────────────────────────────────────────────────
|
||||
/**
|
||||
* Uses the serving operation, as {@link #buildLogResources} does: {@code AssumeRole} is
|
||||
* authorized against the role it names, so a policy can allow assuming one role and not another.
|
||||
* Every other operation keeps {@code *}, so a {@code RoleArn} it never reads cannot choose its resource.
|
||||
*/
|
||||
public List<String> buildStsResources(String action, ContainerRequestContext ctx) {
|
||||
return List.of("sts:AssumeRole".equals(action) ? buildAssumeRoleArn(ctx) : "*");
|
||||
}
|
||||
|
||||
private String buildAssumeRoleArn(ContainerRequestContext ctx) {
|
||||
String roleArn = firstFormParam(ctx, "RoleArn");
|
||||
// Untrimmed: the handler assumes the role named by this exact string.
|
||||
return roleArn == null || roleArn.isBlank() ? "*" : roleArn;
|
||||
}
|
||||
|
||||
/**
|
||||
* A Query-protocol parameter, read from the same place the handler reads it. For a form POST
|
||||
* that is the body alone: {@code AwsQueryController} dispatches on the form parameters and never
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
package io.floci.aws.services.iam;
|
||||
|
||||
import io.floci.aws.core.common.AwsArnUtils;
|
||||
import io.floci.aws.core.common.StoredResourceArns;
|
||||
import jakarta.enterprise.context.ApplicationScoped;
|
||||
import jakarta.inject.Inject;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* What IAM asks of STS for the {@code sts} namespace: whether the role a request names in another account is one STS
|
||||
* assumes there. STS holds no resource of its own; the roles it assumes are IAM's.
|
||||
*/
|
||||
@ApplicationScoped
|
||||
public class StsStoredResourceArns implements StoredResourceArns {
|
||||
|
||||
private static final String NAMESPACE = "sts";
|
||||
private static final String ROLE = "role/";
|
||||
|
||||
private final IamService iam;
|
||||
|
||||
@Inject
|
||||
public StsStoredResourceArns(IamService iam) {
|
||||
this.iam = iam;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String namespace() {
|
||||
return NAMESPACE;
|
||||
}
|
||||
|
||||
/** A request names its role, federated user or root user outright: nothing to find. */
|
||||
@Override
|
||||
public Optional<String> find(String type, List<String> names, String region) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether a role ARN naming another account than the caller's names a role IAM holds in that account, which STS
|
||||
* assumes there, as its handler finds it: in the ARN's account, by the last segment of the ARN's resource. Such a
|
||||
* request is checked on that ARN alone, not also on the caller's role of that name. False when that account holds
|
||||
* no such role.
|
||||
*/
|
||||
@Override
|
||||
public boolean reachedInItsAccount(String arn, String accountId) {
|
||||
if (!AwsArnUtils.isArnFor(arn, "iam")) {
|
||||
return false;
|
||||
}
|
||||
AwsArnUtils.Arn parsed = AwsArnUtils.parse(arn);
|
||||
String resource = parsed.resource();
|
||||
if (parsed.accountId().isEmpty() || parsed.accountId().equals(accountId) || !resource.startsWith(ROLE)) {
|
||||
return false;
|
||||
}
|
||||
String[] path = resource.split("/", -1);
|
||||
return iam.findRole(parsed.accountId(), path[path.length - 1]).isPresent();
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"_source": {"generator": "tools/aws/regen_iam_request_resources.py", "reference": "https://servicereference.us-east-1.amazonaws.com/", "botocore": "botocore 1.43.118 (installed package)", "retrieved": "2026-11-20", "note": "make iam-request-resources-check re-derives every operation's resources from botocore; make iam-request-resources-verify checks every action, type and format against AWS."},
|
||||
"namespaces": {"access-analyzer": ["accessanalyzer"], "account": ["account"], "acm": ["acm"], "application-autoscaling": ["application-autoscaling"], "athena": ["athena"], "bcm-data-exports": ["bcm-data-exports"], "bcm-pricing-calculator": ["bcm-pricing-calculator"], "budgets": ["budgets"], "ce": ["ce"], "cloudformation": ["cloudcontrol", "cloudformation"], "cloudfront": ["cloudfront"], "cloudfront-keyvaluestore": ["cloudfront-keyvaluestore"], "cloudtrail": ["cloudtrail"], "codebuild": ["codebuild"], "codepipeline": ["codepipeline"], "cognito-identity": ["cognito-identity"], "cognito-idp": ["cognito-idp"], "controlcatalog": ["controlcatalog"], "controltower": ["controltower"], "cur": ["cur"], "datasync": ["datasync"], "dsql": ["dsql"], "dynamodb": ["dynamodb"], "ec2": ["ec2"], "ecr": ["ecr"], "ecs": ["ecs"], "elasticloadbalancing": ["elb", "elbv2"], "elasticmapreduce": ["emr"], "emr-containers": ["emr-containers"], "emr-serverless": ["emr-serverless"], "es": ["es", "opensearch"], "events": ["eventbridgev2", "events"], "firehose": ["firehose"], "fis": ["fis"], "globalaccelerator": ["globalaccelerator"], "glue": ["glue"], "guardduty": ["guardduty"], "inspector2": ["inspector2"], "kinesis": ["kinesis"], "kinesisanalytics": ["kinesisanalytics", "kinesisanalyticsv2"], "lambda": ["lambda", "lambda-core", "lambda-microvms", "lambda-web"], "logs": ["logs"], "macie2": ["macie2"], "oam": ["oam"], "payment-cryptography": ["payment-cryptography", "payment-cryptography-data"], "pipes": ["pipes"], "quicksight": ["quicksight"], "ram": ["ram"], "rds": ["docdb", "neptune", "rds"], "redshift": ["redshift"], "redshift-data": ["redshift-data"], "redshift-serverless": ["redshift-serverless"], "rekognition": ["rekognition"], "resource-explorer-2": ["resource-explorer-2"], "route53": ["route53"], "s3tables": ["s3tables"], "s3vectors": ["s3vectors"], "scheduler": ["scheduler"], "secretsmanager": ["secretsmanager"], "securityhub": ["securityhub"], "servicediscovery": ["servicediscovery"], "servicequotas": ["service-quotas"], "signer": ["signer", "signer-data"], "sns": ["sns"], "sqs": ["sqs"], "ssm": ["ssm"], "sso": ["sso", "sso-admin"], "states": ["stepfunctions"], "textract": ["textract"], "timestream-influxdb": ["timestream-influxdb"], "translate": ["translate"], "xray": ["xray"]},
|
||||
"handBuilt": ["apigateway", "bedrock", "dynamodb", "eks", "iam", "kms", "logs", "resource-groups", "s3", "sts"],
|
||||
"namespaces": {"access-analyzer": ["accessanalyzer"], "account": ["account"], "acm": ["acm"], "application-autoscaling": ["application-autoscaling"], "athena": ["athena"], "bcm-data-exports": ["bcm-data-exports"], "bcm-pricing-calculator": ["bcm-pricing-calculator"], "budgets": ["budgets"], "ce": ["ce"], "cloudformation": ["cloudcontrol", "cloudformation"], "cloudfront": ["cloudfront"], "cloudfront-keyvaluestore": ["cloudfront-keyvaluestore"], "cloudtrail": ["cloudtrail"], "codebuild": ["codebuild"], "codepipeline": ["codepipeline"], "cognito-identity": ["cognito-identity"], "cognito-idp": ["cognito-idp"], "controlcatalog": ["controlcatalog"], "controltower": ["controltower"], "cur": ["cur"], "datasync": ["datasync"], "dsql": ["dsql"], "dynamodb": ["dynamodb"], "ec2": ["ec2"], "ecr": ["ecr"], "ecs": ["ecs"], "elasticloadbalancing": ["elb", "elbv2"], "elasticmapreduce": ["emr"], "emr-containers": ["emr-containers"], "emr-serverless": ["emr-serverless"], "es": ["es", "opensearch"], "events": ["eventbridgev2", "events"], "firehose": ["firehose"], "fis": ["fis"], "globalaccelerator": ["globalaccelerator"], "glue": ["glue"], "guardduty": ["guardduty"], "inspector2": ["inspector2"], "kinesis": ["kinesis"], "kinesisanalytics": ["kinesisanalytics", "kinesisanalyticsv2"], "lambda": ["lambda", "lambda-core", "lambda-microvms", "lambda-web"], "logs": ["logs"], "macie2": ["macie2"], "oam": ["oam"], "payment-cryptography": ["payment-cryptography", "payment-cryptography-data"], "pipes": ["pipes"], "quicksight": ["quicksight"], "ram": ["ram"], "rds": ["docdb", "neptune", "rds"], "redshift": ["redshift"], "redshift-data": ["redshift-data"], "redshift-serverless": ["redshift-serverless"], "rekognition": ["rekognition"], "resource-explorer-2": ["resource-explorer-2"], "route53": ["route53"], "s3tables": ["s3tables"], "s3vectors": ["s3vectors"], "scheduler": ["scheduler"], "secretsmanager": ["secretsmanager"], "securityhub": ["securityhub"], "servicediscovery": ["servicediscovery"], "servicequotas": ["service-quotas"], "signer": ["signer", "signer-data"], "sns": ["sns"], "sqs": ["sqs"], "ssm": ["ssm"], "sso": ["sso", "sso-admin"], "states": ["stepfunctions"], "sts": ["sts"], "textract": ["textract"], "timestream-influxdb": ["timestream-influxdb"], "translate": ["translate"], "xray": ["xray"]},
|
||||
"handBuilt": ["apigateway", "bedrock", "dynamodb", "eks", "iam", "kms", "logs", "resource-groups", "s3"],
|
||||
"notCovered": {"airflow": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "app-integrations": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "appconfig": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "appsync": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "aps": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "autoscaling": "not read yet: AWS's group and launch configuration ARNs carry an id the service mints, `autoScalingGroup:<id>:autoScalingGroupName/<name>`, while Floci mints `autoScalingGroup:<name>`, which other services (ECS capacity providers) read back; the mint is fixed first", "aws-marketplace": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "backup": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "batch": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "bedrock-agentcore": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "cloudhsm": "not read yet: its ARN formats end in ${CloudHsmClusterInstanceName} and ${CloudHsmBackupInstanceName}, names, while its requests give ClusterId and BackupId, ids, which the rules do not fill a name from, so nearly every operation's resource would be left open", "cloudwatch": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "codeartifact": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "codedeploy": "not read yet: the Service Reference gives an on-premises instance's ARN as `instance:${InstanceName}`, while the CodeDeploy permissions reference gives arn:aws:codedeploy:region:account-id:instance/instance-ID and AWS's GetOnPremisesInstance example answers instance/<name>_<id>, an id the service mints after the name; reading it needs that format corrected", "codeguru-reviewer": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "comprehend": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "config": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "connect": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "detective": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "dlm": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST routes (regen_rest_routes.MODELS), which do not have its model yet", "dms": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "ec2-instance-connect": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "elasticache": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "elasticbeanstalk": "not read yet: an environment's ARN carries its application's name, `environment/<application>/<name>`, while most of its requests name it by EnvironmentName or EnvironmentId alone, so reading it needs the stored environment those find", "elasticfilesystem": "REST: its requests name their resources in the path, which RequestResources reads from the route a request matched in the vendored REST rLine truncated
|
||||
"otherNamespaces": ["a4b", "account-access", "acm-pca", "aco-automation", "agent-registry", "aidevops", "aiops", "airflow-serverless", "amplify", "amplifybackend", "amplifyuibuilder", "aoss", "apiportal", "appfabric", "appflow", "application-signals", "application-signals-mcp", "appmesh", "appmesh-preview", "apprunner", "appstream", "apptest", "arc-region-switch", "arc-zonal-shift", "artifact", "assurance", "auditmanager", "aws-external-anthropic", "b2bi", "backup-gateway", "backup-search", "bcm-data-hub", "bedrock-mantle", "bedrock-websearch", "billing", "billingconductor", "braket", "bugbust", "cases", "cassandra", "chatbot", "chime", "cleanrooms", "cleanrooms-ml", "cloud9", "clouddirectory", "cloudsearch", "cloudshell", "cloudtrail-data", "codecatalyst", "codecommit", "codeconnections", "codeguru-profiler", "codeguru-security", "codestar-connections", "codestar-notifications", "codewhisperer", "cognito-sync", "connect-campaigns", "consoleapp", "continuum", "databrew", "dataexchange", "datapipeline", "datazone", "dax", "deadline", "devicefarm", "devops-guru", "directconnect", "docdb-elastic", "drs", "ds", "ds-data", "ebs", "ecr-public", "eks-auth", "elastictranscoder", "elemental-appliances-software", "elemental-inference", "elemental-support-cases", "end-user-messaging", "entityresolution", "evs", "finspace", "finspace-api", "fms", "forecast", "frauddetector", "freertos", "fsx", "gamelift", "gameliftstreams", "geo", "geo-maps", "geo-places", "geo-routes", "glacier", "grafana", "greengrass", "groundstation", "health", "health-agent", "healthlake", "honeycode", "identity-sync", "imagebuilder", "interconnect", "internetmonitor", "invoicing", "iotanalytics", "iotdeviceadvisor", "iotfleethub", "iotfleetwise", "iotjobsdata", "iotmanagedintegrations", "iotsitewise", "iottwinmaker", "iotwireless", "iq", "iq-permission", "ivs", "ivschat", "kafka-cluster", "kafkaconnect", "kendra", "kendra-ranking", "kinesisvideo", "launchwizard", "lex", "license-manager", "license-manager-linux-subscriptions", "license-manager-user-subscriptions", "lookoutequipment", "lookoutmetrics", "lookoutvision", "m2", "machinelearning", "managedblockchain", "mapcredits", "mediaconnect", "mediaconvert", "medialive", "mediapackage", "mediapackage-vod", "mediapackagev2", "mediastore", "mediatailor", "medical-imaging", "mgh", "mgn", "migrationhub-orchestrator", "mobiletargeting", "monitron", "mpa", "neptune-db", "neptune-graph", "network-security-manager", "networkflowmonitor", "networkmanager", "networkmonitor", "nimble", "notifications", "notifications-contacts", "nova-act", "observabilityadmin", "odb", "omics", "one", "opensearch", "opsworks", "osis", "osm", "outposts", "panorama", "partnercentral", "payments", "pca-connector-ad", "pca-connector-scep", "pcs", "personalize", "pi", "polly", "private-networks", "profile", "proton", "purchase-orders", "q", "qapps", "qbusiness", "qdeveloper", "qldb", "rbin", "rds-db", "refactor-spaces", "repostspace", "resiliencehub", "robomaker", "rolesanywhere", "route53-recovery-cluster", "route53-recovery-control-config", "route53-recovery-readiness", "route53globalresolver", "route53profiles", "rtbfabric", "s3-object-lambda", "s3-outposts", "s3express", "s3files", "sagemaker-geospatial", "sagemaker-mlflow", "savingsplans", "schemas", "scn", "sdb", "security-ir", "securityagent", "securitylake", "serverlessrepo", "shield", "simspaceweaver", "sms-voice", "snow-device-management", "social-messaging", "sqlworkbench", "ssm-contacts", "ssm-incidents", "ssm-quicksetup", "ssm-sap", "ssmmessages", "storagegateway", "supportauthz", "synthetics", "thinclient", "timestream", "tnb", "transform", "transform-custom", "trustedadvisor", "ts", "vendor-insights", "voiceid", "vpc-lattice", "vpc-lattice-svcs", "vpce", "waf", "waf-regional", "wellarchitected", "wickr", "wisdom", "workdocs", "worklink", "workmail", "workmailmessageflow", "workspaces", "workspaces-instances", "workspaces-web"],
|
||||
"arnFormats": {"access-analyzer": {"Analyzer": "arn:${Partition}:access-analyzer:${Region}:${Account}:analyzer/${AnalyzerName}", "ArchiveRule": "arn:${Partition}:access-analyzer:${Region}:${Account}:analyzer/${AnalyzerName}/archive-rule/${RuleName}"}, "account": {"account": "arn:${Partition}:account::${Account}:account", "accountInOrganization": "arn:${Partition}:account::${ManagementAccountId}:account/o-${OrganizationId}/${MemberAccountId}"}, "acm": {"acme-domain-validation": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}/acme-domain-validation/${AcmeDomainValidationId}", "acme-endpoint": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}", "acme-external-account-binding": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}/acme-external-account-binding/${ExternalAccountBindingId}", "certificate": "arn:${Partition}:acm:${Region}:${Account}:certificate/${CertificateId}"}, "application-autoscaling": {"ScalableTarget": "arn:${Partition}:application-autoscaling:${Region}:${Account}:scalable-target/${ResourceId}"}, "athena": {"capacity-reservation": "arn:${Partition}:athena:${Region}:${Account}:capacity-reservation/${CapacityReservationName}", "datacatalog": "arn:${Partition}:athena:${Region}:${Account}:datacatalog/${DataCatalogName}", "session": "arn:${Partition}:athena:${Region}:${Account}:workgroup/${WorkGroupName}/session/${SessionId}", "system-table": "arn:${Partition}:athena:${Region}:${Account}:system-table/${TableName}", "workgroup": "arn:${Partition}:athena:${Region}:${Account}:workgroup/${WorkGroupName}"}, "bcm-data-exports": {"billingview": "arn:${Partition}:billing::${Account}:billingview/${ResourceId}", "export": "arn:${Partition}:bcm-data-exports:${Region}:${Account}:export/${Identifier}", "table": "arn:${Partition}:bcm-data-exports:${Region}:${Account}:table/${Identifier}"}, "bcm-pricing-calculator": {"bill-estimate": "arn:${Partition}:bcm-pricing-calculator::${Account}:bill-estimate/${BillEstimateId}", "bill-scenario": "arn:${Partition}:bcm-pricing-calculator::${Account}:bill-scenario/${BillScenarioId}", "workload-estimate": "arn:${Partition}:bcm-pricing-calculator::${Account}:workload-estimate/${WorkloadEstimateId}"}, "budgets": {"budget": "arn:${Partition}:budgets::${Account}:budget/${BudgetName}", "budgetAction": "arn:${Partition}:budgets::${Account}:budget/${BudgetName}/action/${ActionId}"}, "ce": {"anomalymonitor": "arn:${Partition}:ce::${Account}:anomalymonitor/${Identifier}", "anomalysubscription": "arn:${Partition}:ce::${Account}:anomalysubscription/${Identifier}", "billingview": "arn:${Partition}:billing::${Account}:billingview/${ResourceId}", "costcategory": "arn:${Partition}:ce::${Account}:costcategory/${Identifier}"}, "cloudformation": {"changeset": "arn:${Partition}:cloudformation:${Region}:${Account}:changeSet/${ChangeSetName}/${Id}", "generatedtemplate": "arn:${Partition}:cloudformation:${Region}:${Account}:generatedTemplate/${Id}", "resourcescan": "arn:${Partition}:cloudformation:${Region}:${Account}:resourceScan/${Id}", "stack": "arn:${Partition}:cloudformation:${Region}:${Account}:stack/${StackName}/${Id}", "stackset": "arn:${Partition}:cloudformation:${Region}:${Account}:stackset/${StackSetName}:${Id}", "stackset-target": "arn:${Partition}:cloudformation:${Region}:${Account}:stackset-target/${StackSetTarget}", "type": "arn:${Partition}:cloudformation:${Region}:${Account}:type/resource/${Type}", "typeHook": "arn:${Partition}:cloudformation:${Region}:${Account}:type/hook/${Type}"}, "cloudfront": {"anycast-ip-list": "arn:${Partition}:cloudfront::${Account}:anycast-ip-list/${Id}", "cache-policy": "arn:${Partition}:cloudfront::${Account}:cache-policy/${Id}", "connection-function": "arn:${Partition}:cloudfront::${Account}:connection-function/${Id}", "connection-group": "arn:${Partition}:cloudfront::${Account}:connection-group/${Id}", "continuous-deployment-policy": "arn:${Partition}:cloudfront::${Account}:continuous-deployment-policy/${Id}", "distribution": "arn:${Partition}:cloudfront::${Account}:distribution/${DistributionId}", "distribution-tenant": "arn:${Partition}:cloudfront::${Account}:distribution-tenant/${Id}", "field-level-encryption-config": "arn:${Partition}:cloudfront::${Account}:field-level-encryption-config/${Id}", "field-level-encryption-profile": "arn:${Partition}:cloudfront::${Account}:field-level-encryption-profile/${Id}", "function": "arn:${Partition}:cloudfront::${Account}:function/${Name}", "key-value-store": "arn:${Partition}:cloudfront::${Account}:key-value-store/${Name}", "origin-access-control": "arn:${Partition}:cloudfront::${Account}:origin-access-control/${Id}", "origin-access-identity": "arn:${Partition}:cloudfront::${Account}:origin-access-identity/${Id}", "origin-request-policy": "arn:${Partition}:cloudfront::${Account}:origin-request-policy/${Id}", "realtime-log-config": "arn:${Partition}:cloudfront::${Account}:realtime-log-config/${Name}", "response-headers-policy": "arn:$Line truncated
|
||||
"resourceTagKeys": {"access-analyzer": {"Analyzer": ["aws:ResourceTag/"]}, "acm": {"acme-domain-validation": ["aws:ResourceTag/"], "acme-endpoint": ["aws:ResourceTag/"], "acme-external-account-binding": ["aws:ResourceTag/"], "certificate": ["aws:ResourceTag/"]}, "application-autoscaling": {"ScalableTarget": ["aws:ResourceTag/"]}, "athena": {"capacity-reservation": ["aws:ResourceTag/"], "datacatalog": ["aws:ResourceTag/"], "session": ["aws:ResourceTag/"], "system-table": ["aws:ResourceTag/"], "workgroup": ["aws:ResourceTag/"]}, "bcm-data-exports": {"billingview": ["aws:ResourceTag/"], "export": ["aws:ResourceTag/"]}, "bcm-pricing-calculator": {"bill-estimate": ["aws:ResourceTag/"], "bill-scenario": ["aws:ResourceTag/"], "workload-estimate": ["aws:ResourceTag/"]}, "budgets": {"budget": ["aws:ResourceTag/"], "budgetAction": ["aws:ResourceTag/"]}, "ce": {"anomalymonitor": ["aws:ResourceTag/"], "anomalysubscription": ["aws:ResourceTag/"], "billingview": ["aws:ResourceTag/"], "costcategory": ["aws:ResourceTag/"]}, "cloudformation": {"changeset": ["aws:ResourceTag/"], "stack": ["aws:ResourceTag/"], "stackset": ["aws:ResourceTag/"]}, "cloudfront": {"anycast-ip-list": ["aws:ResourceTag/"], "connection-function": ["aws:ResourceTag/"], "connection-group": ["aws:ResourceTag/"], "distribution": ["aws:ResourceTag/"], "distribution-tenant": ["aws:ResourceTag/"], "function": ["aws:ResourceTag/"], "key-value-store": ["aws:ResourceTag/"], "streaming-distribution": ["aws:ResourceTag/"], "trust-store": ["aws:ResourceTag/"], "vpcorigin": ["aws:ResourceTag/"]}, "cloudtrail": {"channel": ["aws:ResourceTag/"], "dashboard": ["aws:ResourceTag/"], "eventdatastore": ["aws:ResourceTag/"], "trail": ["aws:ResourceTag/"]}, "codebuild": {"project": ["aws:ResourceTag/"], "report-group": ["aws:ResourceTag/"]}, "codepipeline": {"action": ["aws:ResourceTag/"], "actiontype": ["aws:ResourceTag/"], "pipeline": ["aws:ResourceTag/"], "stage": ["aws:ResourceTag/"], "webhook": ["aws:ResourceTag/"]}, "cognito-identity": {"identitypool": ["aws:ResourceTag/"]}, "cognito-idp": {"userpool": ["aws:ResourceTag/"]}, "controltower": {"EnabledBaseline": ["aws:ResourceTag/"], "EnabledControl": ["aws:ResourceTag/"], "LandingZone": ["aws:ResourceTag/"]}, "datasync": {"agent": ["aws:ResourceTag/"], "discoveryjob": ["aws:ResourceTag/"], "location": ["aws:ResourceTag/"], "storagesystem": ["aws:ResourceTag/"], "task": ["aws:ResourceTag/"], "taskexecution": ["aws:ResourceTag/"]}, "dsql": {"Cluster": ["aws:ResourceTag/"], "Stream": ["aws:ResourceTag/"]}, "dynamodb": {"index": ["aws:ResourceTag/"], "stream": ["aws:ResourceTag/"], "table": ["aws:ResourceTag/"]}, "ec2": {"application-status-check": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-block": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-manager-data-export": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-reservation": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-reservation-cancellation-quote": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-reservation-fleet": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-reservation-modification-quote": ["aws:ResourceTag/", "ec2:ResourceTag/"], "carrier-gateway": ["aws:ResourceTag/", "ec2:ResourceTag/"], "client-vpn-endpoint": ["aws:ResourceTag/", "ec2:ResourceTag/"], "coip-pool": ["aws:ResourceTag/", "ec2:ResourceTag/"], "customer-gateway": ["aws:ResourceTag/", "ec2:ResourceTag/"], "declarative-policies-report": ["aws:ResourceTag/", "ec2:ResourceTag/"], "dedicated-host": ["aws:ResourceTag/", "ec2:ResourceTag/"], "dhcp-options": ["aws:ResourceTag/", "ec2:ResourceTag/"], "egress-only-internet-gateway": ["aws:ResourceTag/", "ec2:ResourceTag/"], "elastic-gpu": ["aws:ResourceTag/", "ec2:ResourceTag/"], "elastic-ip": ["aws:ResourceTag/", "ec2:ResourceTag/"], "export-image-task": ["aws:ResourceTag/", "ec2:ResourceTag/"], "export-instance-task": ["aws:ResourceTag/", "ec2:ResourceTag/"], "fleet": ["aws:ResourceTag/", "ec2:ResourceTag/"], "fpga-image": ["aws:ResourceTag/", "ec2:ResourceTag/"], "host-reservation": ["aws:ResourceTag/", "ec2:ResourceTag/"], "image": ["aws:ResourceTag/", "ec2:ResourceTag/"], "image-usage-report": ["aws:ResourceTag/", "ec2:ResourceTag/"], "import-image-task": ["aws:ResourceTag/", "ec2:ResourceTag/"], "import-snapshot-task": ["aws:ResourceTag/", "ec2:ResourceTag/"], "instance": ["aws:ResourceTag/", "ec2:ResourceTag/"], "instance-connect-endpoint": ["aws:ResourceTag/", "ec2:ResourceTag/"], "instance-event-window": ["aws:ResourceTag/", "ec2:ResourceTag/"], "internet-gateway": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-external-resource-verification-token": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-internet-registry-association": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-policy": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-pool": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-pool-allocation": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-prefix-list-rLine truncated
|
||||
"arnFormats": {"access-analyzer": {"Analyzer": "arn:${Partition}:access-analyzer:${Region}:${Account}:analyzer/${AnalyzerName}", "ArchiveRule": "arn:${Partition}:access-analyzer:${Region}:${Account}:analyzer/${AnalyzerName}/archive-rule/${RuleName}"}, "account": {"account": "arn:${Partition}:account::${Account}:account", "accountInOrganization": "arn:${Partition}:account::${ManagementAccountId}:account/o-${OrganizationId}/${MemberAccountId}"}, "acm": {"acme-domain-validation": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}/acme-domain-validation/${AcmeDomainValidationId}", "acme-endpoint": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}", "acme-external-account-binding": "arn:${Partition}:acm:${Region}:${Account}:acme-endpoint/${AcmeEndpointId}/acme-external-account-binding/${ExternalAccountBindingId}", "certificate": "arn:${Partition}:acm:${Region}:${Account}:certificate/${CertificateId}"}, "application-autoscaling": {"ScalableTarget": "arn:${Partition}:application-autoscaling:${Region}:${Account}:scalable-target/${ResourceId}"}, "athena": {"capacity-reservation": "arn:${Partition}:athena:${Region}:${Account}:capacity-reservation/${CapacityReservationName}", "datacatalog": "arn:${Partition}:athena:${Region}:${Account}:datacatalog/${DataCatalogName}", "session": "arn:${Partition}:athena:${Region}:${Account}:workgroup/${WorkGroupName}/session/${SessionId}", "system-table": "arn:${Partition}:athena:${Region}:${Account}:system-table/${TableName}", "workgroup": "arn:${Partition}:athena:${Region}:${Account}:workgroup/${WorkGroupName}"}, "bcm-data-exports": {"billingview": "arn:${Partition}:billing::${Account}:billingview/${ResourceId}", "export": "arn:${Partition}:bcm-data-exports:${Region}:${Account}:export/${Identifier}", "table": "arn:${Partition}:bcm-data-exports:${Region}:${Account}:table/${Identifier}"}, "bcm-pricing-calculator": {"bill-estimate": "arn:${Partition}:bcm-pricing-calculator::${Account}:bill-estimate/${BillEstimateId}", "bill-scenario": "arn:${Partition}:bcm-pricing-calculator::${Account}:bill-scenario/${BillScenarioId}", "workload-estimate": "arn:${Partition}:bcm-pricing-calculator::${Account}:workload-estimate/${WorkloadEstimateId}"}, "budgets": {"budget": "arn:${Partition}:budgets::${Account}:budget/${BudgetName}", "budgetAction": "arn:${Partition}:budgets::${Account}:budget/${BudgetName}/action/${ActionId}"}, "ce": {"anomalymonitor": "arn:${Partition}:ce::${Account}:anomalymonitor/${Identifier}", "anomalysubscription": "arn:${Partition}:ce::${Account}:anomalysubscription/${Identifier}", "billingview": "arn:${Partition}:billing::${Account}:billingview/${ResourceId}", "costcategory": "arn:${Partition}:ce::${Account}:costcategory/${Identifier}"}, "cloudformation": {"changeset": "arn:${Partition}:cloudformation:${Region}:${Account}:changeSet/${ChangeSetName}/${Id}", "generatedtemplate": "arn:${Partition}:cloudformation:${Region}:${Account}:generatedTemplate/${Id}", "resourcescan": "arn:${Partition}:cloudformation:${Region}:${Account}:resourceScan/${Id}", "stack": "arn:${Partition}:cloudformation:${Region}:${Account}:stack/${StackName}/${Id}", "stackset": "arn:${Partition}:cloudformation:${Region}:${Account}:stackset/${StackSetName}:${Id}", "stackset-target": "arn:${Partition}:cloudformation:${Region}:${Account}:stackset-target/${StackSetTarget}", "type": "arn:${Partition}:cloudformation:${Region}:${Account}:type/resource/${Type}", "typeHook": "arn:${Partition}:cloudformation:${Region}:${Account}:type/hook/${Type}"}, "cloudfront": {"anycast-ip-list": "arn:${Partition}:cloudfront::${Account}:anycast-ip-list/${Id}", "cache-policy": "arn:${Partition}:cloudfront::${Account}:cache-policy/${Id}", "connection-function": "arn:${Partition}:cloudfront::${Account}:connection-function/${Id}", "connection-group": "arn:${Partition}:cloudfront::${Account}:connection-group/${Id}", "continuous-deployment-policy": "arn:${Partition}:cloudfront::${Account}:continuous-deployment-policy/${Id}", "distribution": "arn:${Partition}:cloudfront::${Account}:distribution/${DistributionId}", "distribution-tenant": "arn:${Partition}:cloudfront::${Account}:distribution-tenant/${Id}", "field-level-encryption-config": "arn:${Partition}:cloudfront::${Account}:field-level-encryption-config/${Id}", "field-level-encryption-profile": "arn:${Partition}:cloudfront::${Account}:field-level-encryption-profile/${Id}", "function": "arn:${Partition}:cloudfront::${Account}:function/${Name}", "key-value-store": "arn:${Partition}:cloudfront::${Account}:key-value-store/${Name}", "origin-access-control": "arn:${Partition}:cloudfront::${Account}:origin-access-control/${Id}", "origin-access-identity": "arn:${Partition}:cloudfront::${Account}:origin-access-identity/${Id}", "origin-request-policy": "arn:${Partition}:cloudfront::${Account}:origin-request-policy/${Id}", "realtime-log-config": "arn:${Partition}:cloudfront::${Account}:realtime-log-config/${Name}", "response-headers-policy": "arn:$Line truncated
|
||||
"resourceTagKeys": {"access-analyzer": {"Analyzer": ["aws:ResourceTag/"]}, "acm": {"acme-domain-validation": ["aws:ResourceTag/"], "acme-endpoint": ["aws:ResourceTag/"], "acme-external-account-binding": ["aws:ResourceTag/"], "certificate": ["aws:ResourceTag/"]}, "application-autoscaling": {"ScalableTarget": ["aws:ResourceTag/"]}, "athena": {"capacity-reservation": ["aws:ResourceTag/"], "datacatalog": ["aws:ResourceTag/"], "session": ["aws:ResourceTag/"], "system-table": ["aws:ResourceTag/"], "workgroup": ["aws:ResourceTag/"]}, "bcm-data-exports": {"billingview": ["aws:ResourceTag/"], "export": ["aws:ResourceTag/"]}, "bcm-pricing-calculator": {"bill-estimate": ["aws:ResourceTag/"], "bill-scenario": ["aws:ResourceTag/"], "workload-estimate": ["aws:ResourceTag/"]}, "budgets": {"budget": ["aws:ResourceTag/"], "budgetAction": ["aws:ResourceTag/"]}, "ce": {"anomalymonitor": ["aws:ResourceTag/"], "anomalysubscription": ["aws:ResourceTag/"], "billingview": ["aws:ResourceTag/"], "costcategory": ["aws:ResourceTag/"]}, "cloudformation": {"changeset": ["aws:ResourceTag/"], "stack": ["aws:ResourceTag/"], "stackset": ["aws:ResourceTag/"]}, "cloudfront": {"anycast-ip-list": ["aws:ResourceTag/"], "connection-function": ["aws:ResourceTag/"], "connection-group": ["aws:ResourceTag/"], "distribution": ["aws:ResourceTag/"], "distribution-tenant": ["aws:ResourceTag/"], "function": ["aws:ResourceTag/"], "key-value-store": ["aws:ResourceTag/"], "streaming-distribution": ["aws:ResourceTag/"], "trust-store": ["aws:ResourceTag/"], "vpcorigin": ["aws:ResourceTag/"]}, "cloudtrail": {"channel": ["aws:ResourceTag/"], "dashboard": ["aws:ResourceTag/"], "eventdatastore": ["aws:ResourceTag/"], "trail": ["aws:ResourceTag/"]}, "codebuild": {"project": ["aws:ResourceTag/"], "report-group": ["aws:ResourceTag/"]}, "codepipeline": {"action": ["aws:ResourceTag/"], "actiontype": ["aws:ResourceTag/"], "pipeline": ["aws:ResourceTag/"], "stage": ["aws:ResourceTag/"], "webhook": ["aws:ResourceTag/"]}, "cognito-identity": {"identitypool": ["aws:ResourceTag/"]}, "cognito-idp": {"userpool": ["aws:ResourceTag/"]}, "controltower": {"EnabledBaseline": ["aws:ResourceTag/"], "EnabledControl": ["aws:ResourceTag/"], "LandingZone": ["aws:ResourceTag/"]}, "datasync": {"agent": ["aws:ResourceTag/"], "discoveryjob": ["aws:ResourceTag/"], "location": ["aws:ResourceTag/"], "storagesystem": ["aws:ResourceTag/"], "task": ["aws:ResourceTag/"], "taskexecution": ["aws:ResourceTag/"]}, "dsql": {"Cluster": ["aws:ResourceTag/"], "Stream": ["aws:ResourceTag/"]}, "dynamodb": {"index": ["aws:ResourceTag/"], "stream": ["aws:ResourceTag/"], "table": ["aws:ResourceTag/"]}, "ec2": {"application-status-check": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-block": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-manager-data-export": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-reservation": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-reservation-cancellation-quote": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-reservation-fleet": ["aws:ResourceTag/", "ec2:ResourceTag/"], "capacity-reservation-modification-quote": ["aws:ResourceTag/", "ec2:ResourceTag/"], "carrier-gateway": ["aws:ResourceTag/", "ec2:ResourceTag/"], "client-vpn-endpoint": ["aws:ResourceTag/", "ec2:ResourceTag/"], "coip-pool": ["aws:ResourceTag/", "ec2:ResourceTag/"], "customer-gateway": ["aws:ResourceTag/", "ec2:ResourceTag/"], "declarative-policies-report": ["aws:ResourceTag/", "ec2:ResourceTag/"], "dedicated-host": ["aws:ResourceTag/", "ec2:ResourceTag/"], "dhcp-options": ["aws:ResourceTag/", "ec2:ResourceTag/"], "egress-only-internet-gateway": ["aws:ResourceTag/", "ec2:ResourceTag/"], "elastic-gpu": ["aws:ResourceTag/", "ec2:ResourceTag/"], "elastic-ip": ["aws:ResourceTag/", "ec2:ResourceTag/"], "export-image-task": ["aws:ResourceTag/", "ec2:ResourceTag/"], "export-instance-task": ["aws:ResourceTag/", "ec2:ResourceTag/"], "fleet": ["aws:ResourceTag/", "ec2:ResourceTag/"], "fpga-image": ["aws:ResourceTag/", "ec2:ResourceTag/"], "host-reservation": ["aws:ResourceTag/", "ec2:ResourceTag/"], "image": ["aws:ResourceTag/", "ec2:ResourceTag/"], "image-usage-report": ["aws:ResourceTag/", "ec2:ResourceTag/"], "import-image-task": ["aws:ResourceTag/", "ec2:ResourceTag/"], "import-snapshot-task": ["aws:ResourceTag/", "ec2:ResourceTag/"], "instance": ["aws:ResourceTag/", "ec2:ResourceTag/"], "instance-connect-endpoint": ["aws:ResourceTag/", "ec2:ResourceTag/"], "instance-event-window": ["aws:ResourceTag/", "ec2:ResourceTag/"], "internet-gateway": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-external-resource-verification-token": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-internet-registry-association": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-policy": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-pool": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-pool-allocation": ["aws:ResourceTag/", "ec2:ResourceTag/"], "ipam-prefix-list-rLine truncated
|
||||
"resourceKeys": {"ec2": {"capacity-reservation": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:AvailabilityZoneId": {"member": "AvailabilityZoneId"}, "ec2:CapacityReservationFleet": {"member": "CapacityReservationFleetId", "arn": "capacity-reservation-fleet"}, "ec2:EbsOptimized": {"member": "EbsOptimized"}, "ec2:EndDateType": {"member": "EndDateType"}, "ec2:EphemeralStorage": {"member": "EphemeralStorage"}, "ec2:InstanceMatchCriteria": {"member": "InstanceMatchCriteria"}, "ec2:InstanceType": {"member": "InstanceType"}, "ec2:Tenancy": {"member": "Tenancy"}}, "carrier-gateway": {"ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "dhcp-options": {"ec2:DhcpOptionsID": {"member": "DhcpOptionsId"}}, "fpga-image": {"ec2:Owner": {"member": "OwnerId"}, "ec2:Public": {"member": "Public"}}, "image": {"ec2:ImageID": {"member": "ImageId"}, "ec2:ImageType": {"member": "ImageType"}, "ec2:Owner": {"member": "OwnerId"}, "ec2:Public": {"member": "Public"}, "ec2:RootDeviceType": {"member": "RootDeviceType"}}, "instance": {"ec2:EbsOptimized": {"member": "EbsOptimized"}, "ec2:InstanceID": {"member": "InstanceId"}, "ec2:InstanceType": {"member": "InstanceType"}, "ec2:RootDeviceType": {"member": "RootDeviceType"}}, "internet-gateway": {"ec2:InternetGatewayID": {"member": "InternetGatewayId"}}, "launch-template": {"ec2:LaunchTemplate": {"member": "LaunchTemplateId", "arn": "launch-template"}}, "network-acl": {"ec2:NetworkAclID": {"member": "NetworkAclId"}, "ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "network-interface": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:NetworkInterfaceID": {"member": "NetworkInterfaceId"}, "ec2:Subnet": {"member": "SubnetId", "arn": "subnet"}, "ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "reserved-instances": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:InstanceType": {"member": "InstanceType"}}, "route-table": {"ec2:RouteTableID": {"member": "RouteTableId"}, "ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "secondary-interface": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:AvailabilityZoneId": {"member": "AvailabilityZoneId"}}, "security-group": {"ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "snapshot": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:Encrypted": {"member": "Encrypted"}, "ec2:Owner": {"member": "OwnerId"}, "ec2:SnapshotID": {"member": "SnapshotId"}, "ec2:VolumeSize": {"member": "VolumeSize"}}, "subnet": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:AvailabilityZoneId": {"member": "AvailabilityZoneId"}, "ec2:SubnetID": {"member": "SubnetId"}, "ec2:Vpc": {"member": "VpcId", "arn": "vpc"}}, "transit-gateway": {"ec2:transitGatewayId": {"member": "TransitGatewayId"}}, "transit-gateway-attachment": {"ec2:transitGatewayAttachmentId": {"member": "TransitGatewayAttachmentId"}}, "transit-gateway-connect-peer": {"ec2:transitGatewayConnectPeerId": {"member": "TransitGatewayConnectPeerId"}}, "transit-gateway-metering-policy": {"ec2:transitGatewayMeteringPolicyId": {"member": "TransitGatewayMeteringPolicyId"}}, "transit-gateway-multicast-domain": {"ec2:transitGatewayMulticastDomainId": {"member": "TransitGatewayMulticastDomainId"}}, "transit-gateway-policy-table": {"ec2:transitGatewayPolicyTableId": {"member": "TransitGatewayPolicyTableId"}}, "transit-gateway-route-table": {"ec2:transitGatewayRouteTableId": {"member": "TransitGatewayRouteTableId"}}, "transit-gateway-route-table-announcement": {"ec2:transitGatewayRouteTableAnnouncementId": {"member": "TransitGatewayRouteTableAnnouncementId"}}, "volume": {"ec2:AvailabilityZone": {"member": "AvailabilityZone"}, "ec2:AvailabilityZoneId": {"member": "AvailabilityZoneId"}, "ec2:Encrypted": {"member": "Encrypted"}, "ec2:KmsKeyId": {"member": "KmsKeyId"}, "ec2:VolumeID": {"member": "VolumeId"}, "ec2:VolumeInitializationRate": {"member": "VolumeInitializationRate"}, "ec2:VolumeType": {"member": "VolumeType"}}, "vpc": {"ec2:VpcID": {"member": "VpcId"}}, "vpc-peering-connection": {"ec2:VpcPeeringConnectionID": {"member": "VpcPeeringConnectionId"}}}},
|
||||
"unqualified": {"ssm": ["parameter"], "states": ["statemachine"]},
|
||||
"mintedIds": {"events": ["api-destination", "connection"]},
|
||||
@@ -4987,6 +4987,18 @@
|
||||
"states:UpdateStateMachine": {"action": "states:UpdateStateMachine", "types": ["statemachine"], "resources": [{"types": ["statemachine"], "arn": "roleArn"}, {"types": ["statemachine"], "arn": "stateMachineArn"}]},
|
||||
"states:UpdateStateMachineAlias": {"action": "states:UpdateStateMachineAlias", "types": ["statemachine"], "resources": [{"types": ["statemachine"], "arn": "routingConfiguration[].stateMachineVersionArn"}, {"types": ["statemachine"], "arn": "stateMachineAliasArn"}]},
|
||||
"states:ValidateStateMachineDefinition": {"action": "states:ValidateStateMachineDefinition", "types": [], "resources": []},
|
||||
"sts:AssumeRole": {"action": "sts:AssumeRole", "types": ["role"], "resources": [{"types": ["role"], "arn": "PolicyArns[].arn"}, {"types": ["role"], "arn": "ProvidedContexts[].ProviderArn"}, {"types": ["role"], "arn": "RoleArn"}]},
|
||||
"sts:AssumeRoleWithSAML": {"action": "sts:AssumeRoleWithSAML", "types": ["role"], "resources": [{"types": ["role"], "arn": "PolicyArns[].arn"}, {"types": ["role"], "arn": "PrincipalArn"}, {"types": ["role"], "arn": "RoleArn"}]},
|
||||
"sts:AssumeRoleWithWebIdentity": {"action": "sts:AssumeRoleWithWebIdentity", "types": ["role"], "resources": [{"types": ["role"], "arn": "PolicyArns[].arn"}, {"types": ["role"], "arn": "RoleArn"}]},
|
||||
"sts:AssumeRoot": {"action": "sts:AssumeRoot", "types": ["root-user"], "resources": [{"types": ["root-user"], "arn": "TaskPolicyArn.arn"}, {"type": "root-user", "fill": {}}]},
|
||||
"sts:DecodeAuthorizationMessage": {"action": "sts:DecodeAuthorizationMessage", "types": [], "resources": []},
|
||||
"sts:GetAccessKeyInfo": {"action": "sts:GetAccessKeyInfo", "types": [], "resources": []},
|
||||
"sts:GetCallerIdentity": {"action": "sts:GetCallerIdentity", "types": [], "resources": []},
|
||||
"sts:GetDelegatedAccessToken": {"action": "sts:GetDelegatedAccessToken", "types": [], "resources": []},
|
||||
"sts:GetFederationToken": {"action": "sts:GetFederationToken", "types": ["federated-user"], "resources": [{"types": ["federated-user"], "arn": "PolicyArns[].arn"}, {"type": "federated-user", "fill": {"FederatedUserName": "Name"}}]},
|
||||
"sts:GetScopedCredentials": {"action": "sts:GetScopedCredentials", "types": [], "resources": []},
|
||||
"sts:GetSessionToken": {"action": "sts:GetSessionToken", "types": [], "resources": []},
|
||||
"sts:GetWebIdentityToken": {"action": "sts:GetWebIdentityToken", "types": [], "resources": []},
|
||||
"textract:AnalyzeDocument": {"action": "textract:AnalyzeDocument", "types": [], "resources": []},
|
||||
"textract:AnalyzeExpense": {"action": "textract:AnalyzeExpense", "types": [], "resources": []},
|
||||
"textract:AnalyzeID": {"action": "textract:AnalyzeID", "types": [], "resources": []},
|
||||
|
||||
@@ -61,6 +61,7 @@ import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anyString;
|
||||
import static org.mockito.Mockito.clearInvocations;
|
||||
import static org.mockito.Mockito.doAnswer;
|
||||
import static org.mockito.Mockito.mock;
|
||||
@@ -1037,11 +1038,22 @@ class ResourceArnBuilderTest {
|
||||
// ── STS ──────────────────────────────────────────────────────────────────────
|
||||
|
||||
@Test
|
||||
void stsAssumeRoleIsAuthorizedAgainstTheRoleItNames() {
|
||||
void stsAssumeRoleIsCheckedOnTheRoleItNamesInItsAccountFromTheTable() {
|
||||
// STS assumes the role in the account its ARN names, so a role IAM holds there is checked alone.
|
||||
setFormBody("Action=AssumeRole&Version=2011-06-15"
|
||||
+ "&RoleArn=arn%3Aaws%3Aiam%3A%3A729951873967%3Arole%2FAdmin&RoleSessionName=robin");
|
||||
String arn = sts("sts:AssumeRole");
|
||||
assertEquals("arn:aws:iam::729951873967:role/Admin", arn);
|
||||
assertEquals(List.of("arn:aws:iam::729951873967:role/Admin"), sts("sts:AssumeRole"));
|
||||
setFormBody("Action=AssumeRole&Version=2011-06-15"
|
||||
+ "&RoleArn=arn%3Aaws%3Aiam%3A%3A" + ACCOUNT + "%3Arole%2Fops%2FAdmin&RoleSessionName=robin");
|
||||
assertEquals(List.of("arn:aws:iam::" + ACCOUNT + ":role/ops/Admin"), sts("sts:AssumeRole"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void stsAssumeRoleOfARoleNoAccountHoldsIsCheckedAsTheCallersToo() {
|
||||
setFormBody("Action=AssumeRole&Version=2011-06-15"
|
||||
+ "&RoleArn=arn%3Aaws%3Aiam%3A%3A729951873967%3Arole%2FMissing&RoleSessionName=robin");
|
||||
assertEquals(List.of("arn:aws:iam::729951873967:role/Missing", "arn:aws:iam::" + ACCOUNT + ":role/Missing"),
|
||||
sts("sts:AssumeRole"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -1051,17 +1063,16 @@ class ResourceArnBuilderTest {
|
||||
queryParams.add("RoleArn", "arn:aws:iam::729951873967:role/Allowed");
|
||||
setFormBody("Action=AssumeRole&Version=2011-06-15"
|
||||
+ "&RoleArn=arn%3Aaws%3Aiam%3A%3A729951873967%3Arole%2FAdmin&RoleSessionName=robin");
|
||||
String arn = sts("sts:AssumeRole");
|
||||
assertEquals("arn:aws:iam::729951873967:role/Admin", arn);
|
||||
assertEquals(List.of("arn:aws:iam::729951873967:role/Admin"), sts("sts:AssumeRole"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void stsReadsRoleArnOnlyForAssumeRole() {
|
||||
void stsGetFederationTokenIsCheckedOnTheFederatedUserItNamesNotARoleArnItNeverReads() {
|
||||
// GetFederationToken never acts on a role, so a RoleArn added to it must not let a policy
|
||||
// scoped to that role allow it.
|
||||
setFormBody("Action=GetFederationToken&Version=2011-06-15&Name=robin"
|
||||
+ "&RoleArn=arn%3Aaws%3Aiam%3A%3A729951873967%3Arole%2FAdmin");
|
||||
assertEquals("*", sts("sts:GetFederationToken"));
|
||||
assertEquals(List.of("arn:aws:sts::" + ACCOUNT + ":federated-user/robin"), sts("sts:GetFederationToken"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -1072,15 +1083,21 @@ class ResourceArnBuilderTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void stsRoleArnIsCheckedAsTheHandlerReadsIt() {
|
||||
// The handler does not trim, so neither does the check.
|
||||
void stsRoleArnFittingNoRoleFormatNamesNoRole() {
|
||||
// The handler does not trim, and neither does the reader: a value with a leading space fits no
|
||||
// role's ARN format, so the request is checked on every resource, which a policy naming the role
|
||||
// does not match.
|
||||
setFormBody("Action=AssumeRole&Version=2011-06-15"
|
||||
+ "&RoleArn=+arn%3Aaws%3Aiam%3A%3A729951873967%3Arole%2FAdmin&RoleSessionName=robin");
|
||||
assertEquals(" arn:aws:iam::729951873967:role/Admin", sts("sts:AssumeRole"));
|
||||
assertEquals(List.of("*"), sts("sts:AssumeRole"));
|
||||
}
|
||||
|
||||
private String sts(String action) {
|
||||
return builder.buildStsResources(action, ctx).getFirst();
|
||||
private List<String> sts(String operation) {
|
||||
IamService iam = mock(IamService.class);
|
||||
when(iam.findRole(anyString(), anyString())).thenReturn(Optional.empty());
|
||||
when(iam.findRole("729951873967", "Admin")).thenReturn(Optional.of(new IamRole()));
|
||||
return reading(new StsStoredResourceArns(iam)).buildResources("sts", operation, ctx, "us-east-1", ACCOUNT,
|
||||
"aws");
|
||||
}
|
||||
|
||||
|
||||
|
||||
+49
-2
@@ -23,14 +23,16 @@ import static org.hamcrest.Matchers.not;
|
||||
|
||||
/**
|
||||
* With {@code iam.enforcement-enabled=true}, {@code sts:AssumeRole} is authorized against the role it
|
||||
* names, so an identity policy can allow assuming one role and not another (IAM User Guide, "Granting
|
||||
* a user permissions to switch roles": the policy's Resource is the role's ARN).
|
||||
* names, in the account its ARN names, so an identity policy can allow assuming one role and not another
|
||||
* (IAM User Guide, "Granting a user permissions to switch roles": the policy's Resource is the role's ARN),
|
||||
* and {@code sts:GetFederationToken} against the federated user its name names.
|
||||
*/
|
||||
@QuarkusTest
|
||||
@TestProfile(IamEnforcementProfile.class)
|
||||
class StsAssumeRoleResourceEnforcementIntegrationTest {
|
||||
|
||||
private static final String ACCOUNT = "111111111111";
|
||||
private static final String OTHER_ACCOUNT = "222222222222";
|
||||
|
||||
@TestHTTPResource
|
||||
URI baseUri;
|
||||
@@ -54,6 +56,42 @@ class StsAssumeRoleResourceEnforcementIntegrationTest {
|
||||
assumeRole(caller, otherArn).then().statusCode(403);
|
||||
}
|
||||
|
||||
@Test
|
||||
void aPolicyNamingAnotherAccountsRoleAllowsAssumingThatRole() {
|
||||
// STS assumes the role in the account its ARN names, so the policy naming that role is all
|
||||
// the caller needs, not also one naming a role of the same name in its own account.
|
||||
String suffix = UUID.randomUUID().toString().substring(0, 8);
|
||||
String roleArn = EnforcementFixtures.createRole(cleanup, baseUri.getPort(), OTHER_ACCOUNT, "/",
|
||||
"cross-account-" + suffix, """
|
||||
{"Version":"2012-10-17","Statement":[{"Effect":"Allow",
|
||||
"Principal":{"AWS":"arn:aws:iam::%s:root"},"Action":"sts:AssumeRole"}]}""".formatted(ACCOUNT), """
|
||||
{"Version":"2012-10-17","Statement":[
|
||||
{"Effect":"Allow","Action":"iam:ListUsers","Resource":"*"}]}""");
|
||||
String user = "cross-account-caller-" + suffix;
|
||||
String iamAuth = auth(ACCOUNT, "iam");
|
||||
UserCredentials caller = EnforcementFixtures.createUser(cleanup, baseUri.getPort(), iamAuth, user);
|
||||
EnforcementFixtures.putUserPolicy(baseUri.getPort(), iamAuth, user, "assume", """
|
||||
{"Version":"2012-10-17","Statement":[
|
||||
{"Effect":"Allow","Action":"sts:AssumeRole","Resource":"%s"}]}""".formatted(roleArn));
|
||||
|
||||
assumeRole(caller, roleArn).then().statusCode(200);
|
||||
}
|
||||
|
||||
@Test
|
||||
void aPolicyNamingOneFederatedUserAllowsGetFederationTokenForThatNameOnly() {
|
||||
String suffix = UUID.randomUUID().toString().substring(0, 8);
|
||||
String user = "federation-named-" + suffix;
|
||||
String iamAuth = auth(ACCOUNT, "iam");
|
||||
UserCredentials caller = EnforcementFixtures.createUser(cleanup, baseUri.getPort(), iamAuth, user);
|
||||
EnforcementFixtures.putUserPolicy(baseUri.getPort(), iamAuth, user, "federation", """
|
||||
{"Version":"2012-10-17","Statement":[
|
||||
{"Effect":"Allow","Action":"sts:GetFederationToken",
|
||||
"Resource":"arn:aws:sts::%s:federated-user/fed-%s"}]}""".formatted(ACCOUNT, suffix));
|
||||
|
||||
getFederationToken(caller, "fed-" + suffix).then().statusCode(200);
|
||||
getFederationToken(caller, "other-" + suffix).then().statusCode(403);
|
||||
}
|
||||
|
||||
@Test
|
||||
void aPolicyNamingOneRoleDoesNotAllowOtherStsActionsThatCarryItsArn() {
|
||||
// GetFederationToken never acts on a role, so adding the allowed role's ARN to it must not
|
||||
@@ -110,6 +148,15 @@ class StsAssumeRoleResourceEnforcementIntegrationTest {
|
||||
{"Effect":"Allow","Action":"iam:ListUsers","Resource":"*"}]}""");
|
||||
}
|
||||
|
||||
private Response getFederationToken(UserCredentials caller, String name) {
|
||||
return given().port(baseUri.getPort())
|
||||
.contentType("application/x-www-form-urlencoded")
|
||||
.header("Authorization", auth(caller.accessKeyId(), "sts"))
|
||||
.formParam("Action", "GetFederationToken")
|
||||
.formParam("Name", name)
|
||||
.when().post("/");
|
||||
}
|
||||
|
||||
private Response assumeRole(UserCredentials caller, String roleArn) {
|
||||
return given().port(baseUri.getPort())
|
||||
.contentType("application/x-www-form-urlencoded")
|
||||
|
||||
@@ -298,11 +298,11 @@ NAMESPACES = ("access-analyzer", "account", "acm", "application-autoscaling", "a
|
||||
"rekognition", "resource-explorer-2", "route53", "s3tables", "s3vectors", "servicediscovery",
|
||||
"servicequotas", "ssm", "sso", "states", "textract", "timestream-influxdb", "translate", "signer", "xray",
|
||||
"securityhub", "guardduty", "secretsmanager", "scheduler", "lambda", "cloudformation", "glue",
|
||||
"sqs", "sns", "kinesis", "pipes", "dsql")
|
||||
"sqs", "sns", "kinesis", "pipes", "dsql", "sts")
|
||||
|
||||
# The namespaces whose resources ResourceArnBuilder builds itself.
|
||||
HAND_BUILT = ("apigateway", "bedrock", "dynamodb", "eks", "iam", "kms", "logs", "resource-groups",
|
||||
"s3", "sts")
|
||||
"s3")
|
||||
|
||||
# Operations of a namespace in `HAND_BUILT` read from the reference all the same, each with its reason.
|
||||
_LOGS_DELIVERY = ("CloudWatch Logs vended-log delivery: its requests name a delivery source, destination or delivery "
|
||||
|
||||
Reference in new issue
Block a user