Skip to content

Commit

Permalink
feat: add option to attach a permissions boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
quentin-laplanche committed Aug 14, 2024
1 parent 220725f commit 51e23ee
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions modules/services/cloud-bench/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ No modules.
|------|-------------|------|---------|:--------:|
| <a name="input_is_organizational"></a> [is\_organizational](#input\_is\_organizational) | true/false whether secure-for-cloud should be deployed in an organizational setup (all accounts of org) or not (only on default aws provider account) | `bool` | `false` | no |
| <a name="input_name"></a> [name](#input\_name) | The name of the IAM Role that will be created. | `string` | `"sfc-cloudbench"` | no |
| <a name="input_permissions_boundary_arn"></a> [permissions\_boundary\_arn](#input\_permissions\_boundary\_arn) | ARN of a permissions boundary policy to attach to the cloudbench role | `string` | `null` | no |
| <a name="input_provision_caller_account"></a> [provision\_caller\_account](#input\_provision\_caller\_account) | true/false whether to provision the aws provider account (if is\_organizational=true management account, if is\_organizational=false it will depend on the provider setup on the caller module | `bool` | `true` | no |
| <a name="input_region"></a> [region](#input\_region) | Default region for resource creation in organization mode | `string` | `"eu-central-1"` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | customization of tags to be assigned to all resources. <br/>always include 'product' default tag for resource-group proper functioning.<br/>can also make use of the [provider-level `default-tags`](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags) | `map(string)` | <pre>{<br> "product": "sysdig-secure-for-cloud"<br>}</pre> | no |
Expand Down
7 changes: 4 additions & 3 deletions modules/services/cloud-bench/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,10 @@ data "aws_iam_policy_document" "trust_relationship" {
resource "aws_iam_role" "cloudbench_role" {
count = var.is_organizational && !var.provision_caller_account ? 0 : 1

name = var.name
assume_role_policy = data.aws_iam_policy_document.trust_relationship.json
tags = var.tags
name = var.name
assume_role_policy = data.aws_iam_policy_document.trust_relationship.json
tags = var.tags
permissions_boundary = var.permissions_boundary_arn
}


Expand Down
6 changes: 6 additions & 0 deletions modules/services/cloud-bench/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ variable "tags" {
"product" = "sysdig-secure-for-cloud"
}
}

variable "permissions_boundary_arn" {
type = string
description = "ARN of a permissions boundary policy to attach to the cloudbench role"
default = null
}

0 comments on commit 51e23ee

Please sign in to comment.