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

# Run e6data with least privilege

> Scope every e6data role on AWS to named resources, remove role assumption and attach a permission boundary.

How-to guideApplies to: CloudPrem on AWS

You can run e6data with every engine, console and app role scoped to named resources: no `iam:*`, no role assumption, and a permission boundary. This setup is verified end to end: cluster resume, a query, and the query in Query History.

The full permission lists live in the [Permissions reference](https://docs.e6data.com/platform/deploy/aws-cloudprem/permissions-reference.md). This page covers how to narrow them.

## Requirements

* Your identity team creates every e6data role itself. e6data never creates or changes roles; the installer still passes each role to EKS Pod Identity (`iam:PassRole`).
* Every engine, console and app role statement names its buckets, Glue databases, KMS keys and cluster. The only `Resource: "*"` left in those roles is on `ec2:Describe*`, because AWS has no resource-level permissions for those actions. The node scaler, the AWS Load Balancer Controller and the console's optional health checks keep `*` where the [Permissions reference](https://docs.e6data.com/platform/deploy/aws-cloudprem/permissions-reference.md) shows it.

## What you can switch off or narrow

| Item | AWS | Can remove? | Effect |
| - | - | - | - |
| Role assumption on `*` | `sts:AssumeRole`, `sts:TagSession` on `*` (engine role) | Yes. Scope to one data-owner role ARN only for cross-account data | None for same-account data |
| Broad roles for the node scaler | Karpenter role | See the [Permissions reference](https://docs.e6data.com/platform/deploy/aws-cloudprem/permissions-reference.md) | None seen. Create, query and delete worked |
| Node scaler identity entirely | Use Cluster Autoscaler on managed node groups (see [Node provisioning](https://docs.e6data.com/platform/deploy/aws-cloudprem/node-provisioning.md)) | Yes | No e6data Karpenter role |
| App role | Only with Copilot or Metriq | Yes, if you don't use them | Those features are off |
| Write access to the e6data metadata store | Engine, console, app roles | No | e6data writes query history, results and metadata there |

## Steps

**1. Create the roles yourself**

Create the engine, console and app roles with the permissions in the [Permissions reference](https://docs.e6data.com/platform/deploy/aws-cloudprem/permissions-reference.md). Map them with EKS Pod Identity or IRSA.

**2. Scope every statement**

Scope every statement to named buckets, Glue databases, the KMS key and your cluster.

**3. Leave out role assumption**

Leave out `sts:AssumeRole` unless your data is in another account. If it is, allow `sts:AssumeRole` and `sts:TagSession` on that one data-owner role ARN.

**4. Attach a permission boundary**

Attach your permission boundary to the engine, console and app roles. It must allow the permissions in the first step. If you also put a boundary on the node scaler's role, allow `iam:PassRole` on the node role and the instance-profile reads, or Karpenter can't launch nodes. We recommend the boundary explicitly denies:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{"Effect":"Deny","Action":["iam:*","sts:AssumeRole","organizations:*"],"Resource":"*"}
```

For cross-account data, add an exception for the one data-owner role ARN.

**5. Optional: lock your data bucket to your VPC**

Lock your data bucket to your VPC's S3 gateway endpoint. This denies only data actions, so your team keeps bucket management:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{"Sid":"DenyDataAccessOutsideVpcEndpoint","Effect":"Deny","Principal":"*",
 "Action":["s3:GetObject","s3:PutObject","s3:DeleteObject","s3:ListBucket"],
 "Resource":["arn:aws:s3:::<DATA_BUCKET>","arn:aws:s3:::<DATA_BUCKET>/*"],
 "Condition":{"StringNotEquals":{"aws:SourceVpce":"<VPCE_ID>"}}}
```

Engine nodes must use route tables that send S3 traffic through that endpoint.

**6. Use the scoped installer policy**

For the install into an existing cluster, use the 18-action installer policy in the [Permissions reference](https://docs.e6data.com/platform/deploy/aws-cloudprem/permissions-reference.md) instead of administrator rights.

## Preflight check

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
aws iam simulate-principal-policy --policy-source-arn <engine-role-arn> \
  --action-names iam:CreateRole sts:AssumeRole
```

Expected: both `explicitDeny` when the boundary is attached. If `allowed`, attach the boundary.

## Verify

1. If you locked the data bucket: from outside the VPC, `aws s3 ls s3://<DATA_BUCKET>/` returns `AccessDenied ... explicit deny in a resource-based policy`.
2. Resume a cluster from the e6data console. It reaches **Running**.
3. Run a query in the SQL Editor, then check it appears in **Query History**.

## Troubleshooting

| Symptom | Cause | Fix |
| - | - | - |
| Cross-account catalog fails | Boundary denies `sts:AssumeRole`, or `sts:TagSession` missing | Allow both on the data-owner role ARN in role and boundary |
| Queries fail after locking the data bucket | Engine nodes don't route S3 through the gateway endpoint | Add the endpoint to the engine subnets' route tables |

## Limitations

* The narrower Karpenter scopes e6data uses on the clusters it runs itself are in the [Permissions reference](https://docs.e6data.com/platform/deploy/aws-cloudprem/permissions-reference.md).
* For a new VPC, EKS cluster and Karpenter install, a least-privilege (non-admin) deployment policy has created and removed a new VPC, NAT gateway, EKS cluster, add-ons, Karpenter, the AWS Load Balancer Controller, cert-manager, the operator and a workspace with no denied call.
* The install has no input for a permission boundary. Your identity team attaches it when it creates the roles.

## See also

* [Permissions reference](https://docs.e6data.com/platform/deploy/aws-cloudprem/permissions-reference.md)
* [Your organization's policies](https://docs.e6data.com/platform/deploy/aws-cloudprem/organization-policies.md)
* [Node provisioning](https://docs.e6data.com/platform/deploy/aws-cloudprem/node-provisioning.md)
* [What e6data can access](https://docs.e6data.com/platform/trust/what-e6data-can-access.md)


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