thothctl 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.
- thothctl-0.2.0/.devcontainer/Dockerfile +49 -0
- thothctl-0.2.0/.devcontainer/README.md +55 -0
- thothctl-0.2.0/.devcontainer/devcontainer.json +27 -0
- thothctl-0.2.0/.github/workflows/python-publish.yml +80 -0
- thothctl-0.2.0/.gitignore +254 -0
- thothctl-0.2.0/.pre-commit-config.yaml +38 -0
- thothctl-0.2.0/Dockerfile +23 -0
- thothctl-0.2.0/LICENSE +13 -0
- thothctl-0.2.0/PKG-INFO +202 -0
- thothctl-0.2.0/README.md +165 -0
- thothctl-0.2.0/__init__.py +1 -0
- thothctl-0.2.0/docs/framework/concepts.md +14 -0
- thothctl-0.2.0/docs/framework/space_configuration.md +99 -0
- thothctl-0.2.0/docs/framework/thoth_framework.md +107 -0
- thothctl-0.2.0/docs/framework/use_cases/README.md +66 -0
- thothctl-0.2.0/docs/framework/use_cases/commands/check/check_iac.md +234 -0
- thothctl-0.2.0/docs/framework/use_cases/commands/check/check_overview.md +114 -0
- thothctl-0.2.0/docs/framework/use_cases/commands/init/init.md +17 -0
- thothctl-0.2.0/docs/framework/use_cases/commands/init/init_project.md +260 -0
- thothctl-0.2.0/docs/framework/use_cases/commands/inventory/inventory_iac.md +274 -0
- thothctl-0.2.0/docs/framework/use_cases/commands/inventory/inventory_overview.md +130 -0
- thothctl-0.2.0/docs/framework/use_cases/tasks/create_template.md +2 -0
- thothctl-0.2.0/docs/iac_devsecops_use_case.md +436 -0
- thothctl-0.2.0/docs/img/automate_tasks_command.png +0 -0
- thothctl-0.2.0/docs/img/commnad_init.png +0 -0
- thothctl-0.2.0/docs/img/create_component.gif +0 -0
- thothctl-0.2.0/docs/img/create_inventory.gif +0 -0
- thothctl-0.2.0/docs/img/doc_command.png +0 -0
- thothctl-0.2.0/docs/img/document_project_code.gif +0 -0
- thothctl-0.2.0/docs/img/framework/thothfr.png +0 -0
- thothctl-0.2.0/docs/img/iacpeerbot_summary.png +0 -0
- thothctl-0.2.0/docs/img/init_project.gif +0 -0
- thothctl-0.2.0/docs/img/inventory_command.png +0 -0
- thothctl-0.2.0/docs/img/notification_img.png +0 -0
- thothctl-0.2.0/docs/img/report_dependencies.png +0 -0
- thothctl-0.2.0/docs/img/report_dependencies_summary.png +0 -0
- thothctl-0.2.0/docs/img/restore_inventory_version.gif +0 -0
- thothctl-0.2.0/docs/img/reuse_project_pattern.gif +0 -0
- thothctl-0.2.0/docs/img/scan_code.gif +0 -0
- thothctl-0.2.0/docs/img/scan_command.png +0 -0
- thothctl-0.2.0/docs/img/sync_wk_command.png +0 -0
- thothctl-0.2.0/docs/img/transform_command.png +0 -0
- thothctl-0.2.0/docs/img/update_inventory_version.gif +0 -0
- thothctl-0.2.0/docs/img/validate_command.png +0 -0
- thothctl-0.2.0/docs/img/validate_environment.gif +0 -0
- thothctl-0.2.0/docs/img/validate_project.gif +0 -0
- thothctl-0.2.0/docs/index.md +178 -0
- thothctl-0.2.0/docs/mcp.md +75 -0
- thothctl-0.2.0/docs/quick_start.md +106 -0
- thothctl-0.2.0/docs/template_engine/template_engine.md +0 -0
- thothctl-0.2.0/mkdocs.yaml +13 -0
- thothctl-0.2.0/pyproject.toml +145 -0
- thothctl-0.2.0/scripts/run_mcp_server.sh +9 -0
- thothctl-0.2.0/src/thothctl/__init__.py +15 -0
- thothctl-0.2.0/src/thothctl/application/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/cli.py +82 -0
- thothctl-0.2.0/src/thothctl/commands/__init__.py +3 -0
- thothctl-0.2.0/src/thothctl/commands/check/__init__.py +5 -0
- thothctl-0.2.0/src/thothctl/commands/check/cli.py +58 -0
- thothctl-0.2.0/src/thothctl/commands/check/commands/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/commands/check/commands/environment.py +0 -0
- thothctl-0.2.0/src/thothctl/commands/check/commands/iac.py +93 -0
- thothctl-0.2.0/src/thothctl/commands/check/commands/project.py +0 -0
- thothctl-0.2.0/src/thothctl/commands/document/__init__.py +5 -0
- thothctl-0.2.0/src/thothctl/commands/document/cli.py +58 -0
- thothctl-0.2.0/src/thothctl/commands/document/commands/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/commands/document/commands/iac.py +134 -0
- thothctl-0.2.0/src/thothctl/commands/generate/__init__.py +5 -0
- thothctl-0.2.0/src/thothctl/commands/generate/cli.py +60 -0
- thothctl-0.2.0/src/thothctl/commands/generate/commands/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/commands/generate/commands/component.py +72 -0
- thothctl-0.2.0/src/thothctl/commands/generate/commands/stacks.py +329 -0
- thothctl-0.2.0/src/thothctl/commands/init/__init__.py +5 -0
- thothctl-0.2.0/src/thothctl/commands/init/cli.py +60 -0
- thothctl-0.2.0/src/thothctl/commands/init/commands/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/commands/init/commands/env.py +51 -0
- thothctl-0.2.0/src/thothctl/commands/init/commands/project.py +191 -0
- thothctl-0.2.0/src/thothctl/commands/init/commands/space.py +138 -0
- thothctl-0.2.0/src/thothctl/commands/inventory/__init__.py +5 -0
- thothctl-0.2.0/src/thothctl/commands/inventory/cli.py +61 -0
- thothctl-0.2.0/src/thothctl/commands/inventory/commands/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/commands/inventory/commands/iac.py +283 -0
- thothctl-0.2.0/src/thothctl/commands/list/__init__.py +5 -0
- thothctl-0.2.0/src/thothctl/commands/list/cli.py +63 -0
- thothctl-0.2.0/src/thothctl/commands/list/commands/__init__.py +1 -0
- thothctl-0.2.0/src/thothctl/commands/list/commands/projects.py +36 -0
- thothctl-0.2.0/src/thothctl/commands/list/commands/spaces.py +28 -0
- thothctl-0.2.0/src/thothctl/commands/mcp/__init__.py +1 -0
- thothctl-0.2.0/src/thothctl/commands/mcp/cli.py +86 -0
- thothctl-0.2.0/src/thothctl/commands/project/__init__.py +5 -0
- thothctl-0.2.0/src/thothctl/commands/project/cli.py +61 -0
- thothctl-0.2.0/src/thothctl/commands/project/commands/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/commands/project/commands/cleanup.py +77 -0
- thothctl-0.2.0/src/thothctl/commands/project/commands/convert.py +88 -0
- thothctl-0.2.0/src/thothctl/commands/remove/__init__.py +5 -0
- thothctl-0.2.0/src/thothctl/commands/remove/cli.py +59 -0
- thothctl-0.2.0/src/thothctl/commands/remove/remove.py +57 -0
- thothctl-0.2.0/src/thothctl/commands/remove/space.py +52 -0
- thothctl-0.2.0/src/thothctl/commands/scan/__init__.py +5 -0
- thothctl-0.2.0/src/thothctl/commands/scan/cli.py +67 -0
- thothctl-0.2.0/src/thothctl/commands/scan/commands/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/commands/scan/commands/iac.py +138 -0
- thothctl-0.2.0/src/thothctl/common/.thothcf.setup.toml +129 -0
- thothctl-0.2.0/src/thothctl/common/.thothcf_home.toml +9 -0
- thothctl-0.2.0/src/thothctl/common/.thothcf_module.toml +92 -0
- thothctl-0.2.0/src/thothctl/common/.thothcf_project.toml +76 -0
- thothctl-0.2.0/src/thothctl/common/.thothcf_template_parameters.toml +44 -0
- thothctl-0.2.0/src/thothctl/common/__init__.py +1 -0
- thothctl-0.2.0/src/thothctl/common/common.py +373 -0
- thothctl-0.2.0/src/thothctl/common/terragrunt/.thothcf_project.toml +73 -0
- thothctl-0.2.0/src/thothctl/config/__init__.py +44 -0
- thothctl-0.2.0/src/thothctl/config/constants.py +19 -0
- thothctl-0.2.0/src/thothctl/config/default_values.py +47 -0
- thothctl-0.2.0/src/thothctl/config/defaults.py +41 -0
- thothctl-0.2.0/src/thothctl/config/models.py +150 -0
- thothctl-0.2.0/src/thothctl/config/settings.py +27 -0
- thothctl-0.2.0/src/thothctl/config/template_configs.py +73 -0
- thothctl-0.2.0/src/thothctl/config/templates.py +62 -0
- thothctl-0.2.0/src/thothctl/config/validation.py +27 -0
- thothctl-0.2.0/src/thothctl/core/__init__.py +35 -0
- thothctl-0.2.0/src/thothctl/core/cli_ui.py +405 -0
- thothctl-0.2.0/src/thothctl/core/commands.py +90 -0
- thothctl-0.2.0/src/thothctl/core/config.py +56 -0
- thothctl-0.2.0/src/thothctl/core/integrations/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/core/integrations/azure_devops/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/core/integrations/azure_devops/get_azure_devops.py +208 -0
- thothctl-0.2.0/src/thothctl/core/integrations/azure_devops/pattern_names.py +3 -0
- thothctl-0.2.0/src/thothctl/core/integrations/azure_devops/pull_request_comments.py +79 -0
- thothctl-0.2.0/src/thothctl/core/integrations/integrate_messages_services/__init__.py +1 -0
- thothctl-0.2.0/src/thothctl/core/integrations/integrate_messages_services/microsoft_teams.py +45 -0
- thothctl-0.2.0/src/thothctl/core/integrations/integrate_messages_services/sent_message_teams.py +505 -0
- thothctl-0.2.0/src/thothctl/core/logger.py +23 -0
- thothctl-0.2.0/src/thothctl/core/tools.json +59 -0
- thothctl-0.2.0/src/thothctl/core/version_tools.py +60 -0
- thothctl-0.2.0/src/thothctl/domain/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/domain/interfaces/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/domain/models/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/mcp/__init__.py +5 -0
- thothctl-0.2.0/src/thothctl/mcp/server.py +358 -0
- thothctl-0.2.0/src/thothctl/services/__init__.py +1 -0
- thothctl-0.2.0/src/thothctl/services/check/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/services/check/environment/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/services/check/environment/check_environment.py +99 -0
- thothctl-0.2.0/src/thothctl/services/check/project/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/services/check/project/check_origin_version.py +85 -0
- thothctl-0.2.0/src/thothctl/services/check/project/check_project_structure.py +551 -0
- thothctl-0.2.0/src/thothctl/services/check/project/validate_project_structure.py +370 -0
- thothctl-0.2.0/src/thothctl/services/document/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/services/document/create_documentation.py +264 -0
- thothctl-0.2.0/src/thothctl/services/document/files_content.py +153 -0
- thothctl-0.2.0/src/thothctl/services/document/files_scan.py +140 -0
- thothctl-0.2.0/src/thothctl/services/document/iac_documentation.py +472 -0
- thothctl-0.2.0/src/thothctl/services/document/iac_grunt_graph.py +531 -0
- thothctl-0.2.0/src/thothctl/services/document/iac_grunt_info.py +164 -0
- thothctl-0.2.0/src/thothctl/services/generate/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/services/generate/create_stacks/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/services/generate/create_stacks/config_generator.py +362 -0
- thothctl-0.2.0/src/thothctl/services/generate/create_stacks/remote_config_generation.py +708 -0
- thothctl-0.2.0/src/thothctl/services/generate/create_stacks/stack_service.py +247 -0
- thothctl-0.2.0/src/thothctl/services/generate/create_stacks/templates/terragrunt.hcl.j2 +29 -0
- thothctl-0.2.0/src/thothctl/services/generate/create_template/__init__.py +1 -0
- thothctl-0.2.0/src/thothctl/services/generate/create_template/config.yaml +23 -0
- thothctl-0.2.0/src/thothctl/services/generate/create_template/create_code.py +145 -0
- thothctl-0.2.0/src/thothctl/services/generate/create_template/create_component.py +136 -0
- thothctl-0.2.0/src/thothctl/services/generate/create_template/create_component_service.py +283 -0
- thothctl-0.2.0/src/thothctl/services/generate/create_template/create_stacks.py +173 -0
- thothctl-0.2.0/src/thothctl/services/generate/create_template/create_template.py +207 -0
- thothctl-0.2.0/src/thothctl/services/generate/create_template/files_content.py +681 -0
- thothctl-0.2.0/src/thothctl/services/generate/create_template/project_templates.py +123 -0
- thothctl-0.2.0/src/thothctl/services/init/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/services/init/environment/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/services/init/environment/install_tools.py +398 -0
- thothctl-0.2.0/src/thothctl/services/init/project/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/services/init/project/project.py +101 -0
- thothctl-0.2.0/src/thothctl/services/init/space/__init__.py +1 -0
- thothctl-0.2.0/src/thothctl/services/init/space/example_space.toml +30 -0
- thothctl-0.2.0/src/thothctl/services/init/space/local_registry.py +308 -0
- thothctl-0.2.0/src/thothctl/services/init/space/space_config.py +265 -0
- thothctl-0.2.0/src/thothctl/services/init/space/space_service.py +155 -0
- thothctl-0.2.0/src/thothctl/services/inventory/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/services/inventory/inventory_service.py +112 -0
- thothctl-0.2.0/src/thothctl/services/inventory/models.py +69 -0
- thothctl-0.2.0/src/thothctl/services/inventory/report_service.py +266 -0
- thothctl-0.2.0/src/thothctl/services/inventory/update_versions.py +295 -0
- thothctl-0.2.0/src/thothctl/services/inventory/version_service.py +657 -0
- thothctl-0.2.0/src/thothctl/services/project/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/services/project/cleanup/__init__.py +1 -0
- thothctl-0.2.0/src/thothctl/services/project/cleanup/clean_project.py +80 -0
- thothctl-0.2.0/src/thothctl/services/project/cleanup/clean_space.py +95 -0
- thothctl-0.2.0/src/thothctl/services/project/convert/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/services/project/convert/conversion_service.py +40 -0
- thothctl-0.2.0/src/thothctl/services/project/convert/get_project_data.py +594 -0
- thothctl-0.2.0/src/thothctl/services/project/convert/project_converter.py +140 -0
- thothctl-0.2.0/src/thothctl/services/project/convert/project_defaults.py +45 -0
- thothctl-0.2.0/src/thothctl/services/project/convert/set_project_parameters.py +389 -0
- thothctl-0.2.0/src/thothctl/services/project/create_terramate/__init__.py +1 -0
- thothctl-0.2.0/src/thothctl/services/project/create_terramate/create_terramate_stacks.py +158 -0
- thothctl-0.2.0/src/thothctl/services/project/create_terramate/detect_changes_stacks.py +250 -0
- thothctl-0.2.0/src/thothctl/services/project/create_terramate/manage_terramate_stacks.py +322 -0
- thothctl-0.2.0/src/thothctl/services/scan/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/services/scan/compliance_review.py +397 -0
- thothctl-0.2.0/src/thothctl/services/scan/import_reports.py +37 -0
- thothctl-0.2.0/src/thothctl/services/scan/scan_service.py +226 -0
- thothctl-0.2.0/src/thothctl/services/scan/scanners/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/services/scan/scanners/checkov.py +279 -0
- thothctl-0.2.0/src/thothctl/services/scan/scanners/scan_reports.py +264 -0
- thothctl-0.2.0/src/thothctl/services/scan/scanners/scanners.py +61 -0
- thothctl-0.2.0/src/thothctl/services/scan/scanners/terraform_compliance.py +0 -0
- thothctl-0.2.0/src/thothctl/services/scan/scanners/tfsec.py +30 -0
- thothctl-0.2.0/src/thothctl/services/scan/scanners/trivy.py +125 -0
- thothctl-0.2.0/src/thothctl/utils/__init__.py +1 -0
- thothctl-0.2.0/src/thothctl/utils/common/__init__.py +0 -0
- thothctl-0.2.0/src/thothctl/utils/common/create_compliance_html_reports.py +150 -0
- thothctl-0.2.0/src/thothctl/utils/common/create_html_reports.py +223 -0
- thothctl-0.2.0/src/thothctl/utils/common/delete_directory.py +238 -0
- thothctl-0.2.0/src/thothctl/utils/manage_backend_resources/__init__.py +1 -0
- thothctl-0.2.0/src/thothctl/utils/manage_backend_resources/manage_backend_resources.py +28 -0
- thothctl-0.2.0/src/thothctl/utils/modules_ops/__init__.py +1 -0
- thothctl-0.2.0/src/thothctl/utils/modules_ops/terraform_module_details.py +258 -0
- thothctl-0.2.0/src/thothctl/utils/modules_ops/terraform_modules_fetcher.py +296 -0
- thothctl-0.2.0/src/thothctl/utils/process_hcl/__init__.py +1 -0
- thothctl-0.2.0/src/thothctl/utils/process_hcl/analyze_terraform_plan.py +371 -0
- thothctl-0.2.0/src/thothctl/utils/process_hcl/graph_manager.py +181 -0
- thothctl-0.2.0/src/thothctl/utils/process_hcl/graph_terragrunt_dependencies.py +147 -0
- thothctl-0.2.0/src/thothctl/utils/process_hcl/process_terraform_file.py +20 -0
- thothctl-0.2.0/src/thothctl/utils/process_hcl/risk_analyzing_terraform_plan.py +210 -0
- thothctl-0.2.0/src/thothctl/utils/sync_workspaces/__init__.py +1 -0
- thothctl-0.2.0/src/thothctl/utils/sync_workspaces/sync_terraform_workspaces.py +278 -0
- thothctl-0.2.0/src/thothctl/utils/sync_workspaces/sync_terragrunt_workspaces.py +143 -0
- thothctl-0.2.0/src/thothctl/version.py +2 -0
- thothctl-0.2.0/src/thothctl/wellcome_banner.py +29 -0
- thothctl-0.2.0/test/__init__.py +1 -0
- thothctl-0.2.0/test/unit/__init__.py +1 -0
- thothctl-0.2.0/test/unit/check_environment_test.py +69 -0
- thothctl-0.2.0/tests/test_space_command.py +150 -0
- thothctl-0.2.0/tests/test_space_config.py +126 -0
- thothctl-0.2.0/tox.ini +21 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
FROM mcr.microsoft.com/devcontainers/python:3.10
|
|
2
|
+
|
|
3
|
+
# Install system dependencies
|
|
4
|
+
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
|
5
|
+
&& apt-get -y install --no-install-recommends \
|
|
6
|
+
graphviz \
|
|
7
|
+
wkhtmltopdf \
|
|
8
|
+
curl \
|
|
9
|
+
unzip \
|
|
10
|
+
git \
|
|
11
|
+
jq \
|
|
12
|
+
vim \
|
|
13
|
+
&& apt-get clean -y \
|
|
14
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
15
|
+
|
|
16
|
+
# Install OpenTofu
|
|
17
|
+
RUN curl -Lo /tmp/opentofu.zip https://github.com/opentofu/opentofu/releases/download/v1.6.1/tofu_1.6.1_linux_amd64.zip \
|
|
18
|
+
&& unzip /tmp/opentofu.zip -d /tmp \
|
|
19
|
+
&& mv /tmp/tofu /usr/local/bin/ \
|
|
20
|
+
&& chmod +x /usr/local/bin/tofu \
|
|
21
|
+
&& rm /tmp/opentofu.zip
|
|
22
|
+
|
|
23
|
+
# Install Terragrunt
|
|
24
|
+
RUN curl -Lo /usr/local/bin/terragrunt https://github.com/gruntwork-io/terragrunt/releases/download/v0.55.0/terragrunt_linux_amd64 \
|
|
25
|
+
&& chmod +x /usr/local/bin/terragrunt
|
|
26
|
+
|
|
27
|
+
# Install terraform-docs
|
|
28
|
+
RUN curl -Lo /tmp/terraform-docs.tar.gz https://github.com/terraform-docs/terraform-docs/releases/download/v0.16.0/terraform-docs-v0.16.0-linux-amd64.tar.gz \
|
|
29
|
+
&& tar -xzf /tmp/terraform-docs.tar.gz -C /tmp \
|
|
30
|
+
&& mv /tmp/terraform-docs /usr/local/bin/ \
|
|
31
|
+
&& chmod +x /usr/local/bin/terraform-docs \
|
|
32
|
+
&& rm /tmp/terraform-docs.tar.gz
|
|
33
|
+
|
|
34
|
+
# Install Checkov
|
|
35
|
+
RUN pip install --no-cache-dir checkov
|
|
36
|
+
|
|
37
|
+
# Install Trivy
|
|
38
|
+
RUN curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin v0.48.0
|
|
39
|
+
|
|
40
|
+
# Install ThothCTL
|
|
41
|
+
RUN pip install --no-cache-dir thothctl
|
|
42
|
+
|
|
43
|
+
# Create a non-root user
|
|
44
|
+
USER vscode
|
|
45
|
+
|
|
46
|
+
# Set up aliases for common commands
|
|
47
|
+
RUN echo 'alias tf="tofu"' >> ~/.bashrc \
|
|
48
|
+
&& echo 'alias tg="terragrunt"' >> ~/.bashrc \
|
|
49
|
+
&& echo 'alias tfdocs="terraform-docs"' >> ~/.bashrc
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# ThothForge Development Container
|
|
2
|
+
|
|
3
|
+
This development container provides a consistent environment for working with ThothForge tools and infrastructure as code.
|
|
4
|
+
|
|
5
|
+
## Included Tools
|
|
6
|
+
|
|
7
|
+
- **OpenTofu** - An open-source fork of Terraform for infrastructure as code
|
|
8
|
+
- **Terragrunt** - A thin wrapper for Terraform that provides extra tools for working with multiple Terraform modules
|
|
9
|
+
- **Terraform-docs** - A utility to generate documentation from Terraform modules
|
|
10
|
+
- **Checkov** - A static code analysis tool for infrastructure as code
|
|
11
|
+
- **Trivy** - A vulnerability scanner for containers and other artifacts
|
|
12
|
+
- **ThothCTL** - The ThothForge CLI tool for managing internal developer platform tasks
|
|
13
|
+
- **Python 3.10** - For running ThothCTL and other Python-based tools
|
|
14
|
+
- **Graphviz** - For generating diagrams
|
|
15
|
+
- **wkhtmltopdf** - For PDF generation
|
|
16
|
+
|
|
17
|
+
## Getting Started
|
|
18
|
+
|
|
19
|
+
1. Install [Visual Studio Code](https://code.visualstudio.com/)
|
|
20
|
+
2. Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
|
|
21
|
+
3. Install [Docker](https://www.docker.com/products/docker-desktop/)
|
|
22
|
+
4. Clone this repository
|
|
23
|
+
5. Open the repository in VS Code
|
|
24
|
+
6. When prompted, click "Reopen in Container" or use the command palette (F1) and select "Dev Containers: Reopen in Container"
|
|
25
|
+
|
|
26
|
+
## Using the Container
|
|
27
|
+
|
|
28
|
+
Once inside the container, you can use all the included tools directly from the terminal:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Use OpenTofu
|
|
32
|
+
tofu --version
|
|
33
|
+
# or use the alias
|
|
34
|
+
tf --version
|
|
35
|
+
|
|
36
|
+
# Use Terragrunt
|
|
37
|
+
terragrunt --version
|
|
38
|
+
# or use the alias
|
|
39
|
+
tg --version
|
|
40
|
+
|
|
41
|
+
# Use ThothCTL
|
|
42
|
+
thothctl --version
|
|
43
|
+
|
|
44
|
+
# Scan infrastructure code
|
|
45
|
+
checkov -d .
|
|
46
|
+
trivy fs .
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## AWS Credentials
|
|
50
|
+
|
|
51
|
+
Your local AWS credentials are mounted into the container, so you can use AWS CLI and other AWS tools without additional configuration.
|
|
52
|
+
|
|
53
|
+
## Customizing
|
|
54
|
+
|
|
55
|
+
To add more tools or customize the environment, edit the `Dockerfile` and rebuild the container using the command palette: "Dev Containers: Rebuild Container".
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ThothForge Infrastructure Development",
|
|
3
|
+
"dockerFile": "Dockerfile",
|
|
4
|
+
"remoteUser": "vscode",
|
|
5
|
+
"customizations": {
|
|
6
|
+
"vscode": {
|
|
7
|
+
"extensions": [
|
|
8
|
+
"hashicorp.terraform",
|
|
9
|
+
"ms-python.python",
|
|
10
|
+
"ms-azuretools.vscode-docker",
|
|
11
|
+
"redhat.vscode-yaml",
|
|
12
|
+
"timonwong.shellcheck",
|
|
13
|
+
"github.copilot",
|
|
14
|
+
"eamodio.gitlens"
|
|
15
|
+
],
|
|
16
|
+
"settings": {
|
|
17
|
+
"terminal.integrated.defaultProfile.linux": "bash"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"mounts": [
|
|
22
|
+
"source=${localEnv:HOME}/.aws,target=/home/vscode/.aws,type=bind,consistency=cached"
|
|
23
|
+
],
|
|
24
|
+
"remoteEnv": {
|
|
25
|
+
"PATH": "${containerEnv:PATH}:/home/vscode/.local/bin"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
name: Publish Python Package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
test-deploy:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
environment:
|
|
11
|
+
name: test-release
|
|
12
|
+
url: https://test.pypi.org/p/${{ github.event.repository.name }}
|
|
13
|
+
permissions:
|
|
14
|
+
id-token: write
|
|
15
|
+
contents: read
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
uses: actions/setup-python@v4
|
|
22
|
+
with:
|
|
23
|
+
python-version: '3.x'
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: |
|
|
27
|
+
python -m pip install --upgrade pip
|
|
28
|
+
pip install build twine
|
|
29
|
+
|
|
30
|
+
- name: Build package
|
|
31
|
+
run: python -m build
|
|
32
|
+
|
|
33
|
+
- name: Publish to TestPyPI
|
|
34
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
35
|
+
with:
|
|
36
|
+
repository-url: https://test.pypi.org/legacy/
|
|
37
|
+
skip-existing: true
|
|
38
|
+
verify-metadata: true
|
|
39
|
+
verbose: true
|
|
40
|
+
print-hash: true
|
|
41
|
+
|
|
42
|
+
- name: Verify package is installable from TestPyPI
|
|
43
|
+
run: |
|
|
44
|
+
python -m pip install \
|
|
45
|
+
--index-url https://test.pypi.org/simple/ \
|
|
46
|
+
--no-deps \
|
|
47
|
+
${{ github.event.repository.name }}
|
|
48
|
+
|
|
49
|
+
prod-deploy:
|
|
50
|
+
needs: test-deploy
|
|
51
|
+
runs-on: ubuntu-latest
|
|
52
|
+
environment:
|
|
53
|
+
name: production
|
|
54
|
+
url: https://pypi.org/p/${{ github.event.repository.name }}
|
|
55
|
+
permissions:
|
|
56
|
+
id-token: write
|
|
57
|
+
contents: read
|
|
58
|
+
|
|
59
|
+
steps:
|
|
60
|
+
- uses: actions/checkout@v4
|
|
61
|
+
|
|
62
|
+
- name: Set up Python
|
|
63
|
+
uses: actions/setup-python@v4
|
|
64
|
+
with:
|
|
65
|
+
python-version: '3.x'
|
|
66
|
+
|
|
67
|
+
- name: Install dependencies
|
|
68
|
+
run: |
|
|
69
|
+
python -m pip install --upgrade pip
|
|
70
|
+
pip install build
|
|
71
|
+
|
|
72
|
+
- name: Build package
|
|
73
|
+
run: python -m build
|
|
74
|
+
|
|
75
|
+
- name: Publish to PyPI
|
|
76
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
77
|
+
with:
|
|
78
|
+
verify-metadata: true
|
|
79
|
+
verbose: true
|
|
80
|
+
print-hash: true
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
# Created by https://www.toptal.com/developers/gitignore/api/python,pycharm+all
|
|
2
|
+
# Edit at https://www.toptal.com/developers/gitignore?templates=python,pycharm+all
|
|
3
|
+
|
|
4
|
+
### PyCharm+all ###
|
|
5
|
+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
|
|
6
|
+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
|
|
7
|
+
|
|
8
|
+
# User-specific stuff
|
|
9
|
+
.idea/**/workspace.xml
|
|
10
|
+
.idea/**/tasks.xml
|
|
11
|
+
.idea/**/usage.statistics.xml
|
|
12
|
+
.idea/**/dictionaries
|
|
13
|
+
.idea/**/shelf
|
|
14
|
+
|
|
15
|
+
# AWS User-specific
|
|
16
|
+
.idea/**/aws.xml
|
|
17
|
+
|
|
18
|
+
# Generated mood
|
|
19
|
+
.idea/**/contentModel.xml
|
|
20
|
+
|
|
21
|
+
# Sensitive or high-churn mood
|
|
22
|
+
.idea/**/dataSources/
|
|
23
|
+
.idea/**/dataSources.ids
|
|
24
|
+
.idea/**/dataSources.local.xml
|
|
25
|
+
.idea/**/sqlDataSources.xml
|
|
26
|
+
.idea/**/dynamic.xml
|
|
27
|
+
.idea/**/uiDesigner.xml
|
|
28
|
+
.idea/**/dbnavigator.xml
|
|
29
|
+
|
|
30
|
+
# Gradle
|
|
31
|
+
.idea/**/gradle.xml
|
|
32
|
+
.idea/**/libraries
|
|
33
|
+
|
|
34
|
+
# Gradle and Maven with auto-import
|
|
35
|
+
# When using Gradle or Maven with auto-import, you should exclude module mood,
|
|
36
|
+
# since they will be recreated, and may cause churn. Uncomment if using
|
|
37
|
+
# auto-import.
|
|
38
|
+
# .idea/artifacts
|
|
39
|
+
# .idea/compiler.xml
|
|
40
|
+
# .idea/jarRepositories.xml
|
|
41
|
+
# .idea/modules.xml
|
|
42
|
+
# .idea/*.iml
|
|
43
|
+
# .idea/modules
|
|
44
|
+
# *.iml
|
|
45
|
+
# *.ipr
|
|
46
|
+
|
|
47
|
+
# CMake
|
|
48
|
+
cmake-build-*/
|
|
49
|
+
|
|
50
|
+
# Mongo Explorer plugin
|
|
51
|
+
.idea/**/mongoSettings.xml
|
|
52
|
+
|
|
53
|
+
# File-based project format
|
|
54
|
+
*.iws
|
|
55
|
+
|
|
56
|
+
# IntelliJ
|
|
57
|
+
out/
|
|
58
|
+
|
|
59
|
+
# mpeltonen/sbt-idea plugin
|
|
60
|
+
.idea_modules/
|
|
61
|
+
|
|
62
|
+
# JIRA plugin
|
|
63
|
+
atlassian-ide-plugin.xml
|
|
64
|
+
|
|
65
|
+
# Cursive Clojure plugin
|
|
66
|
+
.idea/replstate.xml
|
|
67
|
+
|
|
68
|
+
# SonarLint plugin
|
|
69
|
+
.idea/sonarlint/
|
|
70
|
+
|
|
71
|
+
# Crashlytics plugin (for Android Studio and IntelliJ)
|
|
72
|
+
com_crashlytics_export_strings.xml
|
|
73
|
+
crashlytics.properties
|
|
74
|
+
crashlytics-build.properties
|
|
75
|
+
fabric.properties
|
|
76
|
+
|
|
77
|
+
# Editor-based Rest Client
|
|
78
|
+
.idea/httpRequests
|
|
79
|
+
|
|
80
|
+
# Android studio 3.1+ serialized cache file
|
|
81
|
+
.idea/caches/build_file_checksums.ser
|
|
82
|
+
|
|
83
|
+
### PyCharm+all Patch ###
|
|
84
|
+
# Ignore everything but code style settings and run configurations
|
|
85
|
+
# that are supposed to be shared within teams.
|
|
86
|
+
|
|
87
|
+
.idea/*
|
|
88
|
+
|
|
89
|
+
!.idea/codeStyles
|
|
90
|
+
!.idea/runConfigurations
|
|
91
|
+
|
|
92
|
+
### Python ###
|
|
93
|
+
# Byte-compiled / optimized / DLL mood
|
|
94
|
+
__pycache__/
|
|
95
|
+
*.py[cod]
|
|
96
|
+
*$py.class
|
|
97
|
+
|
|
98
|
+
# C extensions
|
|
99
|
+
*.so
|
|
100
|
+
|
|
101
|
+
# Distribution / packaging
|
|
102
|
+
.Python
|
|
103
|
+
build/
|
|
104
|
+
develop-eggs/
|
|
105
|
+
dist/
|
|
106
|
+
downloads/
|
|
107
|
+
eggs/
|
|
108
|
+
.eggs/
|
|
109
|
+
lib/
|
|
110
|
+
lib64/
|
|
111
|
+
parts/
|
|
112
|
+
sdist/
|
|
113
|
+
var/
|
|
114
|
+
wheels/
|
|
115
|
+
share/python-wheels/
|
|
116
|
+
*.egg-info/
|
|
117
|
+
.installed.cfg
|
|
118
|
+
*.egg
|
|
119
|
+
MANIFEST
|
|
120
|
+
|
|
121
|
+
# PyInstaller
|
|
122
|
+
# Usually these mood are written by a python script from a template
|
|
123
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
124
|
+
*.manifest
|
|
125
|
+
*.spec
|
|
126
|
+
|
|
127
|
+
# Installer logs
|
|
128
|
+
pip-log.txt
|
|
129
|
+
pip-delete-this-directory.txt
|
|
130
|
+
|
|
131
|
+
# Unit test / coverage reports
|
|
132
|
+
htmlcov/
|
|
133
|
+
.tox/
|
|
134
|
+
.nox/
|
|
135
|
+
.coverage
|
|
136
|
+
.coverage.*
|
|
137
|
+
.cache
|
|
138
|
+
nosetests.xml
|
|
139
|
+
coverage.xml
|
|
140
|
+
*.cover
|
|
141
|
+
*.py,cover
|
|
142
|
+
.hypothesis/
|
|
143
|
+
.pytest_cache/
|
|
144
|
+
cover/
|
|
145
|
+
|
|
146
|
+
# Translations
|
|
147
|
+
*.mo
|
|
148
|
+
*.pot
|
|
149
|
+
|
|
150
|
+
# Django stuff:
|
|
151
|
+
*.log
|
|
152
|
+
local_settings.py
|
|
153
|
+
db.sqlite3
|
|
154
|
+
db.sqlite3-journal
|
|
155
|
+
|
|
156
|
+
# Flask stuff:
|
|
157
|
+
instance/
|
|
158
|
+
.webassets-cache
|
|
159
|
+
|
|
160
|
+
# Scrapy stuff:
|
|
161
|
+
.scrapy
|
|
162
|
+
|
|
163
|
+
# Sphinx documentation
|
|
164
|
+
docs/_build/
|
|
165
|
+
|
|
166
|
+
# PyBuilder
|
|
167
|
+
.pybuilder/
|
|
168
|
+
target/
|
|
169
|
+
|
|
170
|
+
# Jupyter Notebook
|
|
171
|
+
.ipynb_checkpoints
|
|
172
|
+
|
|
173
|
+
# IPython
|
|
174
|
+
profile_default/
|
|
175
|
+
ipython_config.py
|
|
176
|
+
|
|
177
|
+
# pyenv
|
|
178
|
+
# For a library or package, you might want to ignore these mood since the code is
|
|
179
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
180
|
+
# .python-version
|
|
181
|
+
|
|
182
|
+
# pipenv
|
|
183
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
184
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
185
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
186
|
+
# install all needed dependencies.
|
|
187
|
+
#Pipfile.lock
|
|
188
|
+
|
|
189
|
+
# poetry
|
|
190
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
191
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
192
|
+
# commonly ignored for libraries.
|
|
193
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
194
|
+
#poetry.lock
|
|
195
|
+
|
|
196
|
+
# pdm
|
|
197
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
198
|
+
#pdm.lock
|
|
199
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
200
|
+
# in version control.
|
|
201
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
202
|
+
.pdm.toml
|
|
203
|
+
|
|
204
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
205
|
+
__pypackages__/
|
|
206
|
+
|
|
207
|
+
# Celery stuff
|
|
208
|
+
celerybeat-schedule
|
|
209
|
+
celerybeat.pid
|
|
210
|
+
|
|
211
|
+
# SageMath parsed mood
|
|
212
|
+
*.sage.py
|
|
213
|
+
|
|
214
|
+
# Environments
|
|
215
|
+
.env
|
|
216
|
+
.venv
|
|
217
|
+
env/
|
|
218
|
+
venv/
|
|
219
|
+
ENV/
|
|
220
|
+
env.bak/
|
|
221
|
+
venv.bak/
|
|
222
|
+
|
|
223
|
+
# Spyder project settings
|
|
224
|
+
.spyderproject
|
|
225
|
+
.spyproject
|
|
226
|
+
|
|
227
|
+
# Rope project settings
|
|
228
|
+
.ropeproject
|
|
229
|
+
|
|
230
|
+
# mkdocs documentation
|
|
231
|
+
/site
|
|
232
|
+
|
|
233
|
+
# mypy
|
|
234
|
+
.mypy_cache/
|
|
235
|
+
.dmypy.json
|
|
236
|
+
dmypy.json
|
|
237
|
+
|
|
238
|
+
# Pyre type checker
|
|
239
|
+
.pyre/
|
|
240
|
+
|
|
241
|
+
# pytype static type analyzer
|
|
242
|
+
.pytype/
|
|
243
|
+
|
|
244
|
+
# Cython debug symbols
|
|
245
|
+
cython_debug/
|
|
246
|
+
|
|
247
|
+
# PyCharm
|
|
248
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
249
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
250
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
251
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
252
|
+
#.idea/
|
|
253
|
+
|
|
254
|
+
# End of https://www.toptal.com/developers/gitignore/api/python,pycharm+all
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
3
|
+
# Ruff version.
|
|
4
|
+
rev: v0.1.11
|
|
5
|
+
hooks:
|
|
6
|
+
# Run the linter.
|
|
7
|
+
- id: ruff
|
|
8
|
+
args: [ --fix ]
|
|
9
|
+
# Run the formatter.
|
|
10
|
+
- id: ruff-format
|
|
11
|
+
|
|
12
|
+
- repo: https://github.com/miki725/importanize
|
|
13
|
+
rev: 0.8.0-alpha2
|
|
14
|
+
hooks:
|
|
15
|
+
- id: importanize
|
|
16
|
+
|
|
17
|
+
#- repo: https://github.com/PyCQA/bandit
|
|
18
|
+
# rev: 1.7.6
|
|
19
|
+
# hooks:
|
|
20
|
+
# - id: bandit
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
# repo: https://github.com/Lucas-C/pre-commit-hooks-safety
|
|
24
|
+
# rev: v1.7.2
|
|
25
|
+
# hooks:
|
|
26
|
+
# - id: python-safety-dependencies-check
|
|
27
|
+
# args: [check, --full-report, --file]
|
|
28
|
+
|
|
29
|
+
- repo: https://github.com/PyCQA/pydocstyle
|
|
30
|
+
rev: 6.3.0
|
|
31
|
+
hooks:
|
|
32
|
+
- id: pydocstyle
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
FROM python:3.13-slim-bullseye
|
|
2
|
+
|
|
3
|
+
USER root
|
|
4
|
+
|
|
5
|
+
ARG INSTALL_GIT=false
|
|
6
|
+
RUN if [ "$INSTALL_GIT" = "true" ]; then \
|
|
7
|
+
apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*; \
|
|
8
|
+
fi
|
|
9
|
+
|
|
10
|
+
# Runtime dependency
|
|
11
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
12
|
+
ffmpeg \
|
|
13
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
14
|
+
|
|
15
|
+
RUN pip install thothctl
|
|
16
|
+
|
|
17
|
+
# Default USERID and GROUPID
|
|
18
|
+
ARG USERID=10000
|
|
19
|
+
ARG GROUPID=10000
|
|
20
|
+
|
|
21
|
+
USER $USERID:$GROUPID
|
|
22
|
+
|
|
23
|
+
ENTRYPOINT [ "thothctl" ]
|
thothctl-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright 2024 ThothForge
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|