fix(route53): check Route 53's requests under IAM enforcement (#8090)

Under IAM enforcement no Route 53 request but the delegation set calls
was checked: Route 53's model was not among the vendored REST routes,
and its namespace's request resources were not read, so no other
request was mapped to an action and the filter let it through. A
caller with no permissions could create, change and delete hosted
zones, record sets, health checks and tags.

Route 53's routes are now vendored and its requests read, now that
REST-XML path and query members are. Two generator changes name what
the rules did not:

- a path segment in ies names the type in y, so a bare Id after it is
  that type's: ListTrafficPolicyVersions's, in
  /trafficpolicies/{Id}/versions, is the traffic policy's, as the rule
  for path labels already reads UpdateHostedZoneComment's hosted zone
  and the other traffic policy calls;
- a member whose enum lists two or more of the action's types picks
  the type: Route 53's tag calls, by ResourceType.

RequestResources drops a leading /<type>/ from an id, the path Route 53
returns its ids under, so a delegation set or hosted zone named that
way is the same resource. The delegation set calls go through the
vendored routes like the rest, and their hand-built action map and ARN
builder are gone.

Co-authored-by: mrfelek <17274927+mrfelek@users.noreply.github.com>
This commit is contained in:
mrfelekandmrfelek authored and GitHub committed 2026-11-12 20:56:16 -04:00
1 parent 282b53cacc
commit 6b1ba4387a
12 files changed
+451 -59

No files matched your search

