Skip to content

armgit / floci

Public Imported from GitHub
0

Light, fluffy, and always free - The AWS Local Emulator alternative

fix(iam): check CodeBuild and Kinesis Data Analytics on the resources their requests name (#6884)

Priamo Germosen407ac4e210ad
diff --git a/docs/services/iam.md b/docs/services/iam.md
index 501e70bd78..b4cf47ccc9 100644
--- a/docs/services/iam.md
+++ b/docs/services/iam.md
@@ -1527,7 +1527,8 @@ A request is checked against the resources it names. Floci builds their ARNs its
SQS, SNS, DynamoDB, Kinesis, SSM, KMS, IAM, Resource Groups, EventBridge Scheduler, EventBridge
Pipes, Aurora DSQL, EKS, CloudWatch Logs, Secrets Manager and STS. For Elastic Load Balancing, ECR,
Step Functions, EventBridge, Amazon Cognito user pools and identity pools, Amazon Data Firehose, Cloud
-Map, ACM and CodePipeline they come from a table generated from AWS's Service
+Map, ACM, CodePipeline, CodeBuild and Amazon Managed Service for Apache Flink (Kinesis Data Analytics v2)
+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
@@ -1557,7 +1558,9 @@ connects to by `webhook.targetPipeline`. A CodePipeline webhook is `webhook:<nam
gives it, and a custom action type `actiontype:Custom/<category>/<provider>/<version>`, its owner
being `Custom`, which the request does not give. Cloud Map's `CreateService` is checked on the
namespace its `NamespaceId` names or, when it gives none or a JSON null, the one its
-`DnsConfig.NamespaceId` names, as Cloud Map reads them, and on the service it creates. An EventBridge rule is on the event bus
+`DnsConfig.NamespaceId` names, as Cloud Map reads them, and on the service it creates. A CodeBuild build is checked on its
+project, which its id names before its `:` (`<project>:<id>`), as CodeBuild authorizes
+`BatchGetBuilds`, `StopBuild`, `RetryBuild` and `BatchDeleteBuilds`. An EventBridge rule is on the event bus
its request's `EventBusName` names, by name or by ARN, and on the default bus when it names none
or gives a null, whose rules are `rule/<name>`, with no bus; a bus ARN of another account, the
default bus's included, names that account's rule, checked as given and as the caller's own, which
diff --git a/src/main/java/io/github/hectorvent/floci/core/common/RequestResourceMembers.java b/src/main/java/io/github/hectorvent/floci/core/common/RequestResourceMembers.java
index 86e1a6ae84..9f938678bd 100644
--- a/src/main/java/io/github/hectorvent/floci/core/common/RequestResourceMembers.java
+++ b/src/main/java/io/github/hectorvent/floci/core/common/RequestResourceMembers.java
@@ -120,9 +120,11 @@ final class RequestResourceMembers {
* of the ARN that structure gives, if any. Such a member is in {@code absent} or {@code arnOf} only when it
* fills a variable. A member filling a variable may also be a field of a structure ({@code pipeline.name}). A
* variable no member gives may be {@code fixed} to the one value its handler uses (a CodePipeline custom action
- * type's owner, {@code Custom}). An ARN member's value is read up to the character {@code before}, when there
- * is one, as its handler drops the rest. A create naming other resources beside the one it makes marks that one
- * {@code made}, where its tags go (a webhook, not the pipeline it connects to).
+ * type's owner, {@code Custom}). A member's value, an ARN or a variable's, is read up to the character
+ * {@code before}, when there is one: Step Functions Local's handler drops a test case after {@code #}, and a
+ * CodeBuild build id is {@code <project>:<id>}, a build being checked on its project. A create naming other
+ * resources beside the one it makes marks that one {@code made}, where its tags go (a webhook, not the pipeline
+ * it connects to).
*/
record Resource(List<String> types, Member arn, Map<String, Member> fill, Map<String, List<String>> when,
Map<String, List<String>> unless, Map<String, String> absent, Map<String, String> arnOf,
@@ -234,17 +236,17 @@ final class RequestResourceMembers {
+ resource.path("made") + ", which is not true");
}
boolean made = resource.has("made");
+ String before = resource.has("before") ? resource.path("before").asText("") : null;
+ if (before != null && before.length() != 1) {
+ throw new IllegalStateException(RESOURCE_NAME + " reads a member for " + operation
+ + " before " + before + ", no one character");
+ }
if (resource.has("arn")) {
List<String> types = resource.path("types").valueStream().map(JsonNode::asText).toList();
if (types.isEmpty() || !formats.keySet().containsAll(types)) {
throw new IllegalStateException(RESOURCE_NAME + " reads an ARN for " + operation
+ " of types with no format: " + types);
}
- String before = resource.has("before") ? resource.path("before").asText("") : null;
- if (before != null && before.length() != 1) {
- throw new IllegalStateException(RESOURCE_NAME + " reads an ARN for " + operation
- + " before " + before + ", no one character");
- }
return new Resource(types, arnMember(operation, resource.path("arn").asText("")), Map.of(), Map.of(),
Map.of(), Map.of(), Map.of(), null, before, Map.of(), made);
}
@@ -304,7 +306,7 @@ final class RequestResourceMembers {
+ " from " + account.name() + ", no member of one account or a type of none");
}
return new Resource(List.of(type), null, Map.copyOf(fill), when, unless, Map.copyOf(absent), Map.copyOf(arnOf),
- account, null, Map.copyOf(fixed), made);
+ account, before, Map.copyOf(fixed), made);
}
/** The values each member named in {@code when} or {@code unless} may have, an empty one for the member absent. */
diff --git a/src/main/java/io/github/hectorvent/floci/core/common/RequestResources.java b/src/main/java/io/github/hectorvent/floci/core/common/RequestResources.java
index dbfd367569..1a147fbd9b 100644
--- a/src/main/java/io/github/hectorvent/floci/core/common/RequestResources.java
+++ b/src/main/java/io/github/hectorvent/floci/core/common/RequestResources.java
@@ -249,13 +249,16 @@ public final class RequestResources {
/**
* The ARNs of a type the request names through the variables it fills: one for each value of a list member,
- * none when it gives none of them. A value that is itself an ARN of the type names that resource. They are in
- * the account the resource's account member gives, which its handler acts in, and none when that member holds
- * no account id; in the request's without one, or with a JSON null for it. An ARN given for a name puts the
+ * none when it gives none of them. A value that is itself an ARN of the type names that resource, and the others
+ * in the same list their own, as a handler taking a name or an ARN for each reads them (CodeBuild's
+ * {@code BatchGetProjects}). They are in the account the resource's account member gives, which its handler
+ * acts in, and none when that member holds no account id; in the request's without one, or with a JSON null for
+ * it. An ARN given for a name puts the
* resource in that ARN's account and Region, the caller's and the request's where it leaves them empty, as its
* 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). A type
+ * 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
* 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.
*/
@@ -276,16 +279,21 @@ public final class RequestResources {
List<Filling> fillings = new ArrayList<>(List.of(new Filling(resource.fixed(), fromRequest)));
boolean given = false;
for (Map.Entry<String, RequestResourceMembers.Member> variable : resource.fill().entrySet()) {
- List<String> values = read(resource, form, body, variable.getValue());
+ List<String> values = read(resource, form, body, variable.getValue()).stream()
+ .map(value -> before(value, resource.before())).toList();
if (values.isEmpty()) {
continue;
}
given = true;
RequestResourceMembers.ArnFormat named = arnOf(resource, variable.getValue().path(), formats);
- if (resource.fill().size() == 1 && fromRequest == null && values.stream().allMatch(value ->
- !isArnOf(named, value) && format.pattern().matcher(value).matches())) {
- values.forEach(value -> addNamed(arns, format.checked(value), partition, region, accountId));
- return;
+ if (resource.fill().size() == 1 && fromRequest == null) {
+ List<String> asArns = values.stream()
+ .filter(value -> !isArnOf(named, value) && format.pattern().matcher(value).matches()).toList();
+ asArns.forEach(value -> addNamed(arns, format.checked(value), partition, region, accountId));
+ values = values.stream().filter(value -> !asArns.contains(value)).toList();
+ if (values.isEmpty()) {
+ return;
+ }
}
List<Filling> next = new ArrayList<>();
for (Filling filling : fillings) {
diff --git a/src/main/resources/aws/iam-request-resources.json b/src/main/resources/aws/iam-request-resources.json
index 0103139fb0..a079566e8d 100644
--- a/src/main/resources/aws/iam-request-resources.json
+++ b/src/main/resources/aws/iam-request-resources.json
@@ -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.113 (installed package)", "retrieved": "2026-10-28", "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": {"acm": ["acm"], "codepipeline": ["codepipeline"], "cognito-identity": ["cognito-identity"], "cognito-idp": ["cognito-idp"], "ecr": ["ecr"], "elasticloadbalancing": ["elb", "elbv2"], "events": ["events"], "firehose": ["firehose"], "servicediscovery": ["servicediscovery"], "states": ["stepfunctions"]},
- "clientsNotRead": {"eventbridgev2": "EventBridge V2, the AWSEventsV2 target over Smithy RPC v2 CBOR on the eventsv2 endpoint, which Floci does not serve; its operations share EventBridge's names and name their resources by other members"},
+ "_source": {"generator": "tools/aws/regen_iam_request_resources.py", "reference": "https://servicereference.us-east-1.amazonaws.com/", "botocore": "botocore 1.43.113 (installed package)", "retrieved": "2026-10-29", "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": {"acm": ["acm"], "codebuild": ["codebuild"], "codepipeline": ["codepipeline"], "cognito-identity": ["cognito-identity"], "cognito-idp": ["cognito-idp"], "ecr": ["ecr"], "elasticloadbalancing": ["elb", "elbv2"], "events": ["events"], "firehose": ["firehose"], "kinesisanalytics": ["kinesisanalyticsv2"], "servicediscovery": ["servicediscovery"], "states": ["stepfunctions"]},
+ "clientsNotRead": {"eventbridgev2": "EventBridge V2, the AWSEventsV2 target over Smithy RPC v2 CBOR on the eventsv2 endpoint, which Floci does not serve; its operations share EventBridge's names and name their resources by other members", "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": ["dsql", "dynamodb", "eks", "iam", "kinesis", "kms", "lambda", "logs", "pipes", "resource-groups", "s3", "scheduler", "secretsmanager", "sns", "sqs", "ssm", "sts"],
- "notCovered": {"access-analyzer": "REST: its requests name their resources in the path, which RequestResources does not read yet", "account": "REST: its requests name their resources in the path, which RequestResources does not read yet", "airflow": "REST: its requests name their resources in the path, which RequestResources does not read yet", "apigateway": "REST: its requests name their resources in the path, which RequestResources does not read yet", "app-integrations": "REST: its requests name their resources in the path, which RequestResources does not read yet", "appconfig": "REST: its requests name their resources in the path, which RequestResources does not read yet", "application-autoscaling": "not read yet: a scalable target's ARN ends in an id the service mints, `scalable-target/<id>`, while its requests name the target by ServiceNamespace, ResourceId and ScalableDimension, so its resource is the stored ARN those three find, which RequestResources has no lookup for yet; read as a member, ResourceId would fill that id", "appsync": "REST: its requests name their resources in the path, which RequestResources does not read yet", "aps": "REST: its requests name their resources in the path, which RequestResources does not read yet", "athena": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "autoscaling": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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 does not read yet", "batch": "REST: its requests name their resources in the path, which RequestResources does not read yet", "bcm-data-exports": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "bcm-pricing-calculator": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "bedrock": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "bedrock-agentcore": "REST: its requests name their resources in the path, which RequestResources does not read yet", "budgets": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "ce": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "cloudformation": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "cloudfront": "REST: its requests name their resources in the path, which RequestResources does not read yet", "cloudhsm": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "cloudtrail": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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 does not read yet", "codebuild": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "codedeploy": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "codeguru-reviewer": "REST: its requests name their resources in the path, which RequestResources does not read 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 does not read yet", "controlcatalog": "REST: its requests name their resources in the path, which RequestResources does not read yet", "controltower": "REST: its requests name their resources in the path, which RequestResources does not read yet", "cur": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "datasync": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "detective": "REST: its requests name their resources in the path, which RequestResources does not read yet", "dlm": "REST: its requests name their resources in the path, which RequestResources does not read yet", "dms": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "ec2": "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: a later batch, with the tests that show its ARNs are the ones its handlers mint", "elasticfilesystem": "REST: its requests name their resources in the path, which RequestResources does not read yet", "elasticmapreduce": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "emr-serverless": "REST: its requests name their resources in the path, which RequestResources does not read yet", "es": "REST: its requests name their resources in the path, which RequestResources does not read yet", "execute-api": "REST: its requests name their resources in the path, which RequestResources does not read yet", "fis": "REST: its requests name their resources in the path, which RequestResources does not read yet", "globalaccelerator": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "glue": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "guardduty": "REST: its requests name their resources in the path, which RequestResources does not read yet", "identitystore": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "inspector2": "REST: its requests name their resources in the path, which RequestResources does not read yet", "iot": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "kafka": "REST: its requests name their resources in the path, which RequestResources does not read yet", "kinesisanalytics": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "lightsail": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "macie2": "REST: its requests name their resources in the path, which RequestResources does not read yet", "memorydb": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "mq": "REST: its requests name their resources in the path, which RequestResources does not read yet", "network-firewall": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "oam": "REST: its requests name their resources in the path, which RequestResources does not read yet", "organizations": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "ram": "REST: its requests name their resources in the path, which RequestResources does not read yet", "rds": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "rds-data": "REST: its requests name their resources in the path, which RequestResources does not read yet", "redshift": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "redshift-data": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "redshift-serverless": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "rekognition": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "resource-explorer-2": "REST: its requests name their resources in the path, which RequestResources does not read yet", "route53": "REST: its requests name their resources in the path, which RequestResources does not read yet", "route53resolver": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "rum": "REST: its requests name their resources in the path, which RequestResources does not read yet", "s3tables": "REST: its requests name their resources in the path, which RequestResources does not read yet", "s3vectors": "REST: its requests name their resources in the path, which RequestResources does not read yet", "sagemaker": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "securityhub": "REST: its requests name their resources in the path, which RequestResources does not read yet", "servicecatalog": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "servicequotas": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "ses": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "signin": "REST: its requests name their resources in the path, which RequestResources does not read yet", "sso": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "sso-oauth": "REST: its requests name their resources in the path, which RequestResources does not read yet", "swf": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "textract": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "timestream-influxdb": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "transcribe": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "transfer": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "translate": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "verifiedpermissions": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "wafv2": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint"},
+ "notCovered": {"access-analyzer": "REST: its requests name their resources in the path, which RequestResources does not read yet", "account": "REST: its requests name their resources in the path, which RequestResources does not read yet", "airflow": "REST: its requests name their resources in the path, which RequestResources does not read yet", "apigateway": "REST: its requests name their resources in the path, which RequestResources does not read yet", "app-integrations": "REST: its requests name their resources in the path, which RequestResources does not read yet", "appconfig": "REST: its requests name their resources in the path, which RequestResources does not read yet", "application-autoscaling": "not read yet: a scalable target's ARN ends in an id the service mints, `scalable-target/<id>`, while its requests name the target by ServiceNamespace, ResourceId and ScalableDimension, so its resource is the stored ARN those three find, which RequestResources has no lookup for yet; read as a member, ResourceId would fill that id", "appsync": "REST: its requests name their resources in the path, which RequestResources does not read yet", "aps": "REST: its requests name their resources in the path, which RequestResources does not read yet", "athena": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "autoscaling": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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 does not read yet", "batch": "REST: its requests name their resources in the path, which RequestResources does not read yet", "bcm-data-exports": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "bcm-pricing-calculator": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "bedrock": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "bedrock-agentcore": "REST: its requests name their resources in the path, which RequestResources does not read yet", "budgets": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "ce": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "cloudformation": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "cloudfront": "REST: its requests name their resources in the path, which RequestResources does not read yet", "cloudhsm": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "cloudtrail": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "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 does not read yet", "codedeploy": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "codeguru-reviewer": "REST: its requests name their resources in the path, which RequestResources does not read 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 does not read yet", "controlcatalog": "REST: its requests name their resources in the path, which RequestResources does not read yet", "controltower": "REST: its requests name their resources in the path, which RequestResources does not read yet", "cur": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "datasync": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "detective": "REST: its requests name their resources in the path, which RequestResources does not read yet", "dlm": "REST: its requests name their resources in the path, which RequestResources does not read yet", "dms": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "ec2": "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: a later batch, with the tests that show its ARNs are the ones its handlers mint", "elasticfilesystem": "REST: its requests name their resources in the path, which RequestResources does not read yet", "elasticmapreduce": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "emr-serverless": "REST: its requests name their resources in the path, which RequestResources does not read yet", "es": "REST: its requests name their resources in the path, which RequestResources does not read yet", "execute-api": "REST: its requests name their resources in the path, which RequestResources does not read yet", "fis": "REST: its requests name their resources in the path, which RequestResources does not read yet", "globalaccelerator": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "glue": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "guardduty": "REST: its requests name their resources in the path, which RequestResources does not read yet", "identitystore": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "inspector2": "REST: its requests name their resources in the path, which RequestResources does not read yet", "iot": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "kafka": "REST: its requests name their resources in the path, which RequestResources does not read yet", "lightsail": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "macie2": "REST: its requests name their resources in the path, which RequestResources does not read yet", "memorydb": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "mq": "REST: its requests name their resources in the path, which RequestResources does not read yet", "network-firewall": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "oam": "REST: its requests name their resources in the path, which RequestResources does not read yet", "organizations": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "ram": "REST: its requests name their resources in the path, which RequestResources does not read yet", "rds": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "rds-data": "REST: its requests name their resources in the path, which RequestResources does not read yet", "redshift": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "redshift-data": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "redshift-serverless": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "rekognition": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "resource-explorer-2": "REST: its requests name their resources in the path, which RequestResources does not read yet", "route53": "REST: its requests name their resources in the path, which RequestResources does not read yet", "route53resolver": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "rum": "REST: its requests name their resources in the path, which RequestResources does not read yet", "s3tables": "REST: its requests name their resources in the path, which RequestResources does not read yet", "s3vectors": "REST: its requests name their resources in the path, which RequestResources does not read yet", "sagemaker": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "securityhub": "REST: its requests name their resources in the path, which RequestResources does not read yet", "servicecatalog": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "servicequotas": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "ses": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "signin": "REST: its requests name their resources in the path, which RequestResources does not read yet", "sso": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "sso-oauth": "REST: its requests name their resources in the path, which RequestResources does not read yet", "swf": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "textract": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "timestream-influxdb": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "transcribe": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "transfer": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "translate": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "verifiedpermissions": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint", "wafv2": "not read yet: a later batch, with the tests that show its ARNs are the ones its handlers mint"},
"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", "cloudfront-keyvaluestore", "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", "ec2-instance-connect", "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", "payment-cryptography", "payments", "pca-connector-ad", "pca-connector-scep", "pcs", "personalize", "pi", "polly", "private-networks", "profile", "proton", "purchase-orders", "q", "qapps", "qbusiness", "qdeveloper", "qldb", "quicksight", "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", "signer", "simspaceweaver", "sms-voice", "snow-device-management", "social-messaging", "sqlworkbench", "ssm-contacts", "ssm-incidents", "ssm-quicksetup", "ssm-sap", "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", "xray"],
- "arnFormats": {"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}"}, "codepipeline": {"action": "arn:${Partition}:codepipeline:${Region}:${Account}:${PipelineName}/${StageName}/${ActionName}", "actiontype": "arn:${Partition}:codepipeline:${Region}:${Account}:actiontype:${Owner}/${Category}/${Provider}/${Version}", "pipeline": "arn:${Partition}:codepipeline:${Region}:${Account}:${PipelineName}", "stage": "arn:${Partition}:codepipeline:${Region}:${Account}:${PipelineName}/${StageName}", "webhook": "arn:${Partition}:codepipeline:${Region}:${Account}:webhook:${WebhookName}"}, "cognito-identity": {"identitypool": "arn:${Partition}:cognito-identity:${Region}:${Account}:identitypool/${IdentityPoolId}"}, "cognito-idp": {"userpool": "arn:${Partition}:cognito-idp:${Region}:${Account}:userpool/${UserPoolId}", "webacl": "arn:${Partition}:wafv2:${Region}:${Account}:${Scope}/webacl/${Name}/${Id}"}, "ecr": {"repository": "arn:${Partition}:ecr:${Region}:${Account}:repository/${RepositoryName}"}, "elasticloadbalancing": {"listener-rule/app": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener-rule/app/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}/${ListenerRuleId}", "listener-rule/net": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener-rule/net/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}/${ListenerRuleId}", "listener/app": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener/app/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}", "listener/gwy": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener/gwy/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}", "listener/net": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener/net/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}", "loadbalancer": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/${LoadBalancerName}", "loadbalancer/app/": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/app/${LoadBalancerName}/${LoadBalancerId}", "loadbalancer/gwy/": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/gwy/${LoadBalancerName}/${LoadBalancerId}", "loadbalancer/net/": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/net/${LoadBalancerName}/${LoadBalancerId}", "targetgroup": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:targetgroup/${TargetGroupName}/${TargetGroupId}", "truststore": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:truststore/${TrustStoreName}/${TrustStoreId}"}, "events": {"alias": "arn:${Partition}:kms:${Region}:${Account}:alias/${Alias}", "api-destination": "arn:${Partition}:events:${Region}:${Account}:api-destination/${ApiDestinationName}", "archive": "arn:${Partition}:events:${Region}:${Account}:archive/${ArchiveName}", "connection": "arn:${Partition}:events:${Region}:${Account}:connection/${ConnectionName}", "create-snapshot": "arn:${Partition}:events:${Region}:${Account}:target/create-snapshot", "endpoint": "arn:${Partition}:events:${Region}:${Account}:endpoint/${EndpointName}", "event-bus": "arn:${Partition}:events:${Region}:${Account}:event-bus/${EventBusName}", "event-busv2": "arn:${Partition}:events:${Region}:${Account}:event-busv2/${EventBusName}/${OpaqueId}", "event-source": "arn:${Partition}:events:${Region}::event-source/${EventSourceName}", "event-sourcev2": "arn:${Partition}:events:${Region}:${Account}:event-sourcev2/${SourceType}/${EventSourceName}/${OpaqueId}", "key": "arn:${Partition}:kms:${Region}:${Account}:key/${KeyId}", "reboot-instance": "arn:${Partition}:events:${Region}:${Account}:target/reboot-instance", "replay": "arn:${Partition}:events:${Region}:${Account}:replay/${ReplayName}", "rule-on-custom-event-bus": "arn:${Partition}:events:${Region}:${Account}:rule/${EventBusName}/${RuleName}", "rule-on-default-event-bus": "arn:${Partition}:events:${Region}:${Account}:rule/${RuleName}", "stop-instance": "arn:${Partition}:events:${Region}:${Account}:target/stop-instance", "subscriber": "arn:${Partition}:events:${Region}:${Account}:subscriber/${SubscriberName}/${OpaqueId}", "terminate-instance": "arn:${Partition}:events:${Region}:${Account}:target/terminate-instance"}, "firehose": {"deliverystream": "arn:${Partition}:firehose:${Region}:${Account}:deliverystream/${DeliveryStreamName}"}, "servicediscovery": {"namespace": "arn:${Partition}:servicediscovery:${Region}:${Account}:namespace/${NamespaceId}", "service": "arn:${Partition}:servicediscovery:${Region}:${Account}:service/${ServiceId}"}, "states": {"activity": "arn:${Partition}:states:${Region}:${Account}:activity:${ActivityName}", "execution": "arn:${Partition}:states:${Region}:${Account}:execution:${StateMachineName}:${ExecutionId}", "express": "arn:${Partition}:states:${Region}:${Account}:express:${StateMachineName}:${ExecutionId}:${ExpressId}", "labelled execution": "arn:${Partition}:states:${Region}:${Account}:execution:${StateMachineName}/${MapRunLabel}:${ExecutionId}", "labelled express": "arn:${Partition}:states:${Region}:${Account}:express:${StateMachineName}/${MapRunLabel}:${ExecutionId}:${ExpressId}", "maprun": "arn:${Partition}:states:${Region}:${Account}:mapRun:${StateMachineName}/${MapRunLabel}:${MapRunId}", "statemachine": "arn:${Partition}:states:${Region}:${Account}:stateMachine:${StateMachineName}", "statemachinealias": "arn:${Partition}:states:${Region}:${Account}:stateMachine:${StateMachineName}:${StateMachineAliasName}", "statemachineversion": "arn:${Partition}:states:${Region}:${Account}:stateMachine:${StateMachineName}:${StateMachineVersionId}"}},
+ "arnFormats": {"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}"}, "codebuild": {"build": "arn:${Partition}:codebuild:${Region}:${Account}:build/${BuildId}", "build-batch": "arn:${Partition}:codebuild:${Region}:${Account}:build-batch/${BuildBatchId}", "fleet": "arn:${Partition}:codebuild:${Region}:${Account}:fleet/${FleetName}:${FleetId}", "project": "arn:${Partition}:codebuild:${Region}:${Account}:project/${ProjectName}", "report": "arn:${Partition}:codebuild:${Region}:${Account}:report/${ReportGroupName}:${ReportId}", "report-group": "arn:${Partition}:codebuild:${Region}:${Account}:report-group/${ReportGroupName}", "sandbox": "arn:${Partition}:codebuild:${Region}:${Account}:sandbox/${SandboxId}"}, "codepipeline": {"action": "arn:${Partition}:codepipeline:${Region}:${Account}:${PipelineName}/${StageName}/${ActionName}", "actiontype": "arn:${Partition}:codepipeline:${Region}:${Account}:actiontype:${Owner}/${Category}/${Provider}/${Version}", "pipeline": "arn:${Partition}:codepipeline:${Region}:${Account}:${PipelineName}", "stage": "arn:${Partition}:codepipeline:${Region}:${Account}:${PipelineName}/${StageName}", "webhook": "arn:${Partition}:codepipeline:${Region}:${Account}:webhook:${WebhookName}"}, "cognito-identity": {"identitypool": "arn:${Partition}:cognito-identity:${Region}:${Account}:identitypool/${IdentityPoolId}"}, "cognito-idp": {"userpool": "arn:${Partition}:cognito-idp:${Region}:${Account}:userpool/${UserPoolId}", "webacl": "arn:${Partition}:wafv2:${Region}:${Account}:${Scope}/webacl/${Name}/${Id}"}, "ecr": {"repository": "arn:${Partition}:ecr:${Region}:${Account}:repository/${RepositoryName}"}, "elasticloadbalancing": {"listener-rule/app": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener-rule/app/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}/${ListenerRuleId}", "listener-rule/net": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener-rule/net/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}/${ListenerRuleId}", "listener/app": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener/app/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}", "listener/gwy": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener/gwy/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}", "listener/net": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:listener/net/${LoadBalancerName}/${LoadBalancerId}/${ListenerId}", "loadbalancer": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/${LoadBalancerName}", "loadbalancer/app/": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/app/${LoadBalancerName}/${LoadBalancerId}", "loadbalancer/gwy/": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/gwy/${LoadBalancerName}/${LoadBalancerId}", "loadbalancer/net/": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:loadbalancer/net/${LoadBalancerName}/${LoadBalancerId}", "targetgroup": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:targetgroup/${TargetGroupName}/${TargetGroupId}", "truststore": "arn:${Partition}:elasticloadbalancing:${Region}:${Account}:truststore/${TrustStoreName}/${TrustStoreId}"}, "events": {"alias": "arn:${Partition}:kms:${Region}:${Account}:alias/${Alias}", "api-destination": "arn:${Partition}:events:${Region}:${Account}:api-destination/${ApiDestinationName}", "archive": "arn:${Partition}:events:${Region}:${Account}:archive/${ArchiveName}", "connection": "arn:${Partition}:events:${Region}:${Account}:connection/${ConnectionName}", "create-snapshot": "arn:${Partition}:events:${Region}:${Account}:target/create-snapshot", "endpoint": "arn:${Partition}:events:${Region}:${Account}:endpoint/${EndpointName}", "event-bus": "arn:${Partition}:events:${Region}:${Account}:event-bus/${EventBusName}", "event-busv2": "arn:${Partition}:events:${Region}:${Account}:event-busv2/${EventBusName}/${OpaqueId}", "event-source": "arn:${Partition}:events:${Region}::event-source/${EventSourceName}", "event-sourcev2": "arn:${Partition}:events:${Region}:${Account}:event-sourcev2/${SourceType}/${EventSourceName}/${OpaqueId}", "key": "arn:${Partition}:kms:${Region}:${Account}:key/${KeyId}", "reboot-instance": "arn:${Partition}:events:${Region}:${Account}:target/reboot-instance", "replay": "arn:${Partition}:events:${Region}:${Account}:replay/${ReplayName}", "rule-on-custom-event-bus": "arn:${Partition}:events:${Region}:${Account}:rule/${EventBusName}/${RuleName}", "rule-on-default-event-bus": "arn:${Partition}:events:${Region}:${Account}:rule/${RuleName}", "stop-instance": "arn:${Partition}:events:${Region}:${Account}:target/stop-instance", "subscriber": "arn:${Partition}:events:${Region}:${Account}:subscriber/${SubscriberName}/${OpaqueId}", "terminate-instance": "arn:${Partition}:events:${Region}:${Account}:target/terminate-instance"}, "firehose": {"deliverystream": "arn:${Partition}:firehose:${Region}:${Account}:deliverystream/${DeliveryStreamName}"}, "kinesisanalytics": {"application": "arn:${Partition}:kinesisanalytics:${Region}:${Account}:application/${ApplicationName}"}, "servicediscovery": {"namespace": "arn:${Partition}:servicediscovery:${Region}:${Account}:namespace/${NamespaceId}", "service": "arn:${Partition}:servicediscovery:${Region}:${Account}:service/${ServiceId}"}, "states": {"activity": "arn:${Partition}:states:${Region}:${Account}:activity:${ActivityName}", "execution": "arn:${Partition}:states:${Region}:${Account}:execution:${StateMachineName}:${ExecutionId}", "express": "arn:${Partition}:states:${Region}:${Account}:express:${StateMachineName}:${ExecutionId}:${ExpressId}", "labelled execution": "arn:${Partition}:states:${Region}:${Account}:execution:${StateMachineName}/${MapRunLabel}:${ExecutionId}", "labelled express": "arn:${Partition}:states:${Region}:${Account}:express:${StateMachineName}/${MapRunLabel}:${ExecutionId}:${ExpressId}", "maprun": "arn:${Partition}:states:${Region}:${Account}:mapRun:${StateMachineName}/${MapRunLabel}:${MapRunId}", "statemachine": "arn:${Partition}:states:${Region}:${Account}:stateMachine:${StateMachineName}", "statemachinealias": "arn:${Partition}:states:${Region}:${Account}:stateMachine:${StateMachineName}:${StateMachineAliasName}", "statemachineversion": "arn:${Partition}:states:${Region}:${Account}:stateMachine:${StateMachineName}:${StateMachineVersionId}"}},
"unqualified": {"states": ["statemachine"]},
"mintedIds": {"events": ["api-destination", "connection"]},
"operations": {
@@ -49,6 +49,65 @@
"acm:UpdateAcmeDomainValidation": {"action": "acm:UpdateAcmeDomainValidation", "types": ["acme-domain-validation"], "resources": [{"types": ["acme-domain-validation"], "arn": "AcmeDomainValidationArn"}]},
"acm:UpdateAcmeEndpoint": {"action": "acm:UpdateAcmeEndpoint", "types": ["acme-endpoint"], "resources": [{"types": ["acme-endpoint"], "arn": "AcmeEndpointArn"}]},
"acm:UpdateCertificateOptions": {"action": "acm:UpdateCertificateOptions", "types": ["certificate"], "resources": [{"types": ["certificate"], "arn": "CertificateArn"}]},
+ "codebuild:BatchDeleteBuilds": {"action": "codebuild:BatchDeleteBuilds", "types": ["project"], "resources": [{"type": "project", "fill": {"ProjectName": "ids[]"}, "before": ":"}]},
+ "codebuild:BatchGetBuildBatches": {"action": "codebuild:BatchGetBuildBatches", "types": ["project"], "resources": []},
+ "codebuild:BatchGetBuilds": {"action": "codebuild:BatchGetBuilds", "types": ["project"], "resources": [{"type": "project", "fill": {"ProjectName": "ids[]"}, "before": ":"}]},
+ "codebuild:BatchGetCommandExecutions": {"action": "codebuild:BatchGetCommandExecutions", "types": ["sandbox"], "resources": [{"type": "sandbox", "fill": {"SandboxId": "sandboxId"}}]},
+ "codebuild:BatchGetFleets": {"action": "codebuild:BatchGetFleets", "types": ["fleet"], "resources": [{"type": "fleet", "fill": {"FleetName": "names[]"}}]},
+ "codebuild:BatchGetProjects": {"action": "codebuild:BatchGetProjects", "types": ["project"], "resources": [{"type": "project", "fill": {"ProjectName": "names[]"}}]},
+ "codebuild:BatchGetReportGroups": {"action": "codebuild:BatchGetReportGroups", "types": ["report-group"], "resources": [{"types": ["report-group"], "arn": "reportGroupArns[]"}]},
+ "codebuild:BatchGetReports": {"action": "codebuild:BatchGetReports", "types": ["report-group"], "resources": [{"types": ["report-group"], "arn": "reportArns[]"}]},
+ "codebuild:BatchGetSandboxes": {"action": "codebuild:BatchGetSandboxes", "types": ["project"], "resources": []},
+ "codebuild:CreateFleet": {"action": "codebuild:CreateFleet", "types": ["fleet"], "resources": [{"type": "fleet", "fill": {"FleetName": "name"}}]},
+ "codebuild:CreateProject": {"action": "codebuild:CreateProject", "types": ["project"], "resources": [{"type": "project", "fill": {"ProjectName": "name"}}]},
+ "codebuild:CreateReportGroup": {"action": "codebuild:CreateReportGroup", "types": ["report-group"], "resources": [{"type": "report-group", "fill": {"ReportGroupName": "name"}}]},
+ "codebuild:CreateWebhook": {"action": "codebuild:CreateWebhook", "types": ["project"], "resources": [{"type": "project", "fill": {"ProjectName": "projectName"}}]},
+ "codebuild:DeleteBuildBatch": {"action": "codebuild:DeleteBuildBatch", "types": ["project"], "resources": []},
+ "codebuild:DeleteFleet": {"action": "codebuild:DeleteFleet", "types": ["fleet"], "resources": [{"types": ["fleet"], "arn": "arn"}]},
+ "codebuild:DeleteProject": {"action": "codebuild:DeleteProject", "types": ["project"], "resources": [{"type": "project", "fill": {"ProjectName": "name"}}]},
+ "codebuild:DeleteReport": {"action": "codebuild:DeleteReport", "types": ["report-group"], "resources": [{"types": ["report-group"], "arn": "arn"}]},
+ "codebuild:DeleteReportGroup": {"action": "codebuild:DeleteReportGroup", "types": ["report-group"], "resources": [{"types": ["report-group"], "arn": "arn"}]},
+ "codebuild:DeleteResourcePolicy": {"action": "codebuild:DeleteResourcePolicy", "types": ["project", "report-group"], "resources": [{"types": ["project", "report-group"], "arn": "resourceArn"}]},
+ "codebuild:DeleteSourceCredentials": {"action": "codebuild:DeleteSourceCredentials", "types": [], "resources": []},
+ "codebuild:DeleteWebhook": {"action": "codebuild:DeleteWebhook", "types": ["project"], "resources": [{"type": "project", "fill": {"ProjectName": "projectName"}}]},
+ "codebuild:DescribeCodeCoverages": {"action": "codebuild:DescribeCodeCoverages", "types": ["report-group"], "resources": [{"types": ["report-group"], "arn": "reportArn"}]},
+ "codebuild:DescribeTestCases": {"action": "codebuild:DescribeTestCases", "types": ["report-group"], "resources": [{"types": ["report-group"], "arn": "reportArn"}]},
+ "codebuild:GetReportGroupTrend": {"action": "codebuild:GetReportGroupTrend", "types": ["report-group"], "resources": [{"types": ["report-group"], "arn": "reportGroupArn"}]},
+ "codebuild:GetResourcePolicy": {"action": "codebuild:GetResourcePolicy", "types": ["project", "report-group"], "resources": [{"types": ["project", "report-group"], "arn": "resourceArn"}]},
+ "codebuild:ImportSourceCredentials": {"action": "codebuild:ImportSourceCredentials", "types": [], "resources": []},
+ "codebuild:InvalidateProjectCache": {"action": "codebuild:InvalidateProjectCache", "types": ["project"], "resources": [{"type": "project", "fill": {"ProjectName": "projectName"}}]},
+ "codebuild:ListBuildBatches": {"action": "codebuild:ListBuildBatches", "types": [], "resources": []},
+ "codebuild:ListBuildBatchesForProject": {"action": "codebuild:ListBuildBatchesForProject", "types": ["project"], "resources": [{"type": "project", "fill": {"ProjectName": "projectName"}}]},
+ "codebuild:ListBuilds": {"action": "codebuild:ListBuilds", "types": [], "resources": []},
+ "codebuild:ListBuildsForProject": {"action": "codebuild:ListBuildsForProject", "types": ["project"], "resources": [{"type": "project", "fill": {"ProjectName": "projectName"}}]},
+ "codebuild:ListCommandExecutionsForSandbox": {"action": "codebuild:ListCommandExecutionsForSandbox", "types": ["sandbox"], "resources": [{"type": "sandbox", "fill": {"SandboxId": "sandboxId"}}]},
+ "codebuild:ListCuratedEnvironmentImages": {"action": "codebuild:ListCuratedEnvironmentImages", "types": [], "resources": []},
+ "codebuild:ListFleets": {"action": "codebuild:ListFleets", "types": [], "resources": []},
+ "codebuild:ListProjects": {"action": "codebuild:ListProjects", "types": [], "resources": []},
+ "codebuild:ListReportGroups": {"action": "codebuild:ListReportGroups", "types": [], "resources": []},
+ "codebuild:ListReports": {"action": "codebuild:ListReports", "types": [], "resources": []},
+ "codebuild:ListReportsForReportGroup": {"action": "codebuild:ListReportsForReportGroup", "types": ["report-group"], "resources": [{"types": ["report-group"], "arn": "reportGroupArn"}]},
+ "codebuild:ListSandboxes": {"action": "codebuild:ListSandboxes", "types": [], "resources": []},
+ "codebuild:ListSandboxesForProject": {"action": "codebuild:ListSandboxesForProject", "types": ["project"], "resources": [{"type": "project", "fill": {"ProjectName": "projectName"}}]},
+ "codebuild:ListSharedProjects": {"action": "codebuild:ListSharedProjects", "types": [], "resources": []},
+ "codebuild:ListSharedReportGroups": {"action": "codebuild:ListSharedReportGroups", "types": [], "resources": []},
+ "codebuild:ListSourceCredentials": {"action": "codebuild:ListSourceCredentials", "types": [], "resources": []},
+ "codebuild:PutResourcePolicy": {"action": "codebuild:PutResourcePolicy", "types": ["project", "report-group"], "resources": [{"types": ["project", "report-group"], "arn": "resourceArn"}]},
+ "codebuild:RetryBuild": {"action": "codebuild:RetryBuild", "types": ["project"], "resources": [{"type": "project", "fill": {"ProjectName": "id"}, "before": ":"}]},
+ "codebuild:RetryBuildBatch": {"action": "codebuild:RetryBuildBatch", "types": ["project"], "resources": []},
+ "codebuild:StartBuild": {"action": "codebuild:StartBuild", "types": ["project"], "resources": [{"types": ["project"], "arn": "fleetOverride.fleetArn"}, {"type": "project", "fill": {"ProjectName": "projectName"}}]},
+ "codebuild:StartBuildBatch": {"action": "codebuild:StartBuildBatch", "types": ["project"], "resources": [{"type": "project", "fill": {"ProjectName": "projectName"}}]},
+ "codebuild:StartCommandExecution": {"action": "codebuild:StartCommandExecution", "types": ["sandbox"], "resources": [{"type": "sandbox", "fill": {"SandboxId": "sandboxId"}}]},
+ "codebuild:StartSandbox": {"action": "codebuild:StartSandbox", "types": ["project"], "resources": [{"type": "project", "fill": {"ProjectName": "projectName"}}]},
+ "codebuild:StartSandboxConnection": {"action": "codebuild:StartSandboxConnection", "types": ["sandbox"], "resources": [{"type": "sandbox", "fill": {"SandboxId": "sandboxId"}}]},
+ "codebuild:StopBuild": {"action": "codebuild:StopBuild", "types": ["project"], "resources": [{"type": "project", "fill": {"ProjectName": "id"}, "before": ":"}]},
+ "codebuild:StopBuildBatch": {"action": "codebuild:StopBuildBatch", "types": ["project"], "resources": []},
+ "codebuild:StopSandbox": {"action": "codebuild:StopSandbox", "types": ["project"], "resources": []},
+ "codebuild:UpdateFleet": {"action": "codebuild:UpdateFleet", "types": ["fleet"], "resources": [{"types": ["fleet"], "arn": "arn"}]},
+ "codebuild:UpdateProject": {"action": "codebuild:UpdateProject", "types": ["project"], "resources": [{"type": "project", "fill": {"ProjectName": "name"}}]},
+ "codebuild:UpdateProjectVisibility": {"action": "codebuild:UpdateProjectVisibility", "types": ["project"], "resources": [{"types": ["project"], "arn": "projectArn"}]},
+ "codebuild:UpdateReportGroup": {"action": "codebuild:UpdateReportGroup", "types": ["report-group"], "resources": [{"types": ["report-group"], "arn": "arn"}]},
+ "codebuild:UpdateWebhook": {"action": "codebuild:UpdateWebhook", "types": ["project"], "resources": [{"type": "project", "fill": {"ProjectName": "projectName"}}]},
"codepipeline:AcknowledgeJob": {"action": "codepipeline:AcknowledgeJob", "types": [], "resources": []},
"codepipeline:AcknowledgeThirdPartyJob": {"action": "codepipeline:AcknowledgeThirdPartyJob", "types": [], "resources": []},
"codepipeline:CreateCustomActionType": {"action": "codepipeline:CreateCustomActionType", "types": ["actiontype"], "resources": [{"type": "actiontype", "fill": {"Category": "category", "Provider": "provider", "Version": "version"}, "fixed": {"Owner": "Custom"}}]},
@@ -464,6 +523,39 @@
"firehose:TagDeliveryStream": {"action": "firehose:TagDeliveryStream", "types": ["deliverystream"], "resources": [{"type": "deliverystream", "fill": {"DeliveryStreamName": "DeliveryStreamName"}}]},
"firehose:UntagDeliveryStream": {"action": "firehose:UntagDeliveryStream", "types": ["deliverystream"], "resources": [{"type": "deliverystream", "fill": {"DeliveryStreamName": "DeliveryStreamName"}}]},
"firehose:UpdateDestination": {"action": "firehose:UpdateDestination", "types": ["deliverystream"], "resources": [{"types": ["deliverystream"], "arn": "AmazonOpenSearchServerlessDestinationUpdate.RoleARN"}, {"types": ["deliverystream"], "arn": "AmazonopensearchserviceDestinationUpdate.DomainARN"}, {"types": ["deliverystream"], "arn": "AmazonopensearchserviceDestinationUpdate.RoleARN"}, {"types": ["deliverystream"], "arn": "ElasticsearchDestinationUpdate.DomainARN"}, {"types": ["deliverystream"], "arn": "ElasticsearchDestinationUpdate.RoleARN"}, {"types": ["deliverystream"], "arn": "ExtendedS3DestinationUpdate.BucketARN"}, {"types": ["deliverystream"], "arn": "ExtendedS3DestinationUpdate.RoleARN"}, {"types": ["deliverystream"], "arn": "HttpEndpointDestinationUpdate.RoleARN"}, {"types": ["deliverystream"], "arn": "IcebergDestinationUpdate.RoleARN"}, {"types": ["deliverystream"], "arn": "RedshiftDestinationUpdate.RoleARN"}, {"types": ["deliverystream"], "arn": "S3DestinationUpdate.BucketARN"}, {"types": ["deliverystream"], "arn": "S3DestinationUpdate.RoleARN"}, {"types": ["deliverystream"], "arn": "SnowflakeDestinationUpdate.RoleARN"}, {"type": "deliverystream", "fill": {"DeliveryStreamName": "DeliveryStreamName"}}]},
+ "kinesisanalytics:AddApplicationCloudWatchLoggingOption": {"action": "kinesisanalytics:AddApplicationCloudWatchLoggingOption", "types": ["application"], "resources": [{"types": ["application"], "arn": "CloudWatchLoggingOption.LogStreamARN"}, {"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:AddApplicationInput": {"action": "kinesisanalytics:AddApplicationInput", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:AddApplicationInputProcessingConfiguration": {"action": "kinesisanalytics:AddApplicationInputProcessingConfiguration", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:AddApplicationOutput": {"action": "kinesisanalytics:AddApplicationOutput", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:AddApplicationReferenceDataSource": {"action": "kinesisanalytics:AddApplicationReferenceDataSource", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:AddApplicationVpcConfiguration": {"action": "kinesisanalytics:AddApplicationVpcConfiguration", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:CreateApplication": {"action": "kinesisanalytics:CreateApplication", "types": [], "resources": []},
+ "kinesisanalytics:CreateApplicationPresignedUrl": {"action": "kinesisanalytics:CreateApplicationPresignedUrl", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:CreateApplicationSnapshot": {"action": "kinesisanalytics:CreateApplicationSnapshot", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:DeleteApplication": {"action": "kinesisanalytics:DeleteApplication", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:DeleteApplicationCloudWatchLoggingOption": {"action": "kinesisanalytics:DeleteApplicationCloudWatchLoggingOption", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:DeleteApplicationInputProcessingConfiguration": {"action": "kinesisanalytics:DeleteApplicationInputProcessingConfiguration", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:DeleteApplicationOutput": {"action": "kinesisanalytics:DeleteApplicationOutput", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:DeleteApplicationReferenceDataSource": {"action": "kinesisanalytics:DeleteApplicationReferenceDataSource", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:DeleteApplicationSnapshot": {"action": "kinesisanalytics:DeleteApplicationSnapshot", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:DeleteApplicationVpcConfiguration": {"action": "kinesisanalytics:DeleteApplicationVpcConfiguration", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:DescribeApplication": {"action": "kinesisanalytics:DescribeApplication", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:DescribeApplicationOperation": {"action": "kinesisanalytics:DescribeApplicationOperation", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:DescribeApplicationSnapshot": {"action": "kinesisanalytics:DescribeApplicationSnapshot", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:DescribeApplicationVersion": {"action": "kinesisanalytics:DescribeApplicationVersion", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:DiscoverInputSchema": {"action": "kinesisanalytics:DiscoverInputSchema", "types": [], "resources": []},
+ "kinesisanalytics:ListApplicationOperations": {"action": "kinesisanalytics:ListApplicationOperations", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:ListApplicationSnapshots": {"action": "kinesisanalytics:ListApplicationSnapshots", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:ListApplicationVersions": {"action": "kinesisanalytics:ListApplicationVersions", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:ListApplications": {"action": "kinesisanalytics:ListApplications", "types": [], "resources": []},
+ "kinesisanalytics:ListTagsForResource": {"action": "kinesisanalytics:ListTagsForResource", "types": ["application"], "resources": [{"types": ["application"], "arn": "ResourceARN"}]},
+ "kinesisanalytics:RollbackApplication": {"action": "kinesisanalytics:RollbackApplication", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:StartApplication": {"action": "kinesisanalytics:StartApplication", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:StopApplication": {"action": "kinesisanalytics:StopApplication", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:TagResource": {"action": "kinesisanalytics:TagResource", "types": ["application"], "resources": [{"types": ["application"], "arn": "ResourceARN"}]},
+ "kinesisanalytics:UntagResource": {"action": "kinesisanalytics:UntagResource", "types": ["application"], "resources": [{"types": ["application"], "arn": "ResourceARN"}]},
+ "kinesisanalytics:UpdateApplication": {"action": "kinesisanalytics:UpdateApplication", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
+ "kinesisanalytics:UpdateApplicationMaintenanceConfiguration": {"action": "kinesisanalytics:UpdateApplicationMaintenanceConfiguration", "types": ["application"], "resources": [{"type": "application", "fill": {"ApplicationName": "ApplicationName"}}]},
"servicediscovery:CreateHttpNamespace": {"action": "servicediscovery:CreateHttpNamespace", "types": [], "resources": []},
"servicediscovery:CreatePrivateDnsNamespace": {"action": "servicediscovery:CreatePrivateDnsNamespace", "types": [], "resources": []},
"servicediscovery:CreatePublicDnsNamespace": {"action": "servicediscovery:CreatePublicDnsNamespace", "types": [], "resources": []},
diff --git a/src/test/java/io/github/hectorvent/floci/core/common/RequestResourceMembersTest.java b/src/test/java/io/github/hectorvent/floci/core/common/RequestResourceMembersTest.java
index 67cdc02067..a1f9678206 100644
--- a/src/test/java/io/github/hectorvent/floci/core/common/RequestResourceMembersTest.java
+++ b/src/test/java/io/github/hectorvent/floci/core/common/RequestResourceMembersTest.java
@@ -150,9 +150,14 @@ class RequestResourceMembersTest {
assertEquals(List.of(new Resource(List.of("thing"), new Member("A", true, new Member("ThingArns", true)), Map.of(),
Map.of(), Map.of(), Map.of(), Map.of(), null, null, Map.of(), false)), parseUnchecked(document(formats, "{\"types\":[\"thing\"],\"arn\":\"A[].ThingArns[]\"}"))
.operations().get("a:Op"));
- // An ARN read before more than one character.
+ // A member read before more than one character, holding an ARN or filling a variable.
assertThrows(IllegalStateException.class, () -> parse(document(formats,
"{\"types\":[\"thing\"],\"arn\":\"ThingArn\",\"before\":\"##\"}")));
+ assertThrows(IllegalStateException.class, () -> parse(document(formats,
+ "{\"type\":\"thing\",\"fill\":{\"ThingName\":\"Id\"},\"before\":\"##\"}")));
+ // A member filling a variable read up to a character, as a CodeBuild build id names its project.
+ assertEquals(":", parseUnchecked(document(formats, "{\"type\":\"thing\",\"fill\":{\"ThingName\":\"Id\"},"
+ + "\"before\":\":\"}")).operations().get("a:Op").getFirst().before());
// An account from a list, or for a type whose format has no account.
assertThrows(IllegalStateException.class, () -> parse(document(formats,
"{\"type\":\"thing\",\"fill\":{\"ThingName\":\"Name\"},\"account\":\"Ids[]\"}")));
diff --git a/src/test/java/io/github/hectorvent/floci/core/common/RequestResourcesTest.java b/src/test/java/io/github/hectorvent/floci/core/common/RequestResourcesTest.java
index 597207b26d..3cd999e2db 100644
--- a/src/test/java/io/github/hectorvent/floci/core/common/RequestResourcesTest.java
+++ b/src/test/java/io/github/hectorvent/floci/core/common/RequestResourcesTest.java
@@ -418,6 +418,26 @@ class RequestResourcesTest {
json("{\"Name\":\"s\",\"NamespaceId\":\"ns-a\"}")));
}
+ /** A CodeBuild build is checked on its project, which its id names before its {@code :}. */
+ @Test
+ void aBuildIsCheckedOnItsProject() {
+ String project = "arn:aws:codebuild:us-east-1:000000000000:project/";
+ assertEquals(List.of(project + "a"), of("codebuild:StopBuild", json("{\"id\":\"a:1\"}")));
+ assertEquals(List.of(project + "a", project + "b"), of("codebuild:BatchGetBuilds",
+ json("{\"ids\":[\"a:1\",\"b:2\",\"a:3\"]}")));
+ assertEquals(List.of(project + "a"), of("codebuild:RetryBuild", form("Action=RetryBuild&id=a:1")));
+ }
+
+ /** A list taking a name or an ARN for each value names each value's resource, whichever it gives. */
+ @Test
+ void aListMixingNamesAndArnsNamesEachValuesResource() {
+ String project = "arn:aws:codebuild:us-east-1:000000000000:project/";
+ assertEquals(List.of(project + "b", project + "a"), of("codebuild:BatchGetProjects",
+ json("{\"names\":[\"a\",\"" + project + "b\"]}")));
+ assertEquals(List.of(project + "a", project + "b"), of("codebuild:BatchGetProjects",
+ json("{\"names\":[\"" + project + "a\",\"" + project + "b\"]}")));
+ }
+
@Test
void aRequestNamingNoResourceOrOfANamespaceTheTableDoesNotReadIsCheckedOnStar() {
assertEquals(List.of(), of("ecr:DescribeRepositories", json("{}")));
diff --git a/src/test/java/io/github/hectorvent/floci/services/iam/IamRequestResourceEnforcementIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/iam/IamRequestResourceEnforcementIntegrationTest.java
index 088cfae9d1..8c8b883920 100644
--- a/src/test/java/io/github/hectorvent/floci/services/iam/IamRequestResourceEnforcementIntegrationTest.java
+++ b/src/test/java/io/github/hectorvent/floci/services/iam/IamRequestResourceEnforcementIntegrationTest.java
@@ -10,6 +10,7 @@ import io.github.hectorvent.floci.testing.RestAssuredJsonUtils;
import io.quarkus.test.common.http.TestHTTPResource;
import io.quarkus.test.junit.QuarkusTest;
import io.quarkus.test.junit.TestProfile;
+import io.restassured.path.json.config.JsonPathConfig;
import io.restassured.response.ValidatableResponse;
import io.restassured.specification.RequestSpecification;
import org.junit.jupiter.api.BeforeAll;
@@ -724,6 +725,66 @@ class IamRequestResourceEnforcementIntegrationTest {
return id;
}
+ /**
+ * A build is checked on its project, which its id names before its {@code :}, as CodeBuild authorizes builds,
+ * and a project on the ARN its name gives, a list naming it by name and by ARN alike.
+ */
+ @Test
+ void aBuildIsCheckedOnTheProjectItsIdNames() {
+ String project = "res-project-" + suffix();
+ String arn = adminJson("codebuild", "CodeBuild_20161006.CreateProject").body("{\"name\":\"" + project
+ + "\",\"source\":{\"type\":\"NO_SOURCE\",\"buildspec\":\"version: 0.2\"},\"artifacts\":{\"type\":"
+ + "\"NO_ARTIFACTS\"},\"environment\":{\"type\":\"LINUX_CONTAINER\",\"image\":\"aws/codebuild/standard:7.0\","
+ + "\"computeType\":\"BUILD_GENERAL1_SMALL\"},\"serviceRole\":\"arn:aws:iam::" + ACCOUNT
+ + ":role/codebuild-role\"}").post("/").then().statusCode(200).extract().path("project.arn");
+ cleanup.register(() -> adminJson("codebuild", "CodeBuild_20161006.DeleteProject")
+ .body("{\"name\":\"" + project + "\"}").post("/"));
+ assertEquals("arn:aws:codebuild:" + REGION + ":" + ACCOUNT + ":project/" + project, arn);
+
+ User user = user("res-build");
+ user.policy(allowOn("codebuild:BatchGetProjects", arn) + "," + allowOn("codebuild:BatchGetBuilds", arn) + ","
+ + allowOn("codebuild:StopBuild", arn));
+ codeBuild(user, "BatchGetProjects", "{\"names\":[\"" + project + "\"]}").statusCode(200);
+ codeBuild(user, "BatchGetProjects", "{\"names\":[\"" + project + "\",\"" + arn + "\"]}").statusCode(200);
+ codeBuild(user, "BatchGetBuilds", "{\"ids\":[\"" + project + ":1\"]}").statusCode(200);
+ refusedJson(codeBuild(user, "BatchGetBuilds", "{\"ids\":[\"" + project + ":1\",\"" + project + "-other:1\"]}"),
+ "codebuild:BatchGetBuilds");
+ codeBuild(user, "StopBuild", "{\"id\":\"" + project + ":1\"}").statusCode(400)
+ .body(containsString("ResourceNotFoundException"));
+ refusedJson(codeBuild(user, "StopBuild", "{\"id\":\"" + project + "-other:1\"}"), "codebuild:StopBuild");
+ }
+
+ /** A Managed Service for Apache Flink application is checked on the ARN its name gives. */
+ @Test
+ void anApplicationIsCheckedOnTheArnItsNameGives() {
+ String name = "res-app-" + suffix();
+ String arn = adminJson("kinesisanalytics", "KinesisAnalytics_20180523.CreateApplication")
+ .body("{\"ApplicationName\":\"" + name + "\",\"RuntimeEnvironment\":\"FLINK-1_18\","
+ + "\"ServiceExecutionRole\":\"arn:aws:iam::" + ACCOUNT + ":role/flink-role\"}")
+ .post("/").then().statusCode(200).extract().path("ApplicationDetail.ApplicationARN");
+ cleanup.register(() -> adminJson("kinesisanalytics", "KinesisAnalytics_20180523.DeleteApplication")
+ .body("{\"ApplicationName\":\"" + name + "\",\"CreateTimestamp\":"
+ + adminJson("kinesisanalytics", "KinesisAnalytics_20180523.DescribeApplication")
+ .body("{\"ApplicationName\":\"" + name + "\"}").post("/").then().statusCode(200).extract()
+ .jsonPath(new JsonPathConfig(JsonPathConfig.NumberReturnType.BIG_DECIMAL))
+ .getString("ApplicationDetail.CreateTimestamp") + "}").post("/"));
+ assertEquals("arn:aws:kinesisanalytics:" + REGION + ":" + ACCOUNT + ":application/" + name, arn);
+
+ User user = user("res-application");
+ user.policy(allowOn("kinesisanalytics:DescribeApplication", arn));
+ describeApplication(user, name).statusCode(200);
+ refusedJson(describeApplication(user, name + "-other"), "kinesisanalytics:DescribeApplication");
+ }
+
+ private static ValidatableResponse codeBuild(User user, String operation, String body) {
+ return user.json("codebuild", "CodeBuild_20161006." + operation, "1.1").body(body).post("/").then();
+ }
+
+ private static ValidatableResponse describeApplication(User user, String name) {
+ return user.json("kinesisanalytics", "KinesisAnalytics_20180523.DescribeApplication", "1.1")
+ .body("{\"ApplicationName\":\"" + name + "\"}").post("/").then();
+ }
+
private static RequestSpecification adminJson(String service, String target) {
return admin(service).header("X-Amz-Target", target).contentType("application/x-amz-json-1.1");
}
diff --git a/tools/aws/regen_iam_request_resources.py b/tools/aws/regen_iam_request_resources.py
index dacd9ae7a5..876b116b28 100644
--- a/tools/aws/regen_iam_request_resources.py
+++ b/tools/aws/regen_iam_request_resources.py
@@ -67,8 +67,10 @@ or not. `HAND_BUILT` are the namespaces `ResourceArnBuilder` builds resources fo
resource there may apply only `when` a member has one of some values (`Type` picks the load balancer
v2 `CreateLoadBalancer` creates), or `unless` it has, a member given a JSON null counting as absent
(Cloud Map's handler then reads `DnsConfig.NamespaceId`), and a member read as a value when it is
-`absent` (an EventBridge request naming no event bus names the default one), a variable may be filled from a field
-of each element of a list of structures, one resource for each element and the `absent` value for an
+`absent` (an EventBridge request naming no event bus names the default one), a member filling a variable may be
+read up to a character `before` (a CodeBuild build id, `<project>:<id>`, names its project), a variable may be
+filled from a field of each element of a list of structures, one resource for each element and the `absent` value
+for an
element lacking it (`PutEvents` publishes each entry to its bus), or from a structure's field (`pipeline.name`),
a variable no member gives may be `fixed` to the one value its handler uses (a CodePipeline custom action
type's owner, `Custom`), and an ARN member's value may be read
@@ -117,8 +119,8 @@ OUTPUT = REPO_ROOT / "src/main/resources/aws/iam-request-resources.json"
# The namespaces read, in batches: each moves here from NOT_COVERED with the tests that show its ARNs
# are the ones its handlers mint.
-NAMESPACES = ("acm", "codepipeline", "cognito-identity", "cognito-idp", "ecr", "elasticloadbalancing", "events",
- "firehose", "servicediscovery", "states")
+NAMESPACES = ("acm", "codebuild", "codepipeline", "cognito-identity", "cognito-idp", "ecr", "elasticloadbalancing",
+ "events", "firehose", "kinesisanalytics", "servicediscovery", "states")
# SDK clients the reference lists for a namespace's operations whose requests Floci does not serve, and why: their
# members are not read.
@@ -126,6 +128,9 @@ CLIENTS_NOT_READ: dict[str, str] = {
"eventbridgev2": "EventBridge V2, the AWSEventsV2 target over Smithy RPC v2 CBOR on the eventsv2 endpoint, which "
"Floci does not serve; its operations share EventBridge's names and name their resources by "
"other members",
+ "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",
}
# The namespaces whose resources ResourceArnBuilder builds itself.
@@ -167,7 +172,6 @@ NOT_COVERED: dict[str, str] = {
"cloudtrail": _LATER,
"cloudwatch": _LATER,
"codeartifact": _REST,
- "codebuild": _LATER,
"codedeploy": _LATER,
"codeguru-reviewer": _REST,
"comprehend": _LATER,
@@ -197,7 +201,6 @@ NOT_COVERED: dict[str, str] = {
"inspector2": _REST,
"iot": _LATER,
"kafka": _REST,
- "kinesisanalytics": _LATER,
"lightsail": _LATER,
"macie2": _REST,
"memorydb": _LATER,
@@ -246,6 +249,12 @@ CORRECTIONS: dict[str, tuple[list[dict], str]] = {
{"type": "loadbalancer/net/", "fill": {"LoadBalancerName": "Name"}, "when": {"Type": ["network"]}},
], "the classic API names its load balancer by LoadBalancerName; the v2 API by Name, its type by Type, "
"an application load balancer when it gives none, which the rule cannot tell apart"),
+ **{f"codebuild:{operation}": ([{"type": "project", "fill": {"ProjectName": member}, "before": ":"}],
+ "a build is checked on its project (the CodeBuild User Guide's permissions reference "
+ "gives each of these the resource project/project-name), which its id names before "
+ "its ':' (CODEBUILD_BUILD_ID, for example codebuild-demo-project:b1e6661e-...)")
+ for operation, member in (("BatchDeleteBuilds", "ids[]"), ("BatchGetBuilds", "ids[]"), ("RetryBuild", "id"),
+ ("StopBuild", "id"))},
**{f"codepipeline:{operation}": ([{"type": "pipeline", "fill": {"PipelineName": "pipeline.name"}}],
"the request names the pipeline by its pipeline structure's name, which the "
"rule does not read inside a structure; its roleArn is the role CodePipeline "
@@ -860,19 +869,20 @@ def validate(document: dict) -> list[str]:
def _resource_problems(operation: str, resource: object, types: set[str], formats: dict[str, str]) -> list[str]:
if not isinstance(resource, dict) or not ({"types", "arn"} <= set(resource) <= {"types", "arn", "before", "made"}
or {"type", "fill"} <= set(resource) <= {"type", "fill", "when", "unless", "absent", "arnOf", "account",
- "fixed", "made"}):
+ "fixed", "made", "before"}):
return [f"{operation} names {resource!r}, which is neither an ARN member nor a type's variables"]
if resource.get("made", True) is not True:
return [f"{operation} marks {resource!r} made by {resource['made']!r}, which is not true"]
+ before = resource.get("before", "#")
+ if not isinstance(before, str) or len(before) != 1:
+ return [f"{operation} reads its members before {before!r}, which is no one character"]
kinds = resource.get("types") or [resource.get("type")]
if not all(isinstance(kind, str) and kind in types and kind in formats for kind in kinds):
return [f"{operation} names {kinds}, not resource types its action acts on with an ARN format"]
if "arn" in resource:
if not isinstance(resource["arn"], str) or not ARN_PATH_RE.match(resource["arn"]):
return [f"{operation} reads an ARN at {resource['arn']!r}, which is no member"]
- before = resource.get("before", "#")
- return [] if isinstance(before, str) and len(before) == 1 else [
- f"{operation} reads its ARN before {before!r}, which is no one character"]
+ return []
fill = resource["fill"]
variables = set(VARIABLE_RE.findall(formats[kinds[0]])) - KNOWN_VARIABLES
if not isinstance(fill, dict) or set(fill) - variables or not all(
diff --git a/tools/aws/test_regen_iam_request_resources.py b/tools/aws/test_regen_iam_request_resources.py
index 49e992786a..6fe6448198 100644
--- a/tools/aws/test_regen_iam_request_resources.py
+++ b/tools/aws/test_regen_iam_request_resources.py
@@ -333,6 +333,8 @@ def test_a_well_formed_document_validates():
document["operations"]["svc:B"]["resources"][0]["absent"] = {"Bus": "default"}
document["operations"]["svc:B"]["resources"][0]["arnOf"] = {"Bus": "thing"}
document["operations"]["svc:A"]["resources"][0]["before"] = "#"
+ # A member filling a variable read up to a character, as a CodeBuild build id names its project before ':'.
+ document["operations"]["svc:B"]["resources"][0]["before"] = ":"
assert r.validate(document) == []
assert r.validate(with_a_create()) == []
# A field of each of a list's structures fills a variable, read as given when absent, or as an ARN.
@@ -385,7 +387,9 @@ def with_a_create() -> dict:
(lambda d: d["operations"]["svc:B"]["resources"][0].update(when={"Types[]": ["a"]}), "no member's values"),
(lambda d: d["operations"]["svc:B"]["resources"][0].update(when={"Type": [1]}), "no member's values"),
(lambda d: d["operations"]["svc:A"]["resources"][0].update(before="##"), "no one character"),
- (lambda d: d["operations"]["svc:B"]["resources"][0].update(before="#"), "neither an ARN member"),
+ (lambda d: d["operations"]["svc:B"]["resources"][0].update(before="##"), "no one character"),
+ (lambda d: d["operations"]["svc:B"]["resources"][0].update(before=":", fill={"GroupName": "Names[]"}) or
+ d["operations"]["svc:B"]["resources"][0].update(before=1), "no one character"),
(lambda d: d["operations"]["svc:B"]["resources"][0].update(account="Ids[]"), "no account of its ARN"),
(lambda d: d["operations"]["svc:B"]["resources"][0].update(account="a.b"), "no account of its ARN"),
(lambda d: d["arnFormats"]["svc"].update(group="arn:${Partition}:svc:::group/${GroupName}")