|
1 | 1 | # Permissions :: Single-Account user credentials
|
2 | 2 |
|
3 | 3 | Creates an IAM user and adds permissions for required modules.
|
4 |
| -<br/>Will use the `deploy_threat_detection` and `deploy_image_scanning` flags |
| 4 | +<br/>Will use the `deploy_threat_detection` and `deploy_image_scanning` flags to pin down specific feature-permissions. |
| 5 | + |
| 6 | + |
| 7 | +## Access Key Rotation |
| 8 | +This module creates a user, and its `aws_iam_access_key` in order Kubernetes-based examples to be able to work with its |
| 9 | +core component [`cloud-connector` helm chart](https://charts.sysdig.com/charts/cloud-connector/) |
| 10 | + |
| 11 | +As AWS Best practices suggest, this **key SHOULD be rotated before 90 days**, but it's not in Sysdig Terraform module's |
| 12 | +responsibility to do so. |
| 13 | + |
| 14 | +Here some guidelines though: |
| 15 | + |
| 16 | +- Up till day, nor AWS nor Terraform do offer an official automatic key rotation. |
| 17 | +- There are several workarounds [[1]](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html#Using_RotateAccessKey) [[2]](https://aws-rotate-iam-keys.com/) [[3]](https://github.com/GSA/aws-access-key-rotation-lambda), but all require some way of detecting the closeness of this date, and a workload to force the key generation. |
| 18 | +- What we suggest, is to |
| 19 | + 1. Create a detection system to know when the access key is nearing the 90 day mark (ex.: cloudwatch daily checkup, cron task , ...) |
| 20 | + 2. Optionally, [Terraform Refresh](https://learn.hashicorp.com/tutorials/terraform/refresh) your terraform state beforehand, to avoid confussion with 3rd step |
| 21 | + ```shell |
| 22 | + $ terraform apply -refresh-only |
| 23 | + ``` |
| 24 | + 3. [Terraform Taint/Replace](https://www.terraform.io/cli/commands/taint) the `aws_iam_access_key` so that a new key is created and propagated to the [`cloud-connector` helm chart](https://charts.sysdig.com/charts/cloud-connector/). |
| 25 | + <br/>This will ask a confirmation, after showing the plan, where the access_key will be replaced and the helm chart updated |
| 26 | + ```shell |
| 27 | + $ terraform state list | grep aws_iam_access_key |
| 28 | + module.cloudvision_aws_single_account_k8s.module.iam_user.aws_iam_access_key.this |
| 29 | +
|
| 30 | + $ terraform apply -replace="module.cloudvision_aws_single_account_k8s.module.iam_user.aws_iam_access_key.this" |
| 31 | + ``` |
| 32 | + |
| 33 | +Note: Contact us if this authentication system does not match your requirement. |
| 34 | + |
5 | 35 |
|
6 | 36 | <!-- BEGIN_TF_DOCS -->
|
7 | 37 | ## Requirements
|
|
0 commit comments