fix(ses): authorize SES v2 calls against their IAM actions under enforcement (#4775)

SES v1 is a Query API, so IAM enforcement resolves its action from the
request's Action like any other. SES v2 is REST-JSON under /v2/email and
IamActionRegistry had no rules for it, so every v2 call resolved to no action,
which the enforcement filter lets through: with enforcement on, the whole v2
API was unguarded, CreateConfigurationSetEventDestination included.

IamActionRegistry now has one rule per operation in the SES v2 model
(botocore sesv2/2019-09-27, 112 operations), each mapped to the IAM action
AWS's service reference lists for it
(servicereference.us-east-1.amazonaws.com/v1/ses/ses.json). That is always
ses:<Operation>, in the ses namespace v1 and v2 share. 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 is a v1
action), so it takes its name too. No two rules can match the
same path, so their order does not matter. The 20 operations Floci does not
serve yet are mapped too, so a route added later is guarded from the start.

Two ways round a rule are closed for every REST service, not only SES v2.
IamActionRegistry.resolve read X-Amz-Target before the path rules, so a REST
request carrying one was checked as whatever operation the header named: a
POST /v2/email/outbound-emails with X-Amz-Target: SES.GetAccount went through
for a caller denied ses:SendEmail. REST-claimed requests now resolve through a
new resolveRoute, from method and path alone. And the rules matched the
decoded path while the router matches the encoded one, so a%2Fb@example.com
reached the suppressed-destination endpoint while its decoded path matched no
rule and passed as an unknown action. resolveRoute matches the path still
percent-encoded, read from the request URI since RESTEasy Reactive does not
serve UriInfo.getPath(false).

A denied call answers AccessDeniedException with HTTP 403, as the SES v2 API
Reference lists among its common errors. Like v1, v2 is evaluated with
resource "*"; resource ARNs for SES, and the extra actions the service
reference lists for some operations (ses:TagResource on the create operations,
iam:PassRole for event destinations), are left for later and documented in
docs/services/ses.md.

IamActionRegistryTest checks every operation against a table generated from
the model and the service reference, not from the rule table.
SesV2IamEnforcementIntegrationTest shows a caller without SES permissions
refused, a single allowed action granting only that operation, a target header
not changing the checked action, and an encoded slash still authorized.
This commit is contained in:
Priamo Germosen authored and GitHub committed 2026-09-30 23:29:23 -05:00
1 parent be87f99220
commit 275d874fed
9 files changed
+498 -15

No files matched your search

