IAM Policy Documents Reference

This reference provides detailed information about IAM policy document structure, syntax, and components in Vidos.

Policy Document Structure

Every IAM policy document must contain the following elements:

{
    "version": "1.0",
    "permissions": [
        // One or more permission statements
    ]
}

Version

FieldTypeRequiredDescription
versionstringYesPolicy language version - currently only "1.0" is supported

Permissions

FieldTypeRequiredDescription
permissionsarrayYesArray of permission statements

Each policy document must contain at least one permission statement.

Permission Statement Structure

Each permission statement in a policy document consists of four required components:

{
    "effect": "allow",
    "scope": "management",
    "actions": ["create", "read"],
    "resources": [
        {
            "region": "eu",
            "service": "resolver",
            "resourceType": "instance",
            "resourceId": "resolver-prod"
        }
    ]
}

Effect

ValuesDescription
allowExplicitly grants access to the specified resources and actions
denyExplicitly blocks access to the specified resources and actions

Scope

ValuesDescription
managementApplies to administrative operations that create, configure, or manage services
serviceApplies to functional operations that use service capabilities

Actions

For management scope, actions include:

ActionDescription
createCreate new resources
readRead or view existing resources
updateModify existing resources
deleteRemove resources
listEnumerate resources
addAdd components to resources
removeRemove components from resources
read-statusCheck resource status
update-statusModify resource status
*All actions

For service scope, actions include:

ActionDescription
authorizePerform authorization operations
resolvePerform resolution operations
validatePerform validation operations
verifyPerform verification operations
list-methodsList available methods
*All actions

Resources

Resources define the specific Vidos resources that the permission applies to. Each resource is defined as an object with these properties:

FieldTypeRequiredDescription
regionstringYesGeographic region where the resource is located
servicestringYesVidos service the resource belongs to
resourceTypestringYesType of resource being referenced
resourceIdstringYesUnique identifier for the resource

Regions

ValueDescription
globalGlobal region for resources not tied to specific regions
euEuropean region
*All regions

Services

ValueDescription
authorizerAuthorizer service
gatewayGateway service
libraryLibrary service
logsLogs service
resolverResolver service
trailTrail service
validatorValidator service
verifierVerifier service
accountsAccounts service
iamIAM service
*All services

Resource Types

Global service resource types:

ValueDescription
userUser resource
policyPolicy resource
api-keyAPI key resource
serviceRoleService role resource
*All resource types

Regional service resource types:

ValueDescription
instanceService instance
configurationService configuration
methodService method
credentialDefinitionCredential definition
*All resource types

Resource ID

The resource ID can be a specific identifier or a wildcard:

ValueDescription
*Matches all resource IDs
[id]Specific resource identifier

Complete Example

Here's a comprehensive example of an IAM policy document that demonstrates multiple permission statements with different scopes, effects, and access patterns:

{
    "version": "1.0",
    "permissions": [
        {
            "effect": "allow",
            "scope": "management",
            "actions": ["create", "read", "update"],
            "resources": [
                {
                    "region": "eu",
                    "service": "resolver",
                    "resourceType": "instance",
                    "resourceId": "*"
                }
            ]
        },
        {
            "effect": "allow",
            "scope": "service",
            "actions": ["resolve"],
            "resources": [
                {
                    "region": "eu",
                    "service": "resolver",
                    "resourceType": "instance",
                    "resourceId": "resolver-prod"
                }
            ]
        },
        {
            "effect": "deny",
            "scope": "management",
            "actions": ["delete"],
            "resources": [
                {
                    "region": "eu",
                    "service": "resolver",
                    "resourceType": "instance",
                    "resourceId": "resolver-prod"
                }
            ]
        }
    ]
}

This policy document:

  1. Allows management operations (create, read, update) for any resolver instances in the EU region
  2. Allows use of the resolve action, but only for the specific resolver-prod instance
  3. Explicitly denies deletion of the resolver-prod instance, adding an additional safeguard

Policy Evaluation Rules

  1. An explicit deny in any policy overrides any allows
  2. If there is no explicit allow, access is denied by default
  3. Permissions are evaluated within their defined scope context
  4. More specific resource definitions take precedence over less specific ones