runbooks 0.2.5__py3-none-any.whl → 0.7.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. conftest.py +26 -0
  2. jupyter-agent/.env +2 -0
  3. jupyter-agent/.env.template +2 -0
  4. jupyter-agent/.gitattributes +35 -0
  5. jupyter-agent/.gradio/certificate.pem +31 -0
  6. jupyter-agent/README.md +16 -0
  7. jupyter-agent/__main__.log +8 -0
  8. jupyter-agent/app.py +256 -0
  9. jupyter-agent/cloudops-agent.png +0 -0
  10. jupyter-agent/ds-system-prompt.txt +154 -0
  11. jupyter-agent/jupyter-agent.png +0 -0
  12. jupyter-agent/llama3_template.jinja +123 -0
  13. jupyter-agent/requirements.txt +9 -0
  14. jupyter-agent/tmp/4ojbs8a02ir/jupyter-agent.ipynb +68 -0
  15. jupyter-agent/tmp/cm5iasgpm3p/jupyter-agent.ipynb +91 -0
  16. jupyter-agent/tmp/crqbsseag5/jupyter-agent.ipynb +91 -0
  17. jupyter-agent/tmp/hohanq1u097/jupyter-agent.ipynb +57 -0
  18. jupyter-agent/tmp/jns1sam29wm/jupyter-agent.ipynb +53 -0
  19. jupyter-agent/tmp/jupyter-agent.ipynb +27 -0
  20. jupyter-agent/utils.py +409 -0
  21. runbooks/__init__.py +71 -3
  22. runbooks/__main__.py +13 -0
  23. runbooks/aws/ec2_describe_instances.py +1 -1
  24. runbooks/aws/ec2_run_instances.py +8 -2
  25. runbooks/aws/ec2_start_stop_instances.py +17 -4
  26. runbooks/aws/ec2_unused_volumes.py +5 -1
  27. runbooks/aws/s3_create_bucket.py +4 -2
  28. runbooks/aws/s3_list_objects.py +6 -1
  29. runbooks/aws/tagging_lambda_handler.py +13 -2
  30. runbooks/aws/tags.json +12 -0
  31. runbooks/base.py +353 -0
  32. runbooks/cfat/README.md +49 -0
  33. runbooks/cfat/__init__.py +74 -0
  34. runbooks/cfat/app.ts +644 -0
  35. runbooks/cfat/assessment/__init__.py +40 -0
  36. runbooks/cfat/assessment/asana-import.csv +39 -0
  37. runbooks/cfat/assessment/cfat-checks.csv +31 -0
  38. runbooks/cfat/assessment/cfat.txt +520 -0
  39. runbooks/cfat/assessment/collectors.py +200 -0
  40. runbooks/cfat/assessment/jira-import.csv +39 -0
  41. runbooks/cfat/assessment/runner.py +387 -0
  42. runbooks/cfat/assessment/validators.py +290 -0
  43. runbooks/cfat/cli.py +103 -0
  44. runbooks/cfat/docs/asana-import.csv +24 -0
  45. runbooks/cfat/docs/cfat-checks.csv +31 -0
  46. runbooks/cfat/docs/cfat.txt +335 -0
  47. runbooks/cfat/docs/checks-output.png +0 -0
  48. runbooks/cfat/docs/cloudshell-console-run.png +0 -0
  49. runbooks/cfat/docs/cloudshell-download.png +0 -0
  50. runbooks/cfat/docs/cloudshell-output.png +0 -0
  51. runbooks/cfat/docs/downloadfile.png +0 -0
  52. runbooks/cfat/docs/jira-import.csv +24 -0
  53. runbooks/cfat/docs/open-cloudshell.png +0 -0
  54. runbooks/cfat/docs/report-header.png +0 -0
  55. runbooks/cfat/models.py +1026 -0
  56. runbooks/cfat/package-lock.json +5116 -0
  57. runbooks/cfat/package.json +38 -0
  58. runbooks/cfat/report.py +496 -0
  59. runbooks/cfat/reporting/__init__.py +46 -0
  60. runbooks/cfat/reporting/exporters.py +337 -0
  61. runbooks/cfat/reporting/formatters.py +496 -0
  62. runbooks/cfat/reporting/templates.py +135 -0
  63. runbooks/cfat/run-assessment.sh +23 -0
  64. runbooks/cfat/runner.py +69 -0
  65. runbooks/cfat/src/actions/check-cloudtrail-existence.ts +43 -0
  66. runbooks/cfat/src/actions/check-config-existence.ts +37 -0
  67. runbooks/cfat/src/actions/check-control-tower.ts +37 -0
  68. runbooks/cfat/src/actions/check-ec2-existence.ts +46 -0
  69. runbooks/cfat/src/actions/check-iam-users.ts +50 -0
  70. runbooks/cfat/src/actions/check-legacy-cur.ts +30 -0
  71. runbooks/cfat/src/actions/check-org-cloudformation.ts +30 -0
  72. runbooks/cfat/src/actions/check-vpc-existence.ts +43 -0
  73. runbooks/cfat/src/actions/create-asanaimport.ts +14 -0
  74. runbooks/cfat/src/actions/create-backlog.ts +372 -0
  75. runbooks/cfat/src/actions/create-jiraimport.ts +15 -0
  76. runbooks/cfat/src/actions/create-report.ts +616 -0
  77. runbooks/cfat/src/actions/define-account-type.ts +51 -0
  78. runbooks/cfat/src/actions/get-enabled-org-policy-types.ts +40 -0
  79. runbooks/cfat/src/actions/get-enabled-org-services.ts +26 -0
  80. runbooks/cfat/src/actions/get-idc-info.ts +34 -0
  81. runbooks/cfat/src/actions/get-org-da-accounts.ts +34 -0
  82. runbooks/cfat/src/actions/get-org-details.ts +35 -0
  83. runbooks/cfat/src/actions/get-org-member-accounts.ts +44 -0
  84. runbooks/cfat/src/actions/get-org-ous.ts +35 -0
  85. runbooks/cfat/src/actions/get-regions.ts +22 -0
  86. runbooks/cfat/src/actions/zip-assessment.ts +27 -0
  87. runbooks/cfat/src/types/index.d.ts +147 -0
  88. runbooks/cfat/tests/__init__.py +141 -0
  89. runbooks/cfat/tests/test_cli.py +340 -0
  90. runbooks/cfat/tests/test_integration.py +290 -0
  91. runbooks/cfat/tests/test_models.py +505 -0
  92. runbooks/cfat/tests/test_reporting.py +354 -0
  93. runbooks/cfat/tsconfig.json +16 -0
  94. runbooks/cfat/webpack.config.cjs +27 -0
  95. runbooks/config.py +260 -0
  96. runbooks/finops/README.md +337 -0
  97. runbooks/finops/__init__.py +86 -0
  98. runbooks/finops/aws_client.py +245 -0
  99. runbooks/finops/cli.py +151 -0
  100. runbooks/finops/cost_processor.py +410 -0
  101. runbooks/finops/dashboard_runner.py +448 -0
  102. runbooks/finops/helpers.py +355 -0
  103. runbooks/finops/main.py +14 -0
  104. runbooks/finops/profile_processor.py +174 -0
  105. runbooks/finops/types.py +66 -0
  106. runbooks/finops/visualisations.py +80 -0
  107. runbooks/inventory/.gitignore +354 -0
  108. runbooks/inventory/ArgumentsClass.py +261 -0
  109. runbooks/inventory/FAILED_SCRIPTS_TROUBLESHOOTING.md +619 -0
  110. runbooks/inventory/Inventory_Modules.py +6130 -0
  111. runbooks/inventory/LandingZone/delete_lz.py +1075 -0
  112. runbooks/inventory/PASSED_SCRIPTS_GUIDE.md +738 -0
  113. runbooks/inventory/README.md +1320 -0
  114. runbooks/inventory/__init__.py +62 -0
  115. runbooks/inventory/account_class.py +532 -0
  116. runbooks/inventory/all_my_instances_wrapper.py +123 -0
  117. runbooks/inventory/aws_decorators.py +201 -0
  118. runbooks/inventory/aws_organization.png +0 -0
  119. runbooks/inventory/cfn_move_stack_instances.py +1526 -0
  120. runbooks/inventory/check_cloudtrail_compliance.py +614 -0
  121. runbooks/inventory/check_controltower_readiness.py +1107 -0
  122. runbooks/inventory/check_landingzone_readiness.py +711 -0
  123. runbooks/inventory/cloudtrail.md +727 -0
  124. runbooks/inventory/collectors/__init__.py +20 -0
  125. runbooks/inventory/collectors/aws_compute.py +518 -0
  126. runbooks/inventory/collectors/aws_networking.py +275 -0
  127. runbooks/inventory/collectors/base.py +222 -0
  128. runbooks/inventory/core/__init__.py +19 -0
  129. runbooks/inventory/core/collector.py +303 -0
  130. runbooks/inventory/core/formatter.py +296 -0
  131. runbooks/inventory/delete_s3_buckets_objects.py +169 -0
  132. runbooks/inventory/discovery.md +81 -0
  133. runbooks/inventory/draw_org_structure.py +748 -0
  134. runbooks/inventory/ec2_vpc_utils.py +341 -0
  135. runbooks/inventory/find_cfn_drift_detection.py +272 -0
  136. runbooks/inventory/find_cfn_orphaned_stacks.py +719 -0
  137. runbooks/inventory/find_cfn_stackset_drift.py +733 -0
  138. runbooks/inventory/find_ec2_security_groups.py +669 -0
  139. runbooks/inventory/find_landingzone_versions.py +201 -0
  140. runbooks/inventory/find_vpc_flow_logs.py +1221 -0
  141. runbooks/inventory/inventory.sh +659 -0
  142. runbooks/inventory/list_cfn_stacks.py +558 -0
  143. runbooks/inventory/list_cfn_stackset_operation_results.py +252 -0
  144. runbooks/inventory/list_cfn_stackset_operations.py +734 -0
  145. runbooks/inventory/list_cfn_stacksets.py +453 -0
  146. runbooks/inventory/list_config_recorders_delivery_channels.py +681 -0
  147. runbooks/inventory/list_ds_directories.py +354 -0
  148. runbooks/inventory/list_ec2_availability_zones.py +286 -0
  149. runbooks/inventory/list_ec2_ebs_volumes.py +244 -0
  150. runbooks/inventory/list_ec2_instances.py +425 -0
  151. runbooks/inventory/list_ecs_clusters_and_tasks.py +562 -0
  152. runbooks/inventory/list_elbs_load_balancers.py +411 -0
  153. runbooks/inventory/list_enis_network_interfaces.py +526 -0
  154. runbooks/inventory/list_guardduty_detectors.py +568 -0
  155. runbooks/inventory/list_iam_policies.py +404 -0
  156. runbooks/inventory/list_iam_roles.py +518 -0
  157. runbooks/inventory/list_iam_saml_providers.py +359 -0
  158. runbooks/inventory/list_lambda_functions.py +882 -0
  159. runbooks/inventory/list_org_accounts.py +446 -0
  160. runbooks/inventory/list_org_accounts_users.py +354 -0
  161. runbooks/inventory/list_rds_db_instances.py +406 -0
  162. runbooks/inventory/list_route53_hosted_zones.py +318 -0
  163. runbooks/inventory/list_servicecatalog_provisioned_products.py +575 -0
  164. runbooks/inventory/list_sns_topics.py +360 -0
  165. runbooks/inventory/list_ssm_parameters.py +402 -0
  166. runbooks/inventory/list_vpc_subnets.py +433 -0
  167. runbooks/inventory/list_vpcs.py +422 -0
  168. runbooks/inventory/lockdown_cfn_stackset_role.py +224 -0
  169. runbooks/inventory/models/__init__.py +24 -0
  170. runbooks/inventory/models/account.py +192 -0
  171. runbooks/inventory/models/inventory.py +309 -0
  172. runbooks/inventory/models/resource.py +247 -0
  173. runbooks/inventory/recover_cfn_stack_ids.py +205 -0
  174. runbooks/inventory/requirements.txt +12 -0
  175. runbooks/inventory/run_on_multi_accounts.py +211 -0
  176. runbooks/inventory/tests/common_test_data.py +3661 -0
  177. runbooks/inventory/tests/common_test_functions.py +204 -0
  178. runbooks/inventory/tests/setup.py +24 -0
  179. runbooks/inventory/tests/src.py +18 -0
  180. runbooks/inventory/tests/test_cfn_describe_stacks.py +208 -0
  181. runbooks/inventory/tests/test_ec2_describe_instances.py +162 -0
  182. runbooks/inventory/tests/test_inventory_modules.py +55 -0
  183. runbooks/inventory/tests/test_lambda_list_functions.py +86 -0
  184. runbooks/inventory/tests/test_moto_integration_example.py +273 -0
  185. runbooks/inventory/tests/test_org_list_accounts.py +49 -0
  186. runbooks/inventory/update_aws_actions.py +173 -0
  187. runbooks/inventory/update_cfn_stacksets.py +1215 -0
  188. runbooks/inventory/update_cloudwatch_logs_retention_policy.py +294 -0
  189. runbooks/inventory/update_iam_roles_cross_accounts.py +478 -0
  190. runbooks/inventory/update_s3_public_access_block.py +539 -0
  191. runbooks/inventory/utils/__init__.py +23 -0
  192. runbooks/inventory/utils/aws_helpers.py +510 -0
  193. runbooks/inventory/utils/threading_utils.py +493 -0
  194. runbooks/inventory/utils/validation.py +682 -0
  195. runbooks/inventory/verify_ec2_security_groups.py +1430 -0
  196. runbooks/main.py +1004 -0
  197. runbooks/organizations/__init__.py +12 -0
  198. runbooks/organizations/manager.py +374 -0
  199. runbooks/security/README.md +447 -0
  200. runbooks/security/__init__.py +71 -0
  201. runbooks/{security_baseline → security}/checklist/alternate_contacts.py +8 -1
  202. runbooks/{security_baseline → security}/checklist/bucket_public_access.py +4 -1
  203. runbooks/{security_baseline → security}/checklist/cloudwatch_alarm_configuration.py +9 -2
  204. runbooks/{security_baseline → security}/checklist/guardduty_enabled.py +9 -2
  205. runbooks/{security_baseline → security}/checklist/multi_region_instance_usage.py +5 -1
  206. runbooks/{security_baseline → security}/checklist/root_access_key.py +6 -1
  207. runbooks/{security_baseline → security}/config-origin.json +1 -1
  208. runbooks/{security_baseline → security}/config.json +1 -1
  209. runbooks/{security_baseline → security}/permission.json +1 -1
  210. runbooks/{security_baseline → security}/report_generator.py +10 -2
  211. runbooks/{security_baseline → security}/report_template_en.html +7 -7
  212. runbooks/{security_baseline → security}/report_template_jp.html +7 -7
  213. runbooks/{security_baseline → security}/report_template_kr.html +12 -12
  214. runbooks/{security_baseline → security}/report_template_vn.html +7 -7
  215. runbooks/{security_baseline → security}/run_script.py +8 -2
  216. runbooks/{security_baseline → security}/security_baseline_tester.py +12 -4
  217. runbooks/{security_baseline → security}/utils/common.py +5 -1
  218. runbooks/utils/__init__.py +204 -0
  219. runbooks-0.7.0.dist-info/METADATA +375 -0
  220. runbooks-0.7.0.dist-info/RECORD +249 -0
  221. {runbooks-0.2.5.dist-info → runbooks-0.7.0.dist-info}/WHEEL +1 -1
  222. runbooks-0.7.0.dist-info/entry_points.txt +7 -0
  223. runbooks-0.7.0.dist-info/licenses/LICENSE +201 -0
  224. runbooks-0.7.0.dist-info/top_level.txt +3 -0
  225. runbooks/python101/calculator.py +0 -34
  226. runbooks/python101/config.py +0 -1
  227. runbooks/python101/exceptions.py +0 -16
  228. runbooks/python101/file_manager.py +0 -218
  229. runbooks/python101/toolkit.py +0 -153
  230. runbooks-0.2.5.dist-info/METADATA +0 -439
  231. runbooks-0.2.5.dist-info/RECORD +0 -61
  232. runbooks-0.2.5.dist-info/entry_points.txt +0 -3
  233. runbooks-0.2.5.dist-info/top_level.txt +0 -1
  234. /runbooks/{security_baseline/__init__.py → inventory/tests/script_test_data.py} +0 -0
  235. /runbooks/{security_baseline → security}/checklist/__init__.py +0 -0
  236. /runbooks/{security_baseline → security}/checklist/account_level_bucket_public_access.py +0 -0
  237. /runbooks/{security_baseline → security}/checklist/direct_attached_policy.py +0 -0
  238. /runbooks/{security_baseline → security}/checklist/iam_password_policy.py +0 -0
  239. /runbooks/{security_baseline → security}/checklist/iam_user_mfa.py +0 -0
  240. /runbooks/{security_baseline → security}/checklist/multi_region_trail.py +0 -0
  241. /runbooks/{security_baseline → security}/checklist/root_mfa.py +0 -0
  242. /runbooks/{security_baseline → security}/checklist/root_usage.py +0 -0
  243. /runbooks/{security_baseline → security}/checklist/trail_enabled.py +0 -0
  244. /runbooks/{security_baseline → security}/checklist/trusted_advisor.py +0 -0
  245. /runbooks/{security_baseline → security}/utils/__init__.py +0 -0
  246. /runbooks/{security_baseline → security}/utils/enums.py +0 -0
  247. /runbooks/{security_baseline → security}/utils/language.py +0 -0
  248. /runbooks/{security_baseline → security}/utils/level_const.py +0 -0
  249. /runbooks/{security_baseline → security}/utils/permission_list.py +0 -0
@@ -0,0 +1,372 @@
1
+ import { CloudFoundationAssessment, Task } from '../types';
2
+
3
+ // backlog is a series of tasks put together that will close
4
+ // any necessary findings from the CFAT checks
5
+ async function createBacklog(assessment: CloudFoundationAssessment): Promise<Task[]> {
6
+ let tasks: Task[] = [];
7
+ if (assessment.iamUserChecks && assessment.iamUserChecks.length > 0) {
8
+ for (const iamUser of assessment.iamUserChecks) {
9
+ let iamTask: Task = {
10
+ title: `Remove IAM user ${iamUser.userName}`,
11
+ detail: `Review and determine if IAM user ${iamUser.userName} can be deleted.`,
12
+ remediationLink: ""
13
+ }
14
+ tasks.push(iamTask);
15
+
16
+ if (iamUser.accessKeyId) {
17
+ let iamApiTask: Task = {
18
+ title: `Remove IAM user ${iamUser.userName} API key ${iamUser.accessKeyId} `,
19
+ detail: `Review and determine if IAM user API key ${iamUser.accessKeyId} for ${iamUser.userName} can be removed.`,
20
+ remediationLink: "https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_manage.html#id_users_deleting"
21
+ }
22
+ tasks.push(iamApiTask);
23
+ }
24
+ }
25
+ }
26
+ if (assessment.ec2Checks && assessment.ec2Checks.find(param => param.ec2Found === true)) {
27
+ for (const ec2 of assessment.ec2Checks) {
28
+ if (ec2.ec2Found && ec2.region) {
29
+ let ec2Task: Task = {
30
+ title: `Delete EC2 instance in ${ec2.region}`,
31
+ detail: `Delete any unnecessary EC2 instance in ${ec2.region}`,
32
+ remediationLink: "https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html"
33
+ }
34
+ tasks.push(ec2Task);
35
+ }
36
+ }
37
+ }
38
+ if (assessment.vpcChecks && assessment.vpcChecks.length > 0) {
39
+ for (const vpcFind of assessment.vpcChecks) {
40
+ if (vpcFind.vpcFound && vpcFind.region) {
41
+ let vpcTask: Task = {
42
+ title: `Delete VPC in ${vpcFind.region}`,
43
+ detail: `Delete any unnecessary VPC in ${vpcFind.region} to include the default VPC.`,
44
+ remediationLink: "https://github.com/cloud-foundations-on-aws/cloud-foundations-templates/blob/main/network/network-default-vpc-deletion/README.md"
45
+ }
46
+ tasks.push(vpcTask);
47
+ }
48
+ }
49
+ }
50
+
51
+ if (!assessment.scpEnabled) {
52
+ const scpEnabledTask: Task = {
53
+ title: 'Enable SCP',
54
+ detail: `Enable SCP in AWS Organization`,
55
+ remediationLink: "https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_enable-disable.html"
56
+ }
57
+ tasks.push(scpEnabledTask);
58
+ }
59
+ if (!assessment.tagPolicyEnabled) {
60
+ let tagPolicyEnabledTask: Task = {
61
+ title: 'Enable Tag Policy',
62
+ detail: `Enable Tag Policy in AWS Organization`,
63
+ remediationLink: "https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_enable-disable.html"
64
+ }
65
+ tasks.push(tagPolicyEnabledTask);
66
+ }
67
+ if (!assessment.backupPolicyEnabled) {
68
+ let backupPolicyEnabledTask: Task = {
69
+ title: 'Enable Backup Policy',
70
+ detail: `Enable Backup Policy in AWS Organization`,
71
+ remediationLink: "https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_enable-disable.html"
72
+ }
73
+ tasks.push(backupPolicyEnabledTask);
74
+ }
75
+ if (!assessment.isLegacyCurSetup) {
76
+ const legacyCurSetupTask: Task = {
77
+ title: 'Setup legacy CUR',
78
+ detail: `Setup legacy CUR in AWS Organization`,
79
+ remediationLink: "https://docs.aws.amazon.com/cur/latest/userguide/dataexports-create-legacy.html"
80
+ }
81
+ tasks.push(legacyCurSetupTask);
82
+ }
83
+ let transitionalFound, suspendedFound, infrastructureFound: boolean = false;
84
+ let workloadsFound: boolean = false;
85
+ let securityFound: boolean = false;
86
+ if (assessment.orgRootOuId) {
87
+ if (assessment.orgOuInfo && assessment.orgOuInfo.length > 0) {
88
+ for (const ou of assessment.orgOuInfo) {
89
+ if (ou.name?.toLowerCase() === 'suspended') { suspendedFound = true }
90
+ if (ou.name?.toLowerCase() === 'transitional') { transitionalFound = true }
91
+ if (ou.name?.toLowerCase() === 'workloads') { workloadsFound = true }
92
+ if (ou.name?.toLowerCase() === 'security') { securityFound = true }
93
+ if (ou.name?.toLowerCase() === 'infrastructure') { infrastructureFound = true }
94
+ }
95
+ }
96
+ }
97
+ let identityDelegated: boolean = false
98
+ let securityHubDelegated: boolean = false
99
+ let guardDutyDelegated: boolean = false
100
+ let configDelegated: boolean = false
101
+ let iamAccessAnalyzerDelegated: boolean = false
102
+ let s3StorageLensDelegated: boolean = false
103
+ let ipamDelegated: boolean = false
104
+ let accountDelegated: boolean = false
105
+ let backupDelegated: boolean = false
106
+ if (assessment.orgDelegatedAdminAccounts && assessment.orgDelegatedAdminAccounts.length > 0) {
107
+ for (const account of assessment.orgDelegatedAdminAccounts) {
108
+ if (account.services && account.services.length > 0) {
109
+ for (const srv of account.services) {
110
+ if (srv.ServicePrincipal === 'securityhub.amazonaws.com') { securityHubDelegated = true }
111
+ if (srv.ServicePrincipal === 'guardduty.amazonaws.com') { guardDutyDelegated = true }
112
+ if (srv.ServicePrincipal === 'sso.amazonaws.com') { identityDelegated = true }
113
+ if (srv.ServicePrincipal === 'config.amazonaws.com') { configDelegated = true }
114
+ if (srv.ServicePrincipal === 'access-analyzer.amazonaws.com') { iamAccessAnalyzerDelegated = true }
115
+ if (srv.ServicePrincipal === 'storage-lens.s3.amazonaws.com') { s3StorageLensDelegated = true }
116
+ if (srv.ServicePrincipal === 'ipam.amazonaws.com') { ipamDelegated = true }
117
+ if (srv.ServicePrincipal === 'account.amazonaws.com') { accountDelegated = true }
118
+ if (srv.ServicePrincipal === 'backup.amazonaws.com') { backupDelegated = true }
119
+ }
120
+ }
121
+ }
122
+ }
123
+ const accountEmailReviewTask: Task = {
124
+ title: 'Review account email addresses',
125
+ detail: `Review Account Email Addresses in AWS Organization`,
126
+ remediationLink: "https://docs.aws.amazon.com/IAM/latest/UserGuide/root-user-best-practices.html#ru-bp-group"
127
+ }
128
+ tasks.push(accountEmailReviewTask);
129
+ // OUs
130
+ if (!transitionalFound) {
131
+ const transitionalTask: Task = {
132
+ title: 'Deploy Transitional OU',
133
+ detail: `Deploy Transitional OU in AWS Organization`,
134
+ remediationLink: "https://docs.aws.amazon.com/whitepapers/latest/organizing-your-aws-environment/transitional-ou.html"
135
+ }
136
+ tasks.push(transitionalTask);
137
+ }
138
+ if (!suspendedFound) {
139
+ const suspendedTask: Task = {
140
+ title: 'Deploy Suspended OU',
141
+ detail: `Deploy Suspended OU in AWS Organization`,
142
+ remediationLink: "https://docs.aws.amazon.com/whitepapers/latest/organizing-your-aws-environment/suspended-ou.html"
143
+ }
144
+ tasks.push(suspendedTask);
145
+ }
146
+ if (!workloadsFound) {
147
+ const workloadsTask: Task = {
148
+ title: 'Deploy Workloads OU',
149
+ detail: `Deploy Workloads OU in AWS Organization`,
150
+ remediationLink: "https://docs.aws.amazon.com/whitepapers/latest/organizing-your-aws-environment/workloads-ou.html"
151
+ }
152
+ tasks.push(workloadsTask);
153
+ }
154
+ if (!securityFound) {
155
+ const securityTask: Task = {
156
+ title: 'Deploy Security OU',
157
+ detail: `Deploy Security OU in AWS Organization`,
158
+ remediationLink: "https://docs.aws.amazon.com/whitepapers/latest/organizing-your-aws-environment/security-ou-and-accounts.html"
159
+ }
160
+ tasks.push(securityTask);
161
+ }
162
+ if (!infrastructureFound) {
163
+ const infrastructureTask: Task = {
164
+ title: 'Deploy Infrastructure OU',
165
+ detail: `Deploy Infrastructure OU in AWS Organization`,
166
+ remediationLink: "https://docs.aws.amazon.com/whitepapers/latest/organizing-your-aws-environment/infrastructure-ou-and-accounts.html"
167
+ }
168
+ tasks.push(infrastructureTask);
169
+ }
170
+ // Control Tower
171
+ if (assessment.controlTowerRegion === undefined) {
172
+ const deployControlTowerTask: Task = {
173
+ title: 'Deploy AWS Control Tower',
174
+ detail: `Deploy AWS Control Tower in AWS Organization`,
175
+ remediationLink: "https://catalog.workshops.aws/control-tower/en-US/prerequisites/deploying"
176
+ }
177
+ tasks.push(deployControlTowerTask);
178
+ }
179
+ if (assessment.controlTowerDriftStatus === 'DRIFTED') {
180
+ const fixLzDriftTask: Task = {
181
+ title: 'Fix drift in deployed landing zone',
182
+ detail: `Fix drift in deployed landing zone`,
183
+ remediationLink: "https://docs.aws.amazon.com/controltower/latest/userguide/resolve-drift.html"
184
+ }
185
+ tasks.push(fixLzDriftTask);
186
+ }
187
+ if (assessment.controlTowerDeployedVersion !== assessment.controlTowerLatestAvailableVersion) {
188
+ const updateControlTowerTask: Task = {
189
+ title: `Update AWS Control Tower to latest version`,
190
+ detail: `Update AWS Control Tower to version ${assessment.controlTowerLatestAvailableVersion}`,
191
+ remediationLink: "https://docs.aws.amazon.com/controltower/latest/userguide/update-controltower.html"
192
+ }
193
+ tasks.push(updateControlTowerTask);
194
+ }
195
+ // cloudtrail
196
+ if (!assessment.orgServices || !assessment.orgServices.find(param => param.service === 'cloudtrail.amazonaws.com')) {
197
+ const ctOrgServiceTask: Task = {
198
+ title: 'Enable AWS CloudTrail',
199
+ detail: `Enable AWS CloudTrail in AWS Organization`,
200
+ remediationLink: "https://docs.aws.amazon.com/controltower/latest/userguide/resolve-drift.html"
201
+ }
202
+ tasks.push(ctOrgServiceTask);
203
+ }
204
+
205
+ // S3 Storage Lens
206
+ if (!s3StorageLensDelegated) {
207
+ const taskS3StorageLensDelegated: Task = {
208
+ title: 'Delegate administration of Amazon S3 Storage Lens',
209
+ detail: `Delegate administration to Amazon S3 Storage Lens`,
210
+ remediationLink: "https://docs.aws.amazon.com/organizations/latest/userguide/services-that-can-integrate-s3lens.html#integrate-enable-da-s3lens"
211
+ }
212
+ tasks.push(taskS3StorageLensDelegated);
213
+ }
214
+ // CloudFormation
215
+ if (!assessment.orgServices || !assessment.orgServices.find(param => param.service === 'member.org.stacksets.cloudformation.amazonaws.com')) {
216
+ const orgServiceCfnEnableTask: Task = {
217
+ title: 'Enable AWS CloudFormation',
218
+ detail: `Enable AWS CloudFormation in AWS Organization`,
219
+ remediationLink: "https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-orgs-activate-trusted-access.html"
220
+ }
221
+ tasks.push(orgServiceCfnEnableTask);
222
+ }
223
+ // Identity Center
224
+ if (!assessment.orgServices || !assessment.orgServices.find(param => param.service === 'sso.amazonaws.com')) {
225
+ const ssoTask: Task = {
226
+ title: 'Enable AWS Single Sign-On',
227
+ detail: `Enable AWS Single Sign-On in AWS Organization`,
228
+ remediationLink: "https://docs.aws.amazon.com/singlesignon/latest/userguide/get-set-up-for-idc.html"
229
+ }
230
+ tasks.push(ssoTask);
231
+ }
232
+ if (!identityDelegated) {
233
+ const identityDelegatedTask: Task = {
234
+ title: 'Delegate administration to AWS IAM Identity Center',
235
+ detail: `Delegate administration to AWS IAM Identity Center`,
236
+ remediationLink: "https://docs.aws.amazon.com/singlesignon/latest/userguide/delegated-admin.html"
237
+ }
238
+ tasks.push(identityDelegatedTask);
239
+ }
240
+ // SecurityHub
241
+ if (!assessment.orgServices || !assessment.orgServices.find(param => param.service === 'securityhub.amazonaws.com')) {
242
+ const taskSecurityHubDelegated: Task = {
243
+ title: 'Delegate administration to AWS Security Hub',
244
+ detail: `Delegate administration to AWS Security Hub`,
245
+ remediationLink: "https://docs.aws.amazon.com/organizations/latest/userguide/services-that-can-integrate-securityhub.html#integrate-enable-ta-securityhub"
246
+ }
247
+ tasks.push(taskSecurityHubDelegated);
248
+ }
249
+ if (!securityHubDelegated) {
250
+ const taskSecurityHubDelegated: Task = {
251
+ title: 'Delegate administration of AWS Security Hub',
252
+ detail: `Delegate administration to AWS Security Hub`,
253
+ remediationLink: "https://docs.aws.amazon.com/securityhub/latest/userguide/designate-orgs-admin-account.html"
254
+ }
255
+ tasks.push(taskSecurityHubDelegated);
256
+ }
257
+ // IAM Access Analyzer
258
+ if (!assessment.orgServices || !assessment.orgServices.find(param => param.service === 'access-analyzer.amazonaws.com')) {
259
+ const taskIamAccessAnalyzerDelegated: Task = {
260
+ title: 'Delegate administration to AWS IAM Access Analyzer',
261
+ detail: `Delegate administration to AWS IAM Access Analyzer`,
262
+ remediationLink: "https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-getting-started.html#access-analyzer-enabling"
263
+ }
264
+ tasks.push(taskIamAccessAnalyzerDelegated);
265
+ }
266
+ if (!iamAccessAnalyzerDelegated) {
267
+ const taskIamAccessAnalyzerDelegated: Task = {
268
+ title: 'Delegate administration of AWS IAM Access Analyzer',
269
+ detail: `Delegate administration to AWS IAM Access Analyzer`,
270
+ remediationLink: "https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-settings.html"
271
+ }
272
+ tasks.push(taskIamAccessAnalyzerDelegated);
273
+ }
274
+ // GuardDuty
275
+ if (!assessment.orgServices || !assessment.orgServices.find(param => param.service === 'guardduty.amazonaws.com')) {
276
+ const taskGuardDutyDelegated: Task = {
277
+ title: 'Enable AWS GuardDuty',
278
+ detail: `Enable AWS GuardDuty in AWS Organization`,
279
+ remediationLink: "https://docs.aws.amazon.com/organizations/latest/userguide/services-that-can-integrate-guardduty.html#integrate-enable-ta-guardduty"
280
+ }
281
+ tasks.push(taskGuardDutyDelegated);
282
+ }
283
+ if (!guardDutyDelegated) {
284
+ const taskGuardDutyDelegated: Task = {
285
+ title: 'Delegate administration of AWS GuardDuty',
286
+ detail: `Delegate administration to AWS GuardDuty`,
287
+ remediationLink: "https://docs.aws.amazon.com/organizations/latest/userguide/services-that-can-integrate-guardduty.html"
288
+ }
289
+ tasks.push(taskGuardDutyDelegated);
290
+ }
291
+ // Config
292
+ if (!assessment.orgServices || !assessment.orgServices.find(param => param.service === 'config.amazonaws.com')) {
293
+ const configOrgServiceTask: Task = {
294
+ title: 'Enable AWS Config',
295
+ detail: `Enable AWS Config in AWS Organization`,
296
+ remediationLink: "https://docs.aws.amazon.com/organizations/latest/userguide/services-that-can-integrate-config.html#integrate-enable-ta-config"
297
+ }
298
+ tasks.push(configOrgServiceTask);
299
+ }
300
+ if (!configDelegated) {
301
+ const taskConfigDelegated: Task = {
302
+ title: 'Delegate administration of AWS Config',
303
+ detail: `Delegate administration to AWS Config`,
304
+ remediationLink: "https://docs.aws.amazon.com/organizations/latest/userguide/services-that-can-integrate-config.html"
305
+ }
306
+ tasks.push(taskConfigDelegated);
307
+ }
308
+ // RAM
309
+ if (!assessment.orgServices || !assessment.orgServices.find(param => param.service === 'ram.amazonaws.com')) {
310
+ const orgServiceRamTask: Task = {
311
+ title: 'Enable AWS Resource Access Manager',
312
+ detail: `Enable AWS Resource Access Manager in AWS Organization`,
313
+ remediationLink: "https://docs.aws.amazon.com/organizations/latest/userguide/services-that-can-integrate-ram.html#integrate-enable-ta-ram"
314
+ }
315
+ tasks.push(orgServiceRamTask);
316
+ }
317
+ // IPAM
318
+ if (!assessment.orgServices || !assessment.orgServices.find(param => param.service === 'ipam.amazonaws.com')) {
319
+ const orgServiceIpamTask: Task = {
320
+ title: 'Enable AWS IPAM',
321
+ detail: `Enable AWS IPAM in AWS Organization`,
322
+ remediationLink: "https://docs.aws.amazon.com/organizations/latest/userguide/services-that-can-integrate-ipam.html"
323
+ }
324
+ tasks.push(orgServiceIpamTask);
325
+ }
326
+ if (!ipamDelegated) {
327
+ const taskIpamDelegated: Task = {
328
+ title: 'Delegate administration of AWS IPAM',
329
+ detail: `Delegate administration to AWS IPAM`,
330
+ remediationLink: "https://docs.aws.amazon.com/vpc/latest/ipam/enable-integ-ipam.html"
331
+ }
332
+ tasks.push(taskIpamDelegated);
333
+ }
334
+ // Account Manager
335
+ if (!assessment.orgServices || !assessment.orgServices.find(param => param.service === 'account.amazonaws.com')) {
336
+ const orgServiceAccountTask: Task = {
337
+ title: 'Enable AWS Account',
338
+ detail: `Enable AWS Account in AWS Organization`,
339
+ remediationLink: "https://docs.aws.amazon.com/accounts/latest/reference/using-orgs-delegated-admin.html"
340
+ }
341
+ tasks.push(orgServiceAccountTask);
342
+ }
343
+ if (!accountDelegated) {
344
+ const taskAccountDelegated: Task = {
345
+ title: 'Delegate administration of AWS Account management',
346
+ detail: `Delegate administration to AWS Account contact management`,
347
+ remediationLink: "https://docs.aws.amazon.com/organizations/latest/userguide/services-that-can-integrate-account.html#integrate-enable-da-account"
348
+ }
349
+ tasks.push(taskAccountDelegated);
350
+ }
351
+ // Backup
352
+ if (!assessment.orgServices || !assessment.orgServices.find(param => param.service === 'backup.amazonaws.com')) {
353
+ const orgServiceBackupTask: Task = {
354
+ title: 'Enable AWS Backup',
355
+ detail: `Enable AWS Backup in AWS Organization`,
356
+ remediationLink: "https://docs.aws.amazon.com/organizations/latest/userguide/services-that-can-integrate-backup.html#integrate-enable-ta-backup"
357
+ }
358
+ tasks.push(orgServiceBackupTask);
359
+ }
360
+ if (!backupDelegated) {
361
+ const taskBackupDelegated: Task = {
362
+ title: 'Delegate administration of AWS Backup',
363
+ detail: `Delegate administration to AWS Backup`,
364
+ remediationLink: "https://docs.aws.amazon.com/aws-backup/latest/devguide/manage-cross-account.html#backup-delegatedadmin"
365
+ }
366
+ tasks.push(taskBackupDelegated);
367
+ }
368
+
369
+ return tasks
370
+ }
371
+
372
+ export default createBacklog;
@@ -0,0 +1,15 @@
1
+
2
+ import { Task } from '../types';
3
+ import * as fs from 'fs';
4
+
5
+ async function createJiraImport(tasks: Task[]): Promise<void> {
6
+ let csv:string = '"Summary", "Description", "Status" \r\n'
7
+ for(const task of tasks){
8
+ csv += `"cfat - ${task.category} - ${task.title}", "${task.detail}", "Open" \r\n`
9
+ }
10
+
11
+ fs.writeFileSync('./jira-import.csv', csv);
12
+ return
13
+ }
14
+
15
+ export default createJiraImport;