You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-11Lines changed: 39 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,8 @@ With Assisted Log Enabler for AWS, logging is turned on automatically for the va
6
6
* AWS CloudTrail (Single Account Only)
7
7
* Amazon Elastic Kubernetes Service (EKS) Audit and Authenticator Logs (Single Account and Multi-Account using AWS Organizations)
8
8
* Amazon Route 53 Resolver Query Logs (Single Account and Multi-Account using AWS Organizations)
9
-
* NEW! Amazon S3 Server Access Logs (Single Account and Multi-Account using AWS Organizations)
9
+
* Amazon S3 Server Access Logs (Single Account and Multi-Account using AWS Organizations)
10
+
* NEW! Elastic Load Balancing Access Logs (Single Account and Multi-Account using AWS Organizations)
10
11
11
12
Link to related AWS Open Source Blog Post: [Introducing Assisted Log Enabler for AWS](https://aws.amazon.com/blogs/opensource/introducing-assisted-log-enabler-for-aws/)
12
13
@@ -22,10 +23,14 @@ The following is a simple diagram on how Assisted Log Enabler for AWS works in a
22
23
23
24

24
25
25
-
NEW! The following is a simple diagram on how Assisted Log Enabler for AWS works with turning on Amazon S3 Server Access Logging in a single account:
26
+
The following is a simple diagram on how Assisted Log Enabler for AWS works with turning on Amazon S3 Server Access Logging in a single account:
26
27
27
28

28
29
30
+
The following is a simple diagram on how Assisted Log Enabler for AWS works with turning on Elastic Load Balancing Access Logging in a single account:
31
+
32
+

33
+
29
34
## Prerequisites
30
35
### Permissions
31
36
The following permissions are needed within AWS IAM for Assisted Log Enabler for AWS to run. Please see each section for a breakdown per AWS Service and functionality:
@@ -100,7 +105,7 @@ The following permissions are needed within AWS IAM for Assisted Log Enabler for
"iam:CreateServiceLinkRole" # This is used to create the AWSServiceRoleForRoute53 Resolver, which is used for creating the Amazon Route 53 Query Logging Configurations.
102
107
103
-
# NEW! For adding Amazon S3 Server Access Logs:
108
+
# For adding Amazon S3 Server Access Logs:
104
109
"s3:PutBucketLogging",
105
110
"s3:GetBucketLogging",
106
111
"s3:ListBucket",
@@ -111,6 +116,17 @@ The following permissions are needed within AWS IAM for Assisted Log Enabler for
111
116
"s3:PutBucketPublicAccessBlock",
112
117
"s3:PutBucketLifecycleConfiguration"
113
118
119
+
# NEW! For adding Elastic Load Balancing Access Logs:
# For cleanup of Amazon Route 53 Resolver Query Logs created by Assisted Log Enabler for AWS:
115
131
"route53resolver:ListResolverQueryLogConfigs",
116
132
"route53resolver:ListTagsForResource",
@@ -135,10 +151,12 @@ The following are the details of what happens within the Assisted Log Enabler fo
135
151
* If no trail is configured, one is created and configured to log to the bucket created. (Single Account only as of this release)
136
152
* If Amazon EKS Clusters exist, audit & authenticator logs are turned on.
137
153
* Amazon Route 53 Query Logging is turned on for VPCs that do not have it turned on already.
138
-
*NEW! Amazon S3 Server Access Logs are created for buckets that do not have it turned on already.
154
+
* Amazon S3 Server Access Logs are created for buckets that do not have it turned on already.
139
155
* This does not include for S3 buckets created by Assisted Log Enabler for AWS
140
156
* Amazon S3 Server Access Logs require buckets that reside in the same account & region, so additional buckets for Amazon S3 Server Access logs are created for this.
141
-
157
+
* NEW! Elastic Load Balancing Access Logs are created for Application, Network and Classic Load Balancers that do not have it turned on already.
158
+
* Elastic Load Balancing Access Logs require buckets that reside in the region, so additional buckets for Elastic Load Balancing Access logs are created for this.
159
+
* The following table contains the account IDs to use in place of elb-account-id in the bucket policy: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-access-logs.html
142
160
143
161
## Running the Code
144
162
The code in its current form can be ran inside the following:
@@ -177,10 +195,10 @@ No valid option selected. Please run with -h to display valid options.
@@ -341,7 +366,7 @@ Sample output within the log file:
341
366
2021-02-23 05:31:54,984 - INFO - Turning on audit and authenticator logging for EKS clusters in region af-south-1.
342
367
```
343
368
344
-
## NEW! Dry Run Mode
369
+
## Dry Run Mode
345
370
Dry Run modes for single and multi-account are both available. These modes allow you to check for resources in your environment that do not have logging turned on, but does not activate the logging for said resources.
346
371
347
372
To run Assisted Log Enabler for AWS in Dry Run mode, you can use the commands below:
function_parser_group.add_argument('--s3logs', action='store_true', help=' Turns on Amazon Bucket Logs.')
85
+
function_parser_group.add_argument('--lblogs', action='store_true', help=' Turns on Amazon Load Balancer Logs.')
85
86
function_parser_group.add_argument('--cloudtrail', action='store_true', help=' Turns on AWS CloudTrail. Only available in Single Account version.')
86
87
87
88
cleanup_parser_group=parser.add_argument_group('Cleanup Options', 'Use these flags to choose which resources you want to turn logging off for.')
@@ -90,6 +91,7 @@ def assisted_log_enabler():
90
91
cleanup_parser_group.add_argument('--single_vpcflow', action='store_true', help=' Removes Amazon VPC Flow Log resources created by Assisted Log Enabler for AWS.')
91
92
cleanup_parser_group.add_argument('--single_all', action='store_true', help=' Turns off all of the log types within the Assisted Log Enabler for AWS.')
92
93
cleanup_parser_group.add_argument('--single_s3logs', action='store_true', help=' Removes Amazon Bucket Log resources created by Assisted Log Enabler for AWS.')
94
+
cleanup_parser_group.add_argument('--single_lblogs', action='store_true', help=' Removes Amazon Load Balancer Log resources created by Assisted Log Enabler for AWS.')
93
95
94
96
dryrun_parser_group=parser.add_argument_group('Dry Run Options', 'Use these flags to run Assisted Log Enabler for AWS in Dry Run mode.')
95
97
dryrun_parser_group.add_argument('--single_account', action='store_true', help=' Runs Assisted Log Enabler for AWS in Dry Run mode for a single AWS account.')
0 commit comments