replimap 0.1.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.
- replimap-0.1.0/.dockerignore +39 -0
- replimap-0.1.0/.github/workflows/release.yml +91 -0
- replimap-0.1.0/.github/workflows/test.yml +64 -0
- replimap-0.1.0/.gitignore +73 -0
- replimap-0.1.0/CHANGELOG.md +140 -0
- replimap-0.1.0/Dockerfile +23 -0
- replimap-0.1.0/IAM_POLICY.md +170 -0
- replimap-0.1.0/LICENSE +31 -0
- replimap-0.1.0/MANIFEST.in +13 -0
- replimap-0.1.0/PKG-INFO +546 -0
- replimap-0.1.0/README.md +503 -0
- replimap-0.1.0/SECURITY.md +202 -0
- replimap-0.1.0/pyproject.toml +155 -0
- replimap-0.1.0/replimap/__init__.py +9 -0
- replimap-0.1.0/replimap/core/__init__.py +52 -0
- replimap-0.1.0/replimap/core/cache.py +600 -0
- replimap-0.1.0/replimap/core/filters.py +377 -0
- replimap-0.1.0/replimap/core/graph_engine.py +372 -0
- replimap-0.1.0/replimap/core/models.py +183 -0
- replimap-0.1.0/replimap/core/selection.py +990 -0
- replimap-0.1.0/replimap/licensing/__init__.py +34 -0
- replimap-0.1.0/replimap/licensing/gates.py +258 -0
- replimap-0.1.0/replimap/licensing/manager.py +350 -0
- replimap-0.1.0/replimap/licensing/models.py +315 -0
- replimap-0.1.0/replimap/licensing/tracker.py +332 -0
- replimap-0.1.0/replimap/main.py +1771 -0
- replimap-0.1.0/replimap/renderers/__init__.py +20 -0
- replimap-0.1.0/replimap/renderers/base.py +74 -0
- replimap-0.1.0/replimap/renderers/cloudformation.py +662 -0
- replimap-0.1.0/replimap/renderers/pulumi.py +764 -0
- replimap-0.1.0/replimap/renderers/terraform.py +1614 -0
- replimap-0.1.0/replimap/scanners/__init__.py +55 -0
- replimap-0.1.0/replimap/scanners/async_base.py +211 -0
- replimap-0.1.0/replimap/scanners/async_vpc_scanner.py +230 -0
- replimap-0.1.0/replimap/scanners/base.py +554 -0
- replimap-0.1.0/replimap/scanners/compute_scanner.py +423 -0
- replimap-0.1.0/replimap/scanners/ec2_scanner.py +230 -0
- replimap-0.1.0/replimap/scanners/elasticache_scanner.py +258 -0
- replimap-0.1.0/replimap/scanners/messaging_scanner.py +256 -0
- replimap-0.1.0/replimap/scanners/networking_scanner.py +279 -0
- replimap-0.1.0/replimap/scanners/rds_scanner.py +254 -0
- replimap-0.1.0/replimap/scanners/s3_scanner.py +257 -0
- replimap-0.1.0/replimap/scanners/storage_scanner.py +193 -0
- replimap-0.1.0/replimap/scanners/vpc_scanner.py +226 -0
- replimap-0.1.0/replimap/templates/autoscaling_group.tf.j2 +121 -0
- replimap-0.1.0/replimap/templates/db_parameter_group.tf.j2 +30 -0
- replimap-0.1.0/replimap/templates/db_subnet_group.tf.j2 +30 -0
- replimap-0.1.0/replimap/templates/ebs_volume.tf.j2 +75 -0
- replimap-0.1.0/replimap/templates/ec2_instance.tf.j2 +75 -0
- replimap-0.1.0/replimap/templates/elasticache_cluster.tf.j2 +81 -0
- replimap-0.1.0/replimap/templates/elasticache_subnet_group.tf.j2 +30 -0
- replimap-0.1.0/replimap/templates/internet_gateway.tf.j2 +24 -0
- replimap-0.1.0/replimap/templates/launch_template.tf.j2 +150 -0
- replimap-0.1.0/replimap/templates/lb.tf.j2 +50 -0
- replimap-0.1.0/replimap/templates/lb_listener.tf.j2 +101 -0
- replimap-0.1.0/replimap/templates/lb_target_group.tf.j2 +79 -0
- replimap-0.1.0/replimap/templates/nat_gateway.tf.j2 +41 -0
- replimap-0.1.0/replimap/templates/rds_instance.tf.j2 +126 -0
- replimap-0.1.0/replimap/templates/route_table.tf.j2 +149 -0
- replimap-0.1.0/replimap/templates/s3_bucket.tf.j2 +62 -0
- replimap-0.1.0/replimap/templates/s3_bucket_policy.tf.j2 +16 -0
- replimap-0.1.0/replimap/templates/security_group.tf.j2 +146 -0
- replimap-0.1.0/replimap/templates/sns_topic.tf.j2 +27 -0
- replimap-0.1.0/replimap/templates/sqs_queue.tf.j2 +48 -0
- replimap-0.1.0/replimap/templates/subnet.tf.j2 +32 -0
- replimap-0.1.0/replimap/templates/vpc.tf.j2 +18 -0
- replimap-0.1.0/replimap/templates/vpc_endpoint.tf.j2 +75 -0
- replimap-0.1.0/replimap/transformers/__init__.py +62 -0
- replimap-0.1.0/replimap/transformers/base.py +103 -0
- replimap-0.1.0/replimap/transformers/downsizer.py +402 -0
- replimap-0.1.0/replimap/transformers/network_remapper.py +246 -0
- replimap-0.1.0/replimap/transformers/renamer.py +234 -0
- replimap-0.1.0/replimap/transformers/sanitizer.py +260 -0
- replimap-0.1.0/tests/__init__.py +1 -0
- replimap-0.1.0/tests/conftest.py +20 -0
- replimap-0.1.0/tests/test_async_scanners.py +86 -0
- replimap-0.1.0/tests/test_cache.py +606 -0
- replimap-0.1.0/tests/test_cli.py +136 -0
- replimap-0.1.0/tests/test_filters.py +385 -0
- replimap-0.1.0/tests/test_graph_engine.py +286 -0
- replimap-0.1.0/tests/test_licensing.py +687 -0
- replimap-0.1.0/tests/test_models.py +158 -0
- replimap-0.1.0/tests/test_phase2_renderers.py +294 -0
- replimap-0.1.0/tests/test_phase2_scanners.py +129 -0
- replimap-0.1.0/tests/test_phase2_transformers.py +160 -0
- replimap-0.1.0/tests/test_renderers.py +1021 -0
- replimap-0.1.0/tests/test_resource_relationships.py +837 -0
- replimap-0.1.0/tests/test_scanner_improvements.py +246 -0
- replimap-0.1.0/tests/test_selection.py +734 -0
- replimap-0.1.0/tests/test_template_logic_fixes.py +934 -0
- replimap-0.1.0/tests/test_transformers.py +319 -0
- replimap-0.1.0/uv.lock +1735 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Git
|
|
2
|
+
.git
|
|
3
|
+
.gitignore
|
|
4
|
+
|
|
5
|
+
# Python
|
|
6
|
+
__pycache__
|
|
7
|
+
*.py[cod]
|
|
8
|
+
*$py.class
|
|
9
|
+
*.so
|
|
10
|
+
.Python
|
|
11
|
+
.venv
|
|
12
|
+
venv
|
|
13
|
+
ENV
|
|
14
|
+
|
|
15
|
+
# IDE
|
|
16
|
+
.idea
|
|
17
|
+
.vscode
|
|
18
|
+
*.swp
|
|
19
|
+
*.swo
|
|
20
|
+
|
|
21
|
+
# Build
|
|
22
|
+
dist
|
|
23
|
+
build
|
|
24
|
+
*.egg-info
|
|
25
|
+
.eggs
|
|
26
|
+
|
|
27
|
+
# Test
|
|
28
|
+
.pytest_cache
|
|
29
|
+
.coverage
|
|
30
|
+
htmlcov
|
|
31
|
+
.mypy_cache
|
|
32
|
+
.ruff_cache
|
|
33
|
+
|
|
34
|
+
# Project
|
|
35
|
+
*.md
|
|
36
|
+
!README.md
|
|
37
|
+
tests
|
|
38
|
+
docs
|
|
39
|
+
Makefile
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
|
|
14
|
+
- name: Install uv
|
|
15
|
+
uses: astral-sh/setup-uv@v4
|
|
16
|
+
with:
|
|
17
|
+
version: "latest"
|
|
18
|
+
|
|
19
|
+
- name: Set up Python
|
|
20
|
+
run: uv python install 3.11
|
|
21
|
+
|
|
22
|
+
- name: Install dependencies
|
|
23
|
+
run: uv sync --all-extras --dev
|
|
24
|
+
|
|
25
|
+
- name: Run tests
|
|
26
|
+
run: uv run pytest tests/ -v
|
|
27
|
+
|
|
28
|
+
- name: Build package
|
|
29
|
+
run: uv build
|
|
30
|
+
|
|
31
|
+
- name: Upload artifacts
|
|
32
|
+
uses: actions/upload-artifact@v4
|
|
33
|
+
with:
|
|
34
|
+
name: dist
|
|
35
|
+
path: dist/
|
|
36
|
+
|
|
37
|
+
publish-testpypi:
|
|
38
|
+
needs: build
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
environment:
|
|
41
|
+
name: testpypi
|
|
42
|
+
url: https://test.pypi.org/p/replimap
|
|
43
|
+
permissions:
|
|
44
|
+
id-token: write
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/download-artifact@v4
|
|
47
|
+
with:
|
|
48
|
+
name: dist
|
|
49
|
+
path: dist/
|
|
50
|
+
|
|
51
|
+
- name: Publish to TestPyPI
|
|
52
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
53
|
+
with:
|
|
54
|
+
repository-url: https://test.pypi.org/legacy/
|
|
55
|
+
|
|
56
|
+
publish-pypi:
|
|
57
|
+
needs: [build, publish-testpypi]
|
|
58
|
+
runs-on: ubuntu-latest
|
|
59
|
+
environment:
|
|
60
|
+
name: pypi
|
|
61
|
+
url: https://pypi.org/p/replimap
|
|
62
|
+
permissions:
|
|
63
|
+
id-token: write
|
|
64
|
+
steps:
|
|
65
|
+
- uses: actions/download-artifact@v4
|
|
66
|
+
with:
|
|
67
|
+
name: dist
|
|
68
|
+
path: dist/
|
|
69
|
+
|
|
70
|
+
- name: Publish to PyPI
|
|
71
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
72
|
+
|
|
73
|
+
github-release:
|
|
74
|
+
needs: publish-pypi
|
|
75
|
+
runs-on: ubuntu-latest
|
|
76
|
+
permissions:
|
|
77
|
+
contents: write
|
|
78
|
+
steps:
|
|
79
|
+
- uses: actions/checkout@v4
|
|
80
|
+
|
|
81
|
+
- uses: actions/download-artifact@v4
|
|
82
|
+
with:
|
|
83
|
+
name: dist
|
|
84
|
+
path: dist/
|
|
85
|
+
|
|
86
|
+
- name: Create GitHub Release
|
|
87
|
+
uses: softprops/action-gh-release@v2
|
|
88
|
+
with:
|
|
89
|
+
files: dist/*
|
|
90
|
+
generate_release_notes: true
|
|
91
|
+
draft: false
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, develop, "claude/*"]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.11", "3.12", "3.13", "3.14"]
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Install uv
|
|
20
|
+
uses: astral-sh/setup-uv@v4
|
|
21
|
+
with:
|
|
22
|
+
version: "latest"
|
|
23
|
+
|
|
24
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
25
|
+
run: uv python install ${{ matrix.python-version }}
|
|
26
|
+
|
|
27
|
+
- name: Install dependencies
|
|
28
|
+
run: uv sync --all-extras --dev
|
|
29
|
+
|
|
30
|
+
- name: Run ruff format check
|
|
31
|
+
run: uv run ruff format --check .
|
|
32
|
+
|
|
33
|
+
- name: Run ruff lint
|
|
34
|
+
run: uv run ruff check .
|
|
35
|
+
|
|
36
|
+
- name: Run tests with coverage
|
|
37
|
+
run: uv run pytest tests/ -v --cov=replimap --cov-report=xml --cov-report=term
|
|
38
|
+
|
|
39
|
+
- name: Upload coverage to Codecov
|
|
40
|
+
uses: codecov/codecov-action@v4
|
|
41
|
+
if: matrix.python-version == '3.12'
|
|
42
|
+
with:
|
|
43
|
+
files: ./coverage.xml
|
|
44
|
+
fail_ci_if_error: false
|
|
45
|
+
|
|
46
|
+
type-check:
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
steps:
|
|
49
|
+
- uses: actions/checkout@v4
|
|
50
|
+
|
|
51
|
+
- name: Install uv
|
|
52
|
+
uses: astral-sh/setup-uv@v4
|
|
53
|
+
with:
|
|
54
|
+
version: "latest"
|
|
55
|
+
|
|
56
|
+
- name: Set up Python
|
|
57
|
+
run: uv python install 3.12
|
|
58
|
+
|
|
59
|
+
- name: Install dependencies
|
|
60
|
+
run: uv sync --all-extras --dev
|
|
61
|
+
|
|
62
|
+
- name: Run mypy
|
|
63
|
+
run: uv run mypy replimap --ignore-missing-imports
|
|
64
|
+
continue-on-error: true
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
.pypirc
|
|
4
|
+
*.py[cod]
|
|
5
|
+
*$py.class
|
|
6
|
+
*.so
|
|
7
|
+
.Python
|
|
8
|
+
build/
|
|
9
|
+
develop-eggs/
|
|
10
|
+
dist/
|
|
11
|
+
downloads/
|
|
12
|
+
eggs/
|
|
13
|
+
.eggs/
|
|
14
|
+
lib/
|
|
15
|
+
lib64/
|
|
16
|
+
parts/
|
|
17
|
+
sdist/
|
|
18
|
+
var/
|
|
19
|
+
wheels/
|
|
20
|
+
*.egg-info/
|
|
21
|
+
.installed.cfg
|
|
22
|
+
*.egg
|
|
23
|
+
|
|
24
|
+
# Virtual environments
|
|
25
|
+
.env
|
|
26
|
+
.venv
|
|
27
|
+
env/
|
|
28
|
+
venv/
|
|
29
|
+
ENV/
|
|
30
|
+
|
|
31
|
+
# IDE
|
|
32
|
+
.idea/
|
|
33
|
+
.vscode/
|
|
34
|
+
*.swp
|
|
35
|
+
*.swo
|
|
36
|
+
*~
|
|
37
|
+
|
|
38
|
+
# Testing
|
|
39
|
+
.pytest_cache/
|
|
40
|
+
.coverage
|
|
41
|
+
htmlcov/
|
|
42
|
+
.tox/
|
|
43
|
+
.nox/
|
|
44
|
+
|
|
45
|
+
# mypy
|
|
46
|
+
.mypy_cache/
|
|
47
|
+
.dmypy.json
|
|
48
|
+
dmypy.json
|
|
49
|
+
|
|
50
|
+
# Generated outputs (can be regenerated with `replimap clone`)
|
|
51
|
+
terraform/
|
|
52
|
+
staging-tf/
|
|
53
|
+
!templates/*.j2
|
|
54
|
+
|
|
55
|
+
# Terraform
|
|
56
|
+
.terraform/
|
|
57
|
+
*.tfstate
|
|
58
|
+
*.tfstate.*
|
|
59
|
+
crash.log
|
|
60
|
+
crash.*.log
|
|
61
|
+
override.tf
|
|
62
|
+
override.tf.json
|
|
63
|
+
*_override.tf
|
|
64
|
+
*_override.tf.json
|
|
65
|
+
.terraformrc
|
|
66
|
+
terraform.rc
|
|
67
|
+
|
|
68
|
+
# Logs
|
|
69
|
+
*.log
|
|
70
|
+
|
|
71
|
+
# OS
|
|
72
|
+
.DS_Store
|
|
73
|
+
Thumbs.db
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to RepliMap will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Graph-based selection engine for intelligent resource filtering
|
|
12
|
+
- Selection modes: VPC_SCOPE, ENTRY_POINT, TAG_BASED
|
|
13
|
+
- Boundary handling for network, identity, and global resources
|
|
14
|
+
- Clone vs reference decision matrix
|
|
15
|
+
- YAML configuration file support for complex selection scenarios
|
|
16
|
+
- New CLI options: `--scope`, `--entry`, `--config`
|
|
17
|
+
- Scan result caching with `--cache` flag for incremental scans
|
|
18
|
+
- **Makefile generation** for easier Terraform workflow management
|
|
19
|
+
- Targets: `init`, `plan`, `apply`, `destroy`, `validate`, `fmt`, `clean`, etc.
|
|
20
|
+
- Filtered planning: `plan-target`, `plan-include`, `plan-exclude`
|
|
21
|
+
- JSON output: `plan-json` for automation
|
|
22
|
+
- Quick validation: `quick-validate` (no tfvars needed)
|
|
23
|
+
- State management: `state-list`, `state-show`, `state-mv`, `state-rm`
|
|
24
|
+
- **test-terraform.sh** script for automated validation
|
|
25
|
+
- Phases: fmt check → init → validate → plan (optional)
|
|
26
|
+
- Colored output with clear pass/fail indicators
|
|
27
|
+
- **tfplan.txt** human-readable plan output alongside binary tfplan
|
|
28
|
+
- **terraform fmt** integration - auto-formats generated files
|
|
29
|
+
- **terraform.tfvars.example** with smart variable detection
|
|
30
|
+
- Includes AWS CLI commands for finding AMIs, certificates, etc.
|
|
31
|
+
- All dynamic variables with helpful comments
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
- Legacy filter options (`--vpc`, `--types`) marked as deprecated but still supported
|
|
35
|
+
- RDS password variables now have default placeholder for `terraform plan` to succeed
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
- **Boundary resource handling**: VPC Peering and Transit Gateway routes are now commented out with clear instructions (prevents staging→production routing)
|
|
39
|
+
- **ASG Target Group ARNs**: Now searches graph by ARN and name, comments out if not found (prevents hardcoded production ARN leakage)
|
|
40
|
+
- **EBS Snapshot IDs**: Commented out by default for staging (creates empty volumes)
|
|
41
|
+
- **ElastiCache Redis 6+ version format**: Strips patch version (6.2.6 → 6.2) as required by Terraform
|
|
42
|
+
- **S3 bucket name length**: Skips environment suffix if name would exceed 63 characters
|
|
43
|
+
- **Security Group circular dependencies**: Rules referencing other SGs use separate `aws_security_group_rule` resources
|
|
44
|
+
|
|
45
|
+
## [0.1.0] - 2025-01-XX
|
|
46
|
+
|
|
47
|
+
### Added
|
|
48
|
+
|
|
49
|
+
#### Core Features
|
|
50
|
+
- Graph-based AWS resource scanning engine using NetworkX
|
|
51
|
+
- Support for VPC, Subnet, Security Group, EC2, RDS, and S3 resources
|
|
52
|
+
- Dependency tracking between resources (VPC → Subnet → EC2)
|
|
53
|
+
- Topological sorting for correct Terraform resource ordering
|
|
54
|
+
|
|
55
|
+
#### Scanners (24 Resource Types)
|
|
56
|
+
- VPC Scanner: Scans VPCs, Subnets, and Security Groups
|
|
57
|
+
- EC2 Scanner: Scans EC2 instances with AMI and security group associations
|
|
58
|
+
- RDS Scanner: Scans RDS instances and DB Subnet Groups
|
|
59
|
+
- S3 Scanner: Scans S3 bucket configurations
|
|
60
|
+
- Networking Scanner: Internet Gateways, NAT Gateways, Route Tables, VPC Endpoints
|
|
61
|
+
- Compute Scanner: Launch Templates, Auto Scaling Groups, ALB/NLB, Target Groups, Listeners
|
|
62
|
+
- ElastiCache Scanner: ElastiCache Clusters and Subnet Groups, DB Parameter Groups
|
|
63
|
+
- Storage Scanner: EBS Volumes, S3 Bucket Policies
|
|
64
|
+
- Messaging Scanner: SQS Queues, SNS Topics
|
|
65
|
+
- Async Scanner Base: Support for concurrent scanning with aiobotocore
|
|
66
|
+
|
|
67
|
+
#### Transformers
|
|
68
|
+
- Sanitization Transformer: Removes secrets, passwords, and sensitive data
|
|
69
|
+
- Downsize Transformer: Reduces EC2, RDS, ElastiCache, Launch Template, and ASG sizes
|
|
70
|
+
- Renaming Transformer: Converts prod → staging naming conventions
|
|
71
|
+
- Network Remapper: Updates resource references for new environment
|
|
72
|
+
|
|
73
|
+
#### Renderers
|
|
74
|
+
- Terraform Renderer (Free+): Generates Terraform HCL files
|
|
75
|
+
- CloudFormation Renderer (Solo+): Generates AWS CloudFormation YAML
|
|
76
|
+
- Pulumi Renderer (Pro+): Generates Pulumi Python code
|
|
77
|
+
|
|
78
|
+
#### Commercial Features
|
|
79
|
+
- License management system with plan tiers (Free, Solo, Pro, Team, Enterprise)
|
|
80
|
+
- Feature gating with `@feature_gate` and `@require_plan` decorators
|
|
81
|
+
- Usage tracking with monthly quotas
|
|
82
|
+
- Local license caching with offline grace period
|
|
83
|
+
|
|
84
|
+
#### CLI Commands
|
|
85
|
+
- `replimap scan`: Scan AWS resources and build dependency graph
|
|
86
|
+
- `replimap clone`: Generate Infrastructure-as-Code from scan
|
|
87
|
+
- `replimap load`: Load and display saved graphs
|
|
88
|
+
- `replimap license activate`: Activate a license key
|
|
89
|
+
- `replimap license status`: Show current license and plan
|
|
90
|
+
- `replimap license usage`: Display usage statistics
|
|
91
|
+
- `replimap license deactivate`: Remove license
|
|
92
|
+
- `replimap profiles`: List available AWS profiles
|
|
93
|
+
- `replimap cache status`: Show cached credentials
|
|
94
|
+
- `replimap cache clear`: Clear credential cache
|
|
95
|
+
|
|
96
|
+
#### CLI UX Improvements
|
|
97
|
+
- Interactive mode (`-i`) for guided setup
|
|
98
|
+
- AWS profile region auto-detection from `~/.aws/config`
|
|
99
|
+
- MFA credential caching (12-hour TTL) to avoid repeated prompts
|
|
100
|
+
- Short `-h` option for help on all commands
|
|
101
|
+
|
|
102
|
+
#### Performance & Reliability
|
|
103
|
+
- Parallel scanning with ThreadPoolExecutor (4 workers default)
|
|
104
|
+
- AWS rate limit handling with exponential backoff retry
|
|
105
|
+
- Configurable via environment variables (`REPLIMAP_MAX_WORKERS`, `REPLIMAP_MAX_RETRIES`)
|
|
106
|
+
- Dev mode (`REPLIMAP_DEV_MODE=1`) for local development without license limits
|
|
107
|
+
|
|
108
|
+
#### Developer Experience
|
|
109
|
+
- Rich console output with progress spinners and tables
|
|
110
|
+
- Comprehensive test suite with 331 tests
|
|
111
|
+
- CI/CD with GitHub Actions (Python 3.11, 3.12, 3.13, 3.14)
|
|
112
|
+
- ruff for formatting and linting
|
|
113
|
+
- mypy for type checking
|
|
114
|
+
- Timezone-aware datetime handling throughout
|
|
115
|
+
|
|
116
|
+
### Security
|
|
117
|
+
- Read-only AWS permissions only
|
|
118
|
+
- Local data processing (no external uploads)
|
|
119
|
+
- Automatic sensitive data sanitization
|
|
120
|
+
- Minimal IAM policy requirements
|
|
121
|
+
|
|
122
|
+
## Plan Comparison
|
|
123
|
+
|
|
124
|
+
| Feature | Free | Solo ($49) | Pro ($99) | Team ($199) | Enterprise ($499+) |
|
|
125
|
+
|---------|------|------------|-----------|-------------|-------------------|
|
|
126
|
+
| Resources/Scan | 5 | ∞ | ∞ | ∞ | ∞ |
|
|
127
|
+
| Scans/Month | 3 | ∞ | ∞ | ∞ | ∞ |
|
|
128
|
+
| AWS Accounts | 1 | 1 | 3 | 10 | ∞ |
|
|
129
|
+
| Terraform Output | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
130
|
+
| CloudFormation | ❌ | ✅ | ✅ | ✅ | ✅ |
|
|
131
|
+
| Pulumi | ❌ | ❌ | ✅ | ✅ | ✅ |
|
|
132
|
+
| Async Scanning | ❌ | ✅ | ✅ | ✅ | ✅ |
|
|
133
|
+
| Web Dashboard | ❌ | ❌ | ✅ | ✅ | ✅ |
|
|
134
|
+
| Collaboration | ❌ | ❌ | ❌ | ✅ | ✅ |
|
|
135
|
+
| SSO | ❌ | ❌ | ❌ | ❌ | ✅ |
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
[Unreleased]: https://github.com/replimap/replimap/compare/v0.1.0...HEAD
|
|
140
|
+
[0.1.0]: https://github.com/replimap/replimap/releases/tag/v0.1.0
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# RepliMap Docker Image
|
|
2
|
+
# Build: docker build -t replimap/replimap .
|
|
3
|
+
# Run: docker run -v ~/.aws:/root/.aws replimap/replimap scan --profile prod
|
|
4
|
+
|
|
5
|
+
FROM python:3.11-slim
|
|
6
|
+
|
|
7
|
+
LABEL maintainer="RepliMap Team <team@replimap.dev>"
|
|
8
|
+
LABEL description="AWS Infrastructure Staging Cloner"
|
|
9
|
+
LABEL org.opencontainers.image.source="https://github.com/replimap/replimap"
|
|
10
|
+
|
|
11
|
+
# Install replimap
|
|
12
|
+
RUN pip install --no-cache-dir replimap
|
|
13
|
+
|
|
14
|
+
# Create non-root user for security (optional, can run as root for AWS creds)
|
|
15
|
+
# RUN useradd -m -s /bin/bash replimap
|
|
16
|
+
# USER replimap
|
|
17
|
+
|
|
18
|
+
# Set working directory
|
|
19
|
+
WORKDIR /workspace
|
|
20
|
+
|
|
21
|
+
# Default command shows help
|
|
22
|
+
ENTRYPOINT ["replimap"]
|
|
23
|
+
CMD ["--help"]
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# RepliMap IAM Policy
|
|
2
|
+
|
|
3
|
+
RepliMap requires **read-only** access to scan your AWS resources. This document provides the minimum required IAM permissions.
|
|
4
|
+
|
|
5
|
+
## Recommended Policy
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
{
|
|
9
|
+
"Version": "2012-10-17",
|
|
10
|
+
"Statement": [
|
|
11
|
+
{
|
|
12
|
+
"Sid": "RepliMapReadOnly",
|
|
13
|
+
"Effect": "Allow",
|
|
14
|
+
"Action": [
|
|
15
|
+
"ec2:DescribeVpcs",
|
|
16
|
+
"ec2:DescribeSubnets",
|
|
17
|
+
"ec2:DescribeSecurityGroups",
|
|
18
|
+
"ec2:DescribeInstances",
|
|
19
|
+
"ec2:DescribeTags",
|
|
20
|
+
"ec2:DescribeAvailabilityZones",
|
|
21
|
+
"ec2:DescribeRouteTables",
|
|
22
|
+
"ec2:DescribeInternetGateways",
|
|
23
|
+
"ec2:DescribeNatGateways",
|
|
24
|
+
"rds:DescribeDBInstances",
|
|
25
|
+
"rds:DescribeDBSubnetGroups",
|
|
26
|
+
"rds:DescribeDBSecurityGroups",
|
|
27
|
+
"rds:ListTagsForResource",
|
|
28
|
+
"s3:ListAllMyBuckets",
|
|
29
|
+
"s3:GetBucketLocation",
|
|
30
|
+
"s3:GetBucketTagging",
|
|
31
|
+
"s3:GetBucketVersioning",
|
|
32
|
+
"s3:GetBucketEncryption",
|
|
33
|
+
"sts:GetCallerIdentity"
|
|
34
|
+
],
|
|
35
|
+
"Resource": "*"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Setup Instructions
|
|
42
|
+
|
|
43
|
+
### Option 1: Create a Dedicated IAM User
|
|
44
|
+
|
|
45
|
+
1. Go to IAM Console → Users → Add User
|
|
46
|
+
2. Name: `replimap-scanner`
|
|
47
|
+
3. Access type: Programmatic access
|
|
48
|
+
4. Attach the policy above
|
|
49
|
+
5. Save the access keys
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Configure AWS CLI
|
|
53
|
+
aws configure --profile replimap
|
|
54
|
+
# Enter the access key ID and secret
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Option 2: Create an IAM Role (Recommended for EC2/ECS)
|
|
58
|
+
|
|
59
|
+
1. Go to IAM Console → Roles → Create Role
|
|
60
|
+
2. Select "AWS service" → EC2/ECS
|
|
61
|
+
3. Attach the policy above
|
|
62
|
+
4. Name: `replimap-scanner-role`
|
|
63
|
+
|
|
64
|
+
### Option 3: Use Existing Profile with Restricted Permissions
|
|
65
|
+
|
|
66
|
+
If you have an existing AWS profile, you can create a more restricted policy:
|
|
67
|
+
|
|
68
|
+
```json
|
|
69
|
+
{
|
|
70
|
+
"Version": "2012-10-17",
|
|
71
|
+
"Statement": [
|
|
72
|
+
{
|
|
73
|
+
"Sid": "RepliMapVPCRead",
|
|
74
|
+
"Effect": "Allow",
|
|
75
|
+
"Action": [
|
|
76
|
+
"ec2:DescribeVpcs",
|
|
77
|
+
"ec2:DescribeSubnets",
|
|
78
|
+
"ec2:DescribeSecurityGroups"
|
|
79
|
+
],
|
|
80
|
+
"Resource": "*",
|
|
81
|
+
"Condition": {
|
|
82
|
+
"StringEquals": {
|
|
83
|
+
"ec2:Region": "us-east-1"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Verification
|
|
92
|
+
|
|
93
|
+
Test your permissions with:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# Verify identity
|
|
97
|
+
aws sts get-caller-identity --profile replimap
|
|
98
|
+
|
|
99
|
+
# Test VPC access
|
|
100
|
+
aws ec2 describe-vpcs --profile replimap --region us-east-1
|
|
101
|
+
|
|
102
|
+
# Test with RepliMap
|
|
103
|
+
replimap scan --profile replimap --region us-east-1
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Security Best Practices
|
|
107
|
+
|
|
108
|
+
1. **Use Read-Only Permissions**: Never grant write permissions to RepliMap
|
|
109
|
+
2. **Restrict by Region**: Limit access to specific regions if possible
|
|
110
|
+
3. **Use IAM Roles**: Prefer roles over access keys when running on AWS
|
|
111
|
+
4. **Rotate Credentials**: Regularly rotate access keys
|
|
112
|
+
5. **Enable CloudTrail**: Monitor API calls made by RepliMap
|
|
113
|
+
|
|
114
|
+
## What RepliMap Does NOT Do
|
|
115
|
+
|
|
116
|
+
- ❌ Create, modify, or delete any AWS resources
|
|
117
|
+
- ❌ Access S3 bucket contents (only metadata)
|
|
118
|
+
- ❌ Read database contents
|
|
119
|
+
- ❌ Access secrets or credentials
|
|
120
|
+
- ❌ Make cross-account API calls
|
|
121
|
+
- ❌ Upload any data to external services
|
|
122
|
+
|
|
123
|
+
## Permissions by Resource Type
|
|
124
|
+
|
|
125
|
+
| Resource | Actions Required | Purpose |
|
|
126
|
+
|----------|-----------------|---------|
|
|
127
|
+
| VPC | `ec2:DescribeVpcs` | Scan VPC configurations |
|
|
128
|
+
| Subnet | `ec2:DescribeSubnets` | Scan subnet configurations |
|
|
129
|
+
| Security Group | `ec2:DescribeSecurityGroups` | Scan security rules |
|
|
130
|
+
| EC2 Instance | `ec2:DescribeInstances` | Scan instance configurations |
|
|
131
|
+
| RDS Instance | `rds:DescribeDBInstances` | Scan database configurations |
|
|
132
|
+
| S3 Bucket | `s3:ListAllMyBuckets`, `s3:GetBucket*` | Scan bucket configurations |
|
|
133
|
+
| STS | `sts:GetCallerIdentity` | Verify authentication |
|
|
134
|
+
|
|
135
|
+
## Troubleshooting
|
|
136
|
+
|
|
137
|
+
### "Access Denied" Error
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
AccessDeniedException: User: arn:aws:iam::123456789012:user/replimap
|
|
141
|
+
is not authorized to perform: ec2:DescribeVpcs
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**Solution**: Ensure the IAM policy is correctly attached to your user/role.
|
|
145
|
+
|
|
146
|
+
### "InvalidClientTokenId" Error
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
InvalidClientTokenId: The security token included in the request is invalid.
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**Solution**: Check your AWS credentials are correctly configured:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
aws configure list --profile replimap
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Region-Specific Issues
|
|
159
|
+
|
|
160
|
+
If you only have access to specific regions:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# Specify the region explicitly
|
|
164
|
+
replimap scan --profile replimap --region eu-west-1
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Questions?
|
|
168
|
+
|
|
169
|
+
- Open an issue on [GitHub](https://github.com/replimap/replimap/issues)
|
|
170
|
+
- Email: support@replimap.io
|
replimap-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
RepliMap Proprietary License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2025 RepliMap. All rights reserved.
|
|
4
|
+
|
|
5
|
+
This software and associated documentation files (the "Software") are the
|
|
6
|
+
proprietary property of RepliMap and are protected by copyright law and
|
|
7
|
+
international treaties.
|
|
8
|
+
|
|
9
|
+
PERMITTED USE:
|
|
10
|
+
- Personal evaluation and testing
|
|
11
|
+
- Use in accordance with a valid commercial license agreement
|
|
12
|
+
|
|
13
|
+
RESTRICTIONS:
|
|
14
|
+
Without a valid commercial license, you may NOT:
|
|
15
|
+
- Use the Software in production environments
|
|
16
|
+
- Redistribute, sublicense, or sell copies of the Software
|
|
17
|
+
- Modify, adapt, or create derivative works based on the Software
|
|
18
|
+
- Remove or alter any proprietary notices or labels on the Software
|
|
19
|
+
|
|
20
|
+
COMMERCIAL LICENSING:
|
|
21
|
+
For commercial use, enterprise licensing, or custom deployments, please
|
|
22
|
+
contact: licensing@replimap.io
|
|
23
|
+
|
|
24
|
+
DISCLAIMER:
|
|
25
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
26
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
27
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
28
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
29
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
30
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
31
|
+
SOFTWARE.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
include LICENSE
|
|
2
|
+
include README.md
|
|
3
|
+
include CHANGELOG.md
|
|
4
|
+
recursive-include replimap/templates *.tf *.tf.j2 *.jinja2
|
|
5
|
+
recursive-include replimap *.py
|
|
6
|
+
global-exclude __pycache__
|
|
7
|
+
global-exclude *.pyc
|
|
8
|
+
global-exclude *.pyo
|
|
9
|
+
global-exclude .git*
|
|
10
|
+
global-exclude .env*
|
|
11
|
+
prune replimap-backend
|
|
12
|
+
prune tests
|
|
13
|
+
prune docs
|