Skip to content

Commit 5d94564

Browse files
authored
Merge pull request #66 from tekdj7/code_standardizations
code, consistency, readme, naming
2 parents 7ef2e93 + 96f35ae commit 5d94564

File tree

202 files changed

+10087
-5945
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+10087
-5945
lines changed

.flake8

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[flake8]
2+
max-line-length = 150
3+
max-parameters-amount = 7
4+
min_python_version = 3.9.0
5+
copyright-regexp = Copyright Amazon.com, Inc\..*
6+
exclude =
7+
.git,
8+
__pycache__,
9+
.vscode
10+
11+
# enables all flake8 checks
12+
select = A,B,B9,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,0,1,2,3,4,5,6,7,8,9
13+
14+
# disable below checks:
15+
ignore =
16+
FS003 # f-string missing prefix (false positives with raw strings)
17+
T003: # add link on issue into TODO
18+
19+
# disable flake8 checks for Lambda function source code that will be used inline. (max 4096 characters)
20+
per-file-ignores =
21+
inline_lambda.py:D100,D103,C801
22+
; D100 # missing docstring in public module
23+
; D103 # missing docstring in public function
24+
; C801 # copyright notice not present

.gitignore

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Created by https://www.toptal.com/developers/gitignore/api/osx,node,linux,python,pycharm,windows,visualstudiocode,intellij
32
# Edit at https://www.toptal.com/developers/gitignore?templates=osx,node,linux,python,pycharm,windows,visualstudiocode,intellij
43

@@ -240,7 +239,6 @@ dist
240239
# Icon must end with two \r
241240
Icon
242241

243-
244242
# Thumbnails
245243
._*
246244

@@ -502,4 +500,10 @@ $RECYCLE.BIN/
502500
# Windows shortcuts
503501
*.lnk
504502

