Managing AWS Permissions

Guardrails integrates with AWS IAM to provide a flexible model for managing access to your AWS accounts. Guardrails can create and manage IAM roles, users, groups, and policies that map Guardrails permission grants to AWS access.

Permission Modes

Set the AWS > Turbot > Permissions policy to control how Guardrails manages AWS permissions:

ModePolicy ValuePermissions UIAWS Login via GuardrailsManaged PoliciesManaged RolesManaged Users
NoneEnforce: None
Policy-OnlyEnforce: Policy-Only Modex
Role ModeEnforce: Role Modexxxx
User ModeEnforce: User Modexxxxx

None: Guardrails does not manage any IAM resources. Existing Guardrails-managed IAM resources are removed. No lockdown or boundary policies are created.

Policy-Only Mode: Guardrails manages IAM policies for lockdown and boundary enforcement, but does not create roles, users, or groups. No ability to assign permissions in the Guardrails console. This is the minimum mode required for lockdown policies.

Role Mode (recommended): Guardrails creates IAM roles and policies in each account. Users assume roles via federation. Full permission management capabilities.

User Mode: Includes all the capabilities of Role Mode, plus Guardrails creates IAM users and groups. See User Mode for details specific to this mode.

resource "turbot_policy_setting" "aws_permissions" {
  resource = "id-of-account-or-folder"
  type     = "tmod:@turbot/aws-iam#/policy/types/permissions"
  value    = "Enforce: Role Mode"
}

Standard Levels

The Permissions > Levels policies configure which standard Guardrails roles/groups/policies are created. Levels enabled in this policy appear in the UI and can be assigned to users:

LevelDescription
UserBasic access to the Guardrails console. No AWS access.
MetadataRead-only access to resource metadata (tags, descriptions).
ReadOnlyRead access to all resource data.
OperatorOperational permissions (start/stop instances, etc.) but not create/delete.
AdminCreate, modify, and delete resources.
OwnerFull administrative access including IAM management.
SuperUserUnrestricted access. Use sparingly. Not applicable on individual services.

Account-level permission levels (AWS/Admin, AWS/Metadata, etc.) are configured in AWS > Permissions > Levels. By default, all levels are enabled.

Service-level permission levels (AWS/S3/Admin, AWS/EC2/Operator, etc.) are configured in AWS > {Service} > Permissions > Levels. Use AWS > Permissions > Levels [Default] to set the default for all services. By default, service-level permissions are not enabled.

Example use cases:

Modifiers

Permission Level Modifiers let you customize the standard permissions that Guardrails generates. Modifiers work with the Guardrails IAM rules engine to modify access directly in the Guardrails-managed IAM policies.

Use modifiers to:

How Modifiers Work

Modifiers are cumulative in the same way that levels are. If you add a permission to the Metadata level, it's also added to ReadOnly, Operator, and Admin.

Modifier policies exist at both the AWS (account) level and per-service level:

[!NOTE] If multiple service-level policies assign an operation to different levels, the operation is assigned at the lower permission level in the account permissions. For example, if S3:CreateBucket is S3/Operator and ElasticBeanstalk/User, it becomes AWS/User.

[!NOTE] If an operation is set to None in one service-level modifier but another service has it defined at that level, it is NOT removed at the AWS level.

Override priority:

  1. Guardrails defaults (built-in)
  2. Capability Modifier Policies (override defaults)
  3. Custom Modifiers (override capability modifiers)

Modifier Policy Format

The modifier policy takes an array of permission: level assignments:

- "ec2:DescribeInstance": "admin"
- "s3:PutObject": "admin"
resource "turbot_policy_setting" "aws_permissions_modifiers" {
  resource = "id-of-account-or-folder"
  type     = "tmod:@turbot/aws-iam#/policy/types/permissionsLevelsModifiers"
  value    = jsonencode([
    { "s3:PutObject" : "admin" },
    { "ec2:DescribeInstance" : "admin" }
  ])
}

Capability Modifier Policies

Capability Modifiers are pre-defined modifiers provided by Guardrails. They're commonly used to force administration of resources through the Guardrails control plane and disallow direct access to underlying AWS APIs.

Examples:

Capability Modifier Policies are applied after the built-in permissions but before custom Modifiers, so custom Modifiers can override them.

Custom Role Levels

Custom Role Levels let you map your existing IAM roles to Guardrails permission levels. The custom roles appear in the UI as grantable permissions, named AWS/Role/{RoleName}.

Use cases:

Setup