+5
View File
@@ -561,6 +561,11 @@ requests. REST-JSON requests return HTTP 403 `AccessDeniedException`; AWS Query
requests retain HTTP 403 XML `AccessDenied` responses. The routed protocol determines
the 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 policies
When `FLOCI_SERVICES_IAM_ENFORCEMENT_ENABLED` is active, Floci also queries registered `ResourcePolicyProvider` SPI implementations (such as S3 bucket policies) during request authorization:
+11
View File
@@ -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 `user@example.com` but not `user@mail.example.com` 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.
@@ -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);
@@ -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,
@@ -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);
@@ -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);
}
@Test
@@ -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%2Fb@example.com", new MultivaluedHashMap<>(),
MediaType.APPLICATION_JSON_TYPE, "{}")));
assertEquals("ses:DeleteSuppressedDestination", registry.resolveRoute("ses",
mockCtx("DELETE", "/v2/email/suppression/addresses/a%2Fb@example.com", new MultivaluedHashMap<>(),
MediaType.APPLICATION_JSON_TYPE, "{}")));
}
@Test
void 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);
@@ -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":"sender@example.com","Destination":{"ToAddresses":["to@example.com"]},
"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%2Fb@example.com"));
assertAccessDenied(given()
.urlEncodingEnabled(false)
.header("Authorization", auth(accessKeyId, "ses"))
.when().delete("/v2/email/suppression/addresses/a%2Fb@example.com"));
}
/** 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";
}
}
@@ -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
1 # Every SES v2 operation: a sample of its path from the SES v2 model (botocore 1.43.62,
2 # sesv2/2019-09-27) and the IAM action AWS's service reference lists for it
3 # (https://servicereference.us-east-1.amazonaws.com/v1/ses/ses.json, read 2026-09-30).
4 # SendEmail has no entry there; the Service Authorization Reference's SES v2 page defines
5 # ses:SendEmail as v2's only send action (ses:SendRawEmail belongs to v1).
6 GetAccount,GET,/v2/email/account,ses:GetAccount
7 PutAccountDedicatedIpWarmupAttributes,PUT,/v2/email/account/dedicated-ips/warmup,ses:PutAccountDedicatedIpWarmupAttributes
8 PutAccountDetails,POST,/v2/email/account/details,ses:PutAccountDetails
9 PutAccountPricingAttributes,PUT,/v2/email/account/pricing-attributes,ses:PutAccountPricingAttributes
10 PutAccountSendingAttributes,PUT,/v2/email/account/sending,ses:PutAccountSendingAttributes
11 PutAccountSuppressionAttributes,PUT,/v2/email/account/suppression,ses:PutAccountSuppressionAttributes
12 PutAccountVdmAttributes,PUT,/v2/email/account/vdm,ses:PutAccountVdmAttributes
13 ListConfigurationSets,GET,/v2/email/configuration-sets,ses:ListConfigurationSets
14 CreateConfigurationSet,POST,/v2/email/configuration-sets,ses:CreateConfigurationSet
15 DeleteConfigurationSet,DELETE,/v2/email/configuration-sets/sample-configurationsetname,ses:DeleteConfigurationSet
16 GetConfigurationSet,GET,/v2/email/configuration-sets/sample-configurationsetname,ses:GetConfigurationSet
17 PutConfigurationSetArchivingOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/archiving-options,ses:PutConfigurationSetArchivingOptions
18 PutConfigurationSetDeliveryOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/delivery-options,ses:PutConfigurationSetDeliveryOptions
19 GetConfigurationSetEventDestinations,GET,/v2/email/configuration-sets/sample-configurationsetname/event-destinations,ses:GetConfigurationSetEventDestinations
20 CreateConfigurationSetEventDestination,POST,/v2/email/configuration-sets/sample-configurationsetname/event-destinations,ses:CreateConfigurationSetEventDestination
21 DeleteConfigurationSetEventDestination,DELETE,/v2/email/configuration-sets/sample-configurationsetname/event-destinations/sample-eventdestinationname,ses:DeleteConfigurationSetEventDestination
22 UpdateConfigurationSetEventDestination,PUT,/v2/email/configuration-sets/sample-configurationsetname/event-destinations/sample-eventdestinationname,ses:UpdateConfigurationSetEventDestination
23 PutConfigurationSetReputationOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/reputation-options,ses:PutConfigurationSetReputationOptions
24 PutConfigurationSetSendingOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/sending,ses:PutConfigurationSetSendingOptions
25 PutConfigurationSetSuppressionOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/suppression-options,ses:PutConfigurationSetSuppressionOptions
26 PutConfigurationSetTrackingOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/tracking-options,ses:PutConfigurationSetTrackingOptions
27 PutConfigurationSetVdmOptions,PUT,/v2/email/configuration-sets/sample-configurationsetname/vdm-options,ses:PutConfigurationSetVdmOptions
28 ListContactLists,GET,/v2/email/contact-lists,ses:ListContactLists
29 CreateContactList,POST,/v2/email/contact-lists,ses:CreateContactList
30 DeleteContactList,DELETE,/v2/email/contact-lists/sample-contactlistname,ses:DeleteContactList
31 GetContactList,GET,/v2/email/contact-lists/sample-contactlistname,ses:GetContactList
32 UpdateContactList,PUT,/v2/email/contact-lists/sample-contactlistname,ses:UpdateContactList
33 CreateContact,POST,/v2/email/contact-lists/sample-contactlistname/contacts,ses:CreateContact
34 ListContacts,POST,/v2/email/contact-lists/sample-contactlistname/contacts/list,ses:ListContacts
35 DeleteContact,DELETE,/v2/email/contact-lists/sample-contactlistname/contacts/sample-emailaddress,ses:DeleteContact
36 GetContact,GET,/v2/email/contact-lists/sample-contactlistname/contacts/sample-emailaddress,ses:GetContact
37 UpdateContact,PUT,/v2/email/contact-lists/sample-contactlistname/contacts/sample-emailaddress,ses:UpdateContact
38 ListCustomVerificationEmailTemplates,GET,/v2/email/custom-verification-email-templates,ses:ListCustomVerificationEmailTemplates
39 CreateCustomVerificationEmailTemplate,POST,/v2/email/custom-verification-email-templates,ses:CreateCustomVerificationEmailTemplate
40 DeleteCustomVerificationEmailTemplate,DELETE,/v2/email/custom-verification-email-templates/sample-templatename,ses:DeleteCustomVerificationEmailTemplate
41 GetCustomVerificationEmailTemplate,GET,/v2/email/custom-verification-email-templates/sample-templatename,ses:GetCustomVerificationEmailTemplate
42 UpdateCustomVerificationEmailTemplate,PUT,/v2/email/custom-verification-email-templates/sample-templatename,ses:UpdateCustomVerificationEmailTemplate
43 ListDedicatedIpPools,GET,/v2/email/dedicated-ip-pools,ses:ListDedicatedIpPools
44 CreateDedicatedIpPool,POST,/v2/email/dedicated-ip-pools,ses:CreateDedicatedIpPool
45 DeleteDedicatedIpPool,DELETE,/v2/email/dedicated-ip-pools/sample-poolname,ses:DeleteDedicatedIpPool
46 GetDedicatedIpPool,GET,/v2/email/dedicated-ip-pools/sample-poolname,ses:GetDedicatedIpPool
47 PutDedicatedIpPoolScalingAttributes,PUT,/v2/email/dedicated-ip-pools/sample-poolname/scaling,ses:PutDedicatedIpPoolScalingAttributes
48 GetDedicatedIps,GET,/v2/email/dedicated-ips,ses:GetDedicatedIps
49 GetDedicatedIp,GET,/v2/email/dedicated-ips/sample-ip,ses:GetDedicatedIp
50 PutDedicatedIpInPool,PUT,/v2/email/dedicated-ips/sample-ip/pool,ses:PutDedicatedIpInPool
51 PutDedicatedIpWarmupAttributes,PUT,/v2/email/dedicated-ips/sample-ip/warmup,ses:PutDedicatedIpWarmupAttributes
52 GetDeliverabilityDashboardOptions,GET,/v2/email/deliverability-dashboard,ses:GetDeliverabilityDashboardOptions
53 PutDeliverabilityDashboardOption,PUT,/v2/email/deliverability-dashboard,ses:PutDeliverabilityDashboardOption
54 GetBlacklistReports,GET,/v2/email/deliverability-dashboard/blacklist-report,ses:GetBlacklistReports
55 GetDomainDeliverabilityCampaign,GET,/v2/email/deliverability-dashboard/campaigns/sample-campaignid,ses:GetDomainDeliverabilityCampaign
56 ListDomainDeliverabilityCampaigns,GET,/v2/email/deliverability-dashboard/domains/sample-subscribeddomain/campaigns,ses:ListDomainDeliverabilityCampaigns
57 GetDomainStatisticsReport,GET,/v2/email/deliverability-dashboard/statistics-report/sample-domain,ses:GetDomainStatisticsReport
58 CreateDeliverabilityTestReport,POST,/v2/email/deliverability-dashboard/test,ses:CreateDeliverabilityTestReport
59 ListDeliverabilityTestReports,GET,/v2/email/deliverability-dashboard/test-reports,ses:ListDeliverabilityTestReports
60 GetDeliverabilityTestReport,GET,/v2/email/deliverability-dashboard/test-reports/sample-reportid,ses:GetDeliverabilityTestReport
61 GetEmailAddressInsights,POST,/v2/email/email-address-insights/,ses:GetEmailAddressInsights
62 CreateExportJob,POST,/v2/email/export-jobs,ses:CreateExportJob
63 GetExportJob,GET,/v2/email/export-jobs/sample-jobid,ses:GetExportJob
64 CancelExportJob,PUT,/v2/email/export-jobs/sample-jobid/cancel,ses:CancelExportJob
65 ListEmailIdentities,GET,/v2/email/identities,ses:ListEmailIdentities
66 CreateEmailIdentity,POST,/v2/email/identities,ses:CreateEmailIdentity
67 DeleteEmailIdentity,DELETE,/v2/email/identities/sample-emailidentity,ses:DeleteEmailIdentity
68 GetEmailIdentity,GET,/v2/email/identities/sample-emailidentity,ses:GetEmailIdentity
69 PutEmailIdentityConfigurationSetAttributes,PUT,/v2/email/identities/sample-emailidentity/configuration-set,ses:PutEmailIdentityConfigurationSetAttributes
70 PutEmailIdentityDkimAttributes,PUT,/v2/email/identities/sample-emailidentity/dkim,ses:PutEmailIdentityDkimAttributes
71 PutEmailIdentityDkimSigningAttributes,PUT,/v2/email/identities/sample-emailidentity/dkim/signing,ses:PutEmailIdentityDkimSigningAttributes
72 PutEmailIdentityFeedbackAttributes,PUT,/v2/email/identities/sample-emailidentity/feedback,ses:PutEmailIdentityFeedbackAttributes
73 PutEmailIdentityMailFromAttributes,PUT,/v2/email/identities/sample-emailidentity/mail-from,ses:PutEmailIdentityMailFromAttributes
74 GetEmailIdentityPolicies,GET,/v2/email/identities/sample-emailidentity/policies,ses:GetEmailIdentityPolicies
75 DeleteEmailIdentityPolicy,DELETE,/v2/email/identities/sample-emailidentity/policies/sample-policyname,ses:DeleteEmailIdentityPolicy
76 CreateEmailIdentityPolicy,POST,/v2/email/identities/sample-emailidentity/policies/sample-policyname,ses:CreateEmailIdentityPolicy
77 UpdateEmailIdentityPolicy,PUT,/v2/email/identities/sample-emailidentity/policies/sample-policyname,ses:UpdateEmailIdentityPolicy
78 CreateImportJob,POST,/v2/email/import-jobs,ses:CreateImportJob
79 ListImportJobs,POST,/v2/email/import-jobs/list,ses:ListImportJobs
80 GetImportJob,GET,/v2/email/import-jobs/sample-jobid,ses:GetImportJob
81 GetMessageInsights,GET,/v2/email/insights/sample-messageid/,ses:GetMessageInsights
82 ListExportJobs,POST,/v2/email/list-export-jobs,ses:ListExportJobs
83 BatchGetMetricData,POST,/v2/email/metrics/batch,ses:BatchGetMetricData
84 ListMultiRegionEndpoints,GET,/v2/email/multi-region-endpoints,ses:ListMultiRegionEndpoints
85 CreateMultiRegionEndpoint,POST,/v2/email/multi-region-endpoints,ses:CreateMultiRegionEndpoint
86 DeleteMultiRegionEndpoint,DELETE,/v2/email/multi-region-endpoints/sample-endpointname,ses:DeleteMultiRegionEndpoint
87 GetMultiRegionEndpoint,GET,/v2/email/multi-region-endpoints/sample-endpointname,ses:GetMultiRegionEndpoint
88 SendBulkEmail,POST,/v2/email/outbound-bulk-emails,ses:SendBulkEmail
89 SendCustomVerificationEmail,POST,/v2/email/outbound-custom-verification-emails,ses:SendCustomVerificationEmail
90 SendEmail,POST,/v2/email/outbound-emails,ses:SendEmail
91 ListReputationEntities,POST,/v2/email/reputation/entities,ses:ListReputationEntities
92 GetReputationEntity,GET,/v2/email/reputation/entities/sample-reputationentitytype/sample-reputationentityreference,ses:GetReputationEntity
93 UpdateReputationEntityCustomerManagedStatus,PUT,/v2/email/reputation/entities/sample-reputationentitytype/sample-reputationentityreference/customer-managed-status,ses:UpdateReputationEntityCustomerManagedStatus
94 UpdateReputationEntityPolicy,PUT,/v2/email/reputation/entities/sample-reputationentitytype/sample-reputationentityreference/policy,ses:UpdateReputationEntityPolicy
95 ListResourceTenants,POST,/v2/email/resources/tenants/list,ses:ListResourceTenants
96 ListSuppressedDestinations,GET,/v2/email/suppression/addresses,ses:ListSuppressedDestinations
97 PutSuppressedDestination,PUT,/v2/email/suppression/addresses,ses:PutSuppressedDestination
98 DeleteSuppressedDestination,DELETE,/v2/email/suppression/addresses/sample-emailaddress,ses:DeleteSuppressedDestination
99 GetSuppressedDestination,GET,/v2/email/suppression/addresses/sample-emailaddress,ses:GetSuppressedDestination
100 UntagResource,DELETE,/v2/email/tags,ses:UntagResource
101 ListTagsForResource,GET,/v2/email/tags,ses:ListTagsForResource
102 TagResource,POST,/v2/email/tags,ses:TagResource
103 ListEmailTemplates,GET,/v2/email/templates,ses:ListEmailTemplates
104 CreateEmailTemplate,POST,/v2/email/templates,ses:CreateEmailTemplate
105 DeleteEmailTemplate,DELETE,/v2/email/templates/sample-templatename,ses:DeleteEmailTemplate
106 GetEmailTemplate,GET,/v2/email/templates/sample-templatename,ses:GetEmailTemplate
107 UpdateEmailTemplate,PUT,/v2/email/templates/sample-templatename,ses:UpdateEmailTemplate
108 TestRenderEmailTemplate,POST,/v2/email/templates/sample-templatename/render,ses:TestRenderEmailTemplate
109 PutTenantSuppressionAttributes,POST,/v2/email/tenant/suppression,ses:PutTenantSuppressionAttributes
110 CreateTenant,POST,/v2/email/tenants,ses:CreateTenant
111 DeleteTenant,POST,/v2/email/tenants/delete,ses:DeleteTenant
112 GetTenant,POST,/v2/email/tenants/get,ses:GetTenant
113 ListTenants,POST,/v2/email/tenants/list,ses:ListTenants
114 CreateTenantResourceAssociation,POST,/v2/email/tenants/resources,ses:CreateTenantResourceAssociation
115 DeleteTenantResourceAssociation,POST,/v2/email/tenants/resources/delete,ses:DeleteTenantResourceAssociation
116 ListTenantResources,POST,/v2/email/tenants/resources/list,ses:ListTenantResources
117 ListRecommendations,POST,/v2/email/vdm/recommendations,ses:ListRecommendations