runbooks 0.1.8__tar.gz → 0.2.0__tar.gz

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 (61) hide show
  1. {runbooks-0.1.8/src/runbooks.egg-info → runbooks-0.2.0}/PKG-INFO +2 -2
  2. {runbooks-0.1.8 → runbooks-0.2.0}/pyproject.toml +10 -7
  3. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/__init__.py +1 -1
  4. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/checklist/__init__.py +1 -0
  5. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/checklist/account_level_bucket_public_access.py +3 -2
  6. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/checklist/alternate_contacts.py +3 -2
  7. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/checklist/bucket_public_access.py +3 -2
  8. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/checklist/cloudwatch_alarm_configuration.py +3 -2
  9. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/checklist/direct_attached_policy.py +3 -2
  10. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/checklist/guardduty_enabled.py +3 -2
  11. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/checklist/iam_password_policy.py +3 -2
  12. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/checklist/iam_user_mfa.py +2 -2
  13. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/checklist/multi_region_instance_usage.py +3 -2
  14. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/checklist/multi_region_trail.py +3 -2
  15. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/checklist/root_access_key.py +2 -2
  16. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/checklist/root_mfa.py +2 -2
  17. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/checklist/root_usage.py +3 -3
  18. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/checklist/trail_enabled.py +3 -2
  19. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/checklist/trusted_advisor.py +2 -2
  20. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/report_generator.py +2 -1
  21. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/run_script.py +2 -2
  22. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/security_baseline_tester.py +14 -9
  23. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/utils/__init__.py +1 -0
  24. {runbooks-0.1.8 → runbooks-0.2.0/src/runbooks.egg-info}/PKG-INFO +2 -2
  25. runbooks-0.2.0/src/runbooks.egg-info/entry_points.txt +3 -0
  26. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks.egg-info/requires.txt +1 -1
  27. runbooks-0.1.8/src/runbooks.egg-info/entry_points.txt +0 -3
  28. {runbooks-0.1.8 → runbooks-0.2.0}/LICENSE +0 -0
  29. {runbooks-0.1.8 → runbooks-0.2.0}/README.md +0 -0
  30. {runbooks-0.1.8 → runbooks-0.2.0}/setup.cfg +0 -0
  31. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/aws/__init__.py +0 -0
  32. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/aws/dynamodb_operations.py +0 -0
  33. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/aws/ec2_copy_image_cross-region.py +0 -0
  34. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/aws/ec2_describe_instances.py +0 -0
  35. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/aws/ec2_ebs_snapshots_delete.py +0 -0
  36. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/aws/ec2_run_instances.py +0 -0
  37. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/aws/ec2_start_stop_instances.py +0 -0
  38. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/aws/ec2_terminate_instances.py +0 -0
  39. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/aws/ec2_unused_eips.py +0 -0
  40. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/aws/ec2_unused_volumes.py +0 -0
  41. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/aws/s3_create_bucket.py +0 -0
  42. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/aws/s3_list_buckets.py +0 -0
  43. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/aws/s3_list_objects.py +0 -0
  44. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/aws/s3_object_operations.py +0 -0
  45. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/aws/tagging_lambda_handler.py +0 -0
  46. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/python101/calculator.py +0 -0
  47. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/python101/config.py +0 -0
  48. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/python101/exceptions.py +0 -0
  49. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/python101/file_manager.py +0 -0
  50. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/python101/toolkit.py +0 -0
  51. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/__init__.py +0 -0
  52. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/utils/common.py +0 -0
  53. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/utils/enums.py +0 -0
  54. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/utils/language.py +0 -0
  55. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/utils/level_const.py +0 -0
  56. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/security_baseline/utils/permission_list.py +0 -0
  57. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/utils/__init__.py +0 -0
  58. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks/utils/logger.py +0 -0
  59. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks.egg-info/SOURCES.txt +0 -0
  60. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks.egg-info/dependency_links.txt +0 -0
  61. {runbooks-0.1.8 → runbooks-0.2.0}/src/runbooks.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: runbooks
3
- Version: 0.1.8
3
+ Version: 0.2.0
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.2.0
259
259
 
260
260
  # 🔥 CloudOps Automation at Scale 🦅
261
261
 
@@ -2,7 +2,7 @@
2
2
  ## Metadata: https://docs.astral.sh/uv/concepts/projects/config/
3
3
  name = "runbooks"
4
4
  ## Incremented for new release
5
- version = "0.1.8"
5
+ version = "0.2.0"
6
6
  description = "CloudOps Automation Toolkit for DevOps and SRE teams."
7
7
  readme = "README.md"
8
8
  requires-python = ">=3.11"
@@ -85,7 +85,7 @@ dependencies = [
85
85
  "vizro-ai>=0.3.2",
86
86
 
87
87
  ## 1xOps/CloudOps-Runbooks: https://pypi.org/project/runbooks/
88
- "runbooks>=0.1.8"
88
+ "runbooks>=0.2.0"
89
89
  ]
90
90
 
91
91
  [dependency-groups]
@@ -102,11 +102,14 @@ dev = [
102
102
  ]
103
103
 
104
104
  [build-system]
105
- requires = ["setuptools"]
105
+ requires = [
106
+ "setuptools>=75",
107
+ "wheel",
108
+ "build"
109
+ ]
106
110
  build-backend = "setuptools.build_meta"
107
111
 
108
112
  [tool.setuptools]
109
- # packages = ["runbooks"]
110
113
  package-dir = {"" = "src"} ## Tells setuptools that code is in `src/`
111
114
  # include-package-data = true ## If you want non-.py files included too
112
115
  license-files = []
@@ -115,12 +118,12 @@ license-files = []
115
118
  [tool.setuptools.packages.find]
116
119
  where = ["src"] ## Look inside `src` for packages
117
120
  include = ["runbooks*"] ## Include runbooks and its subpackages
118
- exclude = ["tests*"] ## Exclude test folders
121
+ # exclude = ["tests*"] ## DON'T Exclude test folders
119
122
 
120
123
  [tool.versioningit]
121
124
  vcs = "git"
122
125
  tag2version = "v{base}"
123
- default-version = "0.1.8"
126
+ default-version = "0.2.0"
124
127
 
125
128
  [tool.pytest.ini_options]
126
129
  ## Test Configuration
@@ -132,7 +135,7 @@ addopts = "--cov=src/runbooks --cov-report=term-missing --verbose"
132
135
  [project.scripts]
133
136
  ## CLI Commands
134
137
  runbooks-aws = "runbooks.aws:run_script"
135
- runbooks-security = "runbooks.security_baseline:run_script"
138
+ runbooks-security = "runbooks.security_baseline.run_script:main"
136
139
 
137
140
 
138
141
  [tool.ruff]
@@ -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.2.0"
@@ -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.2.0
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.2.0
259
259
 
260
260
  # 🔥 CloudOps Automation at Scale 🦅
261
261
 
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ runbooks-aws = runbooks.aws:run_script
3
+ runbooks-security = runbooks.security_baseline.run_script:main
@@ -36,4 +36,4 @@ pandas>=2.2.3
36
36
  plotly>=5.24.1
37
37
  vizro>=0.1.30
38
38
  vizro-ai>=0.3.2
39
- runbooks>=0.1.8
39
+ runbooks>=0.2.0
@@ -1,3 +0,0 @@
1
- [console_scripts]
2
- runbooks-aws = runbooks.aws:run_script
3
- runbooks-security = runbooks.security_baseline:run_script
File without changes
File without changes
File without changes