runbooks 0.2.3__py3-none-any.whl → 0.6.1__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 (221) hide show
  1. conftest.py +26 -0
  2. jupyter-agent/.env.template +2 -0
  3. jupyter-agent/.gitattributes +35 -0
  4. jupyter-agent/README.md +16 -0
  5. jupyter-agent/app.py +256 -0
  6. jupyter-agent/cloudops-agent.png +0 -0
  7. jupyter-agent/ds-system-prompt.txt +154 -0
  8. jupyter-agent/jupyter-agent.png +0 -0
  9. jupyter-agent/llama3_template.jinja +123 -0
  10. jupyter-agent/requirements.txt +9 -0
  11. jupyter-agent/utils.py +409 -0
  12. runbooks/__init__.py +71 -3
  13. runbooks/__main__.py +13 -0
  14. runbooks/aws/ec2_describe_instances.py +1 -1
  15. runbooks/aws/ec2_run_instances.py +8 -2
  16. runbooks/aws/ec2_start_stop_instances.py +17 -4
  17. runbooks/aws/ec2_unused_volumes.py +5 -1
  18. runbooks/aws/s3_create_bucket.py +4 -2
  19. runbooks/aws/s3_list_objects.py +6 -1
  20. runbooks/aws/tagging_lambda_handler.py +13 -2
  21. runbooks/aws/tags.json +12 -0
  22. runbooks/base.py +353 -0
  23. runbooks/cfat/README.md +49 -0
  24. runbooks/cfat/__init__.py +74 -0
  25. runbooks/cfat/app.ts +644 -0
  26. runbooks/cfat/assessment/__init__.py +40 -0
  27. runbooks/cfat/assessment/asana-import.csv +39 -0
  28. runbooks/cfat/assessment/cfat-checks.csv +31 -0
  29. runbooks/cfat/assessment/cfat.txt +520 -0
  30. runbooks/cfat/assessment/collectors.py +200 -0
  31. runbooks/cfat/assessment/jira-import.csv +39 -0
  32. runbooks/cfat/assessment/runner.py +387 -0
  33. runbooks/cfat/assessment/validators.py +290 -0
  34. runbooks/cfat/cli.py +103 -0
  35. runbooks/cfat/docs/asana-import.csv +24 -0
  36. runbooks/cfat/docs/cfat-checks.csv +31 -0
  37. runbooks/cfat/docs/cfat.txt +335 -0
  38. runbooks/cfat/docs/checks-output.png +0 -0
  39. runbooks/cfat/docs/cloudshell-console-run.png +0 -0
  40. runbooks/cfat/docs/cloudshell-download.png +0 -0
  41. runbooks/cfat/docs/cloudshell-output.png +0 -0
  42. runbooks/cfat/docs/downloadfile.png +0 -0
  43. runbooks/cfat/docs/jira-import.csv +24 -0
  44. runbooks/cfat/docs/open-cloudshell.png +0 -0
  45. runbooks/cfat/docs/report-header.png +0 -0
  46. runbooks/cfat/models.py +1026 -0
  47. runbooks/cfat/package-lock.json +5116 -0
  48. runbooks/cfat/package.json +38 -0
  49. runbooks/cfat/report.py +496 -0
  50. runbooks/cfat/reporting/__init__.py +46 -0
  51. runbooks/cfat/reporting/exporters.py +337 -0
  52. runbooks/cfat/reporting/formatters.py +496 -0
  53. runbooks/cfat/reporting/templates.py +135 -0
  54. runbooks/cfat/run-assessment.sh +23 -0
  55. runbooks/cfat/runner.py +69 -0
  56. runbooks/cfat/src/actions/check-cloudtrail-existence.ts +43 -0
  57. runbooks/cfat/src/actions/check-config-existence.ts +37 -0
  58. runbooks/cfat/src/actions/check-control-tower.ts +37 -0
  59. runbooks/cfat/src/actions/check-ec2-existence.ts +46 -0
  60. runbooks/cfat/src/actions/check-iam-users.ts +50 -0
  61. runbooks/cfat/src/actions/check-legacy-cur.ts +30 -0
  62. runbooks/cfat/src/actions/check-org-cloudformation.ts +30 -0
  63. runbooks/cfat/src/actions/check-vpc-existence.ts +43 -0
  64. runbooks/cfat/src/actions/create-asanaimport.ts +14 -0
  65. runbooks/cfat/src/actions/create-backlog.ts +372 -0
  66. runbooks/cfat/src/actions/create-jiraimport.ts +15 -0
  67. runbooks/cfat/src/actions/create-report.ts +616 -0
  68. runbooks/cfat/src/actions/define-account-type.ts +51 -0
  69. runbooks/cfat/src/actions/get-enabled-org-policy-types.ts +40 -0
  70. runbooks/cfat/src/actions/get-enabled-org-services.ts +26 -0
  71. runbooks/cfat/src/actions/get-idc-info.ts +34 -0
  72. runbooks/cfat/src/actions/get-org-da-accounts.ts +34 -0
  73. runbooks/cfat/src/actions/get-org-details.ts +35 -0
  74. runbooks/cfat/src/actions/get-org-member-accounts.ts +44 -0
  75. runbooks/cfat/src/actions/get-org-ous.ts +35 -0
  76. runbooks/cfat/src/actions/get-regions.ts +22 -0
  77. runbooks/cfat/src/actions/zip-assessment.ts +27 -0
  78. runbooks/cfat/src/types/index.d.ts +147 -0
  79. runbooks/cfat/tests/__init__.py +141 -0
  80. runbooks/cfat/tests/test_cli.py +340 -0
  81. runbooks/cfat/tests/test_integration.py +290 -0
  82. runbooks/cfat/tests/test_models.py +505 -0
  83. runbooks/cfat/tests/test_reporting.py +354 -0
  84. runbooks/cfat/tsconfig.json +16 -0
  85. runbooks/cfat/webpack.config.cjs +27 -0
  86. runbooks/config.py +260 -0
  87. runbooks/finops/__init__.py +88 -0
  88. runbooks/finops/aws_client.py +245 -0
  89. runbooks/finops/cli.py +151 -0
  90. runbooks/finops/cost_processor.py +410 -0
  91. runbooks/finops/dashboard_runner.py +448 -0
  92. runbooks/finops/helpers.py +355 -0
  93. runbooks/finops/main.py +14 -0
  94. runbooks/finops/profile_processor.py +174 -0
  95. runbooks/finops/types.py +66 -0
  96. runbooks/finops/visualisations.py +80 -0
  97. runbooks/inventory/.gitignore +354 -0
  98. runbooks/inventory/ArgumentsClass.py +261 -0
  99. runbooks/inventory/Inventory_Modules.py +6130 -0
  100. runbooks/inventory/LandingZone/delete_lz.py +1075 -0
  101. runbooks/inventory/README.md +1320 -0
  102. runbooks/inventory/__init__.py +62 -0
  103. runbooks/inventory/account_class.py +532 -0
  104. runbooks/inventory/all_my_instances_wrapper.py +123 -0
  105. runbooks/inventory/aws_decorators.py +201 -0
  106. runbooks/inventory/cfn_move_stack_instances.py +1526 -0
  107. runbooks/inventory/check_cloudtrail_compliance.py +614 -0
  108. runbooks/inventory/check_controltower_readiness.py +1107 -0
  109. runbooks/inventory/check_landingzone_readiness.py +711 -0
  110. runbooks/inventory/cloudtrail.md +727 -0
  111. runbooks/inventory/collectors/__init__.py +20 -0
  112. runbooks/inventory/collectors/aws_compute.py +518 -0
  113. runbooks/inventory/collectors/aws_networking.py +275 -0
  114. runbooks/inventory/collectors/base.py +222 -0
  115. runbooks/inventory/core/__init__.py +19 -0
  116. runbooks/inventory/core/collector.py +303 -0
  117. runbooks/inventory/core/formatter.py +296 -0
  118. runbooks/inventory/delete_s3_buckets_objects.py +169 -0
  119. runbooks/inventory/discovery.md +81 -0
  120. runbooks/inventory/draw_org_structure.py +748 -0
  121. runbooks/inventory/ec2_vpc_utils.py +341 -0
  122. runbooks/inventory/find_cfn_drift_detection.py +272 -0
  123. runbooks/inventory/find_cfn_orphaned_stacks.py +719 -0
  124. runbooks/inventory/find_cfn_stackset_drift.py +733 -0
  125. runbooks/inventory/find_ec2_security_groups.py +669 -0
  126. runbooks/inventory/find_landingzone_versions.py +201 -0
  127. runbooks/inventory/find_vpc_flow_logs.py +1221 -0
  128. runbooks/inventory/inventory.sh +659 -0
  129. runbooks/inventory/list_cfn_stacks.py +558 -0
  130. runbooks/inventory/list_cfn_stackset_operation_results.py +252 -0
  131. runbooks/inventory/list_cfn_stackset_operations.py +734 -0
  132. runbooks/inventory/list_cfn_stacksets.py +453 -0
  133. runbooks/inventory/list_config_recorders_delivery_channels.py +681 -0
  134. runbooks/inventory/list_ds_directories.py +354 -0
  135. runbooks/inventory/list_ec2_availability_zones.py +286 -0
  136. runbooks/inventory/list_ec2_ebs_volumes.py +244 -0
  137. runbooks/inventory/list_ec2_instances.py +425 -0
  138. runbooks/inventory/list_ecs_clusters_and_tasks.py +562 -0
  139. runbooks/inventory/list_elbs_load_balancers.py +411 -0
  140. runbooks/inventory/list_enis_network_interfaces.py +526 -0
  141. runbooks/inventory/list_guardduty_detectors.py +568 -0
  142. runbooks/inventory/list_iam_policies.py +404 -0
  143. runbooks/inventory/list_iam_roles.py +518 -0
  144. runbooks/inventory/list_iam_saml_providers.py +359 -0
  145. runbooks/inventory/list_lambda_functions.py +882 -0
  146. runbooks/inventory/list_org_accounts.py +446 -0
  147. runbooks/inventory/list_org_accounts_users.py +354 -0
  148. runbooks/inventory/list_rds_db_instances.py +406 -0
  149. runbooks/inventory/list_route53_hosted_zones.py +318 -0
  150. runbooks/inventory/list_servicecatalog_provisioned_products.py +575 -0
  151. runbooks/inventory/list_sns_topics.py +360 -0
  152. runbooks/inventory/list_ssm_parameters.py +402 -0
  153. runbooks/inventory/list_vpc_subnets.py +433 -0
  154. runbooks/inventory/list_vpcs.py +422 -0
  155. runbooks/inventory/lockdown_cfn_stackset_role.py +224 -0
  156. runbooks/inventory/models/__init__.py +24 -0
  157. runbooks/inventory/models/account.py +192 -0
  158. runbooks/inventory/models/inventory.py +309 -0
  159. runbooks/inventory/models/resource.py +247 -0
  160. runbooks/inventory/recover_cfn_stack_ids.py +205 -0
  161. runbooks/inventory/requirements.txt +12 -0
  162. runbooks/inventory/run_on_multi_accounts.py +211 -0
  163. runbooks/inventory/tests/common_test_data.py +3661 -0
  164. runbooks/inventory/tests/common_test_functions.py +204 -0
  165. runbooks/inventory/tests/script_test_data.py +0 -0
  166. runbooks/inventory/tests/setup.py +24 -0
  167. runbooks/inventory/tests/src.py +18 -0
  168. runbooks/inventory/tests/test_cfn_describe_stacks.py +208 -0
  169. runbooks/inventory/tests/test_ec2_describe_instances.py +162 -0
  170. runbooks/inventory/tests/test_inventory_modules.py +55 -0
  171. runbooks/inventory/tests/test_lambda_list_functions.py +86 -0
  172. runbooks/inventory/tests/test_moto_integration_example.py +273 -0
  173. runbooks/inventory/tests/test_org_list_accounts.py +49 -0
  174. runbooks/inventory/update_aws_actions.py +173 -0
  175. runbooks/inventory/update_cfn_stacksets.py +1215 -0
  176. runbooks/inventory/update_cloudwatch_logs_retention_policy.py +294 -0
  177. runbooks/inventory/update_iam_roles_cross_accounts.py +478 -0
  178. runbooks/inventory/update_s3_public_access_block.py +539 -0
  179. runbooks/inventory/utils/__init__.py +23 -0
  180. runbooks/inventory/utils/aws_helpers.py +510 -0
  181. runbooks/inventory/utils/threading_utils.py +493 -0
  182. runbooks/inventory/utils/validation.py +682 -0
  183. runbooks/inventory/verify_ec2_security_groups.py +1430 -0
  184. runbooks/main.py +785 -0
  185. runbooks/organizations/__init__.py +12 -0
  186. runbooks/organizations/manager.py +374 -0
  187. runbooks/security_baseline/README.md +324 -0
  188. runbooks/security_baseline/checklist/alternate_contacts.py +8 -1
  189. runbooks/security_baseline/checklist/bucket_public_access.py +4 -1
  190. runbooks/security_baseline/checklist/cloudwatch_alarm_configuration.py +9 -2
  191. runbooks/security_baseline/checklist/guardduty_enabled.py +9 -2
  192. runbooks/security_baseline/checklist/multi_region_instance_usage.py +5 -1
  193. runbooks/security_baseline/checklist/root_access_key.py +6 -1
  194. runbooks/security_baseline/config-origin.json +1 -1
  195. runbooks/security_baseline/config.json +1 -1
  196. runbooks/security_baseline/permission.json +1 -1
  197. runbooks/security_baseline/report_generator.py +10 -2
  198. runbooks/security_baseline/report_template_en.html +8 -8
  199. runbooks/security_baseline/report_template_jp.html +8 -8
  200. runbooks/security_baseline/report_template_kr.html +13 -13
  201. runbooks/security_baseline/report_template_vn.html +8 -8
  202. runbooks/security_baseline/requirements.txt +7 -0
  203. runbooks/security_baseline/run_script.py +8 -2
  204. runbooks/security_baseline/security_baseline_tester.py +10 -2
  205. runbooks/security_baseline/utils/common.py +5 -1
  206. runbooks/utils/__init__.py +204 -0
  207. runbooks-0.6.1.dist-info/METADATA +373 -0
  208. runbooks-0.6.1.dist-info/RECORD +237 -0
  209. {runbooks-0.2.3.dist-info → runbooks-0.6.1.dist-info}/WHEEL +1 -1
  210. runbooks-0.6.1.dist-info/entry_points.txt +7 -0
  211. runbooks-0.6.1.dist-info/licenses/LICENSE +201 -0
  212. runbooks-0.6.1.dist-info/top_level.txt +3 -0
  213. runbooks/python101/calculator.py +0 -34
  214. runbooks/python101/config.py +0 -1
  215. runbooks/python101/exceptions.py +0 -16
  216. runbooks/python101/file_manager.py +0 -218
  217. runbooks/python101/toolkit.py +0 -153
  218. runbooks-0.2.3.dist-info/METADATA +0 -435
  219. runbooks-0.2.3.dist-info/RECORD +0 -61
  220. runbooks-0.2.3.dist-info/entry_points.txt +0 -3
  221. runbooks-0.2.3.dist-info/top_level.txt +0 -1
@@ -1,435 +0,0 @@
1
- Metadata-Version: 2.2
2
- Name: runbooks
3
- Version: 0.2.3
4
- Summary: CloudOps Automation Toolkit for DevOps and SRE teams.
5
- Author-email: runbooks maintainers <nnthanh101@gmail.com>
6
- License: Apache License
7
- Version 2.0, January 2004
8
- http://www.apache.org/licenses/
9
-
10
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
11
-
12
- 1. Definitions.
13
-
14
- "License" shall mean the terms and conditions for use, reproduction,
15
- and distribution as defined by Sections 1 through 9 of this document.
16
-
17
- "Licensor" shall mean the copyright owner or entity authorized by
18
- the copyright owner that is granting the License.
19
-
20
- "Legal Entity" shall mean the union of the acting entity and all
21
- other entities that control, are controlled by, or are under common
22
- control with that entity. For the purposes of this definition,
23
- "control" means (i) the power, direct or indirect, to cause the
24
- direction or management of such entity, whether by contract or
25
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
26
- outstanding shares, or (iii) beneficial ownership of such entity.
27
-
28
- "You" (or "Your") shall mean an individual or Legal Entity
29
- exercising permissions granted by this License.
30
-
31
- "Source" form shall mean the preferred form for making modifications,
32
- including but not limited to software source code, documentation
33
- source, and configuration files.
34
-
35
- "Object" form shall mean any form resulting from mechanical
36
- transformation or translation of a Source form, including but
37
- not limited to compiled object code, generated documentation,
38
- and conversions to other media types.
39
-
40
- "Work" shall mean the work of authorship, whether in Source or
41
- Object form, made available under the License, as indicated by a
42
- copyright notice that is included in or attached to the work
43
- (an example is provided in the Appendix below).
44
-
45
- "Derivative Works" shall mean any work, whether in Source or Object
46
- form, that is based on (or derived from) the Work and for which the
47
- editorial revisions, annotations, elaborations, or other modifications
48
- represent, as a whole, an original work of authorship. For the purposes
49
- of this License, Derivative Works shall not include works that remain
50
- separable from, or merely link (or bind by name) to the interfaces of,
51
- the Work and Derivative Works thereof.
52
-
53
- "Contribution" shall mean any work of authorship, including
54
- the original version of the Work and any modifications or additions
55
- to that Work or Derivative Works thereof, that is intentionally
56
- submitted to Licensor for inclusion in the Work by the copyright owner
57
- or by an individual or Legal Entity authorized to submit on behalf of
58
- the copyright owner. For the purposes of this definition, "submitted"
59
- means any form of electronic, verbal, or written communication sent
60
- to the Licensor or its representatives, including but not limited to
61
- communication on electronic mailing lists, source code control systems,
62
- and issue tracking systems that are managed by, or on behalf of, the
63
- Licensor for the purpose of discussing and improving the Work, but
64
- excluding communication that is conspicuously marked or otherwise
65
- designated in writing by the copyright owner as "Not a Contribution."
66
-
67
- "Contributor" shall mean Licensor and any individual or Legal Entity
68
- on behalf of whom a Contribution has been received by Licensor and
69
- subsequently incorporated within the Work.
70
-
71
- 2. Grant of Copyright License. Subject to the terms and conditions of
72
- this License, each Contributor hereby grants to You a perpetual,
73
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
74
- copyright license to reproduce, prepare Derivative Works of,
75
- publicly display, publicly perform, sublicense, and distribute the
76
- Work and such Derivative Works in Source or Object form.
77
-
78
- 3. Grant of Patent License. Subject to the terms and conditions of
79
- this License, each Contributor hereby grants to You a perpetual,
80
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
81
- (except as stated in this section) patent license to make, have made,
82
- use, offer to sell, sell, import, and otherwise transfer the Work,
83
- where such license applies only to those patent claims licensable
84
- by such Contributor that are necessarily infringed by their
85
- Contribution(s) alone or by combination of their Contribution(s)
86
- with the Work to which such Contribution(s) was submitted. If You
87
- institute patent litigation against any entity (including a
88
- cross-claim or counterclaim in a lawsuit) alleging that the Work
89
- or a Contribution incorporated within the Work constitutes direct
90
- or contributory patent infringement, then any patent licenses
91
- granted to You under this License for that Work shall terminate
92
- as of the date such litigation is filed.
93
-
94
- 4. Redistribution. You may reproduce and distribute copies of the
95
- Work or Derivative Works thereof in any medium, with or without
96
- modifications, and in Source or Object form, provided that You
97
- meet the following conditions:
98
-
99
- (a) You must give any other recipients of the Work or
100
- Derivative Works a copy of this License; and
101
-
102
- (b) You must cause any modified files to carry prominent notices
103
- stating that You changed the files; and
104
-
105
- (c) You must retain, in the Source form of any Derivative Works
106
- that You distribute, all copyright, patent, trademark, and
107
- attribution notices from the Source form of the Work,
108
- excluding those notices that do not pertain to any part of
109
- the Derivative Works; and
110
-
111
- (d) If the Work includes a "NOTICE" text file as part of its
112
- distribution, then any Derivative Works that You distribute must
113
- include a readable copy of the attribution notices contained
114
- within such NOTICE file, excluding those notices that do not
115
- pertain to any part of the Derivative Works, in at least one
116
- of the following places: within a NOTICE text file distributed
117
- as part of the Derivative Works; within the Source form or
118
- documentation, if provided along with the Derivative Works; or,
119
- within a display generated by the Derivative Works, if and
120
- wherever such third-party notices normally appear. The contents
121
- of the NOTICE file are for informational purposes only and
122
- do not modify the License. You may add Your own attribution
123
- notices within Derivative Works that You distribute, alongside
124
- or as an addendum to the NOTICE text from the Work, provided
125
- that such additional attribution notices cannot be construed
126
- as modifying the License.
127
-
128
- You may add Your own copyright statement to Your modifications and
129
- may provide additional or different license terms and conditions
130
- for use, reproduction, or distribution of Your modifications, or
131
- for any such Derivative Works as a whole, provided Your use,
132
- reproduction, and distribution of the Work otherwise complies with
133
- the conditions stated in this License.
134
-
135
- 5. Submission of Contributions. Unless You explicitly state otherwise,
136
- any Contribution intentionally submitted for inclusion in the Work
137
- by You to the Licensor shall be under the terms and conditions of
138
- this License, without any additional terms or conditions.
139
- Notwithstanding the above, nothing herein shall supersede or modify
140
- the terms of any separate license agreement you may have executed
141
- with Licensor regarding such Contributions.
142
-
143
- 6. Trademarks. This License does not grant permission to use the trade
144
- names, trademarks, service marks, or product names of the Licensor,
145
- except as required for reasonable and customary use in describing the
146
- origin of the Work and reproducing the content of the NOTICE file.
147
-
148
- 7. Disclaimer of Warranty. Unless required by applicable law or
149
- agreed to in writing, Licensor provides the Work (and each
150
- Contributor provides its Contributions) on an "AS IS" BASIS,
151
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
152
- implied, including, without limitation, any warranties or conditions
153
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
154
- PARTICULAR PURPOSE. You are solely responsible for determining the
155
- appropriateness of using or redistributing the Work and assume any
156
- risks associated with Your exercise of permissions under this License.
157
-
158
- 8. Limitation of Liability. In no event and under no legal theory,
159
- whether in tort (including negligence), contract, or otherwise,
160
- unless required by applicable law (such as deliberate and grossly
161
- negligent acts) or agreed to in writing, shall any Contributor be
162
- liable to You for damages, including any direct, indirect, special,
163
- incidental, or consequential damages of any character arising as a
164
- result of this License or out of the use or inability to use the
165
- Work (including but not limited to damages for loss of goodwill,
166
- work stoppage, computer failure or malfunction, or any and all
167
- other commercial damages or losses), even if such Contributor
168
- has been advised of the possibility of such damages.
169
-
170
- 9. Accepting Warranty or Additional Liability. While redistributing
171
- the Work or Derivative Works thereof, You may choose to offer,
172
- and charge a fee for, acceptance of support, warranty, indemnity,
173
- or other liability obligations and/or rights consistent with this
174
- License. However, in accepting such obligations, You may act only
175
- on Your own behalf and on Your sole responsibility, not on behalf
176
- of any other Contributor, and only if You agree to indemnify,
177
- defend, and hold each Contributor harmless for any liability
178
- incurred by, or claims asserted against, such Contributor by reason
179
- of your accepting any such warranty or additional liability.
180
-
181
- END OF TERMS AND CONDITIONS
182
-
183
- APPENDIX: How to apply the Apache License to your work.
184
-
185
- To apply the Apache License to your work, attach the following
186
- boilerplate notice, with the fields enclosed by brackets "[]"
187
- replaced with your own identifying information. (Don't include
188
- the brackets!) The text should be enclosed in the appropriate
189
- comment syntax for the file format. We also recommend that a
190
- file or class name and description of purpose be included on the
191
- same "printed page" as the copyright notice for easier
192
- identification within third-party archives.
193
-
194
- Copyright (c) 2025, Nhat-Thanh Nguyen <nnthanh101@gmail.com>
195
-
196
- Licensed under the Apache License, Version 2.0 (the "License");
197
- you may not use this file except in compliance with the License.
198
- You may obtain a copy of the License at
199
-
200
- http://www.apache.org/licenses/LICENSE-2.0
201
-
202
- Unless required by applicable law or agreed to in writing, software
203
- distributed under the License is distributed on an "AS IS" BASIS,
204
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
205
- See the License for the specific language governing permissions and
206
- limitations under the License.
207
-
208
- Keywords: runbooks,automation,DevOps,SRE,CloudOps
209
- Classifier: Development Status :: 5 - Production/Stable
210
- Classifier: Environment :: Console
211
- Classifier: License :: OSI Approved :: Apache Software License
212
- Classifier: Operating System :: OS Independent
213
- Classifier: Programming Language :: Python :: 3
214
- Classifier: Programming Language :: Python :: 3.11
215
- Classifier: Programming Language :: Python :: 3.12
216
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
217
- Classifier: Topic :: Utilities
218
- Requires-Python: >=3.11
219
- Description-Content-Type: text/markdown
220
- Requires-Dist: requests>=2.32.3
221
- Requires-Dist: loguru>=0.7.3
222
- Requires-Dist: tqdm>=4.67.1
223
- Requires-Dist: fastapi>=0.115.6
224
- Requires-Dist: tabulate>=0.9.0
225
- Requires-Dist: diagrams>=0.24.1
226
- Requires-Dist: mkdocs
227
- Requires-Dist: mkdocs-material
228
- Requires-Dist: mkdocstrings
229
- Requires-Dist: mkdocstrings[python]
230
- Requires-Dist: mkdocs-drawio-exporter
231
- Requires-Dist: mkdocs-glightbox
232
- Requires-Dist: mkdocs-mermaid2-plugin
233
- Requires-Dist: mkdocs-rss-plugin
234
- Requires-Dist: pymdown-extensions
235
- Requires-Dist: pygments
236
- Requires-Dist: mkdocs-techdocs-core
237
- Requires-Dist: gunicorn>=23.0.0
238
- Requires-Dist: ipykernel>=6.29.5
239
- Requires-Dist: ipywidgets>=8.1.5
240
- Requires-Dist: jupyterlab>=4.3.4
241
- Requires-Dist: jupyterlab-git>=0.50.2
242
- Requires-Dist: azure-cli
243
- Requires-Dist: boto3>=1.35.90
244
- Requires-Dist: botocore>=1.35.95
245
- Requires-Dist: jmespath>=1.0.1
246
- Requires-Dist: python-dateutil>=2.9.0
247
- Requires-Dist: s3transfer>=0.10.4
248
- Requires-Dist: six>=1.17.0
249
- Requires-Dist: urllib3~=2.3.0
250
- Requires-Dist: openai>=1.58.1
251
- Requires-Dist: pydantic>=2.10.4
252
- Requires-Dist: pydantic-ai>=0.0.16
253
- Requires-Dist: openpyxl>=3.1.5
254
- Requires-Dist: pandas>=2.2.3
255
- Requires-Dist: plotly>=5.24.1
256
- Requires-Dist: vizro>=0.1.30
257
- Requires-Dist: vizro-ai>=0.3.2
258
- Requires-Dist: runbooks>=0.2.3
259
-
260
- # 🔥 CloudOps Automation at Scale 🦅
261
-
262
- 🌟 You can use [CloudOps Automation Runbooks](https://cloudops.oceansoft.io), built on Jupyter Notebooks, to quickly create SRE RunBooks for Runbook Automation and Cloud Infrastructure Management! 🌐
263
-
264
- > [!IMPORTANT]
265
- > **🏆 Mission**: Our mission is to simplify CloudOps Automation for DevOps and SRE teams by providing an extensive, community-driven repository of actions and runbooks that streamline day-to-day operations.
266
-
267
- > [!NOTE]
268
- > **👁️ Vision**: Our vision is to be the 🥇 One-Stop Multi-Cloud Platform Engineering & Best Practices Solution for all CloudOps Automation needs, allowing DevOps and SRE teams to automate their workflows with ease, improve efficiency, and minimize toil.
269
-
270
- [![🐍 Runbooks PyPI version](https://img.shields.io/pypi/v/runbooks)](https://pypi.org/project/runbooks/) ![🦾 GitHub Container Registry](https://img.shields.io/github/v/tag/nnthanh101/runbooks:latest?label=GHCR%20Version&color=blue&logo=docker)
271
-
272
-
273
- <div align="left">
274
- <a href="https://www.linkedin.com/in/nnthanh" target="blank"><img align="center" src="https://img.shields.io/badge/-nnthanh-blue?style=flat-square&logo=Linkedin&logoColor=white&link=https://www.linkedin.com/in/nnthanh/" alt="Nhat-Thanh Nguyen" height="25" width="100" /></a>
275
- <a href="https://github.com/nnthanh101/" target="blank"><img align="center" src="https://img.shields.io/github/followers/nnthanh101?label=Follow&style=social&link=https://github.com/nnthanh101/" alt="Thanh Nguyen" height="25" width="100" /></a>
276
- <a href="https://www.facebook.com/groups/platformengineering" target="blank"><img align="center" src="https://img.shields.io/badge/Facebook-blue?style=flat-square&logo=facebook&logoColor=white&link=[https://www.linkedin.com/in/nnthanh/](https://www.facebook.com/groups/platformengineering)" alt="Nhat-Thanh Nguyen" height="25" width="100" /></a>
277
- </div>
278
-
279
- ---
280
-
281
- ## 🛠️ Features
282
-
283
- * 🥉 ✅**Lightning-Fast Toolchain**: Powered by 📦 `uv` - Next-generation Python dependency and build management, 💅 `ruff` - Linting and formatting at blazing speed, and 🧪 pytest - Robust testing framework with coverage reports.
284
- * 🥈 ✅**Effortless CI/CD Pipelines**: 🛠️ Taskfile Automation - Say goodbye to manual SDLC repetitive tasks, 🐳 Containerized Workflows – 🛡️ Security-first practices and Multi-stage Wolfi-based Docker builds for scalable production-ready environments, and ⚙️ Auto-publish to `PyPI` and GitHub Container Registry (`GHCR`) with GitHub Actions.
285
- * 🥇 ☑️**CloudOps Automation and FinOps Toolkit** – Pre-configured hybrid-cloud workflows and seamlessly integrations (jupyterlab, mkdocs, boto3, moto) for managing cloud infrastructure 🌐.
286
-
287
- | **Feature** | **Toolchain** | **Purpose** |
288
- |--------------------------|-------------------------------------|----------------------------------------------------|
289
- | 🛠️ Configuration | `pyproject.toml` | Centralized configuration for dependencies, testing, and linting. |
290
- | 🧹 Task Automation | [`Taskfile`](https://taskfile.dev/) | Automates repetitive tasks like linting, testing, and publishing. |
291
- | 📦 Python Dependencies | [`uv`](https://docs.astral.sh/uv/) | Lightning-fast dependency resolution, caching, and builds. |
292
- | 💅 Linting & Formatting | [`ruff`](https://docs.astral.sh/ruff/) | Enforces code quality standards, auto-formatting, and import sorting. |
293
- | 🧪 Testing Framework | [`pytest`](https://docs.pytest.org/) | Comprehensive unit tests, integration tests with coverage reporting. |
294
- | 🐳 Docker Integration | Dockerfile + [`DevContainer`](https://containers.dev/) | Optimized wolfi-based multi-stage builds for CI/CD and local development environments. |
295
- | 🦾 CI/CD Pipelines | [`GitHub Actions`](https://github.com/features/actions) | Automated builds, tests, and deployments to PyPI and GHCR. |
296
- | 📝 Security Compliance | [`chainguard/wolfi-base`](https://hub.docker.com/r/chainguard/wolfi-base) + SBOM + Attestations | Ensures compliance, vulnerability scanning, and security transparency. |
297
-
298
- ---
299
-
300
- ### WIP
301
-
302
- - [ ] 📚 auto doc generation
303
- - [ ] **CLI Tools** – Typer simplifies automation for AWS resources.
304
- - [ ] **Logging** – Loguru ensures structured logs for debugging.
305
- - [x] 🐳 CI/CD Optimized Docker Image runs when a new *release* is created pushing to gh registry
306
- - [x] 🦾 GitHub actions:
307
- - [x] auto publish to [`pypi`](https://pypi.org/) on push on `main`
308
- - [ ] auto creating a new tag on push on `main`, sync versions
309
- - [x] run `tests` and `lint` on `dev` and `main` when a PR is open
310
-
311
- ## 🚀 Quick Start
312
-
313
- ### 1. Clone the Repository
314
-
315
- ```bash
316
- git clone https://github.com/nnthanh101/runbooks.git
317
- cd runbooks
318
- ```
319
-
320
- ### 2. Install Dependencies and Run CI/CD Pipelines
321
-
322
- ```bash
323
- echo "Install Python dependencies using UV"
324
- task install
325
-
326
- echo "Run CI/CD pipeline tasks: clean, lint, format, test, and build"
327
- task ci
328
-
329
- echo "Publish the project package to PyPI"
330
- task publish
331
- ```
332
-
333
- ### 3. Run in DevContainer 🐳
334
-
335
- 1. Open the project in **VSCode**.
336
- 2. Install the [Remote - Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension.
337
- 3. **Reopen in Container**:
338
- **Command Palette `Ctrl+Shift+P` → Reopen in Container**.
339
-
340
- ---
341
-
342
- ## Project Structure
343
-
344
- > 🛠 End-to-end Production-grade project structure for successful 💎 CloudOps Automation and Visual Analytics FinOps projects 🚀
345
-
346
- ```
347
- cloudops-automation/
348
- ├── .devcontainer/ ## Dev Container configurations
349
- │ └── Dockerfile ## Container image build file
350
- ├── .github/ ## CI/CD workflows
351
- │ ├── workflows/ ## GitHub Actions workflows
352
- │ └── templates/ ## Workflow templates
353
- ├── .vscode/ ## IDE-specific configurations
354
- ├── config/ ## Configuration files (YAML, JSON)
355
- ├── data 🔍 Where all your raw and processed data files are stored.
356
- │ ├── external <- Data from third-party sources.
357
- │ ├── interim <- Intermediate data that has been transformed.
358
- │ ├── processed <- The final, canonical data sets for modeling.
359
- │ └── raw <- The original, unprocessed, immutable data dump.
360
-
361
- ├── docs 📓 A default mkdocs project; see mkdocs.org for details
362
- │ ├── api/ ## API documentation
363
- │ ├── architecture/ ## Architecture diagrams
364
- │ ├── tutorials/ ## Tutorials and guides
365
- │ ├── getting-started.md ## Quickstart guide
366
- │ └── index.md ## Overview documentation
367
-
368
- ├── logs/ ## Log files for debugging
369
- |
370
- ├── models 🧠 Store your trained and serialized models for easy access and versioning.
371
-
372
- ├── notebooks 💻 Jupyter notebooks for experiments and visualization.
373
- │ ├── data_exploration.ipynb
374
- │ ├── data_preprocessing.ipynb
375
- │ ├── model_training.ipynb
376
- │ └── model_evaluation.ipynb
377
-
378
- ├── pyproject.toml <- Project configuration file with package metadata for
379
- │ runbooks and configuration for tools like black
380
-
381
- ├── src/ ## 🧩 Source code for use in this project.
382
- │ ├── runbooks/ ## Main module for CloudOps Runbooks automation
383
- │ │ ├── __init__.py ## Package initializer
384
- │ │ ├── calculator.py ## [Python101] Calculator
385
- │ │ ├── config.py
386
- │ │ ├── exceptions.py
387
- │ │ ├── utils.py ## Utility scripts (logging, configs)
388
- │ │ └── cleanup.py ## Cleanup automation runbook
389
- │ ├── main.py
390
- ├── test/ ## Unit and integration tests
391
- │ ├── conftest.py
392
- │ ├── __init__.py
393
- │ ├── test_calculator.py ## [Python101] Test cases for calculator
394
- │ ├── test_utils.py ## Test cases for utils
395
- │ └── test_exceptions.py
396
- ├── templates/ ## Terraform and CloudFormation templates
397
- ├── tools/ ## Developer tools and scripts
398
- ├── .dockerignore ## Docker ignore file
399
- ├── .env ## Environment variables
400
- ├── .gitignore ## Git ignore file
401
- ├── .python-version ## Python version management
402
- ├── .gitignore
403
- ├── mkdocs.yml # Documentation generator configuration
404
- ├── README.md 🤝 Explain your project and its structure for better collaboration.
405
- ├── references <- Data dictionaries, manuals, and all other explanatory materials.
406
-
407
- ├── reports 📊 Generated analysis (reports, charts, and plots) as HTML, PDF, LaTeX.
408
- │ └── figures <- Generated graphics and figures to be used in reporting
409
-
410
- ├── requirements.txt 🛠 The requirements file for reproducing the analysis environment, for easy environment setup.
411
- └── Taskfile <- Taskfile with convenience commands like `task data` or `task train`
412
-
413
- ```
414
-
415
- ### [Github Container Registry to store and manage Docker and OCI images](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry)
416
-
417
- 1. Check if the image exists in GitHub Packages:
418
-
419
- ```
420
- docker pull ghcr.io/nnthanh101/runbooks:latest
421
- ```
422
-
423
- 2. If the image doesn't exist, build and push it:
424
-
425
- ```
426
- docker build -t ghcr.io/nnthanh101/runbooks:latest .
427
- docker login ghcr.io -u nnthanh -p GH_TOKEN
428
- docker push ghcr.io/nnthanh101/runbooks:latest
429
- ```
430
-
431
- 3. Inspect
432
-
433
- ```
434
- docker inspect ghcr.io/nnthanh101/runbooks:latest
435
- ```
@@ -1,61 +0,0 @@
1
- runbooks/__init__.py,sha256=EST6klBDmSndvyKUF7MrSMjysen5yPb9Ivdf8o3b_NM,133
2
- runbooks/aws/__init__.py,sha256=iswGPspnFaHLE_Zzw2uRraYI2zvJ1Nma5PbdOiBUdEo,1646
3
- runbooks/aws/dynamodb_operations.py,sha256=c91YACBHnOELL8Ufj7tRQws9azGqnB6flQsacTi57xQ,6490
4
- runbooks/aws/ec2_copy_image_cross-region.py,sha256=2Afoo2ddzswgtdhdzsDq5aZiqXkQ0_kUyRdHbhkaLAA,6017
5
- runbooks/aws/ec2_describe_instances.py,sha256=-Wbp0wQakCa7lJ2vfqR3P-lXN5s0jqjBHYhppiZEtSI,6543
6
- runbooks/aws/ec2_ebs_snapshots_delete.py,sha256=LwaGGAg_7tdqic1thBLywlHKjMSMyye2B79d4yNtK78,5886
7
- runbooks/aws/ec2_run_instances.py,sha256=wE7G8Xn10gG25Smu4SHpfc54rFly40Ba09Cv76XJYGg,6803
8
- runbooks/aws/ec2_start_stop_instances.py,sha256=a0yUy9Zb2JmJc7wsGh3UXJZ5P0CI1omRaRCCpV5jOxE,5939
9
- runbooks/aws/ec2_terminate_instances.py,sha256=p8ZHHDkT--rlOFah82hG6SJpty4rYZa4hn3yq4MqvQI,4692
10
- runbooks/aws/ec2_unused_eips.py,sha256=04pjoeSwm-CfJKT6u9XuHa_D-iK5r9D65FaisQy00Zk,5535
11
- runbooks/aws/ec2_unused_volumes.py,sha256=x2kcYV6DUqw77AaKILLtXYfrzAnEg3uoPJD6h5ad2Yg,5686
12
- runbooks/aws/s3_create_bucket.py,sha256=-oSYKJ_tCW5fuspuQUYSw8Y_Y9_oqzn9dbmmO80UHc4,4182
13
- runbooks/aws/s3_list_buckets.py,sha256=sHh05_KrvpLzOlGZJy8nxTAfTuMaVtMIhb3A9nLh_rQ,4752
14
- runbooks/aws/s3_list_objects.py,sha256=VYk-ljQbgXsrt9d-xCJoXe6hPeCgkCa97pf-z7EOk08,4595
15
- runbooks/aws/s3_object_operations.py,sha256=46l8v0Xt8pJhTuMjCyLDSLsU06WGxWKad99nQ91o2hg,5400
16
- runbooks/aws/tagging_lambda_handler.py,sha256=o4hTUS8ta99tVS4kZ-w_j329NArGZDi46XB-AdvWi4M,5367
17
- runbooks/python101/calculator.py,sha256=FEWSHyC6vV0Qoy13Fz-bE-mWP6Xs_yvu39iji260jDs,1365
18
- runbooks/python101/config.py,sha256=ILwA7ZyjEDHNdDbOArFAZkDSB-saF-tzeE7xmJ2CtbE,104
19
- runbooks/python101/exceptions.py,sha256=4KuSN-Kz-Xx17dU8i4rMbECANA4IXdT5dAposuv3tZc,319
20
- runbooks/python101/file_manager.py,sha256=7QLxO2eiwlgcTpdnbd80TIP1CNFGz0ZGpGKnBZvpdAk,7163
21
- runbooks/python101/toolkit.py,sha256=bWoP_r8GhsEPFsgTKSeJiilcjxO4A1fynjSDSOnlmzQ,3709
22
- runbooks/security_baseline/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
- runbooks/security_baseline/config-origin.json,sha256=PGgnYqIezumoAO_q5Wav6HDmC7O-OLFucqwC_0dkCcQ,1008
24
- runbooks/security_baseline/config.json,sha256=PGgnYqIezumoAO_q5Wav6HDmC7O-OLFucqwC_0dkCcQ,1008
25
- runbooks/security_baseline/permission.json,sha256=rpn6jdZja8SidfjHtQDjzNBx9qlg9Xl4ZZ3RxDXzKGc,1260
26
- runbooks/security_baseline/report_generator.py,sha256=rHh9d6OBg_Qcy59ZJSCfZu0ur-LeE_dSIc2LJQAtWMY,6333
27
- runbooks/security_baseline/report_template_en.html,sha256=wXommD4UxeorrsvPDMTclGMycCW0tT0sq3S2thztc8I,8039
28
- runbooks/security_baseline/report_template_jp.html,sha256=wXommD4UxeorrsvPDMTclGMycCW0tT0sq3S2thztc8I,8039
29
- runbooks/security_baseline/report_template_kr.html,sha256=3zAQOM5Wwy_J3dXt_KxfvLm-0uksWgenBwySUXvFhU4,10489
30
- runbooks/security_baseline/report_template_vn.html,sha256=wXommD4UxeorrsvPDMTclGMycCW0tT0sq3S2thztc8I,8039
31
- runbooks/security_baseline/run_script.py,sha256=EVsLzmb8aLXJqXvNxSMKMdIFRJXXtPPK3iJk-PBcTgs,2274
32
- runbooks/security_baseline/security_baseline_tester.py,sha256=p4RXkOdrMcGwC970PkdvcJggd0PPlQvGoYb98LycaR4,7743
33
- runbooks/security_baseline/checklist/__init__.py,sha256=gXjVSA36zv5jCkaw3XASG8DpLPo6Fu8yxquUdX8YSFY,455
34
- runbooks/security_baseline/checklist/account_level_bucket_public_access.py,sha256=_sILKNiBg-33wUUxoZhUq2O-x-xC2zZU9cQUehYMxTs,3386
35
- runbooks/security_baseline/checklist/alternate_contacts.py,sha256=MqHcKNwwmNKTna0bOdUPPNj2ytobpDMGPAUW2XhvRxI,3043
36
- runbooks/security_baseline/checklist/bucket_public_access.py,sha256=FmNpOOUPVTTTZEOrUGZOVEQab-VbwrrG1yoNNrj-5bc,3307
37
- runbooks/security_baseline/checklist/cloudwatch_alarm_configuration.py,sha256=LmErieAcBLO8qmuwoHfrJnLKrR_gHEMcF0TI0oZDcMc,2262
38
- runbooks/security_baseline/checklist/direct_attached_policy.py,sha256=zjM3olLXjlaHQxHEOYyifTiugICuLAAOCMxn9pSLKFw,2568
39
- runbooks/security_baseline/checklist/guardduty_enabled.py,sha256=uvjgRqpjPiTd-d762P2jLPHCiHuGPkTvrXOwhOpLcjI,2448
40
- runbooks/security_baseline/checklist/iam_password_policy.py,sha256=bKIxhWQQ4xuE_uxtWfm0LXCqTFRQ-ygafxMKqeFFGw4,1570
41
- runbooks/security_baseline/checklist/iam_user_mfa.py,sha256=H3mG_rC01iF-lbKCT7IqOEyShby9QkSADXE9BOt1DyQ,1234
42
- runbooks/security_baseline/checklist/multi_region_instance_usage.py,sha256=em2RvxW7rQK4Nv6APqE3mQJ7q4mO8e10Z8uymfyVvSY,1944
43
- runbooks/security_baseline/checklist/multi_region_trail.py,sha256=OCAejEa59rKUWU-vnVQaNxOg1wOAUQZdGzyI7r25vi4,2293
44
- runbooks/security_baseline/checklist/root_access_key.py,sha256=SUPpV3n3Wnx7VI7cWldjE6yYDn09dUnqkaiNykvN4f4,2504
45
- runbooks/security_baseline/checklist/root_mfa.py,sha256=X8PPzRLgaNhd-MMUjm432OkjQ1RqGis-pEhQUgqwVa8,1293
46
- runbooks/security_baseline/checklist/root_usage.py,sha256=20XEtXC2seJnUW0clME3YGrosRYP5yRTi7a_Rr5YpdA,4658
47
- runbooks/security_baseline/checklist/trail_enabled.py,sha256=kcX7sgB7NO2YbN8i3SDkB1m5Bb00Wu6JX9cniGBsSPw,2289
48
- runbooks/security_baseline/checklist/trusted_advisor.py,sha256=zsLQf-mFeu3aiOhGndrojoa5K4QiI1Buk5rC5Hfg_gA,674
49
- runbooks/security_baseline/utils/__init__.py,sha256=fEyCpWrJ6S6Z5rdHJGf7WRMnRNoZ6th5HmXbESc6guM,96
50
- runbooks/security_baseline/utils/common.py,sha256=hCgYtgIgzV5Z2LCeXSDXd7LNxYg9NE2s_c-d9w43a-Y,3399
51
- runbooks/security_baseline/utils/enums.py,sha256=BGr8EgwZrWsU8kvWkwWsPqELUPGBc2tvJ5SzN9XhWQU,1258
52
- runbooks/security_baseline/utils/language.py,sha256=MrSAojEyjHqRDDALdk002snj4xnFbwGgIjAc2buJ8g0,60448
53
- runbooks/security_baseline/utils/level_const.py,sha256=l8uYBmgEMjIQTGVVuXPAfDd_Psl6jNfTQw2isI43zO8,88
54
- runbooks/security_baseline/utils/permission_list.py,sha256=nq06vlILHp9rfnCpJauCmFCOEGdgFMF-XO3uBFrrd-o,767
55
- runbooks/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
- runbooks/utils/logger.py,sha256=ifxqLjDlZoDaG8rtAGVKLZ5dAwcMn16rB4YgMfeUC3E,972
57
- runbooks-0.2.3.dist-info/METADATA,sha256=XtAgfyrCcz6uTlDi23p6aeEpL0hDX0nWwDVxOE__mi8,24982
58
- runbooks-0.2.3.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
59
- runbooks-0.2.3.dist-info/entry_points.txt,sha256=OJnk7J9_zVLbo3ZDr9DZ-RviRA8TsU9nMZJnNI91otQ,120
60
- runbooks-0.2.3.dist-info/top_level.txt,sha256=1EwNxU12QGOLtO0Naw75hXIdSIhgV_b-z_6vhlhVkhM,9
61
- runbooks-0.2.3.dist-info/RECORD,,
@@ -1,3 +0,0 @@
1
- [console_scripts]
2
- runbooks-aws = runbooks.aws:run_script
3
- runbooks-security = runbooks.security_baseline.run_script:main
@@ -1 +0,0 @@
1
- runbooks