@@ -461,7 +461,9 @@ public final class RequestResources {
* handler then acts on the caller's resource of that name, and it is named as an ARN the request gives is; for
* a member naming one resource for each of a list's structures, each in the account and Region of the ARN its
* structure gives, the request's for a name (a {@code PutEvents} entry, on the bus it names). Each value is read
* up to the resource's {@code before} character, when it has one (a CodeBuild build id's project). A type
* up to the resource's {@code before} character, when it has one (a CodeBuild build id's project), and without the
* type's own path when it begins with one, as Route 53 returns its ids ({@code /hostedzone/Z1} names hosted zone
* {@code Z1}). A type
* whose service mints an id after its name is the caller's resource {@code stored} finds under that name, or
* else has that id open.
*/
@@ -479,7 +481,8 @@ public final class RequestResources {
boolean given = false;
for (Map.Entry<String, RequestResourceMembers.Member> variable : resource.fill().entrySet()) {
List<String> values = read(resource, form, body, variable.getValue()).stream()
.map(value -> before(value, resource.before())).toList();
.map(value -> withoutTypePath(before(value, resource.before()), resource.types().getFirst()))
.toList();
if (values.isEmpty()) {
continue;
}
@@ -525,6 +528,12 @@ public final class RequestResources {
}
}
/** The value without a leading {@code /<type>/}, the path a service may return an id of that type under. */
static String withoutTypePath(String value, String type) {
String path = "/" + type + "/";
return value.length() > path.length() && value.startsWith(path) ? value.substring(path.length()) : value;
}
/**
* The account the resource is in: the one its account member gives, the request's without one or with a JSON null
* for it; null when that member holds no account id, which its handler refuses.
@@ -11,7 +11,6 @@ import io.floci.aws.core.common.SignedServiceRoute;
import io.floci.aws.core.common.WireProtocol;
import io.floci.aws.services.dynamodb.DynamoDbPartiQLParser;
import io.floci.aws.services.eks.EksController;
import io.floci.aws.services.route53.Route53Controller;
import io.floci.aws.services.s3.S3BucketSubresources;
import io.floci.aws.services.s3.S3ObjectActions;
import jakarta.enterprise.context.ApplicationScoped;
@@ -44,12 +43,6 @@ import java.util.regex.Pattern;
@ApplicationScoped
public class IamActionRegistry {
private static final Map<String, String> ROUTE53_DELEGATION_ACTIONS = Map.of(
"createReusableDelegationSet", "route53:CreateReusableDelegationSet",
"getReusableDelegationSet", "route53:GetReusableDelegationSet",
"listReusableDelegationSets", "route53:ListReusableDelegationSets",
"deleteReusableDelegationSet", "route53:DeleteReusableDelegationSet");
private static final Logger LOG = Logger.getLogger(IamActionRegistry.class);
private static final ObjectMapper MAPPER = new ObjectMapper();
@@ -656,11 +649,6 @@ public class IamActionRegistry {
/** The serving method identifies these actions even when path encoding or matrix parameters vary. */
public String resolveMatchedRoute(String credentialScope, ResourceInfo resourceInfo) {
if ("route53".equals(credentialScope) && resourceInfo != null
&& Route53Controller.class.equals(resourceInfo.getResourceClass())
&& resourceInfo.getResourceMethod() != null) {
return ROUTE53_DELEGATION_ACTIONS.get(resourceInfo.getResourceMethod().getName());
}
if (resourceInfo == null || resourceInfo.getResourceClass() == null) {
return null;
}
@@ -240,10 +240,6 @@ public class ResourceArnBuilder {
case "dsql" -> List.of(buildDsqlArn(path, ctx, region, accountId, partition));
case "eks" -> List.of(buildEksArn(path, ctx, region, accountId));
case "apigateway" -> List.of(buildApiGatewayArn(ctx, region, partition));
case "route53" -> "route53:GetReusableDelegationSet".equals(operation)
|| "route53:DeleteReusableDelegationSet".equals(operation)
? List.of(buildRoute53DelegationSetArn(ctx, partition))
: namedResources(credentialScope, operation, ctx, region, accountId, partition);
case "bedrock" -> List.of(buildBedrockArn(path, ctx));
default -> namedResources(credentialScope, operation, ctx, region, accountId, partition);
};
@@ -276,17 +272,6 @@ public class ResourceArnBuilder {
return null;
}
private String buildRoute53DelegationSetArn(ContainerRequestContext ctx, String partition) {
String id = ctx.getUriInfo().getPathParameters().getFirst("Id");
if (id == null) {
return "*";
}
if (id.startsWith("/delegationset/")) {
id = id.substring(15);
}
return AwsArnUtils.Arn.global(partition, "route53", "", "delegationset/" + id).toString();
}
private String buildResourceGroupArn(ContainerRequestContext ctx, String region, String accountId) {
JsonNode body = readJsonBody(ctx);
if (body == null) {
@@ -1011,6 +1011,29 @@
"ListSupportedResourceTypes",
"ListViews"
],
"route53": [
"CreateCidrCollection",
"CreateHealthCheck",
"CreateHostedZone",
"CreateReusableDelegationSet",
"CreateTrafficPolicy",
"GetAccountLimit",
"GetCheckerIpRanges",
"GetGeoLocation",
"GetHealthCheckCount",
"GetHostedZoneCount",
"GetTrafficPolicyInstanceCount",
"ListCidrCollections",
"ListGeoLocations",
"ListHealthChecks",
"ListHostedZones",
"ListHostedZonesByName",
"ListHostedZonesByVPC",
"ListReusableDelegationSets",
"ListTrafficPolicies",
"ListTrafficPolicyInstances",
"TestDNSAnswer"
],
"scheduler": [
"ListScheduleGroups",
"ListSchedules",
@@ -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-12", "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"], "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"], "dynamodb": ["dynamodb"], "ec2": ["ec2"], "ecr": ["ecr"], "elasticloadbalancing": ["elb", "elbv2"], "elasticmapreduce": ["emr"], "emr-serverless": ["emr-serverless"], "es": ["es", "opensearch"], "events": ["eventbridgev2", "events"], "firehose": ["firehose"], "fis": ["fis"], "globalaccelerator": ["globalaccelerator"], "guardduty": ["guardduty"], "inspector2": ["inspector2"], "kinesisanalytics": ["kinesisanalyticsv2"], "logs": ["logs"], "macie2": ["macie2"], "oam": ["oam"], "payment-cryptography": ["payment-cryptography", "payment-cryptography-data"], "quicksight": ["quicksight"], "ram": ["ram"], "redshift": ["redshift"], "redshift-data": ["redshift-data"], "redshift-serverless": ["redshift-serverless"], "rekognition": ["rekognition"], "resource-explorer-2": ["resource-explorer-2"], "securityhub": ["securityhub"], "servicediscovery": ["servicediscovery"], "servicequotas": ["service-quotas"], "signer": ["signer", "signer-data"], "sso": ["sso", "sso-admin"], "states": ["stepfunctions"], "textract": ["textract"], "timestream-influxdb": ["timestream-influxdb"], "translate": ["translate"], "xray": ["xray"]},
"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"], "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"], "dynamodb": ["dynamodb"], "ec2": ["ec2"], "ecr": ["ecr"], "elasticloadbalancing": ["elb", "elbv2"], "elasticmapreduce": ["emr"], "emr-serverless": ["emr-serverless"], "es": ["es", "opensearch"], "events": ["eventbridgev2", "events"], "firehose": ["firehose"], "fis": ["fis"], "globalaccelerator": ["globalaccelerator"], "guardduty": ["guardduty"], "inspector2": ["inspector2"], "kinesisanalytics": ["kinesisanalyticsv2"], "logs": ["logs"], "macie2": ["macie2"], "oam": ["oam"], "payment-cryptography": ["payment-cryptography", "payment-cryptography-data"], "quicksight": ["quicksight"], "ram": ["ram"], "redshift": ["redshift"], "redshift-data": ["redshift-data"], "redshift-serverless": ["redshift-serverless"], "rekognition": ["rekognition"], "resource-explorer-2": ["resource-explorer-2"], "route53": ["route53"], "securityhub": ["securityhub"], "servicediscovery": ["servicediscovery"], "servicequotas": ["service-quotas"], "signer": ["signer", "signer-data"], "sso": ["sso", "sso-admin"], "states": ["stepfunctions"], "textract": ["textract"], "timestream-influxdb": ["timestream-influxdb"], "translate": ["translate"], "xray": ["xray"]},
"clientsNotRead": {"kinesisanalytics": "Kinesis Data Analytics v1, SQL applications on the KinesisAnalytics_20150814 target, which Floci does not serve (it serves v2, kinesisanalyticsv2); its operations share v2's names and name their resources by other members"},
"handBuilt": ["apigateway", "bedrock", "dsql", "dynamodb", "eks", "iam", "kinesis", "kms", "lambda", "logs", "pipes", "resource-groups", "s3", "scheduler", "secretsmanager", "sns", "sqs", "ssm", "sts"],
"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", "cloudformation": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "cloudhsm": "not read yet: its ARN formats end in ${CloudHsmClusterInstanceName} and ${CloudHsmBackupInstanceName}, names, while its requests give ClusterId and BackupId, ids, which the rule does not fill a name from, so nearly every operation needs a correction", "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", "ecs": "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 reaLine truncated
"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", "cloudformation": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "cloudhsm": "not read yet: its ARN formats end in ${CloudHsmClusterInstanceName} and ${CloudHsmBackupInstanceName}, names, while its requests give ClusterId and BackupId, ids, which the rule does not fill a name from, so nearly every operation needs a correction", "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", "ecs": "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 reaLine truncated
"otherNamespaces": ["a4b", "account-access", "acm-pca", "aco-automation", "agent-registry", "aidevops", "aiops", "airflow-serverless", "amplify", "amplifybackend", "amplifyuibuilder", "aoss", "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", "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", "emr-containers", "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", "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}"}, "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:${Partition}:cloudfront::${Account}:response-headers-policy/${Id}", "streaming-distribution": "arn:${Partition}:cloudfront::${Account}:streaming-distribution/${DistributionId}", "trust-store": "arn:${Partition}:cloudfront::${Account}:trust-store/${Id}", "vpcorigin": "arn:${Partition}:cloudfront::${Account}:vpcorigin/${Id}"}, "cloudfront-keyvaluestore": {"key-value-store": "arn:${Partition}:cloudfront::${Account}:key-value-store/${ResourceId}"}, "cloudtrail": {"channel": "arn:${Partition}:cloudtrail:${Region}:${Account}:channel/${ChannelId}", "dashboard": "arn:${Partition}:cloudtrail:${Region}:${Account}:dashboard/${DashboardName}", "eventdatastore": "arn:${Partition}:cloudtrail:${Region}:${Account}:eventdatastore/${EventDataStoreId}", "trail": "arn:${Partition}:cloudtrail:${Line 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}"}, "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:${Partition}:cloudfront::${Account}:response-headers-policy/${Id}", "streaming-distribution": "arn:${Partition}:cloudfront::${Account}:streaming-distribution/${DistributionId}", "trust-store": "arn:${Partition}:cloudfront::${Account}:trust-store/${Id}", "vpcorigin": "arn:${Partition}:cloudfront::${Account}:vpcorigin/${Id}"}, "cloudfront-keyvaluestore": {"key-value-store": "arn:${Partition}:cloudfront::${Account}:key-value-store/${ResourceId}"}, "cloudtrail": {"channel": "arn:${Partition}:cloudtrail:${Region}:${Account}:channel/${ChannelId}", "dashboard": "arn:${Partition}:cloudtrail:${Region}:${Account}:dashboard/${DashboardName}", "eventdatastore": "arn:${Partition}:cloudtrail:${Region}:${Account}:eventdatastore/${EventDataStoreId}", "trail": "arn:${Partition}:cloudtrail:${Line truncated
"unqualified": {"states": ["statemachine"]},
"mintedIds": {"events": ["api-destination", "connection"]},
"operations": {
@@ -1025,6 +1025,7 @@
"ec2:CreateLocalGatewayVirtualInterfaceGroup": {"action": "ec2:CreateLocalGatewayVirtualInterfaceGroup", "types": ["local-gateway", "local-gateway-virtual-interface-group"], "resources": []},
"ec2:CreateMacSystemIntegrityProtectionModificationTask": {"action": "ec2:CreateMacSystemIntegrityProtectionModificationTask", "types": ["instance", "mac-modification-task"], "resources": []},
"ec2:CreateManagedPrefixList": {"action": "ec2:CreateManagedPrefixList", "types": ["prefix-list"], "resources": []},
"ec2:CreateMetricCategory": {"action": "ec2:CreateMetricCategory", "types": [], "resources": []},
"ec2:CreateNatGateway": {"action": "ec2:CreateNatGateway", "types": ["elastic-ip", "natgateway", "subnet", "vpc"], "resources": []},
"ec2:CreateNetworkAcl": {"action": "ec2:CreateNetworkAcl", "types": ["network-acl", "vpc"], "resources": []},
"ec2:CreateNetworkAclEntry": {"action": "ec2:CreateNetworkAclEntry", "types": ["network-acl"], "resources": []},
@@ -1124,6 +1125,7 @@
"ec2:DeleteLocalGatewayVirtualInterface": {"action": "ec2:DeleteLocalGatewayVirtualInterface", "types": ["local-gateway-virtual-interface"], "resources": []},
"ec2:DeleteLocalGatewayVirtualInterfaceGroup": {"action": "ec2:DeleteLocalGatewayVirtualInterfaceGroup", "types": ["local-gateway-virtual-interface-group"], "resources": []},
"ec2:DeleteManagedPrefixList": {"action": "ec2:DeleteManagedPrefixList", "types": ["prefix-list"], "resources": []},
"ec2:DeleteMetricCategory": {"action": "ec2:DeleteMetricCategory", "types": [], "resources": []},
"ec2:DeleteNatGateway": {"action": "ec2:DeleteNatGateway", "types": ["natgateway"], "resources": []},
"ec2:DeleteNetworkAcl": {"action": "ec2:DeleteNetworkAcl", "types": ["network-acl"], "resources": []},
"ec2:DeleteNetworkAclEntry": {"action": "ec2:DeleteNetworkAclEntry", "types": ["network-acl"], "resources": []},
@@ -1294,6 +1296,7 @@
"ec2:DescribeMacHosts": {"action": "ec2:DescribeMacHosts", "types": [], "resources": []},
"ec2:DescribeMacModificationTasks": {"action": "ec2:DescribeMacModificationTasks", "types": [], "resources": []},
"ec2:DescribeManagedPrefixLists": {"action": "ec2:DescribeManagedPrefixLists", "types": [], "resources": []},
"ec2:DescribeMetricCategories": {"action": "ec2:DescribeMetricCategories", "types": [], "resources": []},
"ec2:DescribeMovingAddresses": {"action": "ec2:DescribeMovingAddresses", "types": [], "resources": []},
"ec2:DescribeNatGateways": {"action": "ec2:DescribeNatGateways", "types": [], "resources": []},
"ec2:DescribeNetworkAcls": {"action": "ec2:DescribeNetworkAcls", "types": [], "resources": []},
@@ -1596,6 +1599,7 @@
"ec2:ModifyLocalGatewayRoute": {"action": "ec2:ModifyLocalGatewayRoute", "types": ["local-gateway-route-table", "local-gateway-virtual-interface-group", "network-interface", "prefix-list"], "resources": []},
"ec2:ModifyManagedPrefixList": {"action": "ec2:ModifyManagedPrefixList", "types": ["prefix-list"], "resources": []},
"ec2:ModifyManagedResourceVisibility": {"action": "ec2:ModifyManagedResourceVisibility", "types": [], "resources": []},
"ec2:ModifyMetricCategory": {"action": "ec2:ModifyMetricCategory", "types": [], "resources": []},
"ec2:ModifyNetworkInterfaceAttribute": {"action": "ec2:ModifyNetworkInterfaceAttribute", "types": ["instance", "network-interface", "security-group", "subnet"], "resources": []},
"ec2:ModifyPrivateDnsNameOptions": {"action": "ec2:ModifyPrivateDnsNameOptions", "types": ["instance"], "resources": []},
"ec2:ModifyPublicIpDnsNameOptions": {"action": "ec2:ModifyPublicIpDnsNameOptions", "types": ["network-interface"], "resources": []},
@@ -2298,6 +2302,7 @@
"guardduty:ListFilters": {"action": "guardduty:ListFilters", "types": [], "resources": []},
"guardduty:ListFindings": {"action": "guardduty:ListFindings", "types": [], "resources": []},
"guardduty:ListIPSets": {"action": "guardduty:ListIPSets", "types": [], "resources": []},
"guardduty:ListInvestigationRecords": {"action": "guardduty:ListInvestigationRecords", "types": [], "resources": []},
"guardduty:ListInvestigations": {"action": "guardduty:ListInvestigations", "types": [], "resources": []},
"guardduty:ListInvitations": {"action": "guardduty:ListInvitations", "types": [], "resources": []},
"guardduty:ListMalwareProtectionPlans": {"action": "guardduty:ListMalwareProtectionPlans", "types": [], "resources": []},
@@ -3278,6 +3283,80 @@
"resource-explorer-2:UntagResource": {"action": "resource-explorer-2:UntagResource", "types": ["index", "view"], "resources": [{"types": ["index", "view"], "arn": "resourceArn"}], "located": {"resourceArn": "{resourceArn}"}},
"resource-explorer-2:UpdateIndexType": {"action": "resource-explorer-2:UpdateIndexType", "types": ["index"], "resources": [{"types": ["index"], "arn": "Arn"}]},
"resource-explorer-2:UpdateView": {"action": "resource-explorer-2:UpdateView", "types": ["view"], "resources": [{"types": ["view"], "arn": "ViewArn"}]},
"route53:ActivateKeySigningKey": {"action": "route53:ActivateKeySigningKey", "types": ["hostedzone"], "resources": [{"type": "hostedzone", "fill": {"Id": "HostedZoneId"}}], "located": {"HostedZoneId": "{HostedZoneId}"}},
"route53:AssociateVPCWithHostedZone": {"action": "route53:AssociateVPCWithHostedZone", "types": ["hostedzone"], "resources": [{"type": "hostedzone", "fill": {"Id": "HostedZoneId"}}], "located": {"HostedZoneId": "{Id}"}},
"route53:ChangeCidrCollection": {"action": "route53:ChangeCidrCollection", "types": ["cidrcollection"], "resources": [{"type": "cidrcollection", "fill": {"Id": "Id"}}], "located": {"Id": "{CidrCollectionId}"}},
"route53:ChangeResourceRecordSets": {"action": "route53:ChangeResourceRecordSets", "types": ["hostedzone"], "resources": [{"type": "hostedzone", "fill": {"Id": "HostedZoneId"}}], "located": {"HostedZoneId": "{Id}"}},
"route53:ChangeTagsForResource": {"action": "route53:ChangeTagsForResource", "types": ["healthcheck", "hostedzone"], "resources": [{"type": "healthcheck", "fill": {"Id": "ResourceId"}, "when": {"ResourceType": ["healthcheck"]}}, {"type": "hostedzone", "fill": {"Id": "ResourceId"}, "when": {"ResourceType": ["hostedzone"]}}], "located": {"ResourceId": "{ResourceId}", "ResourceType": "{ResourceType}"}},
"route53:CreateCidrCollection": {"action": "route53:CreateCidrCollection", "types": [], "resources": []},
"route53:CreateHealthCheck": {"action": "route53:CreateHealthCheck", "types": [], "resources": []},
"route53:CreateHostedZone": {"action": "route53:CreateHostedZone", "types": [], "resources": []},
"route53:CreateKeySigningKey": {"action": "route53:CreateKeySigningKey", "types": ["hostedzone"], "resources": []},
"route53:CreateQueryLoggingConfig": {"action": "route53:CreateQueryLoggingConfig", "types": ["hostedzone"], "resources": []},
"route53:CreateResourceRecordSetProtections": {"action": "route53:CreateResourceRecordSetProtections", "types": [], "resources": []},
"route53:CreateReusableDelegationSet": {"action": "route53:CreateReusableDelegationSet", "types": [], "resources": []},
"route53:CreateTrafficPolicy": {"action": "route53:CreateTrafficPolicy", "types": [], "resources": []},
"route53:CreateTrafficPolicyInstance": {"action": "route53:CreateTrafficPolicyInstance", "types": ["hostedzone", "trafficpolicy"], "resources": []},
"route53:CreateTrafficPolicyVersion": {"action": "route53:CreateTrafficPolicyVersion", "types": ["trafficpolicy"], "resources": [{"type": "trafficpolicy", "fill": {"Id": "Id"}}], "located": {"Id": "{Id}"}},
"route53:CreateVPCAssociationAuthorization": {"action": "route53:CreateVPCAssociationAuthorization", "types": ["hostedzone"], "resources": [{"type": "hostedzone", "fill": {"Id": "HostedZoneId"}}], "located": {"HostedZoneId": "{Id}"}},
"route53:DeactivateKeySigningKey": {"action": "route53:DeactivateKeySigningKey", "types": ["hostedzone"], "resources": [{"type": "hostedzone", "fill": {"Id": "HostedZoneId"}}], "located": {"HostedZoneId": "{HostedZoneId}"}},
"route53:DeleteCidrCollection": {"action": "route53:DeleteCidrCollection", "types": ["cidrcollection"], "resources": [{"type": "cidrcollection", "fill": {"Id": "Id"}}], "located": {"Id": "{CidrCollectionId}"}},
"route53:DeleteHealthCheck": {"action": "route53:DeleteHealthCheck", "types": ["healthcheck"], "resources": [{"type": "healthcheck", "fill": {"Id": "HealthCheckId"}}], "located": {"HealthCheckId": "{HealthCheckId}"}},
"route53:DeleteHostedZone": {"action": "route53:DeleteHostedZone", "types": ["hostedzone"], "resources": [{"type": "hostedzone", "fill": {"Id": "Id"}}], "located": {"Id": "{Id}"}},
"route53:DeleteKeySigningKey": {"action": "route53:DeleteKeySigningKey", "types": ["hostedzone"], "resources": [{"type": "hostedzone", "fill": {"Id": "HostedZoneId"}}], "located": {"HostedZoneId": "{HostedZoneId}"}},
"route53:DeleteQueryLoggingConfig": {"action": "route53:DeleteQueryLoggingConfig", "types": ["queryloggingconfig"], "resources": [{"type": "queryloggingconfig", "fill": {"Id": "Id"}}], "located": {"Id": "{Id}"}},
"route53:DeleteResourceRecordSetProtections": {"action": "route53:DeleteResourceRecordSetProtections", "types": [], "resources": []},
"route53:DeleteReusableDelegationSet": {"action": "route53:DeleteReusableDelegationSet", "types": ["delegationset"], "resources": [{"type": "delegationset", "fill": {"Id": "Id"}}], "located": {"Id": "{Id}"}},
"route53:DeleteTrafficPolicy": {"action": "route53:DeleteTrafficPolicy", "types": ["trafficpolicy"], "resources": [{"type": "trafficpolicy", "fill": {"Id": "Id"}}], "located": {"Id": "{Id}"}},
"route53:DeleteTrafficPolicyInstance": {"action": "route53:DeleteTrafficPolicyInstance", "types": ["trafficpolicyinstance"], "resources": [{"type": "trafficpolicyinstance", "fill": {"Id": "Id"}}], "located": {"Id": "{Id}"}},
"route53:DeleteVPCAssociationAuthorization": {"action": "route53:DeleteVPCAssociationAuthorization", "types": ["hostedzone"], "resources": [{"type": "hostedzone", "fill": {"Id": "HostedZoneId"}}], "located": {"HostedZoneId": "{Id}"}},
"route53:DisableHostedZoneDNSSEC": {"action": "route53:DisableHostedZoneDNSSEC", "types": ["hostedzone"], "resources": [{"type": "hostedzone", "fill": {"Id": "HostedZoneId"}}], "located": {"HostedZoneId": "{Id}"}},
"route53:DisassociateVPCFromHostedZone": {"action": "route53:DisassociateVPCFromHostedZone", "types": ["hostedzone"], "resources": [{"type": "hostedzone", "fill": {"Id": "HostedZoneId"}}], "located": {"HostedZoneId": "{Id}"}},
"route53:EnableHostedZoneDNSSEC": {"action": "route53:EnableHostedZoneDNSSEC", "types": ["hostedzone"], "resources": [{"type": "hostedzone", "fill": {"Id": "HostedZoneId"}}], "located": {"HostedZoneId": "{Id}"}},
"route53:GetAccountLimit": {"action": "route53:GetAccountLimit", "types": [], "resources": []},
"route53:GetChange": {"action": "route53:GetChange", "types": ["change"], "resources": [{"type": "change", "fill": {"Id": "Id"}}], "located": {"Id": "{Id}"}},
"route53:GetCheckerIpRanges": {"action": "route53:GetCheckerIpRanges", "types": [], "resources": []},
"route53:GetDNSSEC": {"action": "route53:GetDNSSEC", "types": ["hostedzone"], "resources": [{"type": "hostedzone", "fill": {"Id": "HostedZoneId"}}], "located": {"HostedZoneId": "{Id}"}},
"route53:GetGeoLocation": {"action": "route53:GetGeoLocation", "types": [], "resources": []},
"route53:GetHealthCheck": {"action": "route53:GetHealthCheck", "types": ["healthcheck"], "resources": [{"type": "healthcheck", "fill": {"Id": "HealthCheckId"}}], "located": {"HealthCheckId": "{HealthCheckId}"}},
"route53:GetHealthCheckCount": {"action": "route53:GetHealthCheckCount", "types": [], "resources": []},
"route53:GetHealthCheckLastFailureReason": {"action": "route53:GetHealthCheckLastFailureReason", "types": ["healthcheck"], "resources": [{"type": "healthcheck", "fill": {"Id": "HealthCheckId"}}], "located": {"HealthCheckId": "{HealthCheckId}"}},
"route53:GetHealthCheckStatus": {"action": "route53:GetHealthCheckStatus", "types": ["healthcheck"], "resources": [{"type": "healthcheck", "fill": {"Id": "HealthCheckId"}}], "located": {"HealthCheckId": "{HealthCheckId}"}},
"route53:GetHostedZone": {"action": "route53:GetHostedZone", "types": ["hostedzone"], "resources": [{"type": "hostedzone", "fill": {"Id": "Id"}}], "located": {"Id": "{Id}"}},
"route53:GetHostedZoneCount": {"action": "route53:GetHostedZoneCount", "types": [], "resources": []},
"route53:GetHostedZoneLimit": {"action": "route53:GetHostedZoneLimit", "types": ["hostedzone"], "resources": [{"type": "hostedzone", "fill": {"Id": "HostedZoneId"}}], "located": {"HostedZoneId": "{Id}"}},
"route53:GetQueryLoggingConfig": {"action": "route53:GetQueryLoggingConfig", "types": ["queryloggingconfig"], "resources": [{"type": "queryloggingconfig", "fill": {"Id": "Id"}}], "located": {"Id": "{Id}"}},
"route53:GetReusableDelegationSet": {"action": "route53:GetReusableDelegationSet", "types": ["delegationset"], "resources": [{"type": "delegationset", "fill": {"Id": "Id"}}], "located": {"Id": "{Id}"}},
"route53:GetReusableDelegationSetLimit": {"action": "route53:GetReusableDelegationSetLimit", "types": ["delegationset"], "resources": [{"type": "delegationset", "fill": {"Id": "DelegationSetId"}}], "located": {"DelegationSetId": "{Id}"}},
"route53:GetTrafficPolicy": {"action": "route53:GetTrafficPolicy", "types": ["trafficpolicy"], "resources": [{"type": "trafficpolicy", "fill": {"Id": "Id"}}], "located": {"Id": "{Id}"}},
"route53:GetTrafficPolicyInstance": {"action": "route53:GetTrafficPolicyInstance", "types": ["trafficpolicyinstance"], "resources": [{"type": "trafficpolicyinstance", "fill": {"Id": "Id"}}], "located": {"Id": "{Id}"}},
"route53:GetTrafficPolicyInstanceCount": {"action": "route53:GetTrafficPolicyInstanceCount", "types": [], "resources": []},
"route53:ListCidrBlocks": {"action": "route53:ListCidrBlocks", "types": ["cidrcollection"], "resources": [{"type": "cidrcollection", "fill": {"Id": "CollectionId"}}], "located": {"CollectionId": "{CidrCollectionId}"}},
"route53:ListCidrCollections": {"action": "route53:ListCidrCollections", "types": [], "resources": []},
"route53:ListCidrLocations": {"action": "route53:ListCidrLocations", "types": ["cidrcollection"], "resources": [{"type": "cidrcollection", "fill": {"Id": "CollectionId"}}], "located": {"CollectionId": "{CidrCollectionId}"}},
"route53:ListGeoLocations": {"action": "route53:ListGeoLocations", "types": [], "resources": []},
"route53:ListHealthChecks": {"action": "route53:ListHealthChecks", "types": [], "resources": []},
"route53:ListHostedZones": {"action": "route53:ListHostedZones", "types": [], "resources": []},
"route53:ListHostedZonesByName": {"action": "route53:ListHostedZonesByName", "types": [], "resources": []},
"route53:ListHostedZonesByVPC": {"action": "route53:ListHostedZonesByVPC", "types": [], "resources": []},
"route53:ListQueryLoggingConfigs": {"action": "route53:ListQueryLoggingConfigs", "types": ["hostedzone"], "resources": [{"type": "hostedzone", "fill": {"Id": "HostedZoneId"}}], "located": {"HostedZoneId": "?hostedzoneid"}},
"route53:ListResourceRecordSetProtections": {"action": "route53:ListResourceRecordSetProtections", "types": [], "resources": []},
"route53:ListResourceRecordSets": {"action": "route53:ListResourceRecordSets", "types": ["hostedzone"], "resources": [{"type": "hostedzone", "fill": {"Id": "HostedZoneId"}}], "located": {"HostedZoneId": "{Id}"}},
"route53:ListReusableDelegationSets": {"action": "route53:ListReusableDelegationSets", "types": [], "resources": []},
"route53:ListTagsForResource": {"action": "route53:ListTagsForResource", "types": ["healthcheck", "hostedzone"], "resources": [{"type": "healthcheck", "fill": {"Id": "ResourceId"}, "when": {"ResourceType": ["healthcheck"]}}, {"type": "hostedzone", "fill": {"Id": "ResourceId"}, "when": {"ResourceType": ["hostedzone"]}}], "located": {"ResourceId": "{ResourceId}", "ResourceType": "{ResourceType}"}},
"route53:ListTagsForResources": {"action": "route53:ListTagsForResources", "types": ["healthcheck", "hostedzone"], "resources": []},
"route53:ListTrafficPolicies": {"action": "route53:ListTrafficPolicies", "types": [], "resources": []},
"route53:ListTrafficPolicyInstances": {"action": "route53:ListTrafficPolicyInstances", "types": [], "resources": []},
"route53:ListTrafficPolicyInstancesByHostedZone": {"action": "route53:ListTrafficPolicyInstancesByHostedZone", "types": ["hostedzone"], "resources": [{"type": "hostedzone", "fill": {"Id": "HostedZoneId"}}], "located": {"HostedZoneId": "?id"}},
"route53:ListTrafficPolicyInstancesByPolicy": {"action": "route53:ListTrafficPolicyInstancesByPolicy", "types": ["trafficpolicy"], "resources": [{"type": "trafficpolicy", "fill": {"Id": "TrafficPolicyId"}}], "located": {"TrafficPolicyId": "?id"}},
"route53:ListTrafficPolicyVersions": {"action": "route53:ListTrafficPolicyVersions", "types": ["trafficpolicy"], "resources": [{"type": "trafficpolicy", "fill": {"Id": "Id"}}], "located": {"Id": "{Id}"}},
"route53:ListVPCAssociationAuthorizations": {"action": "route53:ListVPCAssociationAuthorizations", "types": ["hostedzone"], "resources": [{"type": "hostedzone", "fill": {"Id": "HostedZoneId"}}], "located": {"HostedZoneId": "{Id}"}},
"route53:TestDNSAnswer": {"action": "route53:TestDNSAnswer", "types": [], "resources": []},
"route53:UpdateHealthCheck": {"action": "route53:UpdateHealthCheck", "types": ["healthcheck"], "resources": [{"type": "healthcheck", "fill": {"Id": "HealthCheckId"}}], "located": {"HealthCheckId": "{HealthCheckId}"}},
"route53:UpdateHostedZoneComment": {"action": "route53:UpdateHostedZoneComment", "types": ["hostedzone"], "resources": [{"type": "hostedzone", "fill": {"Id": "Id"}}], "located": {"Id": "{Id}"}},
"route53:UpdateHostedZoneFeatures": {"action": "route53:UpdateHostedZoneFeatures", "types": ["hostedzone"], "resources": [{"type": "hostedzone", "fill": {"Id": "HostedZoneId"}}], "located": {"HostedZoneId": "{Id}"}},
"route53:UpdateTrafficPolicyComment": {"action": "route53:UpdateTrafficPolicyComment", "types": ["trafficpolicy"], "resources": [{"type": "trafficpolicy", "fill": {"Id": "Id"}}], "located": {"Id": "{Id}"}},
"route53:UpdateTrafficPolicyInstance": {"action": "route53:UpdateTrafficPolicyInstance", "types": ["trafficpolicyinstance"], "resources": [{"type": "trafficpolicyinstance", "fill": {"Id": "Id"}}], "located": {"Id": "{Id}"}},
"securityhub:AcceptAdministratorInvitation": {"action": "securityhub:AcceptAdministratorInvitation", "types": ["hub"], "resources": [{"type": "hub", "fill": {}}]},
"securityhub:AcceptInvitation": {"action": "securityhub:AcceptInvitation", "types": ["hub"], "resources": [{"type": "hub", "fill": {}}]},
"securityhub:BatchDeleteAutomationRules": {"action": "securityhub:BatchDeleteAutomationRules", "types": ["automation-rule"], "resources": [{"types": ["automation-rule"], "arn": "AutomationRulesArns[]"}]},
+77
View File
@@ -1814,6 +1814,83 @@
"UpdateView": {"method": "POST", "requestUri": "/UpdateView"}
}
},
"route53": {
"credentialScope": "route53",
"apiVersion": "2013-04-01",
"operations": {
"ActivateKeySigningKey": {"method": "POST", "requestUri": "/2013-04-01/keysigningkey/{HostedZoneId}/{Name}/activate"},
"AssociateVPCWithHostedZone": {"method": "POST", "requestUri": "/2013-04-01/hostedzone/{Id}/associatevpc"},
"ChangeCidrCollection": {"method": "POST", "requestUri": "/2013-04-01/cidrcollection/{CidrCollectionId}"},
"ChangeResourceRecordSets": {"method": "POST", "requestUri": "/2013-04-01/hostedzone/{Id}/rrset/"},
"ChangeTagsForResource": {"method": "POST", "requestUri": "/2013-04-01/tags/{ResourceType}/{ResourceId}"},
"CreateCidrCollection": {"method": "POST", "requestUri": "/2013-04-01/cidrcollection"},
"CreateHealthCheck": {"method": "POST", "requestUri": "/2013-04-01/healthcheck"},
"CreateHostedZone": {"method": "POST", "requestUri": "/2013-04-01/hostedzone"},
"CreateKeySigningKey": {"method": "POST", "requestUri": "/2013-04-01/keysigningkey"},
"CreateQueryLoggingConfig": {"method": "POST", "requestUri": "/2013-04-01/queryloggingconfig"},
"CreateReusableDelegationSet": {"method": "POST", "requestUri": "/2013-04-01/delegationset"},
"CreateTrafficPolicy": {"method": "POST", "requestUri": "/2013-04-01/trafficpolicy"},
"CreateTrafficPolicyInstance": {"method": "POST", "requestUri": "/2013-04-01/trafficpolicyinstance"},
"CreateTrafficPolicyVersion": {"method": "POST", "requestUri": "/2013-04-01/trafficpolicy/{Id}"},
"CreateVPCAssociationAuthorization": {"method": "POST", "requestUri": "/2013-04-01/hostedzone/{Id}/authorizevpcassociation"},
"DeactivateKeySigningKey": {"method": "POST", "requestUri": "/2013-04-01/keysigningkey/{HostedZoneId}/{Name}/deactivate"},
"DeleteCidrCollection": {"method": "DELETE", "requestUri": "/2013-04-01/cidrcollection/{CidrCollectionId}"},
"DeleteHealthCheck": {"method": "DELETE", "requestUri": "/2013-04-01/healthcheck/{HealthCheckId}"},
"DeleteHostedZone": {"method": "DELETE", "requestUri": "/2013-04-01/hostedzone/{Id}"},
"DeleteKeySigningKey": {"method": "DELETE", "requestUri": "/2013-04-01/keysigningkey/{HostedZoneId}/{Name}"},
"DeleteQueryLoggingConfig": {"method": "DELETE", "requestUri": "/2013-04-01/queryloggingconfig/{Id}"},
"DeleteReusableDelegationSet": {"method": "DELETE", "requestUri": "/2013-04-01/delegationset/{Id}"},
"DeleteTrafficPolicy": {"method": "DELETE", "requestUri": "/2013-04-01/trafficpolicy/{Id}/{Version}"},
"DeleteTrafficPolicyInstance": {"method": "DELETE", "requestUri": "/2013-04-01/trafficpolicyinstance/{Id}"},
"DeleteVPCAssociationAuthorization": {"method": "POST", "requestUri": "/2013-04-01/hostedzone/{Id}/deauthorizevpcassociation"},
"DisableHostedZoneDNSSEC": {"method": "POST", "requestUri": "/2013-04-01/hostedzone/{Id}/disable-dnssec"},
"DisassociateVPCFromHostedZone": {"method": "POST", "requestUri": "/2013-04-01/hostedzone/{Id}/disassociatevpc"},
"EnableHostedZoneDNSSEC": {"method": "POST", "requestUri": "/2013-04-01/hostedzone/{Id}/enable-dnssec"},
"GetAccountLimit": {"method": "GET", "requestUri": "/2013-04-01/accountlimit/{Type}"},
"GetChange": {"method": "GET", "requestUri": "/2013-04-01/change/{Id}"},
"GetCheckerIpRanges": {"method": "GET", "requestUri": "/2013-04-01/checkeripranges"},
"GetDNSSEC": {"method": "GET", "requestUri": "/2013-04-01/hostedzone/{Id}/dnssec"},
"GetGeoLocation": {"method": "GET", "requestUri": "/2013-04-01/geolocation"},
"GetHealthCheck": {"method": "GET", "requestUri": "/2013-04-01/healthcheck/{HealthCheckId}"},
"GetHealthCheckCount": {"method": "GET", "requestUri": "/2013-04-01/healthcheckcount"},
"GetHealthCheckLastFailureReason": {"method": "GET", "requestUri": "/2013-04-01/healthcheck/{HealthCheckId}/lastfailurereason"},
"GetHealthCheckStatus": {"method": "GET", "requestUri": "/2013-04-01/healthcheck/{HealthCheckId}/status"},
"GetHostedZone": {"method": "GET", "requestUri": "/2013-04-01/hostedzone/{Id}"},
"GetHostedZoneCount": {"method": "GET", "requestUri": "/2013-04-01/hostedzonecount"},
"GetHostedZoneLimit": {"method": "GET", "requestUri": "/2013-04-01/hostedzonelimit/{Id}/{Type}"},
"GetQueryLoggingConfig": {"method": "GET", "requestUri": "/2013-04-01/queryloggingconfig/{Id}"},
"GetReusableDelegationSet": {"method": "GET", "requestUri": "/2013-04-01/delegationset/{Id}"},
"GetReusableDelegationSetLimit": {"method": "GET", "requestUri": "/2013-04-01/reusabledelegationsetlimit/{Id}/{Type}"},
"GetTrafficPolicy": {"method": "GET", "requestUri": "/2013-04-01/trafficpolicy/{Id}/{Version}"},
"GetTrafficPolicyInstance": {"method": "GET", "requestUri": "/2013-04-01/trafficpolicyinstance/{Id}"},
"GetTrafficPolicyInstanceCount": {"method": "GET", "requestUri": "/2013-04-01/trafficpolicyinstancecount"},
"ListCidrBlocks": {"method": "GET", "requestUri": "/2013-04-01/cidrcollection/{CidrCollectionId}/cidrblocks"},
"ListCidrCollections": {"method": "GET", "requestUri": "/2013-04-01/cidrcollection"},
"ListCidrLocations": {"method": "GET", "requestUri": "/2013-04-01/cidrcollection/{CidrCollectionId}"},
"ListGeoLocations": {"method": "GET", "requestUri": "/2013-04-01/geolocations"},
"ListHealthChecks": {"method": "GET", "requestUri": "/2013-04-01/healthcheck"},
"ListHostedZones": {"method": "GET", "requestUri": "/2013-04-01/hostedzone"},
"ListHostedZonesByName": {"method": "GET", "requestUri": "/2013-04-01/hostedzonesbyname"},
"ListHostedZonesByVPC": {"method": "GET", "requestUri": "/2013-04-01/hostedzonesbyvpc"},
"ListQueryLoggingConfigs": {"method": "GET", "requestUri": "/2013-04-01/queryloggingconfig"},
"ListResourceRecordSets": {"method": "GET", "requestUri": "/2013-04-01/hostedzone/{Id}/rrset"},
"ListReusableDelegationSets": {"method": "GET", "requestUri": "/2013-04-01/delegationset"},
"ListTagsForResource": {"method": "GET", "requestUri": "/2013-04-01/tags/{ResourceType}/{ResourceId}"},
"ListTagsForResources": {"method": "POST", "requestUri": "/2013-04-01/tags/{ResourceType}"},
"ListTrafficPolicies": {"method": "GET", "requestUri": "/2013-04-01/trafficpolicies"},
"ListTrafficPolicyInstances": {"method": "GET", "requestUri": "/2013-04-01/trafficpolicyinstances"},
"ListTrafficPolicyInstancesByHostedZone": {"method": "GET", "requestUri": "/2013-04-01/trafficpolicyinstances/hostedzone"},
"ListTrafficPolicyInstancesByPolicy": {"method": "GET", "requestUri": "/2013-04-01/trafficpolicyinstances/trafficpolicy"},
"ListTrafficPolicyVersions": {"method": "GET", "requestUri": "/2013-04-01/trafficpolicies/{Id}/versions"},
"ListVPCAssociationAuthorizations": {"method": "GET", "requestUri": "/2013-04-01/hostedzone/{Id}/authorizevpcassociation"},
"TestDNSAnswer": {"method": "GET", "requestUri": "/2013-04-01/testdnsanswer"},
"UpdateHealthCheck": {"method": "POST", "requestUri": "/2013-04-01/healthcheck/{HealthCheckId}"},
"UpdateHostedZoneComment": {"method": "POST", "requestUri": "/2013-04-01/hostedzone/{Id}"},
"UpdateHostedZoneFeatures": {"method": "POST", "requestUri": "/2013-04-01/hostedzone/{Id}/features"},
"UpdateTrafficPolicyComment": {"method": "POST", "requestUri": "/2013-04-01/trafficpolicy/{Id}/{Version}"},
"UpdateTrafficPolicyInstance": {"method": "POST", "requestUri": "/2013-04-01/trafficpolicyinstance/{Id}"}
}
},
"s3": {
"credentialScope": "s3",
"apiVersion": "2006-03-01",
@@ -3,9 +3,7 @@ package io.floci.aws.services.iam;
import io.floci.aws.core.common.AwsProtocolClaimFilter;
import io.floci.aws.core.common.ProtocolClaim;
import io.floci.aws.core.common.WireProtocol;
import io.floci.aws.services.route53.Route53Controller;
import jakarta.ws.rs.container.ContainerRequestContext;
import jakarta.ws.rs.container.ResourceInfo;
import jakarta.ws.rs.core.MediaType;
import jakarta.ws.rs.core.MultivaluedHashMap;
import jakarta.ws.rs.core.MultivaluedMap;
@@ -23,7 +21,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
@@ -224,18 +221,16 @@ class IamActionRegistryTest {
assertNull(registry.resolveRoute("access-analyzer", ctx));
}
/** Route 53's delegation set calls resolve from their vendored routes, an id given with its type's path too. */
@ParameterizedTest
@CsvSource({"createReusableDelegationSet,CreateReusableDelegationSet",
"getReusableDelegationSet,GetReusableDelegationSet",
"listReusableDelegationSets,ListReusableDelegationSets",
"deleteReusableDelegationSet,DeleteReusableDelegationSet"})
void matchedDelegationSetMethodsResolveTheirOwnActions(String method, String operation) {
ResourceInfo info = Mockito.mock(ResourceInfo.class);
Mockito.doReturn(Route53Controller.class).when(info).getResourceClass();
when(info.getResourceMethod()).thenReturn(Arrays.stream(Route53Controller.class.getMethods())
.filter(candidate -> candidate.getName().equals(method)).findFirst().orElseThrow());
assertEquals("route53:" + operation, registry.resolveMatchedRoute("route53", info));
assertNull(registry.resolveMatchedRoute("s3", info));
@CsvSource({"POST,/2013-04-01/delegationset,CreateReusableDelegationSet",
"GET,/2013-04-01/delegationset,ListReusableDelegationSets",
"GET,/2013-04-01/delegationset/N1,GetReusableDelegationSet",
"GET,/2013-04-01/delegationset/%2Fdelegationset%2FN1,GetReusableDelegationSet",
"DELETE,/2013-04-01/delegationset/N1,DeleteReusableDelegationSet"})
void delegationSetRoutesResolveTheirOwnActions(String method, String path, String operation) {
assertEquals("route53:" + operation, registry.resolveRoute("route53",
mockCtx(method, path, new MultivaluedHashMap<>(), MediaType.APPLICATION_XML_TYPE, "")));
}
@ParameterizedTest
@@ -74,10 +74,9 @@ class ResourceArnBuilderTest {
for (String id : List.of("N1", "%2Fdelegationset%2FN1")) {
when(uriInfo.getRequestUri()).thenReturn(URI.create("http://localhost/2013-04-01/delegationset/" + id));
when(uriInfo.getBaseUri()).thenReturn(URI.create("http://localhost/"));
MultivaluedMap<String, String> parameters = new MultivaluedHashMap<>();
parameters.putSingle("Id", id.equals("N1") ? "N1" : "/delegationset/N1");
when(uriInfo.getPathParameters()).thenReturn(parameters);
for (String operation : List.of("GetReusableDelegationSet", "DeleteReusableDelegationSet")) {
// The id is read from the route the request matched, the type's path Route 53 returns it under dropped.
when(ctx.getMethod()).thenReturn(operation.startsWith("Get") ? "GET" : "DELETE");
assertEquals(List.of("arn:" + partition + ":route53:::delegationset/N1"),
builder.buildResources("route53", "route53:" + operation, ctx, region, ACCOUNT, partition));
}
@@ -0,0 +1,162 @@
package io.floci.aws.services.route53;
import io.floci.aws.testing.AwsTestClients;
import io.floci.aws.testing.EnforcementFixtures;
import io.floci.aws.testing.IamEnforcementProfile;
import io.floci.aws.testing.PartitionCleanup;
import io.quarkus.test.common.http.TestHTTPResource;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.TestProfile;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.extension.AfterAllCallback;
import org.junit.jupiter.api.extension.RegisterExtension;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.route53.Route53Client;
import software.amazon.awssdk.services.route53.model.Route53Exception;
import software.amazon.awssdk.services.route53.model.Tag;
import software.amazon.awssdk.services.route53.model.TagResourceType;
import java.net.URI;
import java.util.UUID;
import static io.floci.aws.testing.EnforcementFixtures.auth;
import static io.restassured.RestAssured.given;
import static org.hamcrest.Matchers.containsString;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertThrows;
/**
* Hosted zone requests are checked on the hosted zone their path names
* ({@code arn:aws:route53:::hostedzone/<id>}), and a tag request on the resource its
* {@code ResourceType} and {@code ResourceId} labels name, before the handler changes anything.
*/
@QuarkusTest
@TestProfile(IamEnforcementProfile.class)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class Route53HostedZonesIamEnforcementIntegrationTest {
private static final String ACCOUNT = "741686000031";
@TestHTTPResource("/")
URI baseUri;
private final PartitionCleanup CLEANUP = new PartitionCleanup();
@RegisterExtension
final AfterAllCallback classCleanup = CLEANUP::afterEach;
private Route53Client root;
private String selectedZone;
private String otherZone;
@BeforeAll
void createSharedFixtures() {
root = client(ACCOUNT);
CLEANUP.register(root::close);
selectedZone = createZone(root);
otherZone = createZone(root);
}
@Test
void aCallerWithoutPermissionsIsRefusedBeforeAZoneIsCreated() {
String name = "none-" + UUID.randomUUID().toString().substring(0, 8) + ".example.com.";
try (Route53Client client = client(userWithPolicy(null))) {
assertDenied(() -> client.createHostedZone(r -> r.name(name).callerReference(UUID.randomUUID().toString())));
assertDenied(() -> client.getHostedZone(r -> r.id(selectedZone)));
assertDenied(client::listHostedZones);
}
assertFalse(root.listHostedZones().hostedZones().stream().anyMatch(zone -> zone.name().equals(name)));
}
@Test
void aZoneScopedAllowGrantsOnlyThatZone() {
String key = userWithPolicy(allow("[\"route53:GetHostedZone\",\"route53:UpdateHostedZoneComment\","
+ "\"route53:ListResourceRecordSets\"]", zoneArn(selectedZone)));
try (Route53Client client = client(key)) {
assertEquals(selectedZone, bare(client.getHostedZone(r -> r.id(selectedZone)).hostedZone().id()));
client.updateHostedZoneComment(r -> r.id(selectedZone).comment("scoped"));
client.listResourceRecordSets(r -> r.hostedZoneId(selectedZone));
assertDenied(() -> client.getHostedZone(r -> r.id(otherZone)));
assertDenied(() -> client.updateHostedZoneComment(r -> r.id(otherZone).comment("scoped")));
assertDenied(() -> client.listResourceRecordSets(r -> r.hostedZoneId(otherZone)));
}
}
@Test
void anExplicitDenyOnAZoneKeepsItFromBeingDeleted() {
String zone = createZone(root);
String key = userWithPolicy("""
{"Version":"2012-10-17","Statement":[
{"Effect":"Allow","Action":"route53:*","Resource":"*"},
{"Effect":"Deny","Action":"route53:DeleteHostedZone","Resource":"%s"}]}
""".formatted(zoneArn(zone)));
try (Route53Client client = client(key)) {
assertDenied(() -> client.deleteHostedZone(r -> r.id(zone)));
// Named by the path Route 53 returns its id under, the zone is the same one, and so is the deny.
given().urlEncodingEnabled(false).header("Authorization", auth(key, "route53"))
.delete("/2013-04-01/hostedzone/%2Fhostedzone%2F" + zone)
.then().statusCode(403).body(containsString("<Code>AccessDenied</Code>"));
assertEquals(zone, bare(root.getHostedZone(r -> r.id(zone)).hostedZone().id()));
}
}
@Test
void aTagRequestIsCheckedOnTheResourceItsTypeAndIdName() {
String key = userWithPolicy(allow("[\"route53:ChangeTagsForResource\",\"route53:ListTagsForResource\"]",
zoneArn(selectedZone)));
Tag tag = Tag.builder().key("team").value("dns").build();
try (Route53Client client = client(key)) {
client.changeTagsForResource(r -> r.resourceType(TagResourceType.HOSTEDZONE).resourceId(selectedZone)
.addTags(tag));
assertEquals(1, client.listTagsForResource(r -> r.resourceType(TagResourceType.HOSTEDZONE)
.resourceId(selectedZone)).resourceTagSet().tags().size());
assertDenied(() -> client.changeTagsForResource(r -> r.resourceType(TagResourceType.HOSTEDZONE)
.resourceId(otherZone).addTags(tag)));
// The same id under another type is another resource.
assertDenied(() -> client.listTagsForResource(r -> r.resourceType(TagResourceType.HEALTHCHECK)
.resourceId(selectedZone)));
}
}
private String createZone(Route53Client client) {
String name = "iam-" + UUID.randomUUID().toString().substring(0, 8) + ".example.com";
String id = bare(client.createHostedZone(r -> r.name(name).callerReference(UUID.randomUUID().toString()))
.hostedZone().id());
CLEANUP.register(() -> root.deleteHostedZone(r -> r.id(id)));
return id;
}
/** A hosted zone's id without the {@code /hostedzone/} path Route 53 returns it under. */
private static String bare(String id) {
return id.replace("/hostedzone/", "");
}
private static String zoneArn(String id) {
return "arn:aws:route53:::hostedzone/" + id;
}
private static String allow(String actions, String resource) {
return """
{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":%s,"Resource":"%s"}]}
""".formatted(actions, resource);
}
private String userWithPolicy(String policy) {
String user = "r53-zones-" + UUID.randomUUID();
String key = EnforcementFixtures.createUser(CLEANUP, baseUri.getPort(), auth(ACCOUNT, "iam"), user).accessKeyId();
if (policy != null) {
EnforcementFixtures.putUserPolicy(baseUri.getPort(), auth(ACCOUNT, "iam"), user, "zones", policy);
}
return key;
}
private Route53Client client(String key) {
return AwsTestClients.create(Route53Client.builder(), key, Region.US_EAST_1, baseUri);
}
private void assertDenied(Runnable call) {
Route53Exception error = assertThrows(Route53Exception.class, call::run);
assertEquals(403, error.statusCode());
assertEquals("AccessDenied", error.awsErrorDetails().errorCode());
}
}
+58 -10
View File
@@ -176,7 +176,7 @@ NAMESPACES = ("access-analyzer", "account", "acm", "application-autoscaling", "a
"datasync", "ec2", "ecr", "elasticloadbalancing", "elasticmapreduce", "emr-serverless", "es", "events",
"firehose", "fis", "globalaccelerator", "inspector2", "kinesisanalytics", "macie2", "oam",
"payment-cryptography", "quicksight", "ram", "redshift", "redshift-data", "redshift-serverless",
"rekognition", "resource-explorer-2", "servicediscovery", "servicequotas", "sso", "states", "textract",
"rekognition", "resource-explorer-2", "route53", "servicediscovery", "servicequotas", "sso", "states", "textract",
"timestream-influxdb", "translate", "signer", "xray", "securityhub", "guardduty")
# SDK clients the reference lists for a namespace's operations whose requests Floci does not serve, and why: their
@@ -267,7 +267,6 @@ NOT_COVERED: dict[str, str] = {
"organizations": _LATER,
"rds": _LATER,
"rds-data": _REST,
"route53": _REST,
"route53resolver": _LATER,
"rum": _REST,
"s3tables": _REST,
@@ -769,15 +768,17 @@ def with_absent_account(resources: list[dict], formats: dict[str, str], accounts
def path_labels(models: dict[str, dict], operation: str) -> dict[str, str]:
"""The bare members (`BARE`) the operation's REST request carries as a path label after a segment naming
something, each with that segment stemmed: FIS's `id` in `/safetyLevers/{id}/state` is `safetylever`."""
something, each with that segment stemmed, a plural in `ies` read as its `y`: FIS's `id` in
`/safetyLevers/{id}/state` is `safetylever`, Route 53's `Id` in `/trafficpolicies/{Id}/versions` is
`trafficpolicy`."""
found: dict[str, str] = {}
for model in models.values():
spec = model["operations"].get(operation)
if spec is None or "input" not in spec or "http" not in spec:
continue
segments = spec["http"]["requestUri"].split("?", 1)[0].strip("/").split("/")
labelled = {match.group(1): stem(segments[index - 1]) for index, segment in enumerate(segments)
if index and "{" not in segments[index - 1]
labelled = {match.group(1): stem(re.sub(r"ies$", "y", segments[index - 1]))
for index, segment in enumerate(segments) if index and "{" not in segments[index - 1]
and (match := re.fullmatch(r"\{(\w+)\+?}", segment))}
for name, member in model["shapes"][spec["input"]["shape"]].get("members", {}).items():
label = member.get("locationName", name)
@@ -834,6 +835,51 @@ def request_members(models: dict[str, dict], operation: str) -> dict[str, str]:
return found
def enum_members(models: dict[str, dict], operation: str) -> dict[str, set[str]]:
"""The top-level string members of the operation's request that this file reads, with the values their enum
lists; a member with no enum is left out."""
found: dict[str, set[str]] = {}
for model in models.values():
spec = model["operations"].get(operation)
reading = _reading(model)
if spec is None or "input" not in spec or reading is None:
continue
for name, member in model["shapes"][spec["input"]["shape"]].get("members", {}).items():
if member.get("location") not in BODY_LOCATIONS and _located(member) is None:
continue
if reading == "located" and member.get("location") in BODY_LOCATIONS:
continue
values = model["shapes"][member["shape"]].get("enum")
if values:
found.setdefault(name, set()).update(values)
return found
def picked_by_enum(types: list[str], formats: dict[str, str], members: dict[str, str],
enums: dict[str, set[str]]) -> list[dict] | None:
"""The resources of a request a member of which picks the type: one whose enum lists two or more of the action's
types (Route 53's tag calls name a `ResourceType` of `healthcheck` or `hostedzone`). Each type it lists is filled
from the member naming whatever the action acts on (`ResourceId`) when the request holds that type; None when no
member picks a type, or no member names the resource."""
for picker, values in sorted(enums.items()):
kinds = [kind for kind in types if kind in values and kind in formats]
if len(kinds) < 2:
continue
picked = []
for kind in kinds:
variables = [v for v in VARIABLE_RE.findall(formats[kind]) if v not in KNOWN_VARIABLES]
if len(variables) != 1:
return None
named = [member for member in members if member != picker and stem(member) == "resource"
and compatible(member, variables[0])]
if not named:
return None
member = min(named, key=lambda m: (members[m].endswith("[]"), len(m), m))
picked.append({"type": kind, "fill": {variables[0]: members[member]}, "when": {picker: [kind]}})
return picked
return None
def string_patterns(models: dict[str, dict], operation: str) -> dict[str, set[str | None]]:
"""Patterns of each top-level string member, including list elements, across the request's clients."""
found: dict[str, set[str | None]] = {}
@@ -1316,11 +1362,13 @@ def entry_for(operation: str, upstream: dict, formats: dict[str, str], models: d
f"it reads ({sorted(endpoints)})")
else:
labels = path_labels(models, operation.split(":", 1)[1])
resources = with_through(with_found(with_parent_ids(resources_for(operation, types, formats, members, arn_members,
labels),
formats, types, members),
namespace_of(operation), types, members),
namespace_of(operation), types, members)
resources = picked_by_enum(types, formats, members, enum_members(models, operation.split(":", 1)[1]))
if resources is None:
resources = with_through(with_found(with_parent_ids(resources_for(operation, types, formats, members,
arn_members, labels),
formats, types, members),
namespace_of(operation), types, members),
namespace_of(operation), types, members)
optional = optional_members(models, operation.split(":", 1)[1])
resources = with_absent_arn(resources, formats, optional)
resources = with_absent_account(resources, formats, account_members(models, operation.split(":", 1)[1]),
+1
View File
@@ -76,6 +76,7 @@ MODELS: dict[str, str] = {
"quicksight": "quicksight",
"ram": "ram",
"resource-explorer-2": "resource-explorer-2",
"route53": "route53",
"s3": "s3",
"s3control": "s3",
"scheduler": "scheduler",
@@ -1142,3 +1142,29 @@ def test_sso_access_scope_does_not_authorize_target_applications():
derived = r.entry_for(operation, {"action": entry["action"], "types": entry["types"]},
document["arnFormats"]["sso"], models)
assert derived["resources"] == [{"types": ["Application"], "arn": "ApplicationArn"}]
def test_a_path_segment_in_ies_names_the_type_in_y():
# lever_model's operation stands in for Route 53's ListTrafficPolicyVersions, /trafficpolicies/{Id}/versions.
labels = r.path_labels({"route53": lever_model("/2013-04-01/trafficpolicies/{id}/versions")},
"UpdateSafetyLeverState")
assert labels == {"id": "trafficpolicy"}
formats = {"trafficpolicy": "arn:${Partition}:route53:::trafficpolicy/${Id}"}
assert r.resources_for("route53:ListTrafficPolicyVersions", ["trafficpolicy"], formats, members("id"),
labels=labels) == [{"type": "trafficpolicy", "fill": {"Id": "id"}}]
assert r.resources_for("route53:ListTrafficPolicyVersions", ["trafficpolicy"], formats, members("id")) == []
def test_a_member_whose_enum_lists_two_of_the_actions_types_picks_the_type():
formats = {"healthcheck": "arn:${Partition}:route53:::healthcheck/${Id}",
"hostedzone": "arn:${Partition}:route53:::hostedzone/${Id}"}
members = {"ResourceType": "ResourceType", "ResourceId": "ResourceId"}
enums = {"ResourceType": {"healthcheck", "hostedzone"}}
assert r.picked_by_enum(["healthcheck", "hostedzone"], formats, members, enums) == [
{"type": "healthcheck", "fill": {"Id": "ResourceId"}, "when": {"ResourceType": ["healthcheck"]}},
{"type": "hostedzone", "fill": {"Id": "ResourceId"}, "when": {"ResourceType": ["hostedzone"]}}]
# An enum listing one of the action's types, or none of them, picks nothing.
assert r.picked_by_enum(["hostedzone"], formats, members, enums) is None
assert r.picked_by_enum(["healthcheck", "hostedzone"], formats, members, {"ResourceType": {"other"}}) is None
# Without a member naming the resource, the request names none of them.
assert r.picked_by_enum(["healthcheck", "hostedzone"], formats, {"ResourceType": "ResourceType"}, enums) is None