> ## 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.

# Audit logging and security playbook

> Turn on the cloud, identity and Kubernetes audit logs that prove what e6data did in your In-VPC environment, and the queries and steps to use during a security review or incident.

How-to guideApplies to: CloudPrem (AWS and Azure)

Three logs prove what e6data did in your environment: your cloud audit log (CloudTrail or the Azure Activity Log), your identity sign-in log, and your Kubernetes audit log. Turn them all on before install. The Kubernetes audit log is off by default on both clouds and can't be filled in later.

## Which log proves what

| Question | AWS | Azure |
| - | - | - |
| Which cloud API calls were made, and by whom? | CloudTrail | Azure Activity Log |
| Who signed in, and were any outside identities added? | IAM (roles, trust policies), CloudTrail sign-in events | Microsoft Entra sign-in and audit logs; Azure Lighthouse "Service providers" page |
| Who called the Kubernetes API, and what did they do? | EKS control-plane `audit` log | AKS `kube-audit` resource log |
| Who has Kubernetes access? | EKS access entries | AKS Entra ID authorization; role assignments |
| Did anything connect in? | VPC Flow Logs, security groups, NACLs | VNet flow logs (NSG flow logs can no longer be newly created and retire in September 2027), firewall logs |
| Which objects did e6data read or write? | S3 server access logging on the metadata and data buckets, or S3 data events on your CloudTrail trail (see AWS documentation) | Storage diagnostic logs (StorageRead, StorageWrite, StorageDelete) on the e6data and data storage accounts. Blob reads and writes by the workspace identity are not in the Activity Log |
| What went out? | Your proxy or firewall logs | Your firewall logs |

## Retention

| Log | AWS default | Azure default | Keep it longer |
| - | - | - | - |
| Cloud audit log | CloudTrail event history: 90 days | Activity Log: 90 days | AWS: a CloudTrail trail to S3, or CloudTrail Lake. Azure: a diagnostic setting to Log Analytics or storage |
| Identity sign-in and audit | In CloudTrail | Entra: 7 days (Free), 30 days (P1/P2) | Azure: route to Log Analytics or storage. Changes aren't retroactive |
| Kubernetes audit | Not collected until you turn it on | Not collected until you add a diagnostic setting | Set CloudWatch Logs or Log Analytics retention to your policy |

Match retention to your audit policy. We suggest keeping each log for at least 30 days.

> [!NOTE]
>
> On Azure, the Activity Log records operations, not every authorization check. Use the Entra and AKS audit logs alongside it.

## Turn the logs on

> [tab] AWS
>
> 1. Create a CloudTrail trail to an S3 bucket you own, if you don't have one.
> 2. Turn on the EKS audit log:
>    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
>    aws eks update-cluster-config --name <CLUSTER> \
>      --logging '{"clusterLogging":[{"types":["audit"],"enabled":true}]}'
>    ```
> 3. Turn on VPC Flow Logs for the e6data VPC.
> 4. To prove which objects e6data touched, turn on S3 data events on the trail, or S3 server access logging on the metadata and data buckets. S3 object reads and writes are not in CloudTrail otherwise.

> [tab] Azure
>
> 1. Add a diagnostic setting that sends the Activity Log to Log Analytics.
>
> 2. Route Entra sign-in and audit logs to Log Analytics.
>
> 3. Turn on storage diagnostic logs (StorageRead, StorageWrite, StorageDelete) on the e6data and data storage accounts. Blob reads and writes by the workspace identity are not in the Activity Log.
>
> 4. Turn on VNet flow logs for the e6data VNet.
>
> 5. Send the AKS audit log to Log Analytics:
>    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
>    az monitor diagnostic-settings create --name aks-audit \
>      --resource $(az aks show -g <RESOURCE_GROUP> -n <CLUSTER_NAME> --query id -o tsv) \
>      --workspace <LOG_ANALYTICS_WORKSPACE_ID> \
>      --export-to-resource-specific true \
>      --logs '[{"category":"kube-audit","enabled":true}]'
>    ```
>
> > [!WARNING]
> >
> > The `kube-audit-admin` category leaves out read requests (get and list). Use `kube-audit` if you need to prove who read Secrets objects. It costs more to store.

## Security playbook: queries

Replace the values in angle brackets. `<E6DATA_NAMESPACE>` is the operator or workspace namespace of your install.

### Is this e6data? (cloud API calls)

> [tab] AWS
>
> CloudTrail Lake:
>
> ```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
> SELECT eventTime, eventName, eventSource, userIdentity.arn, sourceIPAddress
> FROM <EVENT_DATA_STORE_ID>
> WHERE userIdentity.sessionContext.sessionIssuer.arn IN ('<E6DATA_ROLE_ARN_1>', '<E6DATA_ROLE_ARN_2>')
>   AND eventTime > '<START_TIME>'
> ORDER BY eventTime DESC
> ```
>
> Expected: calls only to the services you granted (S3 on the e6data and data buckets, Glue reads, EC2 describe calls). Every `AssumeRole` on these roles comes from `pods.eks.amazonaws.com`.