Specify custom roles as YAML lists in the AWS > Turbot > Permissions > Custom Levels [Account] or Custom Levels [Folder] policies. Use [Account] for roles in a single account, [Folder] for roles that exist across multiple accounts.

The assume role policy on each custom role must allow the Guardrails IAM role to assume it:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::{account_id}:role/{turbot_iam_role}"
      },
      "Action": "sts:AssumeRole"
    }
  ]
}

The assume role chain is: Turbot Master Account → Guardrails IAM Role → Custom Role. This is role chaining, which AWS limits to a maximum 1-hour session duration.

Troubleshooting Custom Roles

  1. Verify AWS > Turbot > Permissions is at least Enforce: Role Mode.
  2. Verify the Guardrails IAM role has permission to assume the custom role.
  3. Verify the custom role exists in the account and has a CMDB entry in Guardrails.
  4. Verify spelling in the Custom Levels policy. Use the role name, not the full ARN.
  5. For Custom Levels [Account], the role only appears in the Grant Permission dialog when the resource scope is that account. Use Custom Levels [Folder] to make roles appear at folder level.
  6. Verify the end user has a profile in Guardrails (created on first login or via Terraform).
  7. If Guardrails shows an error assuming the custom role, check the assume role policy on the custom role.

Lockdown and Boundary Policies

Guardrails uses IAM policies to enforce restrictions on both Guardrails-managed and customer-managed users and roles. There are two mechanisms:

Boundary Policies (Hard Limits)

Boundary policies set the maximum permissions a user can have using AWS permissions boundaries. They create a hard ceiling. If a service or region is not in the boundary, there is no access at all, even for Guardrails or SuperUser.

Lockdown Policies (Soft Restrictions)

Lockdown policies add explicit deny statements to IAM policies. They're more granular than boundary policies and support Metadata Only in addition to Enabled/Disabled.

Configuration Policies

PurposeBoundary (Hard)Lockdown (Soft)
Enable/Disable RegionsAWS > Turbot > Permissions > Lockdown > Region BoundaryAWS > Turbot > Permissions > Lockdown > Regions
Enable/Disable ServicesAWS > {Service} > API EnabledAWS > {Service} > Enabled
Enforce on Customer IAMAWS > IAM > Role > Boundary / AWS > IAM > User > BoundaryAWS > IAM > Role > Policy Attachments > Required > Turbot Lockdown / AWS > IAM > User > Policy Attachments > Required > Turbot Lockdown
SuperUser BoundaryAWS > Turbot > Permissions > Superuser BoundaryN/A (lockdown never applies to SuperUser)

[!IMPORTANT] For lockdown and boundary policies to be in effect, you must have the aws-iam mod installed, the IAM service enabled (AWS > IAM > Enabled), and AWS > Turbot > Permissions set to at least Policy-Only Mode.

Common Scenarios

Restrict to specific regions but allow Guardrails/SuperUser to access all regions:

Hard-restrict to specific regions (nobody can access others, including Guardrails):

Disable a service for users but allow Guardrails/SuperUser to use it:

Disable a service completely (nobody, including Guardrails):

Enforce lockdown policies on ALL roles (including customer-managed):

Exempt the Guardrails role from boundary enforcement:

Exempt SuperUser from boundary enforcement:

Use your own boundary policy instead of the Guardrails-managed one:

Allow permissions for a service Guardrails doesn't support:

Name Prefix and Paths

Customize the naming and IAM paths for Guardrails-managed resources:

PolicyDescription
AWS > Turbot > Permissions > Name Prefix [Default]Global prefix for all Guardrails-managed IAM resources.
AWS > Turbot > Permissions > Group > Name PrefixPrefix for IAM group names.
AWS > Turbot > Permissions > Policy > Name PrefixPrefix for IAM policy names.
AWS > Turbot > Permissions > Role > Name PrefixPrefix for IAM role names.
AWS > Turbot > Permissions > Name Path [Default]Global IAM path for all Guardrails-managed IAM resources.

Troubleshooting

IssueSolution
Users can't access expected servicesCheck lockdown policies aren't restricting the service. Verify the service is Enabled. Verify the user has the correct permission level.
Boundary policy errorsEnsure the boundary policy doesn't conflict with the user's required actions. Check if the service is in the API boundary.
IAM resources not being createdVerify AWS > Turbot > Permissions is set to Enforce: Role Mode or Enforce: User Mode, not Skip or None.
Custom role not appearing in Grant dialogVerify the role exists in the account, spelling matches, and the policy is set at the correct scope ([Account] vs [Folder]).
Further assistanceOpen a Support Ticket