-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.yaml
151 lines (130 loc) · 7.2 KB
/
README.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
---
#
# This is the canonical configuration for the `README.md`
# Run `make readme` to rebuild the `README.md`
#
# Name of this project
name : Terraform AWS Cloudtrail Baseline
# License of this project
license: "MIT"
# Canonical GitHub repo
github_repo: clouddrove/terraform-aws-cloudtrail-baseline
# Badges to display
badges:
- name: "Latest Release"
image: "https://img.shields.io/github/release/clouddrove//terraform-aws-cloudtrail-baseline.svg"
url: "https://github.com/clouddrove//terraform-aws-cloudtrail-baseline/releases/latest"
- name: "tfsec"
image: "https://github.com/clouddrove//terraform-aws-cloudtrail-baseline/actions/workflows/tfsec.yml/badge.svg"
url: "https://github.com/clouddrove//terraform-aws-cloudtrail-baseline/actions/workflows/tfsec.yml"
- name: "Licence"
image: "https://img.shields.io/badge/License-APACHE-blue.svg"
url: "LICENSE.md"
- name: "Changelog"
image: "https://img.shields.io/badge/Changelog-blue"
url: "CHANGELOG.md"
prerequesties:
- name: Terraform
url: https://learn.hashicorp.com/terraform/getting-started/install.html
version: ">= 1.6.6"
providers:
- name: aws
url: https://aws.amazon.com/
version: ">= 5.31.0"
module_dependencies:
- name: Labels module
url: https://github.com/clouddrove/terraform-aws-labels
description: Provides resource tagging.
- name: S3 bucket module
url: git::https://github.com/clouddrove/terraform-aws-s3.git?ref=tags/2.0.0
description: Provides resource tagging.
- name: kms-key module
url: git::https://github.com/clouddrove/terraform-aws-kms.git?ref=tags/1.3.1
description: Provides resource tagging.
- name: cloudtrial module
url: https://github.com/clouddrove/terraform-aws-cloudtrail-baseline
description: Provides resource tagging.
- name: cloudtrail-slack-notification module
url: https://github.com/clouddrove/terraform-aws-cloudtrail-slack-notification
description: Provides resource tagging.
# description of this project
description: |-
Terraform module to create an cloudtrail resource on AWS with S3 and KMS key.
# How to use this project
usage : |-
Here are some examples of how you can use this module in your inventory structure:
### Individual Account
```hcl
module "cloudtrail" {
source = "git::https://github.com/clouddrove/terraform-aws-cloudtrail-baseline.git?ref=tags/0.14.0"
name = "trails"
environment = "test"
label_order = ["environment", "application", "name"]
enabled = true
iam_role_name = "CloudTrail-CloudWatch-Delivery-Role"
iam_role_policy_name = "CloudTrail-CloudWatch-Delivery-Policy"
account_type = "individual"
key_deletion_window_in_days = 10
cloudwatch_logs_retention_in_days = 365
cloudwatch_logs_group_name = "cloudtrail-log-group"
EVENT_IGNORE_LIST = jsonencode(["^Describe*", "^Assume*", "^List*", "^Get*", "^Decrypt*", "^Lookup*", "^BatchGet*", "^CreateLogStream$", "^RenewRole$", "^REST.GET.OBJECT_LOCK_CONFIGURATION$", "TestEventPattern", "TestScheduleExpression", "CreateNetworkInterface", "ValidateTemplate"])
EVENT_ALERT_LIST = jsonencode(["DetachRolePolicy", "ConsoleLogin"])
USER_IGNORE_LIST = jsonencode(["^awslambda_*", "^aws-batch$", "^bamboo*", "^i-*", "^[0-9]*$", "^ecs-service-scheduler$", "^AutoScaling$", "^AWSCloudFormation$", "^CloudTrailBot$", "^SLRManagement$"])
SOURCE_LIST = jsonencode(["aws-sdk-go"])
s3_bucket_name = "logs-bucket-clouddrove"
slack_webhook = "https://hooks.slack.com/services/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GVEtJr46llqX"
slack_channel = "testing"
}
```
### Multi Account
#### Master Account
```hcl
module "cloudtrail" {
source = "git::https://github.com/clouddrove/terraform-aws-cloudtrail-baseline.git?ref=tags/0.14.0"
name = "trails"
environment = "test"
label_order = ["environment", "name"]
enabled = true
iam_role_name = "CloudTrail-CloudWatch-Delivery-Role"
iam_role_policy_name = "CloudTrail-CloudWatch-Delivery-Policy"
account_type = "master"
is_organization_trail = true
key_deletion_window_in_days = 10
cloudwatch_logs_retention_in_days = 365
cloudwatch_logs_group_name = "cloudtrail-log-group"
EVENT_IGNORE_LIST = jsonencode(["^Describe*", "^Assume*", "^List*", "^Get*", "^Decrypt*", "^Lookup*", "^BatchGet*", "^CreateLogStream$", "^RenewRole$", "^REST.GET.OBJECT_LOCK_CONFIGURATION$", "TestEventPattern", "TestScheduleExpression", "CreateNetworkInterface", "ValidateTemplate"])
EVENT_ALERT_LIST = jsonencode(["DetachRolePolicy", "ConsoleLogin"])
USER_IGNORE_LIST = jsonencode(["^awslambda_*", "^aws-batch$", "^bamboo*", "^i-*", "^[0-9]*$", "^ecs-service-scheduler$", "^AutoScaling$", "^AWSCloudFormation$", "^CloudTrailBot$", "^SLRManagement$"])
SOURCE_LIST = jsonencode(["aws-sdk-go"])
s3_bucket_name = "logs-bucket-cd"
secure_s3_enabled = false
s3_log_bucket_name = "logs-bucket-cd-logs"
sse_algorithm = "aws:kms"
slack_webhook = "https://hooks.slack.com/services/TEE0GHDK0F0QZ/B015frHRDBEUFHEVEG/dfdrfrefrwewqe"
slack_channel = "testing"
additional_member_root_arn = ["arn:aws:iam::xxxxxxxxxxxx:root"]
additional_member_trail = ["arn:aws:cloudtrail:*:xxxxxxxxxxxx:trail/*"]
additional_member_account_id = ["xxxxxxxxxxxx"]
additional_s3_account_path_arn = ["arn:aws:s3:::logs-bucket-clouddrove/AWSLogs/xxxxxxxxxxxx/*"]
s3_policy = data.aws_iam_policy_document.default.json
}
```
#### Member Account
```hcl
module "cloudtrail" {
source = "git::https://github.com/clouddrove/terraform-aws-cloudtrail-baseline.git?ref=tags/0.14.0"
name = "trails"
environment = "test"
label_order = ["environment", "name"]
enabled = true
iam_role_name = "CloudTrail-cd-Delivery-Role"
iam_role_policy_name = "CloudTrail-cd-Delivery-Policy"
account_type = "member"
key_deletion_window_in_days = 10
cloudwatch_logs_retention_in_days = 365
cloudwatch_logs_group_name = "cloudtrail-log-group"
key_arn = "arn:aws:kms:eu-west-1:xxxxxxxxxxx:key/9f3b66a0-3a38-4ed3-ab34-5e47c7e3604b"
s3_bucket_name = "logs-bucket-cd"
s3_log_bucket_name = "logs-bucket-cd-logs"
}
```