> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/a/amazon-elastic-kubernetes-service.md).

# Amazon Elastic Kubernetes Service

Amazon EKS is the managed Kubernetes service of AWS. OctoXLabs finds the worker nodes of EKS clusters in every enabled region and can collect network access rules as policy assets.

## Use cases

* List the policy assets that this adapter collected.

```
Adapters = aws-eks
```

* Find devices that Amazon Elastic Kubernetes Service reports but your EDR does not cover.

```
Adapters = aws-eks AND NOT Adapters = falcon-crowdstrike
```

* Review devices that Amazon Elastic Kubernetes Service has not seen recently.

```
Adapters = aws-eks AND NOT LastSeen last now-30d/d
```

* Check what one Amazon Elastic Kubernetes Service connection collected.

```
Connections = YOUR_CONNECTION_NAME
```

## Before you begin

### Network

| Source              | Destination                                                                                     | Port | Protocol |
| ------------------- | ----------------------------------------------------------------------------------------------- | ---- | -------- |
| OctoXLabs connector | AWS regional endpoints for EC2, EKS, Auto Scaling and STS                                       | 443  | HTTPS    |
| OctoXLabs connector | Cluster API server endpoint (only for Fetch Network Policies and Fetch Security Group Policies) | 443  | HTTPS    |

### Required permissions

| Scope or role                                               | Permission | Needed for                        |
| ----------------------------------------------------------- | ---------- | --------------------------------- |
| ec2:DescribeRegions, ec2:DescribeInstances                  | Read       | Regions and node instances        |
| eks:ListClusters, eks:ListNodegroups, eks:DescribeNodegroup | Read       | Clusters and node groups          |
| eks:DescribeCluster                                         | Read       | Only for the three policy options |
| autoscaling:DescribeAutoScalingGroups                       | Read       | Node group instances              |

Use an IAM user or role with read-only access to these APIs. For Fetch Network Policies and Fetch Security Group Policies the IAM identity must also be mapped into the cluster, through an EKS access entry or the legacy aws-auth ConfigMap, with **list** on `networkpolicies` and `securitygrouppolicies`. A cluster whose API server endpoint is private is reachable only when the connector runs inside the cluster VPC. Clusters that cannot be reached are skipped with a warning.

## Create credentials in Amazon Elastic Kubernetes Service

Create an IAM user or role with the read-only permissions listed above, then create an access key for it. The source does not give AWS console steps.

## Connection parameters

| Parameter                     | Required | Type    | Default   | Description                                                                                          |
| ----------------------------- | -------- | ------- | --------- | ---------------------------------------------------------------------------------------------------- |
| AWS Access Key ID             | Yes      | String  | None      | Access Key ID of an IAM user or role with read access to EKS, EC2 and Auto Scaling.                  |
| AWS Secret Access Key         | Yes      | String  | None      | Secret Access Key paired with the Access Key ID.                                                     |
| AWS Region                    | No       | String  | us-east-1 | Bootstrap region used to list the available regions. Clusters are discovered in all enabled regions. |
| Fetch Cluster Access Policies | No       | Boolean | False     | Collect the control plane endpoint access rule of each cluster as a policy asset.                    |
| Fetch Network Policies        | No       | Boolean | False     | Collect Kubernetes NetworkPolicy rules of each cluster as policy assets.                             |
| Fetch Security Group Policies | No       | Boolean | False     | Collect SecurityGroupPolicy resources as policy assets.                                              |
| Timeout                       | No       | Integer | 30        | Time in seconds to wait for responses from the Kubernetes API server of a cluster.                   |

## Troubleshooting

| Error message                                                          | Cause                                                                  | Fix                                                                                                                                           |
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| Status Code: `, followed by the URL, the method and the response body` | The API answered with a status other than the one the adapter expects. | Read the code and body. 401 or 403 usually points to wrong credentials or missing permissions. Check the address, port and Is Secure setting. |

## Change history
