A REST request gets its IAM action from IamActionRegistry's hand-written rules, and a route no rule maps gets none, which the caller allows: under enforcement such a request runs unchecked. IamRestRoutes (#7085) reads botocore's routes at runtime, but only for the operations a hand-written list enrolls, ValidatePolicy alone, and only by literal paths. A request no rule maps is now the operation whose route in botocore's model it matches, and it is checked as that operation's action (IamAuthorizedActions), as a Query or JSON request naming its operation is, when Floci checks it on the resources AWS does: those its request names, which ResourceArnBuilder builds for its namespace or the vendored request resources read for the operation, or none, when the Service Reference gives the action no resource type, as AWS authorizes such an action on `*`. An action AWS checks on a resource Floci neither builds nor reads stays unchecked, as before: checked on `*`, a grant scoped to its resource would be refused. That is the reason #7085 gave for enrolling ValidatePolicy alone, now read from generated data instead of a list. - The actions of no resource type come from the Service Reference's Actions, through regen_iam_authorized_actions.py, into iam-authorized-actions.json, for each credential scope whose routes rest-routes.json reads: 88 over 7 scopes. They are read from Actions, not Operations, because the reference lists one SDK client's operations per namespace, OpenSearch's `es` client alone. --check fails until a scope rest-routes.json adds is listed, and --verify fails when AWS gives a listed action a resource type. - IamRestRoutes now matches every route of a model: literal segments, a label taking one segment, a greedy label the rest of the path, and the query a route names, which must be on the request. Of the routes a request matches, the most specific wins, segment by segment from the left a literal, then a segment mixing a literal and a label, then a label, then a greedy label; then the route naming more of the query. The path is the one the rules match, still percent-encoded and without a trailing slash, and a segment may still end in a matrix parameter, which the router ignores. - The rules come first, so nothing they map changes. S3 and API Gateway are listed as handRouted, with their reasons, and routed by their rules alone: S3 tells apart the operations of one route by their query and headers, and API Gateway is checked by HTTP method. The route generator fails when one route names two operations of any other scope. - OpenSearch Service's models, both API versions, are read under `es`: 59 of their 147 operations are checked by their routes (29 of the `es` model's 51, 30 of the `opensearch` model's 96), 53 of which ran unchecked, ListDomainNames and ListVersions among them. The other six are the VPC endpoint operations #7351 mapped by hand: their rules are removed, as their routes give the same actions. - Access Analyzer's 9 operations of no resource type are checked by their routes, ListAnalyzers among those Floci serves, where ValidatePolicy alone was; its analyzer operations are not. Lambda's, EKS's, Scheduler's, Pipes' and DSQL's resources are built by hand and their routes all mapped by their rules, so none is checked differently. IamRestRouteCoverageTest checks every route of a scope not hand-routed: by the vendored routes alone it is its own operation, and through the registry it is its action when its resources are built by hand or read, or its action has no resource type, and unmapped otherwise. iam.md and access-analyzer.md say which routes are checked.
3.7 KiB
IAM Access Analyzer
Protocol: REST JSON
Endpoint: http://localhost:4566
Floci supports the analyzer lifecycle and basic policy validation used by local governance workflows.
Supported Actions
| Action | Description |
|---|---|
ValidatePolicy |
Checks basic policy syntax and grammar and returns paginated findings with source locations. |
ListAnalyzers |
- |
CreateAnalyzer |
- |
DeleteAnalyzer |
- |
GetAnalyzer |
- |
Analyzer state is account and Region scoped and persisted through StorageFactory.
Policy validation
ValidatePolicy accepts a JSON policy string at POST /policy/validation. It does not require an analyzer, persist the submitted policy, or change permissions. It supports IDENTITY_POLICY, RESOURCE_POLICY, SERVICE_CONTROL_POLICY, and RESOURCE_CONTROL_POLICY requests. With IAM enforcement enabled, callers need access-analyzer:ValidatePolicy on Resource: "*", and ListAnalyzers needs access-analyzer:ListAnalyzers the same way, both actions AWS authorizes on no resource. The analyzer operations, which AWS authorizes on the analyzer, are not checked yet.
The local checks cover malformed JSON, repeated object keys, document and statement shapes, required elements, mutually exclusive elements, policy versions, duplicate statement identifiers, principal key names, condition operator names, and selected empty-value suggestions. Resource policies accept the API's supported validatePolicyResourceType values; the IAM trust-policy type permits statements without a resource element. Generic resource policies containing trust actions use the same trust-policy context. BinaryEquals is recognized as policy syntax, but Floci's IAM evaluator does not execute it.
Findings include an issue code, severity, explanation, documentation link, JSON path, and source span. Spans refer to the original policy string, with zero-based offsets and columns, one-based lines, and an exclusive end. Malformed policy JSON and repeated object keys return JSON_SYNTAX_ERROR findings in a successful response. Repeated-key findings point to the repeated key in the submitted text. Invalid request members return ValidationException; malformed outer request JSON returns SerializationException.
Use maxResults and nextToken query parameters to page through findings. The default page size is 100 and the supported range is 1 to 1000. Tokens are opaque, bound to the policy document, policy type, resource type, and locale, and expire when Floci restarts. The page size may change between requests.
These are basic syntax and grammar checks, not the full AWS policy analyzer. Floci does not validate action existence, service-specific resource or condition semantics, or security best practices. An empty findings list only means that the implemented checks found no issue. Accepted locale values currently return English explanations. These limits also apply when a resource type is supplied.
AWS-compatible failures
Analyzer names, types, tags, pagination, duplicate names, and local analyzer quotas are validated. Floci returns ValidationException, ConflictException, ResourceNotFoundException, and ServiceQuotaExceededException for deterministic conditions represented by local state.
AWS also models AccessDeniedException, InternalServerException, and ThrottlingException. Floci does not inject provider-side failures that cannot be derived from the request or emulator state.
See the IAM Access Analyzer API Reference.
Configuration
| Variable | Default | Description |
|---|---|---|
FLOCI_SERVICES_ACCESSANALYZER_ENABLED |
true |
Enable or disable IAM Access Analyzer |