Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CloudTrail Improvements to avoid prowler alerts #342

Merged
merged 26 commits into from
Jun 24, 2022

Conversation

bcarranza
Copy link
Collaborator

@bcarranza bcarranza commented Jun 23, 2022

What does this do?

  • Point to managedkube fork cloudtrail s3 bucket

    module "cloudtrail_s3_bucket" {
    source = "github.com/ManagedKube/terraform-aws-cloudtrail-s3-bucket.git//?ref=0.24.0"
    #version = "master"
    force_destroy = var.force_destroy
    versioning_enabled = var.versioning_enabled
    access_log_bucket_name = var.access_log_bucket_name
    allow_ssl_requests_only= var.allow_ssl_requests_only
    acl = var.acl
    s3_object_ownership = var.s3_object_ownership
    sse_algorithm = "aws:kms"
    context = module.this.context
    }

  • Increase retention to 365 days in order to this alerts.: us-west-2: x2-ops-cloudtrail-cloudwatch-alarms Log Group does not have 365 days retention period!.

  • New inputs vars to make secure s3 bucket

    #Buckets input vars
    variable "versioning_enabled" {
    type = bool
    description = "A state of versioning. Versioning is a means of keeping multiple variants of an object in the same bucket"
    default = false
    }
    variable "access_log_bucket_name" {
    type = string
    default = ""
    description = "Name of the S3 bucket where s3 access log will be sent to"
    }
    variable "allow_ssl_requests_only" {
    type = bool
    default = true
    description = "Set to `true` to require requests to use Secure Socket Layer (HTTPS/SSL). This will explicitly deny access to HTTP requests"
    }
    variable "s3_object_ownership" {
    type = string
    default = "BucketOwnerPreferred"
    description = "Specifies the S3 object ownership control. Valid values are `ObjectWriter`, `BucketOwnerPreferred`, and 'BucketOwnerEnforced'."
    }
    variable "acl" {
    type = string
    description = "The canned ACL to apply. We recommend log-delivery-write for compatibility with AWS services"
    default = "log-delivery-write"
    }
    variable "is_multi_region_trail" {
    type = bool
    default = true
    description = "Specifies whether the trail is created in the current region or in all regions"
    }
    variable "restrict_public_buckets" {
    type = bool
    default = true
    description = "Set to `false` to disable the restricting of making the bucket public"
    }

@bcarranza bcarranza changed the title point to fork cloudtrail s3 buckets CloudTrail Improvements to avoid prowler alerts Jun 23, 2022
@bcarranza bcarranza marked this pull request as ready for review June 23, 2022 20:20
variable "versioning_enabled" {
type = bool
description = "A state of versioning. Versioning is a means of keeping multiple variants of an object in the same bucket"
default = false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be enabled by default? Doesnt prowler want this as well?

Copy link
Collaborator

@sekka1 sekka1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sekka1 sekka1 merged commit b8f16f1 into main Jun 24, 2022
@sekka1 sekka1 deleted the feat-cloudtrail-cloudwatch-remediation branch June 24, 2022 17:30
nasheikh pushed a commit to nasheikh/kubernetes-ops that referenced this pull request Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants