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
+82-17Lines changed: 82 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@ 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
10
10
11
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/)
11
12
@@ -21,6 +22,10 @@ The following is a simple diagram on how Assisted Log Enabler for AWS works in a
21
22
22
23

23
24
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
+
27
+

28
+
24
29
## Prerequisites
25
30
### Permissions
26
31
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:
@@ -48,6 +53,15 @@ 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.
88
102
89
-
# NEW! For cleanup of Amazon Route 53 Resolver Query Logs created by Assisted Log Enabler for AWS:
103
+
# NEW! For adding Amazon S3 Server Access Logs:
104
+
"s3:PutBucketLogging",
105
+
"s3:GetBucketLogging",
106
+
"s3:ListBucket",
107
+
"s3:ListAllMyBuckets",
108
+
"s3:GetBucketLocation",
109
+
"s3:GetBucketAcl",
110
+
"s3:PutBucketAcl",
111
+
"s3:PutBucketPublicAccessBlock",
112
+
"s3:PutBucketLifecycleConfiguration"
113
+
114
+
# For cleanup of Amazon Route 53 Resolver Query Logs created by Assisted Log Enabler for AWS:
@@ -110,6 +135,9 @@ The following are the details of what happens within the Assisted Log Enabler fo
110
135
* If no trail is configured, one is created and configured to log to the bucket created. (Single Account only as of this release)
111
136
* If Amazon EKS Clusters exist, audit & authenticator logs are turned on.
112
137
* 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.
139
+
* This does not include for S3 buckets created by Assisted Log Enabler for AWS
140
+
* 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.
113
141
114
142
115
143
## Running the Code
@@ -149,27 +177,58 @@ No valid option selected. Please run with -h to display valid options.
function_parser_group.add_argument('--s3logs', action='store_true', help=' Turns on Amazon Bucket Logs.')
85
85
function_parser_group.add_argument('--cloudtrail', action='store_true', help=' Turns on AWS CloudTrail. Only available in Single Account version.')
86
86
87
87
cleanup_parser_group=parser.add_argument_group('Cleanup Options', 'Use these flags to choose which resources you want to turn logging off for.')
88
88
cleanup_parser_group.add_argument('--single_r53querylogs', action='store_true', help=' Removes Amazon Route 53 Resolver Query Log resources created by Assisted Log Enabler for AWS.')
89
89
cleanup_parser_group.add_argument('--single_cloudtrail', action='store_true', help=' Removes AWS CloudTrail trails created by Assisted Log Enabler for AWS.')
90
90
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
91
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
+
cleanup_parser_group.add_argument('--single_s3logs', action='store_true', help=' Removes Amazon Bucket Log resources created by Assisted Log Enabler for AWS.')
92
93
93
94
dryrun_parser_group=parser.add_argument_group('Dry Run Options', 'Use these flags to run Assisted Log Enabler for AWS in Dry Run mode.')
94
95
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.')
@@ -106,6 +107,8 @@ def assisted_log_enabler():
106
107
ALE_single_account.run_vpc_flow_logs()
107
108
elifargs.r53querylogs:
108
109
ALE_single_account.run_r53_query_logs()
110
+
elifargs.s3logs:
111
+
ALE_single_account.run_s3_logs()
109
112
elifargs.cloudtrail:
110
113
ALE_single_account.run_cloudtrail()
111
114
elifargs.all:
@@ -119,13 +122,17 @@ def assisted_log_enabler():
119
122
ALE_multi_account.run_vpc_flow_logs()
120
123
elifargs.r53querylogs:
121
124
ALE_multi_account.run_r53_query_logs()
125
+
elifargs.s3logs:
126
+
ALE_multi_account.run_s3_logs()
122
127
elifargs.all:
123
128
ALE_multi_account.lambda_handler(event, context)
124
129
else:
125
130
logging.info("No valid option selected. Please run with -h to display valid options.")
0 commit comments