> [tab] Azure
>
> Activity Log in Log Analytics:
>
> ```kusto theme={"theme":{"light":"github-light","dark":"github-dark"}}
> AzureActivity
> | where Caller == "<WORKSPACE_IDENTITY_PRINCIPAL_ID>"
> | project TimeGenerated, OperationNameValue, ResourceId, ActivityStatusValue
> | order by TimeGenerated desc
> ```
>
> Expected: no create, update or delete operations outside what the workspace identity's roles allow. Check the roles themselves with:
>
> ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
> az role assignment list --assignee <WORKSPACE_IDENTITY_PRINCIPAL_ID> --all --include-inherited -o table
> ```

### Is this e6data? (Kubernetes calls)

> [tab] AWS
>
> CloudWatch Logs Insights on `/aws/eks/<CLUSTER>/cluster`:
>
> ```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
> fields @timestamp, user.username, verb, objectRef.resource, objectRef.namespace, objectRef.name
> | filter @logStream like /kube-apiserver-audit/
> | filter user.username like /system:serviceaccount:<E6DATA_NAMESPACE>:/
> | sort @timestamp desc
> ```

> [tab] Azure
>
> Log Analytics:
>
> ```kusto theme={"theme":{"light":"github-light","dark":"github-dark"}}
> AKSAudit
> | where tostring(User.username) startswith "system:serviceaccount:<E6DATA_NAMESPACE>:"
> | project TimeGenerated, User = tostring(User.username), Verb, ObjectRef
> | order by TimeGenerated desc
> ```

### Who read Secrets objects?

> [tab] AWS
>
> ```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
> fields @timestamp, user.username, verb, objectRef.namespace, objectRef.name, sourceIPs.0
> | filter @logStream like /kube-apiserver-audit/
> | filter objectRef.resource = "secrets" and verb in ["get", "list", "watch"]
> | sort @timestamp desc
> ```

> [tab] Azure
>
> Needs the `kube-audit` category:
>
> ```kusto theme={"theme":{"light":"github-light","dark":"github-dark"}}
> AKSAudit
> | where tostring(ObjectRef.resource) == "secrets" and Verb in ("get", "list", "watch")
> | project TimeGenerated, User = tostring(User.username), Verb,
>           Namespace = tostring(ObjectRef.namespace), Name = tostring(ObjectRef.name), SourceIps
> | order by TimeGenerated desc
> ```

In today's default cluster-wide operator mode, the operator's role allows Secrets access in every namespace, so e6data service accounts can appear for Secrets outside the e6data namespaces. See [What e6data can access](https://docs.e6data.com/platform/trust/what-e6data-can-access.md).

### Does any outside identity have access?

> [tab] AWS
>
> ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
> aws eks list-access-entries --cluster-name <CLUSTER>
> aws iam list-roles --query 'Roles[].[RoleName,AssumeRolePolicyDocument.Statement[].Principal]' --output json
> ```
>
> Expected: only your principals and node roles in the access entries; no role trusts an e6data account.

> [tab] Azure
>
> In the Azure portal, open "Service providers" and check there are no delegations. Then list guest users:
>
> ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
> az ad user list --filter "userType eq 'Guest'" --query '[].[displayName,mail]' -o table
> ```

### Did anything connect in from outside?

Check flow logs for accepted inbound connections to the e6data node subnets from outside your network. Expected: only your own clients on the endpoint ports (443 and 5432).

## Playbook: suspected compromise

**1. Cut the link**

Block the e6data control-plane host at your proxy or firewall. Running clusters and SQL over the endpoint keep working. See [If e6data's control plane is down](https://docs.e6data.com/platform/upgrades/control-plane-outage.md) for what stops and when.

**2. Freeze access to data**

On AWS, remove the data-bucket permissions from the e6data roles. On Azure, remove the Storage Blob Data Reader assignments. If the workspace storage uses your own key, revoking it makes the metadata store unreadable within about 10 minutes (measured on Azure); see [Encryption at rest and customer-managed keys](https://docs.e6data.com/platform/trust/encryption-at-rest.md).

**3. Revoke personal API tokens**

Cutting the link does not stop tokens that were already issued; they are checked inside your workspace. While console sign-in still works, an admin revokes them in the console (one token, or all of a user's tokens). See [Create, use, rotate, and revoke tokens](https://docs.e6data.com/platform/tokens/create-rotate-revoke.md). Users create new tokens once the incident is closed.

**4. Collect evidence**

Run the queries above for the time window in question.

**5. Tell e6data**

Contact e6data through your support channel, and raise it as P0 (urgent). A P0 case is paged to e6data's on-call engineer around the clock, with first response within 15 minutes. See the [responsibilities matrix](https://docs.e6data.com/platform/trust/responsibilities-matrix.md) for the response targets.

Security contact: your e6data account contact. If a security incident happens on e6data's side, e6data notifies you as set out in your agreement with e6data. e6data has a documented data-breach procedure.

## See also

* [What e6data can access](https://docs.e6data.com/platform/trust/what-e6data-can-access.md)
* [Responsibilities matrix](https://docs.e6data.com/platform/trust/responsibilities-matrix.md)
* [If e6data's control plane is down](https://docs.e6data.com/platform/upgrades/control-plane-outage.md)
* [In-VPC support](https://docs.e6data.com/platform/support-access/in-vpc-support.md)


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