505-
# End of https://www.toptal.com/developers/gitignore/api/osx,node,linux,python,pycharm,windows,visualstudiocode,intellij
503+
# End of https://www.toptal.com/developers/gitignore/api/osx,node,linux,python,pycharm,windows,visualstudiocode,intellij
504+
505+
# Other
506+
*.zip
507+
**/local/*
508+
**/sra_staging_manual_upload/*
509+
**/dist-*/*

.markdownlint.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"MD013": false,
3+
"MD024": false
4+
}

CHANGELOG.md

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,69 @@
1-
# Change Log
1+
# Change Log <!-- omit in toc -->
2+
3+
## Table of Contents <!-- omit in toc -->
4+
5+
- [Introduction](#introduction)
6+
- [2021-11-19](#2021-11-19)
7+
- [2021-09-02](#2021-09-02)
8+
- [2021-09-01](#2021-09-01)
9+
10+
---
11+
12+
## Introduction
13+
214
All notable changes to this project will be documented in this file.
315

416
---
517

18+
## 2021-11-19
19+
20+
### Added <!-- omit in toc -->
21+
22+
- Added `.flake8`, `poetry.lock`, `pyproject.toml`, and `.markdownlint.json` to define coding standards that we will require and use when building future solutions. Contributors should use the standards defined within these files before submitting
23+
pull requests. Existing solutions will get refactored to these standards in future updates.
24+
- Added S3 `BucketKeyEnabled` to the solutions that create S3 objects (e.g. CloudTrail, GuardDuty, and Macie)
25+
26+
### Changed <!-- omit in toc -->
27+
28+
- Removed the AWS Config Aggregator account solution since AWS Control Tower deploys an account aggregator within the Audit account.
29+
- Modified the directory structure to support multiple internal packages (e.g. 1 for each solution). The folder structure also allows for tests (integration, unit, etc.). See
30+
[Real Python Application with Internal Packages](https://realpython.com/python-application-layouts/#application-with-internal-packages)
31+
- Renamed folders and files with snake_case to align with [PEP8 Package and Module Names](https://www.python.org/dev/peps/pep-0008/#package-and-module-names)
32+
- Modified links within `README.md` files to align with the updated folders and file names
33+
- Updated the `README.md` files to provide consistency and improved formatting.
34+
- Renamed parameter and template files to `sra-<solution_name>...`
35+
- Updated default values for parameters for resource names with sra- prefix to help with protecting resources deployed
36+
637
## 2021-09-02
738

8-
### Added
39+
### Added <!-- omit in toc -->
940

1041
- Nothing Added
1142

12-
### Changed
43+
### Changed <!-- omit in toc -->
1344

14-
- Removed all code and references to AWS Landing Zone as it is currently in Long-term Support and will not receive any
15-
additional features.
45+
- Removed all code and references to AWS Landing Zone as it is currently in Long-term Support and will not receive any additional features.
1646

17-
### Fixed
47+
### Fixed <!-- omit in toc -->
1848

1949
- Nothing Fixed
2050

2151
---
2252

2353
## 2021-09-01
2454

25-
### Added
55+
### Added <!-- omit in toc -->
2656

2757
- AWS IAM Access Analyzer solution
2858
- Organization AWS Config Aggregator Solution
2959
- Common Register Delegated Administrator Solution
3060

31-
### Changed
61+
### Changed <!-- omit in toc -->
3262

3363
- Nothing Changed
3464

35-
### Fixed
65+
### Fixed <!-- omit in toc -->
3666

3767
- Nothing Fixed
3868

39-
---
69+
---

CONTRIBUTING.md

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,37 @@
1-
# Contributing Guidelines
1+
# Contributing Guidelines <!-- omit in toc -->
22

3-
Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
4-
documentation, we greatly value feedback and contributions from our community.
3+
## Table of Contents <!-- omit in toc -->
54

6-
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
7-
information to effectively respond to your bug report or contribution.
5+
- [Introduction](#introduction)
6+
- [Reporting Bugs/Feature Requests](#reporting-bugsfeature-requests)
7+
- [Contributing via Pull Requests](#contributing-via-pull-requests)
8+
- [Finding contributions to work on](#finding-contributions-to-work-on)
9+
- [Code of Conduct](#code-of-conduct)
10+
- [Security issue notifications](#security-issue-notifications)
11+
- [Licensing](#licensing)
812

13+
## Introduction
14+
15+
Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional documentation, we greatly value feedback and contributions from our community.
16+
17+
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary information to effectively respond to your bug report or contribution.
918

1019
## Reporting Bugs/Feature Requests
1120

1221
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
1322

14-
When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already
15-
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
16-
17-
* A reproducible test case or series of steps
18-
* The version of our code being used
19-
* Any modifications you've made relevant to the bug
20-
* Anything unusual about your environment or deployment
23+
When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
2124

25+
- A reproducible test case or series of steps
26+
- The version of our code being used
27+
- Any modifications you've made relevant to the bug
28+
- Anything unusual about your environment or deployment
2229

2330
## Contributing via Pull Requests
31+
2432
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
2533

26-
1. You are working against the latest source on the *master* branch.
34+
1. You are working against the latest source on the _master_ branch.
2735
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
2836
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
2937

@@ -36,23 +44,21 @@ To send us a pull request, please:
3644
5. Send us a pull request, answering any default questions in the pull request interface.
3745
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
3846

39-
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
40-
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
41-
47+
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and [creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
4248

4349
## Finding contributions to work on
44-
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.
4550

51+
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues
52+
is a great place to start.
4653

4754
## Code of Conduct
48-
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
49-
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
50-
[email protected] with any additional questions or comments.
5155

56+
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact [email protected]
57+
with any additional questions or comments.
5258

5359
## Security issue notifications
54-
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
5560

61+
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
5662

5763
## Licensing
5864

CONTRIBUTORS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Andy Wickersham
22
Kisshore Gunasekaran
33
Neal Rothleder
4-
Todd Gruet
4+
Todd Gruet
5+
Julio Delgado Jr.

GENERAL-CONTRIBUTING-GUIDANCE.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,36 @@
1-
## General Guidance for Contributing
1+
# General Guidance for Contributing <!-- omit in toc -->
22

3-
### CloudFormation
3+
## Table of Contents <!-- omit in toc -->
4+
5+
- [CloudFormation](#cloudformation)
6+
- [Encryption](#encryption)
7+
- [IAM](#iam)
8+
- [Lambda](#lambda)
9+
- [Testing](#testing)
10+
11+
## CloudFormation
412

513
- [ ] GG-CLOUDFORMATION1 = Parameterize all resource values
614
- [ ] GG-CLOUDFORMATION2 = Include parameter groups and labels
715
- [ ] GG-CLOUDFORMATION3 = Validate all parameters
816
- [ ] GG-CLOUDFORMATION4 = Sort everything in alphabetical order (e.g. Labels, Parameters, Policy Actions, etc.)
917
- [ ] GG-CLOUDFORMATION5 = No inline Lambda code
1018
- [ ] GG-CLOUDFORMATION6 = Use custom resource properties over Lambda resource environment variables
11-
- [ ] GG-CLOUDFORMATION7 = Scan templates using CFN NAG and provide metadata with specific reason for any findings that
12-
cannot be remediated
19+
- [ ] GG-CLOUDFORMATION7 = Scan templates using CFN NAG and provide metadata with specific reason for any findings that cannot be remediated
1320

14-
### Encryption
21+
## Encryption
1522

1623
- [ ] GG-ENCRYPTION1 = Enable encryption by default. Customer Managed KMS Key preferred.
1724
- [ ] GG-ENCRYPTION2 = Least privilege used in key policies
18-
19-
### IAM
2025

21-
- [ ] GG-IAM1 = All IAM roles and users must be least privileged with full action names (no wildcards) listed in
22-
policies
23-
- [ ] GG-IAM2 = IAM policy files and/or statements are grouped by service with read and write actions in separate
24-
statements
26+
## IAM
27+
28+
- [ ] GG-IAM1 = All IAM roles and users must be least privileged with full action names (no wildcards) listed in policies
29+
- [ ] GG-IAM2 = IAM policy files and/or statements are grouped by service with read and write actions in separate statements
2530
- [ ] GG-IAM3 = Avoid using AWS managed policies
2631
- [ ] GG-IAM4 = Restrict actions to a resource or resource prefix when possible
27-
28-
### Lambda
32+
33+
## Lambda
2934

3035
- [ ] GG-LAMBDA1 = Add disclaimer stating input validation covered in CloudFormation
3136
- [ ] GG-LAMBDA2 = Handle all exceptions
@@ -34,14 +39,10 @@
3439
- [ ] GG-LAMBDA5 = Unique IAM role used for each function
3540
- [ ] GG-LAMBDA6 = Only include libraries that are not included by the Lambda runtime (e.g. boto3 containing new API)
3641
- [ ] GG-LAMBDA7 = Include a packaging script or instructions instead of including packaged Lambda code (e.g. zip file)
37-
- [ ] GG-LAMBDA8 = Run a SAST scan on the code and fix all findings, if possible but at a minimum fix critical and high
38-
findings (e.g. bandit for python)
39-
40-
### Testing
41-
42-
- [ ] GG-SOLUTION_TESTING1 = Test deploying the solution in a multi-account environment using Customizations for
43-
AWS Control Tower
44-
- [ ] GG-SOLUTION_TESTING2 = Test removing the solution in a multi-account environment following the provided
45-
instructions
46-
- [ ] GG-SOLUTION_TESTING3 = Have at least 1 peer review of the solution before submitting a merge/pull request
42+
- [ ] GG-LAMBDA8 = Run a SAST scan on the code and fix all findings, if possible but at a minimum fix critical and high findings (e.g. bandit for python)
43+
44+
## Testing
4745

46+
- [ ] GG-SOLUTION_TESTING1 = Test deploying the solution in a multi-account environment using Customizations for AWS Control Tower
47+
- [ ] GG-SOLUTION_TESTING2 = Test removing the solution in a multi-account environment following the provided instructions
48+
- [ ] GG-SOLUTION_TESTING3 = Have at least 1 peer review of the solution before submitting a merge/pull request

LICENSE-SUMMARY

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
The documentation is made available under the Creative Commons Attribution-ShareAlike 4.0 International License. See the LICENSE file.
44

55
The sample code within this documentation is made available under the MIT-0 license. See the LICENSE-SAMPLECODE file.
6+
7+
Please note when building the project that some of the configured developer dependencies are subject to copyleft licenses. Please review these as needed for your use.

0 commit comments

Comments
 (0)