> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tensor9.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Revoking Access

You can disable individual permission tiers, re-enable them later, or remove all access entirely. Revocation is immediate - there is no delay or grace period.

> [!NOTE]
>
> This page is about the **standing permission tiers** you grant the controller. Ending a single [break glass](https://docs.tensor9.com/byoc/customer/security/break-glass.md) session is a separate control, at a different scope - see that page for one-off, approved sessions.

## What Happens When Permissions Are Revoked

Regardless of environment, here's what to expect when you revoke a permission tier:

| Revoked Tier | Impact |
| - | - |
| Steady-state | We lose visibility into application health. We won't know if the application is running or has issues. |
| Install | We cannot provision infrastructure or perform upgrades. The current deployment continues running. |
| Deploy | We cannot deploy new versions. The current version continues running. |
| Read-only operations | We cannot view logs or events for troubleshooting. |
| Read-write operations | We cannot restart pods or apply patches. |
| Admin operations | We cannot execute commands in containers or port-forward. |

## Disabling Permissions

> [tab] Kubernetes
>
> To disable a specific permission tier (e.g., prevent us from restarting pods), delete the corresponding cluster role binding.
>
> ```bash theme={null}
> kubectl delete clusterrolebinding <binding-name>
> ```
>
> Once deleted, the controller immediately loses that capability. We cannot perform actions that require that permission tier until you re-enable it.
>
> ### Example: Disable Admin Operations
>
> If you enabled admin operations for a troubleshooting session and want to revoke it:
>
> ```bash theme={null}
> kubectl delete clusterrolebinding <admin-ops-binding>
> ```
>
> The controller can no longer execute commands inside containers or port-forward. Read-only and read-write operations (if enabled) are unaffected.

> [tab] AWS
>
> The controller's EC2 instance uses an IAM instance profile with attached policies. To restrict what the controller can do, detach specific policies from its IAM role.
>
> ### View Current Policies
>
> ```bash theme={null}
> aws iam list-attached-role-policies --role-name <controller-role-name>
> ```
>
> ### Detach a Policy
>
> ```bash theme={null}
> aws iam detach-role-policy \
>   --role-name <controller-role-name> \
>   --policy-arn <policy-arn>
> ```
>
> Once detached, the controller immediately loses the permissions granted by that policy.

## Re-Enabling Permissions

> [tab] Kubernetes
>
> To restore a permission tier you previously disabled, re-apply the role binding. The Terraform configuration you applied during installation contains the definitions. You can either:
>
> 1. Re-run `terraform apply` to restore all bindings to their original state
> 2. Create the specific role binding manually with kubectl

> [tab] AWS
>
> Re-attach the policy to the role:
>
> ```bash theme={null}
> aws iam attach-role-policy \
>   --role-name <controller-role-name> \
>   --policy-arn <policy-arn>
> ```
>
> The Terraform configuration you applied during installation contains the full policy definitions. You can also re-run `terraform apply` to restore everything to its original state.

## Revoking All Access

> [tab] Kubernetes
>
> ### Option 1 - Delete all cluster role bindings
>
> ```bash theme={null}
> kubectl get clusterrolebindings | grep <namespace> | awk '{print $1}' | xargs kubectl delete clusterrolebinding
> ```
>
> ### Option 2 - Delete the namespace
>
> ```bash theme={null}
> kubectl delete namespace <namespace>
> ```
>
> This removes everything - the controller, its permissions, its service accounts, and all resources in the namespace. The application will stop running. Use this only if you need to completely remove the deployment.

> [tab] AWS
>
> ### Option 1 - Detach all policies
>
> First, list all policies attached to the controller's IAM role:
>
> ```bash theme={null}
> aws iam list-attached-role-policies \
>   --role-name <controller-role-name> \
>   --query 'AttachedPolicies[].PolicyArn' \
>   --output text
> ```
>
> Then, for each policy ARN returned, run:
>
> ```bash theme={null}
> aws iam detach-role-policy \
>   --role-name <controller-role-name> \
>   --policy-arn <policy-arn-from-step-1>
> ```
>
> The controller instance keeps running but can no longer call any AWS APIs.
>
> ### Option 2 - Stop the instance
>
> ```bash theme={null}
> aws ec2 stop-instances --instance-ids <instance-id>
> ```
>
> This stops the controller entirely.
>
> ### Option 3 - Detach the instance profile
>
> ```bash theme={null}
> aws ec2 disassociate-iam-instance-profile \
>   --association-id <association-id>
> ```
>
> Once the instance profile is detached, the controller loses all IAM permissions immediately.

## Auditing Permission Changes

> [tab] Kubernetes
>
> Kubernetes records all RBAC changes in the audit log. You can verify when bindings were created, modified, or deleted:
>
> ```bash theme={null}
> kubectl get events -n <namespace> --field-selector reason=Created
> ```

> [tab] AWS
>
> All IAM changes are recorded in AWS CloudTrail. You can verify when policies were attached, detached, or roles modified:
>
> ```bash theme={null}
> aws cloudtrail lookup-events \
>   --lookup-attributes AttributeKey=ResourceName,AttributeValue=<controller-role-name> \
>   --max-results 20
> ```

## Related

* [Permissions](https://docs.tensor9.com/byoc/customer/security/permissions.md) - What each permission tier allows
* [Security Model](https://docs.tensor9.com/byoc/customer/security/security-model.md) - The overall security architecture
* [Break Glass](https://docs.tensor9.com/byoc/customer/security/break-glass.md) - Ending a single approved session, distinct from revoking a standing tier


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.