Light, fluffy, and always free - The AWS Local Emulator alternative
fix(ses): authorize SES v2 calls against their IAM actions under enforcement (#4775)
Priamo Germosen275d874fed88
diff --git a/docs/services/iam.md b/docs/services/iam.mdindex 1b7c17e504..c0ead58572 100644--- a/docs/services/iam.md+++ b/docs/services/iam.md@@ -561,6 +561,11 @@ requests. REST-JSON requests return HTTP 403 `AccessDeniedException`; AWS Queryrequests retain HTTP 403 XML `AccessDenied` responses. The routed protocol determinesthe status, not just the request's content type.+A REST request is authorized as the operation of the route it reached. An `X-Amz-Target` header or+a Query `Action` field on it does not change the action it is checked as, and its path is matched+still percent-encoded, as the router matches it, so an encoded `/` inside a parameter cannot make+the route's rule miss.+### Resource-based policiesWhen `FLOCI_SERVICES_IAM_ENFORCEMENT_ENABLED` is active, Floci also queries registered `ResourcePolicyProvider` SPI implementations (such as S3 bucket policies) during request authorization:diff --git a/docs/services/ses.md b/docs/services/ses.mdindex 85839ba2da..3dc6f1f439 100644--- a/docs/services/ses.md+++ b/docs/services/ses.md@@ -445,3 +445,14 @@ Identity, identity-policy, template, custom-verification-template, configuration`ListTemplates`, `ListEmailTemplates` and `ListExportJobs` page with `PageSize` (`MaxItems` on v1) and `NextToken`, newest first, with the page-size bounds and error messages real SES answers (probed 2026-09-25). A token belongs to the kind of resource listed, as on AWS: a v1 `ListTemplates` token continues a v2 `ListEmailTemplates` list and the other way round, while any other list refuses it. Without a page size the template lists serve 10, and a v1 `MaxItems` outside 1 to 100 is served 100 rather than refused, both as on AWS. Floci's own choice: `ListExportJobs` without a `PageSize` serves 100, since AWS documents no default for it.DKIM follows AWS's domain-centric model. A **domain** identity carries DKIM tokens (generated at verification, stable across `VerifyDomainDkim` calls); its `DkimVerificationStatus` tracks **DNS record detection** — it transitions to `Success` when the expected `<token>._domainkey.<domain>` CNAMEs are present in the Route53 emulation, not when DKIM is enabled. An **email** identity has no DKIM of its own: its `DkimAttributes` (`SigningEnabled`, `Status`, `Tokens`) are inherited from its parent domain identity when one is registered. The parent is the exact domain after the `@` (verified against AWS): a verified `example.com` covers `[email protected]` but not `[email protected]` unless `mail.example.com` is itself a registered identity. `SetIdentityDkimEnabled` / `PutEmailIdentityDkimAttributes` only toggle the signing flag (they no longer force the verification status); `PutEmailIdentityDkimSigningAttributes` sets the signing origin (`AWS_SES` Easy DKIM — regenerating tokens when the key length changes — or `EXTERNAL` BYODKIM).++### IAM enforcement++With `FLOCI_SERVICES_IAM_ENFORCEMENT_ENABLED=true`, every SES v2 operation is authorized as the `ses:`+action AWS's service reference lists for it, which is always `ses:<Operation>`, in the `ses` namespace+v1 and v2 share. The v1 Query API resolves the same way from its `Action`. Both are evaluated with+resource `*`, so a policy that limits `ses:` actions to an identity, configuration set or template ARN+does not grant them yet. The other actions the service reference lists for some operations are not+checked: `ses:TagResource` for the create operations, and `iam:PassRole` (with `iam:PassedToService`+`ses.amazonaws.com`) for creating or updating an event destination. A v2 `SendEmail` is authorized as+`ses:SendEmail` whatever its content: `ses:SendRawEmail` is a v1 action.diff --git a/src/main/java/io/github/hectorvent/floci/core/common/IamEnforcementFilter.java b/src/main/java/io/github/hectorvent/floci/core/common/IamEnforcementFilter.javaindex 075429d4dd..1bd91d24d4 100644--- a/src/main/java/io/github/hectorvent/floci/core/common/IamEnforcementFilter.java+++ b/src/main/java/io/github/hectorvent/floci/core/common/IamEnforcementFilter.java@@ -474,8 +474,8 @@ public class IamEnforcementFilter implements ContainerRequestFilter {return new ResolvedAuthorization(servingScope, servingScope + ":" + queryAction);}- if (claimValue instanceof ProtocolClaim claim && claim.protocol() == WireProtocol.REST- && resourceInfo != null && resourceInfo.getResourceClass() != null) {+ boolean rest = claimValue instanceof ProtocolClaim claim && claim.protocol() == WireProtocol.REST;+ if (rest && resourceInfo != null && resourceInfo.getResourceClass() != null) {ServiceDescriptor descriptor = catalog.byResourceClass(resourceInfo.getResourceClass()).orElse(null);if (descriptor != null) {ResolvedAuthorization routeAuthorization = resolveRestAuthorization(descriptor, ctx);@@ -485,8 +485,11 @@ public class IamEnforcementFilter implements ContainerRequestFilter {}}+ // A REST request is authorized by its route alone, never by an X-Amz-Target it carries.String servingScope = servingCredentialScope(claimedScope, ctx);- return new ResolvedAuthorization(servingScope, actionRegistry.resolve(servingScope, ctx));+ return new ResolvedAuthorization(servingScope, rest+ ? actionRegistry.resolveRoute(servingScope, ctx)+ : actionRegistry.resolve(servingScope, ctx));}private ResolvedAuthorization resolveRestAuthorization(ServiceDescriptor descriptor,@@ -495,7 +498,7 @@ public class IamEnforcementFilter implements ContainerRequestFilter {.map(catalog::canonicalCredentialScope).distinct().sorted()- .map(scope -> new ResolvedAuthorization(scope, actionRegistry.resolve(scope, ctx)))+ .map(scope -> new ResolvedAuthorization(scope, actionRegistry.resolveRoute(scope, ctx))).filter(authorization -> authorization.action() != null).findFirst().orElse(null);diff --git a/src/main/java/io/github/hectorvent/floci/services/iam/IamActionRegistry.java b/src/main/java/io/github/hectorvent/floci/services/iam/IamActionRegistry.javaindex 3ada3c6e8f..3d46507271 100644--- a/src/main/java/io/github/hectorvent/floci/services/iam/IamActionRegistry.java+++ b/src/main/java/io/github/hectorvent/floci/services/iam/IamActionRegistry.java@@ -5,6 +5,7 @@ import jakarta.enterprise.context.ApplicationScoped;import jakarta.ws.rs.container.ContainerRequestContext;import jakarta.ws.rs.core.MediaType;import jakarta.ws.rs.core.MultivaluedMap;+import jakarta.ws.rs.core.UriInfo;import org.jboss.logging.Logger;import java.util.List;@@ -84,6 +85,126 @@ public class IamActionRegistry {rule("apigateway", "DELETE", ".*/restapis/.+", "apigateway:DELETE"),rule("apigateway", "POST", ".*/restapis/.+", "apigateway:POST"),+ // ── SES v2 ─────────────────────────────────────────────────────────────+ // SES v1 is a Query API and resolves from its Action like any other; v2 is REST-JSON under+ // /v2/email, so every operation needs its own rule. One rule per operation in the SES v2+ // model, each mapped to the IAM action AWS's service reference lists for it: always+ // ses:<Operation>, in the ses namespace SES v2 shares with v1. SendEmail has no entry there;+ // the Service Authorization Reference's SES v2 page defines ses:SendEmail as v2's only send+ // action whatever the content (ses:SendRawEmail belongs to v1), so it takes its name too.+ rule("ses", "GET", "^/v2/email/account/?$", "ses:GetAccount"),+ rule("ses", "PUT", "^/v2/email/account/dedicated-ips/warmup/?$", "ses:PutAccountDedicatedIpWarmupAttributes"),+ rule("ses", "POST", "^/v2/email/account/details/?$", "ses:PutAccountDetails"),+ rule("ses", "PUT", "^/v2/email/account/pricing-attributes/?$", "ses:PutAccountPricingAttributes"),+ rule("ses", "PUT", "^/v2/email/account/sending/?$", "ses:PutAccountSendingAttributes"),+ rule("ses", "PUT", "^/v2/email/account/suppression/?$", "ses:PutAccountSuppressionAttributes"),+ rule("ses", "PUT", "^/v2/email/account/vdm/?$", "ses:PutAccountVdmAttributes"),+ rule("ses", "GET", "^/v2/email/configuration-sets/?$", "ses:ListConfigurationSets"),+ rule("ses", "POST", "^/v2/email/configuration-sets/?$", "ses:CreateConfigurationSet"),+ rule("ses", "DELETE","^/v2/email/configuration-sets/[^/]+/?$", "ses:DeleteConfigurationSet"),+ rule("ses", "GET", "^/v2/email/configuration-sets/[^/]+/?$", "ses:GetConfigurationSet"),+ rule("ses", "PUT", "^/v2/email/configuration-sets/[^/]+/archiving-options/?$", "ses:PutConfigurationSetArchivingOptions"),+ rule("ses", "PUT", "^/v2/email/configuration-sets/[^/]+/delivery-options/?$", "ses:PutConfigurationSetDeliveryOptions"),+ rule("ses", "GET", "^/v2/email/configuration-sets/[^/]+/event-destinations/?$", "ses:GetConfigurationSetEventDestinations"),+ rule("ses", "POST", "^/v2/email/configuration-sets/[^/]+/event-destinations/?$", "ses:CreateConfigurationSetEventDestination"),+ rule("ses", "DELETE","^/v2/email/configuration-sets/[^/]+/event-destinations/[^/]+/?$", "ses:DeleteConfigurationSetEventDestination"),+ rule("ses", "PUT", "^/v2/email/configuration-sets/[^/]+/event-destinations/[^/]+/?$", "ses:UpdateConfigurationSetEventDestination"),+ rule("ses", "PUT", "^/v2/email/configuration-sets/[^/]+/reputation-options/?$", "ses:PutConfigurationSetReputationOptions"),+ rule("ses", "PUT", "^/v2/email/configuration-sets/[^/]+/sending/?$", "ses:PutConfigurationSetSendingOptions"),+ rule("ses", "PUT", "^/v2/email/configuration-sets/[^/]+/suppression-options/?$", "ses:PutConfigurationSetSuppressionOptions"),+ rule("ses", "PUT", "^/v2/email/configuration-sets/[^/]+/tracking-options/?$", "ses:PutConfigurationSetTrackingOptions"),+ rule("ses", "PUT", "^/v2/email/configuration-sets/[^/]+/vdm-options/?$", "ses:PutConfigurationSetVdmOptions"),+ rule("ses", "GET", "^/v2/email/contact-lists/?$", "ses:ListContactLists"),+ rule("ses", "POST", "^/v2/email/contact-lists/?$", "ses:CreateContactList"),+ rule("ses", "DELETE","^/v2/email/contact-lists/[^/]+/?$", "ses:DeleteContactList"),+ rule("ses", "GET", "^/v2/email/contact-lists/[^/]+/?$", "ses:GetContactList"),+ rule("ses", "PUT", "^/v2/email/contact-lists/[^/]+/?$", "ses:UpdateContactList"),+ rule("ses", "POST", "^/v2/email/contact-lists/[^/]+/contacts/?$", "ses:CreateContact"),+ rule("ses", "POST", "^/v2/email/contact-lists/[^/]+/contacts/list/?$", "ses:ListContacts"),+ rule("ses", "DELETE","^/v2/email/contact-lists/[^/]+/contacts/[^/]+/?$", "ses:DeleteContact"),+ rule("ses", "GET", "^/v2/email/contact-lists/[^/]+/contacts/[^/]+/?$", "ses:GetContact"),+ rule("ses", "PUT", "^/v2/email/contact-lists/[^/]+/contacts/[^/]+/?$", "ses:UpdateContact"),+ rule("ses", "GET", "^/v2/email/custom-verification-email-templates/?$", "ses:ListCustomVerificationEmailTemplates"),+ rule("ses", "POST", "^/v2/email/custom-verification-email-templates/?$", "ses:CreateCustomVerificationEmailTemplate"),+ rule("ses", "DELETE","^/v2/email/custom-verification-email-templates/[^/]+/?$", "ses:DeleteCustomVerificationEmailTemplate"),+ rule("ses", "GET", "^/v2/email/custom-verification-email-templates/[^/]+/?$", "ses:GetCustomVerificationEmailTemplate"),+ rule("ses", "PUT", "^/v2/email/custom-verification-email-templates/[^/]+/?$", "ses:UpdateCustomVerificationEmailTemplate"),+ rule("ses", "GET", "^/v2/email/dedicated-ip-pools/?$", "ses:ListDedicatedIpPools"),+ rule("ses", "POST", "^/v2/email/dedicated-ip-pools/?$", "ses:CreateDedicatedIpPool"),+ rule("ses", "DELETE","^/v2/email/dedicated-ip-pools/[^/]+/?$", "ses:DeleteDedicatedIpPool"),+ rule("ses", "GET", "^/v2/email/dedicated-ip-pools/[^/]+/?$", "ses:GetDedicatedIpPool"),+ rule("ses", "PUT", "^/v2/email/dedicated-ip-pools/[^/]+/scaling/?$", "ses:PutDedicatedIpPoolScalingAttributes"),+ rule("ses", "GET", "^/v2/email/dedicated-ips/?$", "ses:GetDedicatedIps"),+ rule("ses", "GET", "^/v2/email/dedicated-ips/[^/]+/?$", "ses:GetDedicatedIp"),+ rule("ses", "PUT", "^/v2/email/dedicated-ips/[^/]+/pool/?$", "ses:PutDedicatedIpInPool"),+ rule("ses", "PUT", "^/v2/email/dedicated-ips/[^/]+/warmup/?$", "ses:PutDedicatedIpWarmupAttributes"),+ rule("ses", "GET", "^/v2/email/deliverability-dashboard/?$", "ses:GetDeliverabilityDashboardOptions"),+ rule("ses", "PUT", "^/v2/email/deliverability-dashboard/?$", "ses:PutDeliverabilityDashboardOption"),+ rule("ses", "GET", "^/v2/email/deliverability-dashboard/blacklist-report/?$", "ses:GetBlacklistReports"),+ rule("ses", "GET", "^/v2/email/deliverability-dashboard/campaigns/[^/]+/?$", "ses:GetDomainDeliverabilityCampaign"),+ rule("ses", "GET", "^/v2/email/deliverability-dashboard/domains/[^/]+/campaigns/?$", "ses:ListDomainDeliverabilityCampaigns"),+ rule("ses", "GET", "^/v2/email/deliverability-dashboard/statistics-report/[^/]+/?$", "ses:GetDomainStatisticsReport"),+ rule("ses", "POST", "^/v2/email/deliverability-dashboard/test/?$", "ses:CreateDeliverabilityTestReport"),+ rule("ses", "GET", "^/v2/email/deliverability-dashboard/test-reports/?$", "ses:ListDeliverabilityTestReports"),+ rule("ses", "GET", "^/v2/email/deliverability-dashboard/test-reports/[^/]+/?$", "ses:GetDeliverabilityTestReport"),+ rule("ses", "POST", "^/v2/email/email-address-insights/?$", "ses:GetEmailAddressInsights"),+ rule("ses", "POST", "^/v2/email/export-jobs/?$", "ses:CreateExportJob"),+ rule("ses", "GET", "^/v2/email/export-jobs/[^/]+/?$", "ses:GetExportJob"),+ rule("ses", "PUT", "^/v2/email/export-jobs/[^/]+/cancel/?$", "ses:CancelExportJob"),+ rule("ses", "GET", "^/v2/email/identities/?$", "ses:ListEmailIdentities"),+ rule("ses", "POST", "^/v2/email/identities/?$", "ses:CreateEmailIdentity"),+ rule("ses", "DELETE","^/v2/email/identities/[^/]+/?$", "ses:DeleteEmailIdentity"),+ rule("ses", "GET", "^/v2/email/identities/[^/]+/?$", "ses:GetEmailIdentity"),+ rule("ses", "PUT", "^/v2/email/identities/[^/]+/configuration-set/?$", "ses:PutEmailIdentityConfigurationSetAttributes"),+ rule("ses", "PUT", "^/v2/email/identities/[^/]+/dkim/?$", "ses:PutEmailIdentityDkimAttributes"),+ rule("ses", "PUT", "^/v2/email/identities/[^/]+/dkim/signing/?$", "ses:PutEmailIdentityDkimSigningAttributes"),+ rule("ses", "PUT", "^/v2/email/identities/[^/]+/feedback/?$", "ses:PutEmailIdentityFeedbackAttributes"),+ rule("ses", "PUT", "^/v2/email/identities/[^/]+/mail-from/?$", "ses:PutEmailIdentityMailFromAttributes"),+ rule("ses", "GET", "^/v2/email/identities/[^/]+/policies/?$", "ses:GetEmailIdentityPolicies"),+ rule("ses", "DELETE","^/v2/email/identities/[^/]+/policies/[^/]+/?$", "ses:DeleteEmailIdentityPolicy"),+ rule("ses", "POST", "^/v2/email/identities/[^/]+/policies/[^/]+/?$", "ses:CreateEmailIdentityPolicy"),+ rule("ses", "PUT", "^/v2/email/identities/[^/]+/policies/[^/]+/?$", "ses:UpdateEmailIdentityPolicy"),+ rule("ses", "POST", "^/v2/email/import-jobs/?$", "ses:CreateImportJob"),+ rule("ses", "POST", "^/v2/email/import-jobs/list/?$", "ses:ListImportJobs"),+ rule("ses", "GET", "^/v2/email/import-jobs/[^/]+/?$", "ses:GetImportJob"),+ rule("ses", "GET", "^/v2/email/insights/[^/]+/?$", "ses:GetMessageInsights"),+ rule("ses", "POST", "^/v2/email/list-export-jobs/?$", "ses:ListExportJobs"),+ rule("ses", "POST", "^/v2/email/metrics/batch/?$", "ses:BatchGetMetricData"),+ rule("ses", "GET", "^/v2/email/multi-region-endpoints/?$", "ses:ListMultiRegionEndpoints"),+ rule("ses", "POST", "^/v2/email/multi-region-endpoints/?$", "ses:CreateMultiRegionEndpoint"),+ rule("ses", "DELETE","^/v2/email/multi-region-endpoints/[^/]+/?$", "ses:DeleteMultiRegionEndpoint"),+ rule("ses", "GET", "^/v2/email/multi-region-endpoints/[^/]+/?$", "ses:GetMultiRegionEndpoint"),+ rule("ses", "POST", "^/v2/email/outbound-bulk-emails/?$", "ses:SendBulkEmail"),+ rule("ses", "POST", "^/v2/email/outbound-custom-verification-emails/?$", "ses:SendCustomVerificationEmail"),+ rule("ses", "POST", "^/v2/email/outbound-emails/?$", "ses:SendEmail"),+ rule("ses", "POST", "^/v2/email/reputation/entities/?$", "ses:ListReputationEntities"),+ rule("ses", "GET", "^/v2/email/reputation/entities/[^/]+/[^/]+/?$", "ses:GetReputationEntity"),+ rule("ses", "PUT", "^/v2/email/reputation/entities/[^/]+/[^/]+/customer-managed-status/?$","ses:UpdateReputationEntityCustomerManagedStatus"),+ rule("ses", "PUT", "^/v2/email/reputation/entities/[^/]+/[^/]+/policy/?$", "ses:UpdateReputationEntityPolicy"),+ rule("ses", "POST", "^/v2/email/resources/tenants/list/?$", "ses:ListResourceTenants"),+ rule("ses", "GET", "^/v2/email/suppression/addresses/?$", "ses:ListSuppressedDestinations"),+ rule("ses", "PUT", "^/v2/email/suppression/addresses/?$", "ses:PutSuppressedDestination"),+ rule("ses", "DELETE","^/v2/email/suppression/addresses/[^/]+/?$", "ses:DeleteSuppressedDestination"),+ rule("ses", "GET", "^/v2/email/suppression/addresses/[^/]+/?$", "ses:GetSuppressedDestination"),+ rule("ses", "DELETE","^/v2/email/tags/?$", "ses:UntagResource"),+ rule("ses", "GET", "^/v2/email/tags/?$", "ses:ListTagsForResource"),+ rule("ses", "POST", "^/v2/email/tags/?$", "ses:TagResource"),+ rule("ses", "GET", "^/v2/email/templates/?$", "ses:ListEmailTemplates"),+ rule("ses", "POST", "^/v2/email/templates/?$", "ses:CreateEmailTemplate"),+ rule("ses", "DELETE","^/v2/email/templates/[^/]+/?$", "ses:DeleteEmailTemplate"),+ rule("ses", "GET", "^/v2/email/templates/[^/]+/?$", "ses:GetEmailTemplate"),+ rule("ses", "PUT", "^/v2/email/templates/[^/]+/?$", "ses:UpdateEmailTemplate"),+ rule("ses", "POST", "^/v2/email/templates/[^/]+/render/?$", "ses:TestRenderEmailTemplate"),+ rule("ses", "POST", "^/v2/email/tenant/suppression/?$", "ses:PutTenantSuppressionAttributes"),+ rule("ses", "POST", "^/v2/email/tenants/?$", "ses:CreateTenant"),+ rule("ses", "POST", "^/v2/email/tenants/delete/?$", "ses:DeleteTenant"),+ rule("ses", "POST", "^/v2/email/tenants/get/?$", "ses:GetTenant"),+ rule("ses", "POST", "^/v2/email/tenants/list/?$", "ses:ListTenants"),+ rule("ses", "POST", "^/v2/email/tenants/resources/?$", "ses:CreateTenantResourceAssociation"),+ rule("ses", "POST", "^/v2/email/tenants/resources/delete/?$", "ses:DeleteTenantResourceAssociation"),+ rule("ses", "POST", "^/v2/email/tenants/resources/list/?$", "ses:ListTenantResources"),+ rule("ses", "POST", "^/v2/email/vdm/recommendations/?$", "ses:ListRecommendations"),+// ── Kinesis ────────────────────────────────────────────────────────────rule("kinesis", "POST", ".*", "kinesis:*"));@@ -122,10 +243,23 @@ public class IamActionRegistry {return credentialScope + ":" + operationName;}- // REST-JSON: match against rule table+ return resolveRoute(credentialScope, ctx);+ }++ /**+ * The action of a REST request, from its method and path alone. A REST request is the operation+ * whose route it reached, so neither an {@code X-Amz-Target} header nor a Query {@code Action}+ * field may name another one: a caller could attach either to have the call checked as an+ * action they hold. The path is matched as sent, still percent-encoded, which is the form the+ * router matched: decoded, an encoded {@code /} inside a parameter splits it into two segments,+ * so the route's rule would not match and the call would pass as an unknown action. It is read+ * from the request URI because RESTEasy Reactive does not serve {@code UriInfo.getPath(false)}.+ *+ * <p>Returns {@code null} when no rule matches (caller treats this as ALLOW).+ */+ public String resolveRoute(String credentialScope, ContainerRequestContext ctx) {String method = ctx.getMethod().toUpperCase();- String path = ctx.getUriInfo().getPath();- if (!path.startsWith("/")) path = "/" + path;+ String path = rawPath(ctx.getUriInfo());// S3 sub-resource override: the URL path alone doesn't distinguish// s3:GetObjectAcl / s3:PutObjectAcl from s3:GetObject / s3:PutObject@@ -151,6 +285,19 @@ public class IamActionRegistry {return null;}+ /**+ * The request path relative to the application root, as {@link UriInfo#getPath()} gives it, but+ * still percent-encoded.+ */+ private static String rawPath(UriInfo uriInfo) {+ String path = uriInfo.getRequestUri().getRawPath();+ String base = uriInfo.getBaseUri().getRawPath();+ if (base != null && base.length() > 1 && path.startsWith(base)) {+ path = path.substring(base.length() - 1);+ }+ return path.startsWith("/") ? path : "/" + path;+ }+/*** Returns the Query-protocol action from the form body while preserving the entity stream for* the controller. The controller dispatches only the form body, using the same Action-first,diff --git a/src/test/java/io/github/hectorvent/floci/core/common/CredentialScopeAliasTest.java b/src/test/java/io/github/hectorvent/floci/core/common/CredentialScopeAliasTest.javaindex f7951eb14b..3a07502ee9 100644--- a/src/test/java/io/github/hectorvent/floci/core/common/CredentialScopeAliasTest.java+++ b/src/test/java/io/github/hectorvent/floci/core/common/CredentialScopeAliasTest.java@@ -8,6 +8,7 @@ import jakarta.ws.rs.core.MultivaluedHashMap;import jakarta.ws.rs.core.UriInfo;import org.junit.jupiter.api.Test;+import java.net.URI;import java.util.Map;import java.util.stream.Collectors;@@ -103,6 +104,8 @@ class CredentialScopeAliasTest {private static ContainerRequestContext getObjectRequest() {UriInfo uriInfo = mock(UriInfo.class);when(uriInfo.getPath()).thenReturn("/my-bucket/my-key");+ when(uriInfo.getRequestUri()).thenReturn(URI.create("http://localhost:4566/my-bucket/my-key"));+ when(uriInfo.getBaseUri()).thenReturn(URI.create("http://localhost:4566/"));when(uriInfo.getQueryParameters()).thenReturn(new MultivaluedHashMap<>());ContainerRequestContext ctx = mock(ContainerRequestContext.class);diff --git a/src/test/java/io/github/hectorvent/floci/core/common/IamEnforcementFilterTest.java b/src/test/java/io/github/hectorvent/floci/core/common/IamEnforcementFilterTest.javaindex 8669562231..9a205a9d6a 100644--- a/src/test/java/io/github/hectorvent/floci/core/common/IamEnforcementFilterTest.java+++ b/src/test/java/io/github/hectorvent/floci/core/common/IamEnforcementFilterTest.java@@ -218,7 +218,9 @@ class IamEnforcementFilterTest {when(containerRequest.getMediaType()).thenReturn(MediaType.valueOf(contentType));stubClaim(containerRequest, protocol, dynamoDbDescriptor());when(iamService.resolveCallerContext("AKIAUSER")).thenReturn(CallerContext.of(List.of()));- when(actionRegistry.resolve("dynamodb", containerRequest)).thenReturn("dynamodb:PutItem");+ // A REST-claimed request resolves from its route, the others from the registry's full rules.+ lenient().when(actionRegistry.resolve("dynamodb", containerRequest)).thenReturn("dynamodb:PutItem");+ lenient().when(actionRegistry.resolveRoute("dynamodb", containerRequest)).thenReturn("dynamodb:PutItem");when(evaluator.evaluateResolvedResourcePolicy(any(), any(), any(), eq("dynamodb:PutItem"), any(), any())).thenReturn(IamPolicyEvaluator.Decision.DENY);@@ -288,7 +290,9 @@ class IamEnforcementFilterTest {newFilter().filter(containerRequest);- verify(actionRegistry).resolve(eq("s3"), eq(containerRequest));+ verify(actionRegistry).resolveRoute(eq("s3"), eq(containerRequest));+ // Nor does the header name the action: a REST request never reaches the header-reading rules.+ verify(actionRegistry, never()).resolve(any(), any());}@Test@@ -305,14 +309,14 @@ class IamEnforcementFilterTest {when(catalog.byResourceClass(ApiGatewayController.class)).thenReturn(Optional.of(descriptor("apigateway", ServiceProtocol.REST_JSON,Set.of("apigateway", "execute-api"), ApiGatewayController.class)));- when(actionRegistry.resolve("apigateway", containerRequest)).thenReturn("apigateway:POST");+ when(actionRegistry.resolveRoute("apigateway", containerRequest)).thenReturn("apigateway:POST");when(iamService.resolveCallerContext("AKIAUSER")).thenReturn(CallerContext.of(List.of()));IamEnforcementFilter filter = newFilter(resourceInfo(ApiGatewayController.class));filter.filter(containerRequest);- verify(actionRegistry).resolve("apigateway", containerRequest);- verify(actionRegistry, never()).resolve("iam", containerRequest);+ verify(actionRegistry).resolveRoute("apigateway", containerRequest);+ verify(actionRegistry, never()).resolveRoute("iam", containerRequest);verify(arnBuilder).buildResources("apigateway", containerRequest,"us-east-1", "000000000000");verify(conditionContextResolver).resolve("apigateway", "apigateway:POST", containerRequest);@@ -332,14 +336,14 @@ class IamEnforcementFilterTest {.thenReturn(Optional.of(descriptor("s3", ServiceProtocol.REST_XML,Set.of("s3", "s3express"), S3Controller.class)));when(catalog.canonicalCredentialScope("s3express")).thenReturn("s3");- when(actionRegistry.resolve("s3", containerRequest)).thenReturn("s3:CreateBucket");+ when(actionRegistry.resolveRoute("s3", containerRequest)).thenReturn("s3:CreateBucket");when(iamService.resolveCallerContext("AKIAUSER")).thenReturn(CallerContext.of(List.of()));IamEnforcementFilter filter = newFilter(resourceInfo(S3Controller.class));filter.filter(containerRequest);- verify(actionRegistry).resolve("s3", containerRequest);- verify(actionRegistry, never()).resolve("apigateway", containerRequest);+ verify(actionRegistry).resolveRoute("s3", containerRequest);+ verify(actionRegistry, never()).resolveRoute("apigateway", containerRequest);}@Testdiff --git a/src/test/java/io/github/hectorvent/floci/services/iam/IamActionRegistryTest.java b/src/test/java/io/github/hectorvent/floci/services/iam/IamActionRegistryTest.javaindex ac5f7339d0..89a6b385d9 100644--- a/src/test/java/io/github/hectorvent/floci/services/iam/IamActionRegistryTest.java+++ b/src/test/java/io/github/hectorvent/floci/services/iam/IamActionRegistryTest.java@@ -6,10 +6,13 @@ import jakarta.ws.rs.core.MultivaluedHashMap;import jakarta.ws.rs.core.MultivaluedMap;import jakarta.ws.rs.core.UriInfo;import org.junit.jupiter.api.Test;+import org.junit.jupiter.params.ParameterizedTest;+import org.junit.jupiter.params.provider.CsvFileSource;import org.mockito.Mockito;import java.io.ByteArrayInputStream;import java.io.InputStream;+import java.net.URI;import java.nio.charset.StandardCharsets;import java.util.concurrent.atomic.AtomicReference;@@ -167,6 +170,56 @@ class IamActionRegistryTest {mockCtx("POST", "/RollbackTransaction", new MultivaluedHashMap<>(), MediaType.APPLICATION_JSON_TYPE, "{}")));}+ /**+ * The table is generated from the SES v2 model and AWS's service reference, not from the rule+ * table, so it checks the rules rather than restating them: each operation's path has to+ * resolve to the action AWS lists for it, and to no other operation's.+ */+ @ParameterizedTest(name = "{0}")+ @CsvFileSource(resources = "/iam/sesv2-operation-actions.csv")+ void resolvesEverySesV2OperationToItsAction(String operation, String method, String path, String action) {+ assertEquals(action, registry.resolve("ses",+ mockCtx(method, path, new MultivaluedHashMap<>(), MediaType.APPLICATION_JSON_TYPE, "{}")));+ }++ @Test+ void sesV2RulesMatchTheWholePath() {+ // A rule for /v2/email/configuration-sets must not also claim a path below it.+ assertEquals("ses:ListConfigurationSets", registry.resolve("ses",+ mockCtx("GET", "/v2/email/configuration-sets", new MultivaluedHashMap<>(),+ MediaType.APPLICATION_JSON_TYPE, "{}")));+ assertEquals("ses:GetConfigurationSetEventDestinations", registry.resolve("ses",+ mockCtx("GET", "/v2/email/configuration-sets/my-set/event-destinations/", new MultivaluedHashMap<>(),+ MediaType.APPLICATION_JSON_TYPE, "{}")));+ assertNull(registry.resolve("ses",+ mockCtx("GET", "/v2/email/configuration-sets/my-set/unknown", new MultivaluedHashMap<>(),+ MediaType.APPLICATION_JSON_TYPE, "{}")));+ }++ @Test+ void aRestRouteIsNotRenamedByATargetHeader() {+ // The route decides a REST request's action; a caller-supplied target must not name another.+ ContainerRequestContext send = mockCtx("POST", "/v2/email/outbound-emails", new MultivaluedHashMap<>(),+ MediaType.APPLICATION_JSON_TYPE, "{}");+ when(send.getHeaderString("X-Amz-Target")).thenReturn("SES.GetAccount");+ assertEquals("ses:SendEmail", registry.resolveRoute("ses", send));++ ContainerRequestContext invoke = mockCtx("POST", "/2015-03-31/functions/f/invocations",+ new MultivaluedHashMap<>(), MediaType.APPLICATION_JSON_TYPE, "{}");+ when(invoke.getHeaderString("X-Amz-Target")).thenReturn("AWSLambda.GetFunction");+ assertEquals("lambda:InvokeFunction", registry.resolveRoute("lambda", invoke));+ }++ @Test+ void anEncodedSlashStaysInsideItsPathParameter() {+ assertEquals("ses:GetSuppressedDestination", registry.resolveRoute("ses",+ mockCtx("GET", "/v2/email/suppression/addresses/a%[email protected]", new MultivaluedHashMap<>(),+ MediaType.APPLICATION_JSON_TYPE, "{}")));+ assertEquals("ses:DeleteSuppressedDestination", registry.resolveRoute("ses",+ mockCtx("DELETE", "/v2/email/suppression/addresses/a%[email protected]", new MultivaluedHashMap<>(),+ MediaType.APPLICATION_JSON_TYPE, "{}")));+ }+@Testvoid returnsNullForUnknownRestJsonRoute() {ContainerRequestContext ctx = mockCtx(@@ -440,6 +493,8 @@ class IamActionRegistryTest {UriInfo uriInfo = Mockito.mock(UriInfo.class);when(uriInfo.getQueryParameters()).thenReturn(queryParams);when(uriInfo.getPath()).thenReturn(path);+ when(uriInfo.getRequestUri()).thenReturn(URI.create("http://localhost:4566" + path));+ when(uriInfo.getBaseUri()).thenReturn(URI.create("http://localhost:4566/"));when(ctx.getUriInfo()).thenReturn(uriInfo);when(ctx.getMediaType()).thenReturn(mediaType);when(ctx.getMethod()).thenReturn(method);diff --git a/src/test/java/io/github/hectorvent/floci/services/iam/SesV2IamEnforcementIntegrationTest.java b/src/test/java/io/github/hectorvent/floci/services/iam/SesV2IamEnforcementIntegrationTest.javanew file mode 100644index 0000000000..6df8fe1dd9--- /dev/null+++ b/src/test/java/io/github/hectorvent/floci/services/iam/SesV2IamEnforcementIntegrationTest.java@@ -0,0 +1,138 @@+package io.github.hectorvent.floci.services.iam;++import io.github.hectorvent.floci.testing.IamEnforcementProfile;+import io.quarkus.test.junit.QuarkusTest;+import io.quarkus.test.junit.TestProfile;+import io.restassured.response.Response;+import org.junit.jupiter.api.Test;++import java.util.UUID;++import static io.restassured.RestAssured.given;+import static org.hamcrest.Matchers.equalTo;++/**+ * With {@code iam.enforcement-enabled=true}, SES v2 calls are authorized against their {@code ses:}+ * action like any other request, instead of resolving to no action and passing unchecked.+ */+@QuarkusTest+@TestProfile(IamEnforcementProfile.class)+class SesV2IamEnforcementIntegrationTest {++ private static final String ACCOUNT = "111111111111";++ @Test+ void callerWithoutSesPermissionsIsRefusedEveryV2Operation() {+ String configurationSet = createConfigurationSet();+ String accessKeyId = userWithPolicy(null);++ assertAccessDenied(getAccount(accessKeyId));+ assertAccessDenied(createEventDestination(accessKeyId, configurationSet));+ }++ @Test+ void anAllowedActionGrantsThatOperationOnly() {+ String configurationSet = createConfigurationSet();+ String accessKeyId = userWithPolicy("""+ {"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":"ses:GetAccount","Resource":"*"}]}""");++ getAccount(accessKeyId).then().statusCode(200);+ assertAccessDenied(createEventDestination(accessKeyId, configurationSet));+ }++ @Test+ void theEventDestinationActionAllowsCreatingOne() {+ String configurationSet = createConfigurationSet();+ String accessKeyId = userWithPolicy("""+ {"Version":"2012-10-17","Statement":[{"Effect":"Allow",+ "Action":"ses:CreateConfigurationSetEventDestination","Resource":"*"}]}""");++ createEventDestination(accessKeyId, configurationSet).then().statusCode(200);+ assertAccessDenied(getAccount(accessKeyId));+ }++ @Test+ void aTargetHeaderDoesNotChangeTheActionARestCallIsCheckedAs() {+ String accessKeyId = userWithPolicy("""+ {"Version":"2012-10-17","Statement":[+ {"Effect":"Allow","Action":"*","Resource":"*"},+ {"Effect":"Deny","Action":"ses:SendEmail","Resource":"*"}]}""");++ assertAccessDenied(given()+ .contentType("application/json")+ .header("Authorization", auth(accessKeyId, "ses"))+ .header("X-Amz-Target", "SES.GetAccount")+ .body("""+ {"FromEmailAddress":"[email protected]","Destination":{"ToAddresses":["[email protected]"]},+ "Content":{"Simple":{"Subject":{"Data":"s"},"Body":{"Text":{"Data":"b"}}}}}""")+ .when().post("/v2/email/outbound-emails"));+ }++ @Test+ void anEncodedSlashInAPathParameterIsStillAuthorized() {+ String accessKeyId = userWithPolicy(null);++ assertAccessDenied(given()+ .urlEncodingEnabled(false)+ .header("Authorization", auth(accessKeyId, "ses"))+ .when().get("/v2/email/suppression/addresses/a%[email protected]"));+ assertAccessDenied(given()+ .urlEncodingEnabled(false)+ .header("Authorization", auth(accessKeyId, "ses"))+ .when().delete("/v2/email/suppression/addresses/a%[email protected]"));+ }++ /** SES v2 API Reference, common errors: {@code AccessDeniedException}, HTTP 403. */+ private static void assertAccessDenied(Response response) {+ response.then().statusCode(403).body("__type", equalTo("AccessDeniedException"));+ }++ private static Response getAccount(String accessKeyId) {+ return given()+ .header("Authorization", auth(accessKeyId, "ses"))+ .when().get("/v2/email/account");+ }++ private static Response createEventDestination(String accessKeyId, String configurationSet) {+ return given()+ .contentType("application/json")+ .header("Authorization", auth(accessKeyId, "ses"))+ .body("""+ {"EventDestinationName":"dest","EventDestination":{"Enabled":true,+ "MatchingEventTypes":["SEND"],+ "CloudWatchDestination":{"DimensionConfigurations":[{"DimensionName":"d",+ "DimensionValueSource":"MESSAGE_TAG","DefaultDimensionValue":"v"}]}}}""")+ .when().post("/v2/email/configuration-sets/" + configurationSet + "/event-destinations");+ }++ private static String createConfigurationSet() {+ String name = "sesv2-iam-" + UUID.randomUUID().toString().substring(0, 8);+ given()+ .contentType("application/json")+ .header("Authorization", auth(ACCOUNT, "ses"))+ .body("{\"ConfigurationSetName\":\"" + name + "\"}")+ .when().post("/v2/email/configuration-sets")+ .then().statusCode(200);+ return name;+ }++ /** An IAM user in {@link #ACCOUNT} with {@code policy} inline, or no policy when it is null. */+ private static String userWithPolicy(String policy) {+ String user = "sesv2-iam-" + UUID.randomUUID().toString().substring(0, 8);+ given().formParam("Action", "CreateUser").formParam("UserName", user)+ .header("Authorization", auth(ACCOUNT, "iam")).when().post("/").then().statusCode(200);+ if (policy != null) {+ given().formParam("Action", "PutUserPolicy").formParam("UserName", user).formParam("PolicyName", "p")+ .formParam("PolicyDocument", policy)+ .header("Authorization", auth(ACCOUNT, "iam")).when().post("/").then().statusCode(200);+ }+ return given().formParam("Action", "CreateAccessKey").formParam("UserName", user)+ .header("Authorization", auth(ACCOUNT, "iam")).when().post("/").then().statusCode(200)+ .extract().path("CreateAccessKeyResponse.CreateAccessKeyResult.AccessKey.AccessKeyId");+ }++ private static String auth(String accessKeyId, String service) {+ return "AWS4-HMAC-SHA256 Credential=" + accessKeyId + "/20260930/us-east-1/" + service+ + "/aws4_request, SignedHeaders=host, Signature=abc";+ }+}diff --git a/src/test/resources/iam/sesv2-operation-actions.csv b/src/test/resources/iam/sesv2-operation-actions.csvnew file mode 100644index 0000000000..edc7dbb75a--- /dev/null+++ b/src/test/resources/iam/sesv2-operation-actions.csv@@ -0,0 +1,117 @@+# Every SES v2 operation: a sample of its path from the SES v2 model (botocore 1.43.62,+# sesv2/2019-09-27) and the IAM action AWS's service reference lists for it+# (https://servicereference.us-east-1.amazonaws.com/v1/ses/ses.json, read 2026-09-30).+# SendEmail has no entry there; the Service Authorization Reference's SES v2 page defines+# ses:SendEmail as v2's only send action (ses:SendRawEmail belongs to v1).+GetAccount,GET,/v2/email/account,ses:GetAccount+PutAccountDedicatedIpWarmupAttributes,PUT,/v2/email/account/dedicated-ips/warmup,ses:PutAccountDedicatedIpWarmupAttributes+PutAccountDetails,POST,/v2/email/account/details,ses:PutAccountDetails+PutAccountPricingAttributes,PUT,/v2/email/account/pricing-attributes,ses:PutAccountPricingAttributes+PutAccountSendingAttributes,PUT,/v2/email/account/sending,ses:PutAccountSendingAttributes+PutAccountSuppressionAttributes,PUT,/v2/email/account/suppression,ses:PutAccountSuppressionAttributes+PutAccountVdmAttributes,PUT,/v2/email/account/vdm,ses:PutAccountVdmAttributes+ListConfigurationSets,GET,/v2/email/configuration-sets,ses:ListConfigurationSets+CreateConfigurationSet,POST,/v2/email/configuration-sets,ses:CreateConfigurationSet+DeleteConfigurationSet,DELETE,/v2/email/configuration-sets/sample-configurationsetname,ses:DeleteConfigurationSet+GetConfigurationSet,GET,/v2/email/configuration-sets/sample-configurationsetname,ses:GetConfigurationSet+PutConfigurationSetArchivingOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/archiving-options,ses:PutConfigurationSetArchivingOptions+PutConfigurationSetDeliveryOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/delivery-options,ses:PutConfigurationSetDeliveryOptions+GetConfigurationSetEventDestinations,GET,/v2/email/configuration-sets/sample-configurationsetname/event-destinations,ses:GetConfigurationSetEventDestinations+CreateConfigurationSetEventDestination,POST,/v2/email/configuration-sets/sample-configurationsetname/event-destinations,ses:CreateConfigurationSetEventDestination+DeleteConfigurationSetEventDestination,DELETE,/v2/email/configuration-sets/sample-configurationsetname/event-destinations/sample-eventdestinationname,ses:DeleteConfigurationSetEventDestination+UpdateConfigurationSetEventDestination,PUT,/v2/email/configuration-sets/sample-configurationsetname/event-destinations/sample-eventdestinationname,ses:UpdateConfigurationSetEventDestination+PutConfigurationSetReputationOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/reputation-options,ses:PutConfigurationSetReputationOptions+PutConfigurationSetSendingOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/sending,ses:PutConfigurationSetSendingOptions+PutConfigurationSetSuppressionOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/suppression-options,ses:PutConfigurationSetSuppressionOptions+PutConfigurationSetTrackingOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/tracking-options,ses:PutConfigurationSetTrackingOptions+PutConfigurationSetVdmOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/vdm-options,ses:PutConfigurationSetVdmOptions+ListContactLists,GET,/v2/email/contact-lists,ses:ListContactLists+CreateContactList,POST,/v2/email/contact-lists,ses:CreateContactList+DeleteContactList,DELETE,/v2/email/contact-lists/sample-contactlistname,ses:DeleteContactList+GetContactList,GET,/v2/email/contact-lists/sample-contactlistname,ses:GetContactList+UpdateContactList,PUT,/v2/email/contact-lists/sample-contactlistname,ses:UpdateContactList+CreateContact,POST,/v2/email/contact-lists/sample-contactlistname/contacts,ses:CreateContact+ListContacts,POST,/v2/email/contact-lists/sample-contactlistname/contacts/list,ses:ListContacts+DeleteContact,DELETE,/v2/email/contact-lists/sample-contactlistname/contacts/sample-emailaddress,ses:DeleteContact+GetContact,GET,/v2/email/contact-lists/sample-contactlistname/contacts/sample-emailaddress,ses:GetContact+UpdateContact,PUT,/v2/email/contact-lists/sample-contactlistname/contacts/sample-emailaddress,ses:UpdateContact+ListCustomVerificationEmailTemplates,GET,/v2/email/custom-verification-email-templates,ses:ListCustomVerificationEmailTemplates+CreateCustomVerificationEmailTemplate,POST,/v2/email/custom-verification-email-templates,ses:CreateCustomVerificationEmailTemplate+DeleteCustomVerificationEmailTemplate,DELETE,/v2/email/custom-verification-email-templates/sample-templatename,ses:DeleteCustomVerificationEmailTemplate+GetCustomVerificationEmailTemplate,GET,/v2/email/custom-verification-email-templates/sample-templatename,ses:GetCustomVerificationEmailTemplate+UpdateCustomVerificationEmailTemplate,PUT,/v2/email/custom-verification-email-templates/sample-templatename,ses:UpdateCustomVerificationEmailTemplate+ListDedicatedIpPools,GET,/v2/email/dedicated-ip-pools,ses:ListDedicatedIpPools+CreateDedicatedIpPool,POST,/v2/email/dedicated-ip-pools,ses:CreateDedicatedIpPool+DeleteDedicatedIpPool,DELETE,/v2/email/dedicated-ip-pools/sample-poolname,ses:DeleteDedicatedIpPool+GetDedicatedIpPool,GET,/v2/email/dedicated-ip-pools/sample-poolname,ses:GetDedicatedIpPool+PutDedicatedIpPoolScalingAttributes,PUT,/v2/email/dedicated-ip-pools/sample-poolname/scaling,ses:PutDedicatedIpPoolScalingAttributes+GetDedicatedIps,GET,/v2/email/dedicated-ips,ses:GetDedicatedIps+GetDedicatedIp,GET,/v2/email/dedicated-ips/sample-ip,ses:GetDedicatedIp+PutDedicatedIpInPool,PUT,/v2/email/dedicated-ips/sample-ip/pool,ses:PutDedicatedIpInPool+PutDedicatedIpWarmupAttributes,PUT,/v2/email/dedicated-ips/sample-ip/warmup,ses:PutDedicatedIpWarmupAttributes+GetDeliverabilityDashboardOptions,GET,/v2/email/deliverability-dashboard,ses:GetDeliverabilityDashboardOptions+PutDeliverabilityDashboardOption,PUT,/v2/email/deliverability-dashboard,ses:PutDeliverabilityDashboardOption+GetBlacklistReports,GET,/v2/email/deliverability-dashboard/blacklist-report,ses:GetBlacklistReports+GetDomainDeliverabilityCampaign,GET,/v2/email/deliverability-dashboard/campaigns/sample-campaignid,ses:GetDomainDeliverabilityCampaign+ListDomainDeliverabilityCampaigns,GET,/v2/email/deliverability-dashboard/domains/sample-subscribeddomain/campaigns,ses:ListDomainDeliverabilityCampaigns+GetDomainStatisticsReport,GET,/v2/email/deliverability-dashboard/statistics-report/sample-domain,ses:GetDomainStatisticsReport+CreateDeliverabilityTestReport,POST,/v2/email/deliverability-dashboard/test,ses:CreateDeliverabilityTestReport+ListDeliverabilityTestReports,GET,/v2/email/deliverability-dashboard/test-reports,ses:ListDeliverabilityTestReports+GetDeliverabilityTestReport,GET,/v2/email/deliverability-dashboard/test-reports/sample-reportid,ses:GetDeliverabilityTestReport+GetEmailAddressInsights,POST,/v2/email/email-address-insights/,ses:GetEmailAddressInsights+CreateExportJob,POST,/v2/email/export-jobs,ses:CreateExportJob+GetExportJob,GET,/v2/email/export-jobs/sample-jobid,ses:GetExportJob+CancelExportJob,PUT,/v2/email/export-jobs/sample-jobid/cancel,ses:CancelExportJob+ListEmailIdentities,GET,/v2/email/identities,ses:ListEmailIdentities+CreateEmailIdentity,POST,/v2/email/identities,ses:CreateEmailIdentity+DeleteEmailIdentity,DELETE,/v2/email/identities/sample-emailidentity,ses:DeleteEmailIdentity+GetEmailIdentity,GET,/v2/email/identities/sample-emailidentity,ses:GetEmailIdentity+PutEmailIdentityConfigurationSetAttributes,PUT,/v2/email/identities/sample-emailidentity/configuration-set,ses:PutEmailIdentityConfigurationSetAttributes+PutEmailIdentityDkimAttributes,PUT,/v2/email/identities/sample-emailidentity/dkim,ses:PutEmailIdentityDkimAttributes+PutEmailIdentityDkimSigningAttributes,PUT,/v2/email/identities/sample-emailidentity/dkim/signing,ses:PutEmailIdentityDkimSigningAttributes+PutEmailIdentityFeedbackAttributes,PUT,/v2/email/identities/sample-emailidentity/feedback,ses:PutEmailIdentityFeedbackAttributes+PutEmailIdentityMailFromAttributes,PUT,/v2/email/identities/sample-emailidentity/mail-from,ses:PutEmailIdentityMailFromAttributes+GetEmailIdentityPolicies,GET,/v2/email/identities/sample-emailidentity/policies,ses:GetEmailIdentityPolicies+DeleteEmailIdentityPolicy,DELETE,/v2/email/identities/sample-emailidentity/policies/sample-policyname,ses:DeleteEmailIdentityPolicy+CreateEmailIdentityPolicy,POST,/v2/email/identities/sample-emailidentity/policies/sample-policyname,ses:CreateEmailIdentityPolicy+UpdateEmailIdentityPolicy,PUT,/v2/email/identities/sample-emailidentity/policies/sample-policyname,ses:UpdateEmailIdentityPolicy+CreateImportJob,POST,/v2/email/import-jobs,ses:CreateImportJob+ListImportJobs,POST,/v2/email/import-jobs/list,ses:ListImportJobs+GetImportJob,GET,/v2/email/import-jobs/sample-jobid,ses:GetImportJob+GetMessageInsights,GET,/v2/email/insights/sample-messageid/,ses:GetMessageInsights+ListExportJobs,POST,/v2/email/list-export-jobs,ses:ListExportJobs+BatchGetMetricData,POST,/v2/email/metrics/batch,ses:BatchGetMetricData+ListMultiRegionEndpoints,GET,/v2/email/multi-region-endpoints,ses:ListMultiRegionEndpoints+CreateMultiRegionEndpoint,POST,/v2/email/multi-region-endpoints,ses:CreateMultiRegionEndpoint+DeleteMultiRegionEndpoint,DELETE,/v2/email/multi-region-endpoints/sample-endpointname,ses:DeleteMultiRegionEndpoint+GetMultiRegionEndpoint,GET,/v2/email/multi-region-endpoints/sample-endpointname,ses:GetMultiRegionEndpoint+SendBulkEmail,POST,/v2/email/outbound-bulk-emails,ses:SendBulkEmail+SendCustomVerificationEmail,POST,/v2/email/outbound-custom-verification-emails,ses:SendCustomVerificationEmail+SendEmail,POST,/v2/email/outbound-emails,ses:SendEmail+ListReputationEntities,POST,/v2/email/reputation/entities,ses:ListReputationEntities+GetReputationEntity,GET,/v2/email/reputation/entities/sample-reputationentitytype/sample-reputationentityreference,ses:GetReputationEntity+UpdateReputationEntityCustomerManagedStatus,PUT,/v2/email/reputation/entities/sample-reputationentitytype/sample-reputationentityreference/customer-managed-status,ses:UpdateReputationEntityCustomerManagedStatus+UpdateReputationEntityPolicy,PUT,/v2/email/reputation/entities/sample-reputationentitytype/sample-reputationentityreference/policy,ses:UpdateReputationEntityPolicy+ListResourceTenants,POST,/v2/email/resources/tenants/list,ses:ListResourceTenants+ListSuppressedDestinations,GET,/v2/email/suppression/addresses,ses:ListSuppressedDestinations+PutSuppressedDestination,PUT,/v2/email/suppression/addresses,ses:PutSuppressedDestination+DeleteSuppressedDestination,DELETE,/v2/email/suppression/addresses/sample-emailaddress,ses:DeleteSuppressedDestination+GetSuppressedDestination,GET,/v2/email/suppression/addresses/sample-emailaddress,ses:GetSuppressedDestination+UntagResource,DELETE,/v2/email/tags,ses:UntagResource+ListTagsForResource,GET,/v2/email/tags,ses:ListTagsForResource+TagResource,POST,/v2/email/tags,ses:TagResource+ListEmailTemplates,GET,/v2/email/templates,ses:ListEmailTemplates+CreateEmailTemplate,POST,/v2/email/templates,ses:CreateEmailTemplate+DeleteEmailTemplate,DELETE,/v2/email/templates/sample-templatename,ses:DeleteEmailTemplate+GetEmailTemplate,GET,/v2/email/templates/sample-templatename,ses:GetEmailTemplate+UpdateEmailTemplate,PUT,/v2/email/templates/sample-templatename,ses:UpdateEmailTemplate+TestRenderEmailTemplate,POST,/v2/email/templates/sample-templatename/render,ses:TestRenderEmailTemplate+PutTenantSuppressionAttributes,POST,/v2/email/tenant/suppression,ses:PutTenantSuppressionAttributes+CreateTenant,POST,/v2/email/tenants,ses:CreateTenant+DeleteTenant,POST,/v2/email/tenants/delete,ses:DeleteTenant+GetTenant,POST,/v2/email/tenants/get,ses:GetTenant+ListTenants,POST,/v2/email/tenants/list,ses:ListTenants+CreateTenantResourceAssociation,POST,/v2/email/tenants/resources,ses:CreateTenantResourceAssociation+DeleteTenantResourceAssociation,POST,/v2/email/tenants/resources/delete,ses:DeleteTenantResourceAssociation+ListTenantResources,POST,/v2/email/tenants/resources/list,ses:ListTenantResources+ListRecommendations,POST,/v2/email/vdm/recommendations,ses:ListRecommendations