runbooks 0.1.8__py3-none-any.whl → 0.1.9__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 (26) hide show
  1. runbooks/__init__.py +1 -1
  2. runbooks/security_baseline/checklist/__init__.py +1 -0
  3. runbooks/security_baseline/checklist/account_level_bucket_public_access.py +3 -2
  4. runbooks/security_baseline/checklist/alternate_contacts.py +3 -2
  5. runbooks/security_baseline/checklist/bucket_public_access.py +3 -2
  6. runbooks/security_baseline/checklist/cloudwatch_alarm_configuration.py +3 -2
  7. runbooks/security_baseline/checklist/direct_attached_policy.py +3 -2
  8. runbooks/security_baseline/checklist/guardduty_enabled.py +3 -2
  9. runbooks/security_baseline/checklist/iam_password_policy.py +3 -2
  10. runbooks/security_baseline/checklist/iam_user_mfa.py +2 -2
  11. runbooks/security_baseline/checklist/multi_region_instance_usage.py +3 -2
  12. runbooks/security_baseline/checklist/multi_region_trail.py +3 -2
  13. runbooks/security_baseline/checklist/root_access_key.py +2 -2
  14. runbooks/security_baseline/checklist/root_mfa.py +2 -2
  15. runbooks/security_baseline/checklist/root_usage.py +3 -3
  16. runbooks/security_baseline/checklist/trail_enabled.py +3 -2
  17. runbooks/security_baseline/checklist/trusted_advisor.py +2 -2
  18. runbooks/security_baseline/report_generator.py +2 -1
  19. runbooks/security_baseline/run_script.py +2 -2
  20. runbooks/security_baseline/security_baseline_tester.py +14 -9
  21. runbooks/security_baseline/utils/__init__.py +1 -0
  22. {runbooks-0.1.8.dist-info → runbooks-0.1.9.dist-info}/METADATA +2 -2
  23. {runbooks-0.1.8.dist-info → runbooks-0.1.9.dist-info}/RECORD +26 -26
  24. {runbooks-0.1.8.dist-info → runbooks-0.1.9.dist-info}/WHEEL +0 -0
  25. {runbooks-0.1.8.dist-info → runbooks-0.1.9.dist-info}/entry_points.txt +0 -0
  26. {runbooks-0.1.8.dist-info → runbooks-0.1.9.dist-info}/top_level.txt +0 -0
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.1.8"
7
+ # __version__ = "0.1.9"
@@ -1,3 +1,4 @@
1
+ ## security_baseline/checklist/__init__.py
1
2
  __all__ = [
2
3
  "root_mfa",
3
4
  "root_usage",
@@ -1,8 +1,9 @@
1
1
  import logging
2
2
 
3
3
  import botocore.exceptions
4
- from utils import common
5
- from utils import level_const as level
4
+
5
+ from ..utils import common
6
+ from ..utils import level_const as level
6
7
 
7
8
 
8
9
  def check_account_level_bucket_public_access(session, translator) -> common.CheckResult:
@@ -1,8 +1,9 @@
1
1
  import logging
2
2
 
3
3
  import botocore.exceptions
4
- from utils import common
5
- from utils import level_const as level
4
+
5
+ from ..utils import common
6
+ from ..utils import level_const as level
6
7
 
7
8
 
8
9
  def check_alternate_contact_filling(session, translator) -> common.CheckResult:
@@ -2,8 +2,9 @@ import logging
2
2
  from concurrent.futures import ThreadPoolExecutor, as_completed
3
3
 
4
4
  import botocore.exceptions
5
- from utils import common
6
- from utils import level_const as level
5
+
6
+ from ..utils import common
7
+ from ..utils import level_const as level
7
8
 
8
9
  MAXIMUM_NUMBER_OF_BUCKET_LIMIT = 1000
9
10
 
@@ -2,8 +2,9 @@ import logging
2
2
  from concurrent.futures import ThreadPoolExecutor, as_completed
3
3
 
4
4
  import botocore.exceptions
5
- from utils import common
6
- from utils import level_const as level
5
+
6
+ from ..utils import common
7
+ from ..utils import level_const as level
7
8
 
8
9
 
9
10
  def get_cloudwatch_alarms(client, region):
@@ -1,8 +1,9 @@
1
1
  import logging
2
2
 
3
3
  import botocore.exceptions
4
- from utils import common
5
- from utils import level_const as level
4
+
5
+ from ..utils import common
6
+ from ..utils import level_const as level
6
7
 
7
8
 
8
9
  def get_user_policies(client, user_name):
@@ -2,8 +2,9 @@ import logging
2
2
  from concurrent.futures import ThreadPoolExecutor, as_completed
3
3
 
4
4
  import botocore.exceptions
5
- from utils import common
6
- from utils import level_const as level
5
+
6
+ from ..utils import common
7
+ from ..utils import level_const as level
7
8
 
8
9
 
9
10
  def get_guard_duty_configuration(client, region):
@@ -1,8 +1,9 @@
1
1
  import logging
2
2
 
3
3
  import botocore.exceptions
4
- from utils import common
5
- from utils import level_const as level
4
+
5
+ from ..utils import common
6
+ from ..utils import level_const as level
6
7
 
7
8
 
8
9
  def check_iam_password_policy(session, translator) -> common.CheckResult:
@@ -1,7 +1,7 @@
1
1
  import logging
2
2
 
3
- from utils import common
4
- from utils import level_const as level
3
+ from ..utils import common
4
+ from ..utils import level_const as level
5
5
 
6
6
 
7
7
  def check_iam_user_mfa_setting(session, translator, credential_report) -> common.CheckResult:
@@ -2,8 +2,9 @@ import logging
2
2
  from concurrent.futures import ThreadPoolExecutor, as_completed
3
3
 
4
4
  import botocore.exceptions
5
- from utils import common
6
- from utils import level_const as level
5
+
6
+ from ..utils import common
7
+ from ..utils import level_const as level
7
8
 
8
9
 
9
10
  def get_instance_usage_by_region(client, region):
@@ -1,8 +1,9 @@
1
1
  import logging
2
2
 
3
3
  import botocore.exceptions
4
- from utils import common
5
- from utils import level_const as level
4
+
5
+ from ..utils import common
6
+ from ..utils import level_const as level
6
7
 
7
8
 
8
9
  def check_multi_region_trail_enabled(session, translator) -> common.CheckResult:
@@ -1,8 +1,8 @@
1
1
  import logging
2
2
  from datetime import datetime, timedelta, timezone
3
3
 
4
- from utils import common
5
- from utils import level_const as level
4
+ from ..utils import common
5
+ from ..utils import level_const as level
6
6
 
7
7
 
8
8
  def get_last_used_days(date):
@@ -1,7 +1,7 @@
1
1
  import logging
2
2
 
3
- from utils import common
4
- from utils import level_const as level
3
+ from ..utils import common
4
+ from ..utils import level_const as level
5
5
 
6
6
 
7
7
  def check_root_mfa_setting(session, translator, credential_report) -> common.CheckResult:
@@ -1,10 +1,10 @@
1
1
  from datetime import datetime, timedelta, timezone
2
2
 
3
- from utils import common
4
- from utils import level_const as level
5
-
6
3
  from runbooks.utils.logger import configure_logger
7
4
 
5
+ from ..utils import common
6
+ from ..utils import level_const as level
7
+
8
8
  logger = configure_logger(__name__) ## ✅ Configure Logger
9
9
 
10
10
  ## Define the standard threshold for root account access
@@ -1,8 +1,9 @@
1
1
  import logging
2
2
 
3
3
  import botocore.exceptions
4
- from utils import common
5
- from utils import level_const as level
4
+
5
+ from ..utils import common
6
+ from ..utils import level_const as level
6
7
 
7
8
 
8
9
  def get_trail_status(client, trail_arn):
@@ -1,7 +1,7 @@
1
1
  import logging
2
2
 
3
- from utils import common
4
- from utils import level_const as level
3
+ from ..utils import common
4
+ from ..utils import level_const as level
5
5
 
6
6
 
7
7
  def check_trust_advisor_configuration(translator) -> common.CheckResult:
@@ -4,10 +4,11 @@ from pathlib import Path
4
4
  from string import Template
5
5
 
6
6
  from jinja2 import Template
7
- from utils import language, level_const
8
7
 
9
8
  from runbooks.utils.logger import configure_logger
10
9
 
10
+ from .utils import language, level_const
11
+
11
12
  ## ✅ Configure Logger
12
13
  logger = configure_logger(__name__)
13
14
 
@@ -15,10 +15,10 @@ Compatible with both local (via pip or Docker) and AWS Lambda environments.
15
15
  import argparse
16
16
  import sys
17
17
 
18
- from security_baseline_tester import SecurityBaselineTester
19
-
20
18
  from runbooks.utils.logger import configure_logger
21
19
 
20
+ from .security_baseline_tester import SecurityBaselineTester
21
+
22
22
  ## ✅ Configure Logger
23
23
  logger = configure_logger(__name__)
24
24
 
@@ -1,4 +1,5 @@
1
1
  import datetime
2
+ import importlib
2
3
  import json
3
4
  import logging
4
5
  import os
@@ -7,19 +8,22 @@ from pathlib import Path
7
8
 
8
9
  import boto3
9
10
  import botocore
10
- import report_generator
11
- from checklist import * ## noqa: F403
12
- from utils import common, level_const
13
- from utils.language import get_translator
11
+
12
+ from . import report_generator
13
+ from .checklist import * # noqa: F403
14
+ from .utils import common, language, level_const
15
+
16
+ # from .utils.language import get_translator
14
17
 
15
18
 
16
19
  class SecurityBaselineTester:
17
- def __init__(self, profile, language):
20
+ def __init__(self, profile, lang_code):
18
21
  self.profile = profile
19
- self.language = language
22
+ self.language = lang_code
20
23
  self.session = self._create_session()
21
24
  self.config = self._load_config()
22
- self.translator = get_translator("main", language)
25
+ ## Call module 'language' and pass the string 'lang_code'
26
+ self.translator = language.get_translator("main", lang_code)
23
27
 
24
28
  def _create_session(self):
25
29
  if self.profile == "default":
@@ -99,9 +103,10 @@ class SecurityBaselineTester:
99
103
  return account_id, results
100
104
 
101
105
  def _run_check(self, check_name, credential_report):
102
- check_module = __import__(f"checklist.{check_name}", fromlist=[check_name])
106
+ # check_module = __import__(f"checklist.{check_name}", fromlist=[check_name])
107
+ check_module = importlib.import_module(f"runbooks.security_baseline.checklist.{check_name}")
103
108
  check_method = getattr(check_module, self.config["checks"][check_name])
104
- translator = get_translator(check_name, self.language)
109
+ translator = language.get_translator(check_name, self.language)
105
110
 
106
111
  if check_name in [
107
112
  "alternate_contacts",
@@ -1 +1,2 @@
1
+ ## security_baseline/utils/__init__.py
1
2
  __all__ = ["common", "level_const", "language", "enums"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: runbooks
3
- Version: 0.1.8
3
+ Version: 0.1.9
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.1.8
258
+ Requires-Dist: runbooks>=0.1.9
259
259
 
260
260
  # 🔥 CloudOps Automation at Scale 🦅
261
261
 
@@ -1,4 +1,4 @@
1
- runbooks/__init__.py,sha256=ImR9wfmlMyXaJhnCM8gXdQ32Fu0rB-iXOoVx_-AdMU4,133
1
+ runbooks/__init__.py,sha256=kmipbAcnK8gk4TiDgbq9XPLad1-sZSLzdCwlwWIZ8i0,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
@@ -20,26 +20,26 @@ runbooks/python101/exceptions.py,sha256=4KuSN-Kz-Xx17dU8i4rMbECANA4IXdT5dAposuv3
20
20
  runbooks/python101/file_manager.py,sha256=7QLxO2eiwlgcTpdnbd80TIP1CNFGz0ZGpGKnBZvpdAk,7163
21
21
  runbooks/python101/toolkit.py,sha256=bWoP_r8GhsEPFsgTKSeJiilcjxO4A1fynjSDSOnlmzQ,3709
22
22
  runbooks/security_baseline/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
- runbooks/security_baseline/report_generator.py,sha256=7APIDceRGI7jxyQw7wdE34xY4fF76x0p7F2aPRvSCCI,6331
24
- runbooks/security_baseline/run_script.py,sha256=ZAb6nJK4EnOvwucHrz_QldCaJZlj8_4GqCor1-Higeg,2083
25
- runbooks/security_baseline/security_baseline_tester.py,sha256=t5v79qDC2EhfUrJ0NMA-rWoIHbSFo48nJ8J9SjW3VbE,7124
26
- runbooks/security_baseline/checklist/__init__.py,sha256=_l8n3aeeSB5jb86E-kNoYAApgTVK_OMhtLbiiYxZ0iM,412
27
- runbooks/security_baseline/checklist/account_level_bucket_public_access.py,sha256=RNunFllmsDZqvE91pqSC52MLpxWEClI_of9Wb7LmwpE,3381
28
- runbooks/security_baseline/checklist/alternate_contacts.py,sha256=_jW9-mZkrwwJY61J-AS6Az_kjViMupmeyFydeV31Kb8,3038
29
- runbooks/security_baseline/checklist/bucket_public_access.py,sha256=6blboPnQQo9YAbUe3f7kLwbL23AgB5WTNOYaEUNaCng,3302
30
- runbooks/security_baseline/checklist/cloudwatch_alarm_configuration.py,sha256=ZhxrxpUkNXCIuCJDtQSS7iDWF6XNj_6Wj7mPiDTARtU,2257
31
- runbooks/security_baseline/checklist/direct_attached_policy.py,sha256=A_FITUylEnXjAyXh6yXu5XnHgOt9pV6JqX3iKxX4jS0,2563
32
- runbooks/security_baseline/checklist/guardduty_enabled.py,sha256=wTNTGYjpbe9HrrFqcD0evvzPhBLnlNmSI61-Qxc-5vY,2443
33
- runbooks/security_baseline/checklist/iam_password_policy.py,sha256=44h09PBteGRoheq8kJuJxqNydC7rUQbhLbXWCMOxAy0,1565
34
- runbooks/security_baseline/checklist/iam_user_mfa.py,sha256=tBh1KfNR1sg_tA2gP53rH9EIRB04RxhJfHM4TQTC29s,1230
35
- runbooks/security_baseline/checklist/multi_region_instance_usage.py,sha256=CatzMma6bMqYWbO-Qw83jU3RU21Nz6TdaT2LliV7-FA,1939
36
- runbooks/security_baseline/checklist/multi_region_trail.py,sha256=5OxzvjiIIPwsH9enZz1-jCmD8nniNw7aXOhJYJsmRmQ,2288
37
- runbooks/security_baseline/checklist/root_access_key.py,sha256=jzIm046Hkx32cJ2GnlxCXcz8-ZSyGXpXXJl8Ik_9c7Q,2500
38
- runbooks/security_baseline/checklist/root_mfa.py,sha256=wTuNCF0rz-H5cia5w8LQXYgnEHGnw0YfGcT5sM2WChI,1289
39
- runbooks/security_baseline/checklist/root_usage.py,sha256=lTBn6hqy9ysPlE6dk2NQP1iu_mnN4FEJyIZYhOCWFKY,4654
40
- runbooks/security_baseline/checklist/trail_enabled.py,sha256=AioAw_12-NmYGBzLaneWLsd3mejYibDTtwl18vWca-A,2284
41
- runbooks/security_baseline/checklist/trusted_advisor.py,sha256=xJTwicdp5VPooVc2-1VFDh41OH7PvBs0osUrN82ANkE,670
42
- runbooks/security_baseline/utils/__init__.py,sha256=kK5hPyLqQSuR8Z231QHZ_IgJ5JlxPJCiXmGRSCfO7w0,57
23
+ runbooks/security_baseline/report_generator.py,sha256=rHh9d6OBg_Qcy59ZJSCfZu0ur-LeE_dSIc2LJQAtWMY,6333
24
+ runbooks/security_baseline/run_script.py,sha256=lrvbcOtofspBnI17YYw2q_3CG4q3awoEnsaZ2HcGZ_E,2084
25
+ runbooks/security_baseline/security_baseline_tester.py,sha256=mOVvWWXByaQklth0QeEHxGCMT7bVGrUIVRgmUhINeg0,7354
26
+ runbooks/security_baseline/checklist/__init__.py,sha256=gXjVSA36zv5jCkaw3XASG8DpLPo6Fu8yxquUdX8YSFY,455
27
+ runbooks/security_baseline/checklist/account_level_bucket_public_access.py,sha256=_sILKNiBg-33wUUxoZhUq2O-x-xC2zZU9cQUehYMxTs,3386
28
+ runbooks/security_baseline/checklist/alternate_contacts.py,sha256=MqHcKNwwmNKTna0bOdUPPNj2ytobpDMGPAUW2XhvRxI,3043
29
+ runbooks/security_baseline/checklist/bucket_public_access.py,sha256=FmNpOOUPVTTTZEOrUGZOVEQab-VbwrrG1yoNNrj-5bc,3307
30
+ runbooks/security_baseline/checklist/cloudwatch_alarm_configuration.py,sha256=LmErieAcBLO8qmuwoHfrJnLKrR_gHEMcF0TI0oZDcMc,2262
31
+ runbooks/security_baseline/checklist/direct_attached_policy.py,sha256=zjM3olLXjlaHQxHEOYyifTiugICuLAAOCMxn9pSLKFw,2568
32
+ runbooks/security_baseline/checklist/guardduty_enabled.py,sha256=uvjgRqpjPiTd-d762P2jLPHCiHuGPkTvrXOwhOpLcjI,2448
33
+ runbooks/security_baseline/checklist/iam_password_policy.py,sha256=bKIxhWQQ4xuE_uxtWfm0LXCqTFRQ-ygafxMKqeFFGw4,1570
34
+ runbooks/security_baseline/checklist/iam_user_mfa.py,sha256=H3mG_rC01iF-lbKCT7IqOEyShby9QkSADXE9BOt1DyQ,1234
35
+ runbooks/security_baseline/checklist/multi_region_instance_usage.py,sha256=em2RvxW7rQK4Nv6APqE3mQJ7q4mO8e10Z8uymfyVvSY,1944
36
+ runbooks/security_baseline/checklist/multi_region_trail.py,sha256=OCAejEa59rKUWU-vnVQaNxOg1wOAUQZdGzyI7r25vi4,2293
37
+ runbooks/security_baseline/checklist/root_access_key.py,sha256=SUPpV3n3Wnx7VI7cWldjE6yYDn09dUnqkaiNykvN4f4,2504
38
+ runbooks/security_baseline/checklist/root_mfa.py,sha256=X8PPzRLgaNhd-MMUjm432OkjQ1RqGis-pEhQUgqwVa8,1293
39
+ runbooks/security_baseline/checklist/root_usage.py,sha256=20XEtXC2seJnUW0clME3YGrosRYP5yRTi7a_Rr5YpdA,4658
40
+ runbooks/security_baseline/checklist/trail_enabled.py,sha256=kcX7sgB7NO2YbN8i3SDkB1m5Bb00Wu6JX9cniGBsSPw,2289
41
+ runbooks/security_baseline/checklist/trusted_advisor.py,sha256=zsLQf-mFeu3aiOhGndrojoa5K4QiI1Buk5rC5Hfg_gA,674
42
+ runbooks/security_baseline/utils/__init__.py,sha256=fEyCpWrJ6S6Z5rdHJGf7WRMnRNoZ6th5HmXbESc6guM,96
43
43
  runbooks/security_baseline/utils/common.py,sha256=hCgYtgIgzV5Z2LCeXSDXd7LNxYg9NE2s_c-d9w43a-Y,3399
44
44
  runbooks/security_baseline/utils/enums.py,sha256=BGr8EgwZrWsU8kvWkwWsPqELUPGBc2tvJ5SzN9XhWQU,1258
45
45
  runbooks/security_baseline/utils/language.py,sha256=MrSAojEyjHqRDDALdk002snj4xnFbwGgIjAc2buJ8g0,60448
@@ -47,8 +47,8 @@ runbooks/security_baseline/utils/level_const.py,sha256=l8uYBmgEMjIQTGVVuXPAfDd_P
47
47
  runbooks/security_baseline/utils/permission_list.py,sha256=nq06vlILHp9rfnCpJauCmFCOEGdgFMF-XO3uBFrrd-o,767
48
48
  runbooks/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
49
  runbooks/utils/logger.py,sha256=ifxqLjDlZoDaG8rtAGVKLZ5dAwcMn16rB4YgMfeUC3E,972
50
- runbooks-0.1.8.dist-info/METADATA,sha256=4zvsNO2zEbnz0f7iIP5pw89-EJpwWkMXZm4YsIavyuw,24982
51
- runbooks-0.1.8.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
52
- runbooks-0.1.8.dist-info/entry_points.txt,sha256=dxS4lhytftkG2sBS-tgSRKoWtK-AgQmiAJ4VxJY3f5A,115
53
- runbooks-0.1.8.dist-info/top_level.txt,sha256=1EwNxU12QGOLtO0Naw75hXIdSIhgV_b-z_6vhlhVkhM,9
54
- runbooks-0.1.8.dist-info/RECORD,,
50
+ runbooks-0.1.9.dist-info/METADATA,sha256=CJ9ddkFV-chd3Vv9OO11Iuaf5_fHSXBxhaVXwpqXOLc,24982
51
+ runbooks-0.1.9.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
52
+ runbooks-0.1.9.dist-info/entry_points.txt,sha256=dxS4lhytftkG2sBS-tgSRKoWtK-AgQmiAJ4VxJY3f5A,115
53
+ runbooks-0.1.9.dist-info/top_level.txt,sha256=1EwNxU12QGOLtO0Naw75hXIdSIhgV_b-z_6vhlhVkhM,9
54
+ runbooks-0.1.9.dist-info/RECORD,,