Skip to content

Commit 3adc3fe

Browse files
authored
fix: Remove deploy_threat_detection so it cannot be set (#82)
* fix: remove deploy_threat_detection so it cannot be set * fix: remove length from paramter since it always deploy * fix: remove index * chore: remove deleted var from readme files
1 parent fbe5b7f commit 3adc3fe

File tree

11 files changed

+11
-41
lines changed

11 files changed

+11
-41
lines changed

examples/organizational/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Minimum requirements:
2323
2. Configure [Terraform **AWS** Provider](https://registry.terraform.io/providers/hashicorp/aws/latest/docs) for the `management` account of the organization
2424
* This provider credentials must be [able to manage cloudtrail creation](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-trail-organization.html)
2525
> You must be logged in with the management account for the organization to create an organization trail. You must also have sufficient permissions for the IAM user or role in the management account to successfully create an organization trail.
26-
26+
2727
3. Organizational Multi-Account Setup
2828
* An specific role is required, to enable Sysdig to impersonate and be able to provide
2929
* For the scanning feature, the ability to pull ECR hosted images when they're allocated in a different account
@@ -56,16 +56,16 @@ Permission requirement for this example comes as follows
5656
- used by Sysdig to subscribe to cloudtrail events
5757
- used by Sysdig to be able to jump to several member accounts to pull ECR hosted images through the `OrganizationAccountAccessRole` role
5858
- assumming previous role will also enable the access of cloudtrail s3 buckets when they are in a different region than were the terraform module is deployed
59-
59+
6060
- `SysdigCloudBench` role will be created for SecurityAudit read-only purpose, used by Sysdig to benchmark
61-
61+
6262
- **member accounts**
6363
- terraform aws provider: 'member' aliased
6464
- this provider can be configured as desired, we just provide a default option
6565
- by default, we suggest using an assumeRole to the [AWS created default role `OrganizationAccountAccessRole`](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html)
6666
- if this role does not exist provide input var `organizational_member_default_admin_role` with the role
6767
- `SysdigCloudBench` role will be created for SecurityAudit read-only purpose, used by Sysdig to benchmark
68-
68+
6969
- **sysdig workload member account**
7070
- if ECS workload is deployed, `ECSTaskRole` will be used to define its permissions
7171
- used by Sysdig to assumeRole on management account `SysdigSecureForCloudRole` and other organizations `OrganizationAccountAccessRole`

examples/single-account-k8s/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ $ terraform apply
120120
| <a name="input_deploy_benchmark"></a> [deploy\_benchmark](#input\_deploy\_benchmark) | Whether to deploy or not the cloud benchmarking | `bool` | `true` | no |
121121
| <a name="input_deploy_image_scanning_ecr"></a> [deploy\_image\_scanning\_ecr](#input\_deploy\_image\_scanning\_ecr) | true/false whether to deploy the image scanning on ECR pushed images | `bool` | `true` | no |
122122
| <a name="input_deploy_image_scanning_ecs"></a> [deploy\_image\_scanning\_ecs](#input\_deploy\_image\_scanning\_ecs) | true/false whether to deploy the image scanning on ECS running images | `bool` | `true` | no |
123-
| <a name="input_deploy_threat_detection"></a> [deploy\_threat\_detection](#input\_deploy\_threat\_detection) | true/false whether to deploy cloud\_connector | `bool` | `true` | no |
124123
| <a name="input_name"></a> [name](#input\_name) | Name to be assigned to all child resources. A suffix may be added internally when required. Use default value unless you need to install multiple instances | `string` | `"sfc"` | no |
125124
| <a name="input_tags"></a> [tags](#input\_tags) | sysdig secure-for-cloud tags | `map(string)` | <pre>{<br> "product": "sysdig-secure-for-cloud"<br>}</pre> | no |
126125

examples/single-account-k8s/cloud-connector.tf

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ locals {
66
# requirements
77
#-------------------------------------
88
module "cloud_connector_sqs" {
9-
count = var.deploy_threat_detection ? 1 : 0
109
source = "../../modules/infrastructure/sqs-sns-subscription"
1110

1211
name = var.name
@@ -30,8 +29,6 @@ module "codebuild" {
3029
# cloud_connector
3130
#-------------------------------------
3231
resource "helm_release" "cloud_connector" {
33-
count = var.deploy_threat_detection ? 1 : 0
34-
3532
name = "cloud-connector"
3633
repository = "https://charts.sysdig.com"
3734
chart = "cloud-connector"
@@ -74,7 +71,7 @@ resource "helm_release" "cloud_connector" {
7471
ingestors = [
7572
{
7673
cloudtrail-sns-sqs = {
77-
queueURL = module.cloud_connector_sqs[0].cloudtrail_sns_subscribed_sqs_url
74+
queueURL = module.cloud_connector_sqs.cloudtrail_sns_subscribed_sqs_url
7875
}
7976
}
8077
]

examples/single-account-k8s/credentials.tf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ module "iam_user" {
22
source = "../../modules/infrastructure/permissions/iam-user"
33
name = var.name
44

5-
deploy_threat_detection = var.deploy_threat_detection
6-
deploy_image_scanning = local.deploy_image_scanning
5+
deploy_image_scanning = local.deploy_image_scanning
76

87
ssm_secure_api_token_arn = module.ssm.secure_api_token_secret_arn
98
cloudtrail_s3_bucket_arn = length(module.cloudtrail) > 0 ? module.cloudtrail[0].s3_bucket_arn : "*"
10-
cloudtrail_subscribed_sqs_arn = length(module.cloud_connector_sqs) > 0 ? module.cloud_connector_sqs[0].cloudtrail_sns_subscribed_sqs_arn : "*"
9+
cloudtrail_subscribed_sqs_arn = module.cloud_connector_sqs.cloudtrail_sns_subscribed_sqs_arn
1110
scanning_codebuild_project_arn = length(module.codebuild) > 0 ? module.codebuild[0].project_arn : "*"
1211
}

examples/single-account-k8s/variables.tf

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,6 @@ variable "tags" {
3838
}
3939
}
4040

41-
#
42-
# threat-detection configuration
43-
#
44-
45-
variable "deploy_threat_detection" {
46-
type = bool
47-
description = "true/false whether to deploy cloud_connector"
48-
default = true
49-
}
50-
5141
#
5242
# scanning configuration
5343
#

modules/infrastructure/permissions/iam-user/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Permissions :: Single-Account user credentials
22

33
Creates an IAM user and adds permissions for required modules.
4-
<br/>Will use the `deploy_threat_detection` and `deploy_image_scanning` flags to pin down specific feature-permissions.
4+
<br/>Will use the `deploy_image_scanning` flag to pin down specific feature-permissions.
55

66

77
## Access Key Rotation
@@ -69,7 +69,6 @@ Note: Contact us if this authentication system does not match your requirement.
6969
| <a name="input_cloudtrail_s3_bucket_arn"></a> [cloudtrail\_s3\_bucket\_arn](#input\_cloudtrail\_s3\_bucket\_arn) | ARN of cloudtrail s3 bucket | `string` | `"*"` | no |
7070
| <a name="input_cloudtrail_subscribed_sqs_arn"></a> [cloudtrail\_subscribed\_sqs\_arn](#input\_cloudtrail\_subscribed\_sqs\_arn) | ARN of the cloudtrail subscribed sqs's | `string` | `"*"` | no |
7171
| <a name="input_deploy_image_scanning"></a> [deploy\_image\_scanning](#input\_deploy\_image\_scanning) | true/false whether to provision cloud\_scanning permissions | `bool` | `true` | no |
72-
| <a name="input_deploy_threat_detection"></a> [deploy\_threat\_detection](#input\_deploy\_threat\_detection) | true/false whether to provision cloud\_connector permissions | `bool` | `true` | no |
7372
| <a name="input_name"></a> [name](#input\_name) | Name to be assigned to all child resources. A suffix may be added internally when required. Use default value unless you need to install multiple instances | `string` | `"sfc"` | no |
7473
| <a name="input_scanning_codebuild_project_arn"></a> [scanning\_codebuild\_project\_arn](#input\_scanning\_codebuild\_project\_arn) | ARN of codebuild to launch the image scanning process | `string` | `"*"` | no |
7574
| <a name="input_ssm_secure_api_token_arn"></a> [ssm\_secure\_api\_token\_arn](#input\_ssm\_secure\_api\_token\_arn) | ARN of the security credentials for the secure\_api\_token | `string` | `"*"` | no |

modules/infrastructure/permissions/iam-user/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ module "credentials_general" {
2525

2626

2727
module "credentials_cloud_connector" {
28-
count = var.deploy_threat_detection ? 1 : 0
2928
source = "../cloud-connector"
3029
name = var.name
3130

modules/infrastructure/permissions/iam-user/variables.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22
# optionals - with defaults
33
#---------------------------------
44

5-
variable "deploy_threat_detection" {
6-
type = bool
7-
description = "true/false whether to provision cloud_connector permissions"
8-
default = true
9-
}
10-
115
variable "deploy_image_scanning" {
126
type = bool
137
description = "true/false whether to provision cloud_scanning permissions"

modules/infrastructure/permissions/org-role-eks/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ No modules.
5353
| <a name="input_cloudtrail_s3_arn"></a> [cloudtrail\_s3\_arn](#input\_cloudtrail\_s3\_arn) | Cloudtrail S3 bucket ARN | `string` | n/a | yes |
5454
| <a name="input_user_arn"></a> [user\_arn](#input\_user\_arn) | ARN of the IAM user to which roles will be added | `string` | n/a | yes |
5555
| <a name="input_deploy_image_scanning"></a> [deploy\_image\_scanning](#input\_deploy\_image\_scanning) | true/false whether to provision cloud\_scanning permissions | `bool` | `true` | no |
56-
| <a name="input_deploy_threat_detection"></a> [deploy\_threat\_detection](#input\_deploy\_threat\_detection) | true/false whether to provision cloud\_connector permissions | `bool` | `true` | no |
5756
| <a name="input_name"></a> [name](#input\_name) | Name to be assigned to all child resources. A suffix may be added internally when required. Use default value unless you need to install multiple instances | `string` | `"sfc"` | no |
5857
| <a name="input_organizational_role_per_account"></a> [organizational\_role\_per\_account](#input\_organizational\_role\_per\_account) | Name of the organizational role deployed by AWS in each account of the organization | `string` | `"OrganizationAccountAccessRole"` | no |
5958
| <a name="input_tags"></a> [tags](#input\_tags) | sysdig secure-for-cloud tags | `map(string)` | <pre>{<br> "product": "sysdig-secure-for-cloud"<br>}</pre> | no |

modules/infrastructure/permissions/org-role-eks/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,12 @@ data "aws_iam_policy_document" "sysdig_secure_for_cloud_role_trusted" {
2222
# ------------------------------
2323

2424
resource "aws_iam_role_policy" "sysdig_secure_for_cloud_role_s3" {
25-
count = var.deploy_threat_detection ? 1 : 0
2625
name = "${var.name}-AllowCloudtrailS3Policy"
2726
role = aws_iam_role.secure_for_cloud_role.id
28-
policy = data.aws_iam_policy_document.sysdig_secure_for_cloud_role_s3[0].json
27+
policy = data.aws_iam_policy_document.sysdig_secure_for_cloud_role_s3.json
2928
}
29+
3030
data "aws_iam_policy_document" "sysdig_secure_for_cloud_role_s3" {
31-
count = var.deploy_threat_detection ? 1 : 0
3231
statement {
3332
effect = "Allow"
3433
actions = [
@@ -52,6 +51,7 @@ resource "aws_iam_role_policy" "sysdig_secure_for_cloud_role_assume_role" {
5251
role = aws_iam_role.secure_for_cloud_role.id
5352
policy = data.aws_iam_policy_document.sysdig_secure_for_cloud_role_assume_role[0].json
5453
}
54+
5555
data "aws_iam_policy_document" "sysdig_secure_for_cloud_role_assume_role" {
5656
count = var.deploy_image_scanning ? 1 : 0
5757
statement {

0 commit comments

Comments
 (0)