runbooks 0.2.2__py3-none-any.whl → 0.2.3__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.
runbooks/__init__.py CHANGED
@@ -4,4 +4,4 @@ runbooks
4
4
  Provides utility functions for math operations, AWS S3 interactions, and data management.
5
5
  """
6
6
 
7
- # __version__ = "0.2.2"
7
+ # __version__ = "0.2.3"
@@ -45,6 +45,7 @@ def parse_arguments():
45
45
  default="EN",
46
46
  help="Language for the Security Baseline Report (default: 'EN').",
47
47
  )
48
+ parser.add_argument("--output", default=None, help="Custom output directory for HTML results (default: ./results).")
48
49
  return parser.parse_args()
49
50
 
50
51
 
@@ -61,9 +62,10 @@ def main():
61
62
  logger.info("Starting AWS Security Baseline Tester...")
62
63
  logger.info(f"Using AWS profile: {args.profile}")
63
64
  logger.info(f"Report language: {args.language}")
65
+ logger.info(f"Output directory: {args.output}")
64
66
 
65
67
  ## Instantiate and run the Security Baseline Tester
66
- tester = SecurityBaselineTester(args.profile, args.language)
68
+ tester = SecurityBaselineTester(args.profile, args.language, args.output)
67
69
  tester.run()
68
70
 
69
71
  logger.info("AWS Security Baseline testing completed successfully.")
@@ -17,9 +17,10 @@ from .utils import common, language, level_const
17
17
 
18
18
 
19
19
  class SecurityBaselineTester:
20
- def __init__(self, profile, lang_code):
20
+ def __init__(self, profile, lang_code, output_dir):
21
21
  self.profile = profile
22
22
  self.language = lang_code
23
+ self.output = output_dir
23
24
  self.session = self._create_session()
24
25
  self.config = self._load_config()
25
26
  ## Call module 'language' and pass the string 'lang_code'
@@ -142,8 +143,14 @@ class SecurityBaselineTester:
142
143
  # else:
143
144
  # logging.info(self.translator.translate("results_folder_already_exists"))
144
145
 
145
- script_dir = Path(__file__).resolve().parent
146
- results_dir = script_dir / "results"
146
+ ## ISSUE: creates results/ next to the module files in, e.g, .../site-packages/runbooks/security_baseline/results
147
+ # script_dir = Path(__file__).resolve().parent
148
+ # results_dir = script_dir / "results"
149
+ ## Use the current working directory instead of the script directory
150
+ if self.output:
151
+ results_dir = Path(self.output).resolve()
152
+ else:
153
+ results_dir = Path.cwd() / "results"
147
154
 
148
155
  if not results_dir.exists():
149
156
  results_dir.mkdir(parents=True, exist_ok=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: runbooks
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: CloudOps Automation Toolkit for DevOps and SRE teams.
5
5
  Author-email: runbooks maintainers <nnthanh101@gmail.com>
6
6
  License: Apache License
@@ -255,7 +255,7 @@ Requires-Dist: pandas>=2.2.3
255
255
  Requires-Dist: plotly>=5.24.1
256
256
  Requires-Dist: vizro>=0.1.30
257
257
  Requires-Dist: vizro-ai>=0.3.2
258
- Requires-Dist: runbooks>=0.2.2
258
+ Requires-Dist: runbooks>=0.2.3
259
259
 
260
260
  # 🔥 CloudOps Automation at Scale 🦅
261
261
 
@@ -1,4 +1,4 @@
1
- runbooks/__init__.py,sha256=qeIbPORHnybodq1itJ5LeDQ49K9KMNhyZb1SLIePLxg,133
1
+ runbooks/__init__.py,sha256=EST6klBDmSndvyKUF7MrSMjysen5yPb9Ivdf8o3b_NM,133
2
2
  runbooks/aws/__init__.py,sha256=iswGPspnFaHLE_Zzw2uRraYI2zvJ1Nma5PbdOiBUdEo,1646
3
3
  runbooks/aws/dynamodb_operations.py,sha256=c91YACBHnOELL8Ufj7tRQws9azGqnB6flQsacTi57xQ,6490
4
4
  runbooks/aws/ec2_copy_image_cross-region.py,sha256=2Afoo2ddzswgtdhdzsDq5aZiqXkQ0_kUyRdHbhkaLAA,6017
@@ -28,8 +28,8 @@ runbooks/security_baseline/report_template_en.html,sha256=wXommD4UxeorrsvPDMTclG
28
28
  runbooks/security_baseline/report_template_jp.html,sha256=wXommD4UxeorrsvPDMTclGMycCW0tT0sq3S2thztc8I,8039
29
29
  runbooks/security_baseline/report_template_kr.html,sha256=3zAQOM5Wwy_J3dXt_KxfvLm-0uksWgenBwySUXvFhU4,10489
30
30
  runbooks/security_baseline/report_template_vn.html,sha256=wXommD4UxeorrsvPDMTclGMycCW0tT0sq3S2thztc8I,8039
31
- runbooks/security_baseline/run_script.py,sha256=lrvbcOtofspBnI17YYw2q_3CG4q3awoEnsaZ2HcGZ_E,2084
32
- runbooks/security_baseline/security_baseline_tester.py,sha256=mOVvWWXByaQklth0QeEHxGCMT7bVGrUIVRgmUhINeg0,7354
31
+ runbooks/security_baseline/run_script.py,sha256=EVsLzmb8aLXJqXvNxSMKMdIFRJXXtPPK3iJk-PBcTgs,2274
32
+ runbooks/security_baseline/security_baseline_tester.py,sha256=p4RXkOdrMcGwC970PkdvcJggd0PPlQvGoYb98LycaR4,7743
33
33
  runbooks/security_baseline/checklist/__init__.py,sha256=gXjVSA36zv5jCkaw3XASG8DpLPo6Fu8yxquUdX8YSFY,455
34
34
  runbooks/security_baseline/checklist/account_level_bucket_public_access.py,sha256=_sILKNiBg-33wUUxoZhUq2O-x-xC2zZU9cQUehYMxTs,3386
35
35
  runbooks/security_baseline/checklist/alternate_contacts.py,sha256=MqHcKNwwmNKTna0bOdUPPNj2ytobpDMGPAUW2XhvRxI,3043
@@ -54,8 +54,8 @@ runbooks/security_baseline/utils/level_const.py,sha256=l8uYBmgEMjIQTGVVuXPAfDd_P
54
54
  runbooks/security_baseline/utils/permission_list.py,sha256=nq06vlILHp9rfnCpJauCmFCOEGdgFMF-XO3uBFrrd-o,767
55
55
  runbooks/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
56
56
  runbooks/utils/logger.py,sha256=ifxqLjDlZoDaG8rtAGVKLZ5dAwcMn16rB4YgMfeUC3E,972
57
- runbooks-0.2.2.dist-info/METADATA,sha256=myHAk6MRwOOFjRu2vYWUxrx4SafUC8To5cHvqoEqCWw,24982
58
- runbooks-0.2.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
59
- runbooks-0.2.2.dist-info/entry_points.txt,sha256=OJnk7J9_zVLbo3ZDr9DZ-RviRA8TsU9nMZJnNI91otQ,120
60
- runbooks-0.2.2.dist-info/top_level.txt,sha256=1EwNxU12QGOLtO0Naw75hXIdSIhgV_b-z_6vhlhVkhM,9
61
- runbooks-0.2.2.dist-info/RECORD,,
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,,