Skip to main content
Latest Documentation
This is the latest documentation for the Cloud Posse Reference Architecture. To determine which version you're currently using, please see Version Identification.

Summary

There are certain controls that only make sense to monitor once per account, not once per region per account. As an example, imagine you wanted to verify an IAM Role exists for a given account. That wouldn't need to be verified in each region for the account. As such, this module takes your current AWS Provider configuration and uses it to generate and output a list of controls to disable.

Because this list doesn't change much, we have a static definition of the controls to disable in the main.tf file.

Scope

Right now, this module only targets CIS 1.2 controls.

Usage

module "control_disablements" {
source = "cloudposse/security-hub/aws//modules/control-disablements"
# Cloud Posse recommends pinning every module to a specific version
# version = "x.x.x"

global_resource_collector_region = var.global_resource_collector_region # i.e. us-east-1
central_logging_account = local.central_logging_account

environment = ""

context = module.this.context
}

resource "awsutils_security_hub_control_disablement" "global" {
for_each = toset(module.control_disablements.controls)
control_arn = each.key
reason = "Global and CloudTrail resources are not collected in this account/region"

depends_on = [
module.security_hub
]
}

Terraform Docs

Requirements

NameVersion
terraform>= 1.0
aws>= 2

Providers

NameVersion
aws>= 2

Modules

NameSourceVersion
thiscloudposse/label/null0.24.1

Resources

NameType
aws_caller_identity.thisdata source
aws_partition.thisdata source
aws_region.thisdata source

Inputs

NameDescriptionTypeDefaultRequired
additional_tag_mapAdditional tags for appending to tags_as_list_of_maps. Not added to tags.map(string){}no
attributesAdditional attributes (e.g. 1)list(string)[]no
central_logging_accountThe id of the account that is the centralized cloudtrail logging account.stringn/ayes
contextSingle object for setting entire context at once.
See description of individual variables for details.
Leave string and numeric variables as null to use default value.
Individual variable settings (non-null) override settings in context object,
except for attributes, tags, and additional_tag_map, which are merged.
any
{
"additional_tag_map": {},
"attributes": [],
"delimiter": null,
"enabled": true,
"environment": null,
"id_length_limit": null,
"label_key_case": null,
"label_order": [],
"label_value_case": null,
"name": null,
"namespace": null,
"regex_replace_chars": null,
"stage": null,
"tags": {}
}
no
delimiterDelimiter to be used between namespace, environment, stage, name and attributes.
Defaults to - (hyphen). Set to "" to use no delimiter at all.
stringnullno
enabledSet to false to prevent the module from creating any resourcesboolnullno
environmentEnvironment, e.g. 'uw2', 'us-west-2', OR 'prod', 'staging', 'dev', 'UAT'stringnullno
global_resource_collector_regionThe region that collects AWS Config data for global resources such as IAMstringn/ayes
id_length_limitLimit id to this many characters (minimum 6).
Set to 0 for unlimited length.
Set to null for default, which is 0.
Does not affect id_full.
numbernullno
label_key_caseThe letter case of label keys (tag names) (i.e. name, namespace, environment, stage, attributes) to use in tags.
Possible values: lower, title, upper.
Default value: title.
stringnullno
label_orderThe naming order of the id output and Name tag.
Defaults to ["namespace", "environment", "stage", "name", "attributes"].
You can omit any of the 5 elements, but at least one must be present.
list(string)nullno
label_value_caseThe letter case of output label values (also used in tags and id).
Possible values: lower, title, upper and none (no transformation).
Default value: lower.
stringnullno
nameSolution name, e.g. 'app' or 'jenkins'stringnullno
namespaceNamespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp'stringnullno
regex_replace_charsRegex to replace chars with empty string in namespace, environment, stage and name.
If not set, "/[^a-zA-Z0-9-]/" is used to remove all characters other than hyphens, letters and digits.
stringnullno
stageStage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release'stringnullno
tagsAdditional tags (e.g. map('BusinessUnit','XYZ')map(string){}no

Outputs

NameDescription
controlsA list of controls to disable based on the the input variables