replimap 0.3.39__tar.gz → 0.3.41__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.3.39 → replimap-0.3.41}/PKG-INFO +1 -1
- {replimap-0.3.39 → replimap-0.3.41}/pyproject.toml +6 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/__init__.py +1 -1
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/engine.py +4 -2
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/hooks.py +3 -3
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/models.py +25 -6
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/trust_center.py +6 -6
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/analyze.py +64 -13
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/audit.py +91 -35
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/codify.py +21 -12
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/drift.py +317 -104
- replimap-0.3.41/replimap/cli/commands/explain.py +499 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/scan.py +11 -12
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/errors.py +85 -16
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/utils/__init__.py +11 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/utils/aws_session.py +131 -2
- replimap-0.3.41/replimap/cli/utils/cache_resolution.py +154 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/utils/helpers.py +2 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/cache_manager.py +5 -1
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/resilience/circuit_breaker.py +7 -7
- {replimap-0.3.39 → replimap-0.3.41}/replimap/drift/models.py +72 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/drift/reporter.py +31 -4
- replimap-0.3.39/replimap/cli/commands/explain.py +0 -261
- {replimap-0.3.39 → replimap-0.3.41}/.gitignore +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/LICENSE +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/MANIFEST.in +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/README.md +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/docs/assets/demo.gif +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/api.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/apra_cps234_mapping.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/checkov_runner.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/classifier.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/exporters.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/fix_suggestions.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/nzism_mapping.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/rbnz_bs11_mapping.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/remediation/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/remediation/generator.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/remediation/models.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/remediation/templates/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/remediation/templates/ec2.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/remediation/templates/kms.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/remediation/templates/rds.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/remediation/templates/s3.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/renderer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/reporter.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/soc2_mapping.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/templates/audit_report.html.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/audit/terminal_reporter.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cache/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cache/snapshots.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/cache.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/clone.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/completion.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/cost.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/deps.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/doctor.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/dr.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/graph.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/iam.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/license.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/load.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/profiles.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/remediate.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/residency.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/snapshot.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/transfer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/trends.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/trust_center.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/unused.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/upgrade.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/commands/validate.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/common_options.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/completers.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/completion.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/config.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/context.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/error_catalog.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/error_renderer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/output.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/params/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/params/definitions.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/params/registry.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/params/schema.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/state.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/telemetry.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/utils/console.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/utils/console_links.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/utils/error_handler.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/utils/options.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/utils/tips.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cli/utils/update_checker.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/empty_pruner.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/generators/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/generators/backend.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/generators/hcl.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/generators/imports.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/generators/output.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/generators/readme.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/generators/variables.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/hcl_types.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/pipeline.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/schema_mapper.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/schema_rules.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/set_sorter.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/transformers/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/transformers/base.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/transformers/cleanup_transformer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/transformers/data_source_filter.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/transformers/default_filter.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/transformers/global_filter.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/transformers/iam_normalizer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/transformers/import_resolver.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/transformers/lifecycle_protector.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/transformers/managed_filter.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/transformers/naming_transformer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/transformers/ref_transformer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/transformers/schema_filter.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/transformers/secrets_transformer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/transformers/sg_splitter.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/transforms.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/type_caster.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/utils/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/codify/utils/config_integrity_checker.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/compliance/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/compliance/audit/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/compliance/audit/renderer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/compliance/codify_checker.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/compliance/compliance_tf_registry.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/compliance/data_residency.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/compliance/drift/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/compliance/drift/exemptions.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/compliance/drift/mapping.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/compliance/drift/report.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/compliance/drift/rules.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/analysis/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/analysis/centrality.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/async_aws.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/aws_config.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/bootstrap.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/browser.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/cache.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/circuit_breaker.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/concurrency.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/config.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/constants.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/context.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/enrichment/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/enrichment/enricher.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/enrichment/metadata_extractor.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/enrichment/network_analyzer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/errors.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/filters.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/first_run.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/formatters/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/formatters/sarif.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/graph/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/graph/algorithms.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/graph_engine.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/graph_tracer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/identity.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/identity_resolver.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/logging.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/models.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/naming.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/operations.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/pagination.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/pagination_config.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/rate_limiter.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/resilience/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/resilience/errors/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/resilience/errors/classifier.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/resilience/errors/loader.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/resilience/errors/rules.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/retry.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/sanitizer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/scope.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/security/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/security/credential_checker.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/security/drift.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/security/global_sanitizer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/security/iam_generator.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/security/patterns.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/security/redactor.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/security/scrubber.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/security/session_manager.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/security/storage.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/selection.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/signals.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/state.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/storage.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/topology_constraints.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/unified_storage/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/unified_storage/adapter.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/unified_storage/base.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/unified_storage/engine.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/unified_storage/migrate.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/core/unified_storage/sqlite_backend.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cost/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cost/constants.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cost/estimator.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cost/explorer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cost/local_rightsizer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cost/models.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cost/pricing.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cost/pricing_engine.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cost/reporter.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cost/ri_aware.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cost/rightsizer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cost/transfer_analyzer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cost/trends.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/cost/unused_detector.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/data/field_hints.yaml +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/data/schema_rules.yaml +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/decisions/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/decisions/cli.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/decisions/manager.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/decisions/models.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/dependencies/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/dependencies/graph_builder.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/dependencies/impact_calculator.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/dependencies/models.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/dependencies/reporter.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/dependencies/weights.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/deps/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/deps/analyzers/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/deps/analyzers/asg.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/deps/analyzers/ec2.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/deps/analyzers/elasticache.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/deps/analyzers/elb.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/deps/analyzers/graph_fallback.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/deps/analyzers/iam_role.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/deps/analyzers/lambda_func.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/deps/analyzers/rds.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/deps/analyzers/s3.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/deps/analyzers/security_group.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/deps/base_analyzer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/deps/blast_radius.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/deps/implicit_resolver.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/deps/models.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/deps/reporter.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/dr/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/dr/readiness.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/drift/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/drift/comparator.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/drift/engine.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/drift/ignore.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/drift/normalizer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/drift/state_parser.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/drift/templates/drift_report.html.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/extraction/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/extraction/hints.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/graph/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/graph/aggregation.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/graph/builder.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/graph/cost_overlay.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/graph/cross_region.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/graph/drift.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/graph/environment.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/graph/filters.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/graph/formatters/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/graph/formatters/d3.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/graph/formatters/json_format.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/graph/formatters/mermaid.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/graph/global_context.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/graph/grouper.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/graph/layout.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/graph/link_classification.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/graph/multi_region.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/graph/naming.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/graph/orphan_detection.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/graph/summary_links.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/graph/templates/graph.html.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/graph/tool_modes.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/graph/views.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/graph/visualizer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/licensing/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/licensing/cache.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/licensing/ci_adapter.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/licensing/crypto/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/licensing/crypto/keys.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/licensing/crypto/time_validator.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/licensing/developer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/licensing/fingerprint.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/licensing/gates.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/licensing/manager.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/licensing/models.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/licensing/prompts.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/licensing/secure_manager.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/licensing/secure_models.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/licensing/server/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/licensing/server/signer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/licensing/tracker.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/licensing/verifier.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/licensing/version_check.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/main.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/mcp_server.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/migrations/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/migrations/sanitize_cache.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/patterns/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/patterns/local_module.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/recovery/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/recovery/actions.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/recovery/engine.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/recovery/gray_zone.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/renderers/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/renderers/audit_annotator.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/renderers/backend.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/renderers/base.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/renderers/cloudformation.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/renderers/file_router.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/renderers/import_generator.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/renderers/name_generator.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/renderers/preloader.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/renderers/pulumi.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/renderers/refactoring.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/renderers/terraform.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/renderers/terraform_v2.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/renderers/variable_extractor.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/scanners/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/scanners/async_base.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/scanners/async_vpc_scanner.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/scanners/base.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/scanners/compute_scanner.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/scanners/ec2_scanner.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/scanners/elasticache_scanner.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/scanners/iam_scanner.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/scanners/implementations/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/scanners/implementations/s3_scanner.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/scanners/implementations/vpc_scanner.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/scanners/incremental.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/scanners/legacy_adapter.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/scanners/messaging_scanner.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/scanners/monitoring_scanner.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/scanners/networking_scanner.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/scanners/rds_scanner.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/scanners/s3_scanner.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/scanners/storage_scanner.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/scanners/unified_base.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/scanners/unified_scanners.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/scanners/vpc_scanner.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/snapshot/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/snapshot/differ.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/snapshot/models.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/snapshot/reporter.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/snapshot/store.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/templates/autoscaling_group.tf.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/templates/db_parameter_group.tf.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/templates/db_subnet_group.tf.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/templates/ebs_volume.tf.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/templates/ec2_instance.tf.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/templates/elasticache_cluster.tf.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/templates/elasticache_subnet_group.tf.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/templates/internet_gateway.tf.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/templates/launch_template.tf.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/templates/lb.tf.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/templates/lb_listener.tf.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/templates/lb_target_group.tf.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/templates/nat_gateway.tf.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/templates/network_acl.tf.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/templates/rds_instance.tf.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/templates/route_table.tf.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/templates/s3_bucket.tf.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/templates/s3_bucket_policy.tf.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/templates/security_group.tf.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/templates/sns_topic.tf.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/templates/sqs_queue.tf.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/templates/subnet.tf.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/templates/vpc.tf.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/templates/vpc_endpoint.tf.j2 +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/transformers/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/transformers/base.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/transformers/downsizer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/transformers/network_remapper.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/transformers/renamer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/transformers/sanitizer.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/ui/__init__.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/ui/console.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/ui/rich_output.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/ui/snapshot_panels.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/replimap/ui/snapshot_tables.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/scripts/check_stdout_hygiene.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/scripts/record_cassettes.py +0 -0
- {replimap-0.3.39 → replimap-0.3.41}/scripts/verify_compliance_tf_subdomains.py +0 -0
|
@@ -195,6 +195,12 @@ python_files = ["test_*.py"]
|
|
|
195
195
|
python_functions = ["test_*"]
|
|
196
196
|
addopts = "-v --tb=short"
|
|
197
197
|
asyncio_mode = "auto"
|
|
198
|
+
filterwarnings = [
|
|
199
|
+
# Regression guard (Batch 4 D-4): a reintroduced datetime.utcnow() fails the suite.
|
|
200
|
+
# Scoped to the utcnow message only — do NOT broaden to error::DeprecationWarning,
|
|
201
|
+
# some tests exercise intentional deprecations (e.g. GraphEngine in test_cache.py).
|
|
202
|
+
"error:datetime.datetime.utcnow:DeprecationWarning",
|
|
203
|
+
]
|
|
198
204
|
markers = [
|
|
199
205
|
"json_output: tests for JSON output format correctness",
|
|
200
206
|
"stdout_hygiene: tests for stdout cleanliness in JSON mode",
|
|
@@ -38,9 +38,11 @@ class AuditEngine:
|
|
|
38
38
|
|
|
39
39
|
Usage:
|
|
40
40
|
engine = AuditEngine(session, region, profile="prod")
|
|
41
|
+
# Callers choose the artifact locations; the audit CLI defaults to
|
|
42
|
+
# ~/.replimap/reports/<timestamp>/{terraform/, audit_report.html}
|
|
41
43
|
results, report_path = engine.run(
|
|
42
|
-
output_dir=
|
|
43
|
-
report_path=
|
|
44
|
+
output_dir=artifacts_dir / "terraform",
|
|
45
|
+
report_path=artifacts_dir / "audit_report.html",
|
|
44
46
|
)
|
|
45
47
|
"""
|
|
46
48
|
|
|
@@ -19,7 +19,7 @@ import logging
|
|
|
19
19
|
import threading
|
|
20
20
|
import uuid
|
|
21
21
|
from collections.abc import Callable
|
|
22
|
-
from datetime import datetime
|
|
22
|
+
from datetime import UTC, datetime
|
|
23
23
|
from typing import TYPE_CHECKING, Any
|
|
24
24
|
|
|
25
25
|
from .classifier import classifier
|
|
@@ -144,7 +144,7 @@ class AuditHooks:
|
|
|
144
144
|
**kwargs: Any,
|
|
145
145
|
) -> None:
|
|
146
146
|
"""Handler called before each API request."""
|
|
147
|
-
_timing_context.start_time = datetime.
|
|
147
|
+
_timing_context.start_time = datetime.now(UTC)
|
|
148
148
|
_timing_context.params = params if self.capture_params else {}
|
|
149
149
|
|
|
150
150
|
def _after_call_handler(
|
|
@@ -155,7 +155,7 @@ class AuditHooks:
|
|
|
155
155
|
**kwargs: Any,
|
|
156
156
|
) -> None:
|
|
157
157
|
"""Handler called after each API response."""
|
|
158
|
-
end_time = datetime.
|
|
158
|
+
end_time = datetime.now(UTC)
|
|
159
159
|
|
|
160
160
|
# Calculate duration
|
|
161
161
|
start_time = getattr(_timing_context, "start_time", end_time)
|
|
@@ -8,11 +8,30 @@ audit sessions, and compliance reports.
|
|
|
8
8
|
from __future__ import annotations
|
|
9
9
|
|
|
10
10
|
from dataclasses import dataclass, field
|
|
11
|
-
from datetime import datetime
|
|
11
|
+
from datetime import UTC, datetime
|
|
12
12
|
from enum import Enum
|
|
13
13
|
from typing import Any
|
|
14
14
|
|
|
15
15
|
|
|
16
|
+
def _ensure_utc(dt: datetime) -> datetime:
|
|
17
|
+
"""
|
|
18
|
+
Coerce a naive datetime to UTC-aware.
|
|
19
|
+
|
|
20
|
+
Legacy persisted sessions (written before the utcnow() removal) contain
|
|
21
|
+
naive ISO timestamps without an offset. New timestamps are UTC-aware, so
|
|
22
|
+
naive values loaded from old files must be tagged as UTC to keep them
|
|
23
|
+
comparable (naive vs aware comparison raises TypeError).
|
|
24
|
+
|
|
25
|
+
Load-bearing assumption: legacy naive values were written by
|
|
26
|
+
datetime.utcnow(), i.e. they already represent UTC wall-clock time.
|
|
27
|
+
Tagging them with UTC changes no instant — this is semantically correct,
|
|
28
|
+
not a best-effort approximation.
|
|
29
|
+
"""
|
|
30
|
+
if dt.tzinfo is None:
|
|
31
|
+
return dt.replace(tzinfo=UTC)
|
|
32
|
+
return dt
|
|
33
|
+
|
|
34
|
+
|
|
16
35
|
class APICategory(Enum):
|
|
17
36
|
"""
|
|
18
37
|
AWS API operation categories.
|
|
@@ -111,7 +130,7 @@ class APICallRecord:
|
|
|
111
130
|
def from_dict(cls, data: dict[str, Any]) -> APICallRecord:
|
|
112
131
|
"""Create from dictionary."""
|
|
113
132
|
return cls(
|
|
114
|
-
timestamp=datetime.fromisoformat(data["timestamp"]),
|
|
133
|
+
timestamp=_ensure_utc(datetime.fromisoformat(data["timestamp"])),
|
|
115
134
|
duration_ms=data["duration_ms"],
|
|
116
135
|
service=data["service"],
|
|
117
136
|
operation=data["operation"],
|
|
@@ -139,7 +158,7 @@ class AuditSession:
|
|
|
139
158
|
session_name: str | None = None
|
|
140
159
|
|
|
141
160
|
# Timing
|
|
142
|
-
start_time: datetime = field(default_factory=datetime.
|
|
161
|
+
start_time: datetime = field(default_factory=lambda: datetime.now(UTC))
|
|
143
162
|
end_time: datetime | None = None
|
|
144
163
|
|
|
145
164
|
# Statistics (updated incrementally)
|
|
@@ -199,7 +218,7 @@ class AuditSession:
|
|
|
199
218
|
|
|
200
219
|
def close(self) -> None:
|
|
201
220
|
"""Mark session as complete."""
|
|
202
|
-
self.end_time = datetime.
|
|
221
|
+
self.end_time = datetime.now(UTC)
|
|
203
222
|
|
|
204
223
|
def to_dict(self) -> dict[str, Any]:
|
|
205
224
|
"""Convert to dictionary for serialization."""
|
|
@@ -227,9 +246,9 @@ class AuditSession:
|
|
|
227
246
|
session = cls(
|
|
228
247
|
session_id=data["session_id"],
|
|
229
248
|
session_name=data.get("session_name"),
|
|
230
|
-
start_time=datetime.fromisoformat(data["start_time"]),
|
|
249
|
+
start_time=_ensure_utc(datetime.fromisoformat(data["start_time"])),
|
|
231
250
|
end_time=(
|
|
232
|
-
datetime.fromisoformat(data["end_time"])
|
|
251
|
+
_ensure_utc(datetime.fromisoformat(data["end_time"]))
|
|
233
252
|
if data.get("end_time")
|
|
234
253
|
else None
|
|
235
254
|
),
|
|
@@ -33,7 +33,7 @@ import threading
|
|
|
33
33
|
import uuid
|
|
34
34
|
from collections.abc import Generator
|
|
35
35
|
from contextlib import contextmanager
|
|
36
|
-
from datetime import datetime, timedelta
|
|
36
|
+
from datetime import UTC, datetime, timedelta
|
|
37
37
|
from pathlib import Path
|
|
38
38
|
from typing import TYPE_CHECKING, Any
|
|
39
39
|
|
|
@@ -192,7 +192,7 @@ class TrustCenter:
|
|
|
192
192
|
audit_session = AuditSession(
|
|
193
193
|
session_id=session_id,
|
|
194
194
|
session_name=name,
|
|
195
|
-
start_time=datetime.
|
|
195
|
+
start_time=datetime.now(UTC),
|
|
196
196
|
metadata=metadata or {},
|
|
197
197
|
)
|
|
198
198
|
|
|
@@ -282,7 +282,7 @@ class TrustCenter:
|
|
|
282
282
|
audit_session = AuditSession(
|
|
283
283
|
session_id=session_id,
|
|
284
284
|
session_name=name,
|
|
285
|
-
start_time=datetime.
|
|
285
|
+
start_time=datetime.now(UTC),
|
|
286
286
|
metadata=metadata or {},
|
|
287
287
|
)
|
|
288
288
|
|
|
@@ -363,7 +363,7 @@ class TrustCenter:
|
|
|
363
363
|
account_id: AWS account ID
|
|
364
364
|
"""
|
|
365
365
|
record = APICallRecord(
|
|
366
|
-
timestamp=datetime.
|
|
366
|
+
timestamp=datetime.now(UTC),
|
|
367
367
|
duration_ms=duration_ms,
|
|
368
368
|
service=service,
|
|
369
369
|
operation=operation,
|
|
@@ -397,7 +397,7 @@ class TrustCenter:
|
|
|
397
397
|
Returns:
|
|
398
398
|
TrustCenterReport instance
|
|
399
399
|
"""
|
|
400
|
-
period_end = period_end or datetime.
|
|
400
|
+
period_end = period_end or datetime.now(UTC)
|
|
401
401
|
period_start = period_start or (period_end - timedelta(days=30))
|
|
402
402
|
|
|
403
403
|
# Collect sessions
|
|
@@ -463,7 +463,7 @@ class TrustCenter:
|
|
|
463
463
|
|
|
464
464
|
return TrustCenterReport(
|
|
465
465
|
report_id=str(uuid.uuid4())[:8],
|
|
466
|
-
generated_at=datetime.
|
|
466
|
+
generated_at=datetime.now(UTC),
|
|
467
467
|
report_period_start=period_start,
|
|
468
468
|
report_period_end=period_end,
|
|
469
469
|
tool_name=self.TOOL_NAME,
|
|
@@ -14,6 +14,10 @@ V3 Architecture:
|
|
|
14
14
|
- JSON mode available via global --format flag
|
|
15
15
|
|
|
16
16
|
Usage:
|
|
17
|
+
# Analyze the cached scan for a profile/region (no file needed)
|
|
18
|
+
replimap analyze -p prod --critical
|
|
19
|
+
replimap analyze -p prod --region eu-west-1 --spof
|
|
20
|
+
|
|
17
21
|
# Analyze a saved graph (JSON or SQLite)
|
|
18
22
|
replimap analyze graph.db --critical
|
|
19
23
|
replimap analyze graph.json --critical
|
|
@@ -26,6 +30,9 @@ Usage:
|
|
|
26
30
|
|
|
27
31
|
# Full analysis report
|
|
28
32
|
replimap analyze graph.db --report
|
|
33
|
+
|
|
34
|
+
Note: the short flag -r belongs to --report (pre-existing); --region has no
|
|
35
|
+
short flag here.
|
|
29
36
|
"""
|
|
30
37
|
|
|
31
38
|
from __future__ import annotations
|
|
@@ -37,6 +44,7 @@ import typer
|
|
|
37
44
|
from rich.table import Table
|
|
38
45
|
|
|
39
46
|
from replimap.cli.errors import EXIT_GENERAL_ERROR, enhanced_cli_error_handler
|
|
47
|
+
from replimap.cli.utils import resolve_cached_scan
|
|
40
48
|
from replimap.core.analysis.centrality import (
|
|
41
49
|
AttackSurfaceAnalyzer,
|
|
42
50
|
CentralityAnalyzer,
|
|
@@ -101,10 +109,24 @@ def register(app: typer.Typer, panel: str | None = None) -> None:
|
|
|
101
109
|
@enhanced_cli_error_handler
|
|
102
110
|
def analyze_command(
|
|
103
111
|
ctx: typer.Context,
|
|
104
|
-
graph_file: Path = typer.Argument(
|
|
105
|
-
|
|
106
|
-
help=
|
|
107
|
-
|
|
112
|
+
graph_file: Path | None = typer.Argument(
|
|
113
|
+
None,
|
|
114
|
+
help=(
|
|
115
|
+
"Path to graph file (.db for SQLite, .json for legacy). "
|
|
116
|
+
"Omit to analyze the cached scan for --profile/--region."
|
|
117
|
+
),
|
|
118
|
+
),
|
|
119
|
+
# === Common Options ===
|
|
120
|
+
profile: str | None = typer.Option(
|
|
121
|
+
None,
|
|
122
|
+
"--profile",
|
|
123
|
+
"-p",
|
|
124
|
+
help="AWS profile whose cached scan to analyze (when GRAPH_FILE is omitted)",
|
|
125
|
+
),
|
|
126
|
+
region: str | None = typer.Option(
|
|
127
|
+
None,
|
|
128
|
+
"--region",
|
|
129
|
+
help="AWS region of the cached scan (when GRAPH_FILE is omitted)",
|
|
108
130
|
),
|
|
109
131
|
# === Analysis Options ===
|
|
110
132
|
critical: bool = typer.Option(
|
|
@@ -176,15 +198,18 @@ def register(app: typer.Typer, panel: str | None = None) -> None:
|
|
|
176
198
|
|
|
177
199
|
This command loads a previously saved graph and performs various
|
|
178
200
|
analyses to identify critical resources, single points of failure,
|
|
179
|
-
and attack surface exposure.
|
|
201
|
+
and attack surface exposure. Without a GRAPH_FILE argument it uses
|
|
202
|
+
the cached scan for --profile/--region (run `replimap scan` first).
|
|
180
203
|
|
|
181
204
|
\b
|
|
182
205
|
|
|
183
206
|
Examples:
|
|
184
207
|
|
|
185
|
-
replimap analyze
|
|
208
|
+
replimap analyze -p prod --critical
|
|
209
|
+
|
|
210
|
+
replimap analyze -p prod --region eu-west-1 --spof
|
|
186
211
|
|
|
187
|
-
replimap analyze graph.db --
|
|
212
|
+
replimap analyze graph.db --critical
|
|
188
213
|
|
|
189
214
|
replimap analyze graph.db --blast-radius vpc-12345
|
|
190
215
|
|
|
@@ -198,6 +223,29 @@ def register(app: typer.Typer, panel: str | None = None) -> None:
|
|
|
198
223
|
gctx: GlobalContext = ctx.obj
|
|
199
224
|
output = gctx.output
|
|
200
225
|
|
|
226
|
+
# Resolve the graph source: explicit GRAPH_FILE wins; otherwise use
|
|
227
|
+
# the cached scan for profile/region. Identity derivation + lookup
|
|
228
|
+
# live in the shared single source of truth also used by scan's
|
|
229
|
+
# write path (cli/utils/cache_resolution.py), so the read path can
|
|
230
|
+
# never drift from the cache key scan writes.
|
|
231
|
+
if graph_file is None:
|
|
232
|
+
effective_profile, effective_region, graph_file = resolve_cached_scan(
|
|
233
|
+
profile, region, gctx
|
|
234
|
+
)
|
|
235
|
+
if graph_file is None:
|
|
236
|
+
output.error(
|
|
237
|
+
f"No cached scan found for profile '{effective_profile}' "
|
|
238
|
+
f"region '{effective_region}'."
|
|
239
|
+
)
|
|
240
|
+
output.log(
|
|
241
|
+
f"Run: replimap scan -p {effective_profile} -r {effective_region}"
|
|
242
|
+
)
|
|
243
|
+
raise typer.Exit(EXIT_GENERAL_ERROR)
|
|
244
|
+
output.progress(f"Using cached scan: {graph_file}")
|
|
245
|
+
elif not graph_file.exists():
|
|
246
|
+
output.error(f"Graph file not found: {graph_file}")
|
|
247
|
+
raise typer.Exit(EXIT_GENERAL_ERROR)
|
|
248
|
+
|
|
201
249
|
# Load the graph
|
|
202
250
|
try:
|
|
203
251
|
graph = _load_graph(graph_file)
|
|
@@ -293,7 +341,8 @@ def _show_critical_analysis(
|
|
|
293
341
|
|
|
294
342
|
table = Table(show_header=True, header_style="bold magenta")
|
|
295
343
|
table.add_column("Rank", style="dim", width=4)
|
|
296
|
-
|
|
344
|
+
# overflow="fold": IDs must stay complete (copy-paste into --blast-radius)
|
|
345
|
+
table.add_column("Resource ID", style="cyan", overflow="fold")
|
|
297
346
|
table.add_column("Type", style="green")
|
|
298
347
|
table.add_column("Level", width=10)
|
|
299
348
|
table.add_column("Score", justify="right", width=6)
|
|
@@ -311,7 +360,7 @@ def _show_critical_analysis(
|
|
|
311
360
|
level_style = level_colors.get(result.level, "white")
|
|
312
361
|
table.add_row(
|
|
313
362
|
str(i),
|
|
314
|
-
result.resource_id
|
|
363
|
+
result.resource_id,
|
|
315
364
|
result.resource_type,
|
|
316
365
|
f"[{level_style}]{result.level.value.upper()}[/]",
|
|
317
366
|
f"{result.score:.1f}",
|
|
@@ -355,14 +404,15 @@ def _show_spof_analysis(
|
|
|
355
404
|
return
|
|
356
405
|
|
|
357
406
|
table = Table(show_header=True, header_style="bold magenta")
|
|
358
|
-
|
|
407
|
+
# overflow="fold": IDs must stay complete (copy-paste into --blast-radius)
|
|
408
|
+
table.add_column("Resource ID", style="cyan", overflow="fold")
|
|
359
409
|
table.add_column("Type", style="green")
|
|
360
410
|
table.add_column("Dependents", justify="right")
|
|
361
411
|
table.add_column("Percentile", justify="right")
|
|
362
412
|
|
|
363
413
|
for spof in spofs:
|
|
364
414
|
table.add_row(
|
|
365
|
-
spof.resource_id
|
|
415
|
+
spof.resource_id,
|
|
366
416
|
spof.resource_type,
|
|
367
417
|
str(spof.dependent_count),
|
|
368
418
|
f"{spof.in_degree_percentile:.0f}%",
|
|
@@ -518,13 +568,14 @@ def _show_attack_surface(
|
|
|
518
568
|
table = Table(show_header=True, header_style="bold")
|
|
519
569
|
table.add_column("Category", style="cyan")
|
|
520
570
|
table.add_column("Count", justify="right")
|
|
521
|
-
|
|
571
|
+
# overflow="fold": IDs must stay complete (copy-paste into --blast-radius)
|
|
572
|
+
table.add_column("Resources", style="dim", overflow="fold")
|
|
522
573
|
|
|
523
574
|
def format_resources(resources: list[str], max_show: int = 3) -> str:
|
|
524
575
|
if not resources:
|
|
525
576
|
return "-"
|
|
526
577
|
shown = resources[:max_show]
|
|
527
|
-
result_str = ", ".join(
|
|
578
|
+
result_str = ", ".join(shown)
|
|
528
579
|
if len(resources) > max_show:
|
|
529
580
|
result_str += f" (+{len(resources) - max_show} more)"
|
|
530
581
|
return result_str
|
|
@@ -33,6 +33,15 @@ if TYPE_CHECKING:
|
|
|
33
33
|
from replimap.cli.output import OutputManager
|
|
34
34
|
|
|
35
35
|
|
|
36
|
+
def _default_reports_dir(timestamp: str) -> Path:
|
|
37
|
+
"""Default artifact directory for an audit run: ~/.replimap/reports/<ts>/.
|
|
38
|
+
|
|
39
|
+
Keeps the user's CWD clean. One timestamped subdirectory per run
|
|
40
|
+
accumulates under ~/.replimap/reports/ (no automatic cleanup).
|
|
41
|
+
"""
|
|
42
|
+
return Path.home() / ".replimap" / "reports" / timestamp
|
|
43
|
+
|
|
44
|
+
|
|
36
45
|
def _get_compliance_mappers(framework: str) -> list[tuple[str, Any]]:
|
|
37
46
|
"""Get compliance mapping functions for the specified framework(s).
|
|
38
47
|
|
|
@@ -290,12 +299,13 @@ def _run_evidence_audit(
|
|
|
290
299
|
company: str,
|
|
291
300
|
audit_period: str,
|
|
292
301
|
ignore_file: Path | None,
|
|
293
|
-
output_file: Path,
|
|
302
|
+
output_file: Path | None,
|
|
294
303
|
report_format: str,
|
|
295
304
|
no_cache: bool,
|
|
296
305
|
refresh: bool,
|
|
297
306
|
vpc: str | None,
|
|
298
307
|
output: OutputManager,
|
|
308
|
+
run_timestamp: str,
|
|
299
309
|
) -> None:
|
|
300
310
|
"""Run SOC 2 evidence audit using drift detection pipeline.
|
|
301
311
|
|
|
@@ -438,30 +448,32 @@ def _run_evidence_audit(
|
|
|
438
448
|
period=audit_period,
|
|
439
449
|
)
|
|
440
450
|
|
|
441
|
-
#
|
|
442
|
-
|
|
443
|
-
|
|
451
|
+
# Default location: ~/.replimap/reports/<run timestamp>/ (keeps CWD
|
|
452
|
+
# clean; the timestamped directory preserves history for audit
|
|
453
|
+
# comparisons). Explicit --output always wins, exactly as given.
|
|
454
|
+
default_dir = _default_reports_dir(run_timestamp)
|
|
444
455
|
|
|
445
|
-
|
|
446
|
-
ts = datetime.now(UTC).strftime("%Y%m%d-%H%M%S")
|
|
447
|
-
|
|
448
|
-
if report_format in ("markdown", "md"):
|
|
449
|
-
out_path = output_file if user_set_output else Path(f"./soc2-evidence-{ts}.md")
|
|
450
|
-
out_path.write_text(renderer.render())
|
|
451
|
-
output.success(f"Evidence report: {out_path.absolute()}")
|
|
452
|
-
elif report_format == "json":
|
|
456
|
+
if report_format == "json":
|
|
453
457
|
import json as json_mod
|
|
454
458
|
|
|
455
459
|
out_path = (
|
|
456
|
-
output_file
|
|
460
|
+
output_file
|
|
461
|
+
if output_file is not None
|
|
462
|
+
else default_dir / "soc2-evidence.json"
|
|
457
463
|
)
|
|
458
|
-
|
|
459
|
-
|
|
464
|
+
payload = json_mod.dumps(compliance_report.to_dict(), indent=2)
|
|
465
|
+
label = "JSON report"
|
|
460
466
|
else:
|
|
461
|
-
# Default: markdown for evidence reports
|
|
462
|
-
out_path =
|
|
463
|
-
|
|
464
|
-
|
|
467
|
+
# Default: markdown for evidence reports (covers "markdown"/"md" too)
|
|
468
|
+
out_path = (
|
|
469
|
+
output_file if output_file is not None else default_dir / "soc2-evidence.md"
|
|
470
|
+
)
|
|
471
|
+
payload = renderer.render()
|
|
472
|
+
label = "Evidence report"
|
|
473
|
+
|
|
474
|
+
out_path.parent.mkdir(parents=True, exist_ok=True)
|
|
475
|
+
out_path.write_text(payload)
|
|
476
|
+
output.success(f"{label}: {out_path.absolute()}")
|
|
465
477
|
|
|
466
478
|
# JSON mode (V3 global --format json): present to stdout
|
|
467
479
|
if output.is_json:
|
|
@@ -522,11 +534,15 @@ def audit_command(
|
|
|
522
534
|
"-v",
|
|
523
535
|
help="VPC ID to scope the audit (optional)",
|
|
524
536
|
),
|
|
525
|
-
output_file: Path = typer.Option(
|
|
526
|
-
|
|
537
|
+
output_file: Path | None = typer.Option(
|
|
538
|
+
None,
|
|
527
539
|
"--output",
|
|
528
540
|
"-o",
|
|
529
|
-
help=
|
|
541
|
+
help=(
|
|
542
|
+
"Report path (default: ~/.replimap/reports/<timestamp>/ — "
|
|
543
|
+
"audit_report.html, or soc2-evidence.md/.json in --state "
|
|
544
|
+
"evidence mode)"
|
|
545
|
+
),
|
|
530
546
|
),
|
|
531
547
|
report_format: str = typer.Option(
|
|
532
548
|
"html",
|
|
@@ -535,17 +551,20 @@ def audit_command(
|
|
|
535
551
|
help="Output format: html or json",
|
|
536
552
|
),
|
|
537
553
|
# === Output Options ===
|
|
538
|
-
terraform_dir: Path = typer.Option(
|
|
539
|
-
|
|
554
|
+
terraform_dir: Path | None = typer.Option(
|
|
555
|
+
None,
|
|
540
556
|
"--terraform-dir",
|
|
541
557
|
"-t",
|
|
542
|
-
help=
|
|
558
|
+
help=(
|
|
559
|
+
"Directory for generated Terraform files "
|
|
560
|
+
"(default: ~/.replimap/reports/<timestamp>/terraform/)"
|
|
561
|
+
),
|
|
543
562
|
rich_help_panel="Output",
|
|
544
563
|
),
|
|
545
564
|
open_report: bool = typer.Option(
|
|
546
|
-
|
|
565
|
+
False,
|
|
547
566
|
"--open/--no-open",
|
|
548
|
-
help="Open report in browser after generation",
|
|
567
|
+
help="Open report in browser after generation (default: off)",
|
|
549
568
|
rich_help_panel="Output",
|
|
550
569
|
),
|
|
551
570
|
verbose: bool = typer.Option(
|
|
@@ -575,10 +594,13 @@ def audit_command(
|
|
|
575
594
|
help="Generate Terraform remediation code for findings",
|
|
576
595
|
rich_help_panel="Remediation",
|
|
577
596
|
),
|
|
578
|
-
fix_output: Path = typer.Option(
|
|
579
|
-
|
|
597
|
+
fix_output: Path | None = typer.Option(
|
|
598
|
+
None,
|
|
580
599
|
"--fix-output",
|
|
581
|
-
help=
|
|
600
|
+
help=(
|
|
601
|
+
"Directory for remediation Terraform files "
|
|
602
|
+
"(default: ~/.replimap/reports/<timestamp>/remediation/)"
|
|
603
|
+
),
|
|
582
604
|
rich_help_panel="Remediation",
|
|
583
605
|
),
|
|
584
606
|
# === Compliance Framework ===
|
|
@@ -659,17 +681,24 @@ def audit_command(
|
|
|
659
681
|
|
|
660
682
|
\b
|
|
661
683
|
|
|
684
|
+
Artifacts default to ~/.replimap/reports/<timestamp>/ (report +
|
|
685
|
+
terraform/, plus remediation/ with --fix); use -o, -t and --fix-output
|
|
686
|
+
to choose your own paths. The report is only opened in a browser when
|
|
687
|
+
--open is passed.
|
|
688
|
+
|
|
689
|
+
\b
|
|
690
|
+
|
|
662
691
|
Examples:
|
|
663
692
|
|
|
664
693
|
replimap audit --region us-east-1
|
|
665
694
|
|
|
666
695
|
replimap audit -p prod -r ap-southeast-2 -v vpc-abc123
|
|
667
696
|
|
|
668
|
-
replimap audit -r us-west-2 --
|
|
697
|
+
replimap audit -r us-west-2 --open # open HTML report in browser
|
|
669
698
|
|
|
670
|
-
replimap audit -r us-east-1 --fail-on-high
|
|
699
|
+
replimap audit -r us-east-1 --fail-on-high # CI/CD mode
|
|
671
700
|
|
|
672
|
-
replimap audit -r us-east-1 --fail-on-score 70
|
|
701
|
+
replimap audit -r us-east-1 --fail-on-score 70
|
|
673
702
|
|
|
674
703
|
replimap audit -r us-east-1 --format json
|
|
675
704
|
|
|
@@ -697,6 +726,11 @@ def audit_command(
|
|
|
697
726
|
region, effective_profile
|
|
698
727
|
)
|
|
699
728
|
|
|
729
|
+
# Default artifact location: ~/.replimap/reports/<UTC timestamp>/ so a
|
|
730
|
+
# default run never writes into the user's CWD. Explicit -o/--terraform-dir
|
|
731
|
+
# values are used exactly as given (no timestamp added).
|
|
732
|
+
run_timestamp = datetime.now(UTC).strftime("%Y%m%d-%H%M%S")
|
|
733
|
+
|
|
700
734
|
# ── SOC 2 Evidence Mode (when --state or --state-bucket is provided) ──
|
|
701
735
|
if state is not None or (state_bucket and state_key):
|
|
702
736
|
_run_evidence_audit(
|
|
@@ -718,12 +752,21 @@ def audit_command(
|
|
|
718
752
|
refresh=refresh,
|
|
719
753
|
vpc=vpc,
|
|
720
754
|
output=output,
|
|
755
|
+
run_timestamp=run_timestamp,
|
|
721
756
|
)
|
|
722
757
|
return
|
|
723
758
|
|
|
724
759
|
# ── Checkov-based audit (existing behavior) ─────────────────────────
|
|
725
760
|
from replimap.audit import AuditEngine, CheckovNotInstalledError
|
|
726
761
|
|
|
762
|
+
# Resolve default artifact paths (explicit flags always win); the report
|
|
763
|
+
# and the Terraform output share the same timestamped directory.
|
|
764
|
+
default_dir = _default_reports_dir(run_timestamp)
|
|
765
|
+
if output_file is None:
|
|
766
|
+
output_file = default_dir / "audit_report.html"
|
|
767
|
+
if terraform_dir is None:
|
|
768
|
+
terraform_dir = default_dir / "terraform"
|
|
769
|
+
|
|
727
770
|
output.log("")
|
|
728
771
|
output._stderr_console.print(
|
|
729
772
|
Panel(
|
|
@@ -823,7 +866,12 @@ def audit_command(
|
|
|
823
866
|
)
|
|
824
867
|
graph = apply_filter_to_graph(graph, filter_config)
|
|
825
868
|
|
|
826
|
-
# Run audit with the graph (skip scanning since we have it)
|
|
869
|
+
# Run audit with the graph (skip scanning since we have it).
|
|
870
|
+
# Create artifact directories up front (the default location
|
|
871
|
+
# ~/.replimap/reports/<ts>/ does not exist yet).
|
|
872
|
+
output_file.parent.mkdir(parents=True, exist_ok=True)
|
|
873
|
+
terraform_dir.mkdir(parents=True, exist_ok=True)
|
|
874
|
+
|
|
827
875
|
output.log("")
|
|
828
876
|
with Progress(
|
|
829
877
|
SpinnerColumn(),
|
|
@@ -948,7 +996,15 @@ def audit_command(
|
|
|
948
996
|
output.log(fix_gate.prompt)
|
|
949
997
|
raise typer.Exit(EXIT_GENERAL_ERROR)
|
|
950
998
|
if results.findings:
|
|
951
|
-
|
|
999
|
+
# Default remediation output shares this run's timestamped
|
|
1000
|
+
# reports directory (same policy as the report and terraform/:
|
|
1001
|
+
# never write into the CWD by default). An explicit --fix-output
|
|
1002
|
+
# is used exactly as given, no timestamp added.
|
|
1003
|
+
effective_fix_output = (
|
|
1004
|
+
fix_output if fix_output is not None else default_dir / "remediation"
|
|
1005
|
+
)
|
|
1006
|
+
_generate_remediation(results, effective_fix_output, output)
|
|
1007
|
+
output.success(f"Remediation: {effective_fix_output.absolute()}")
|
|
952
1008
|
|
|
953
1009
|
# CI/CD checks (PRO+ feature)
|
|
954
1010
|
exit_code = EXIT_SUCCESS
|
|
@@ -24,6 +24,7 @@ from replimap.cli.errors import EXIT_SUCCESS, enhanced_cli_error_handler
|
|
|
24
24
|
from replimap.cli.utils import (
|
|
25
25
|
get_aws_session,
|
|
26
26
|
resolve_effective_region,
|
|
27
|
+
resolve_scan_identity,
|
|
27
28
|
)
|
|
28
29
|
|
|
29
30
|
if TYPE_CHECKING:
|
|
@@ -214,18 +215,26 @@ def register(app: typer.Typer, panel: str | None = None) -> None:
|
|
|
214
215
|
|
|
215
216
|
effective_profile = profile or ctx_profile
|
|
216
217
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
218
|
+
if gctx is not None:
|
|
219
|
+
# Identity (profile + region) via the single source of truth
|
|
220
|
+
# shared with scan's write path and the offline read paths
|
|
221
|
+
# (cli/utils/cache_resolution.py) — the value below feeds
|
|
222
|
+
# get_or_load_graph, so it must match the cache key scan writes.
|
|
223
|
+
effective_profile, effective_region, region_source = resolve_scan_identity(
|
|
224
|
+
profile, region, gctx
|
|
225
|
+
)
|
|
226
|
+
else:
|
|
227
|
+
# Legacy dict ctx.obj (sub-command groups without a
|
|
228
|
+
# GlobalContext): no explicit_region is available; preserve the
|
|
229
|
+
# prior fallback derivation. Do NOT copy this branch into new
|
|
230
|
+
# commands — use resolve_scan_identity.
|
|
231
|
+
effective_region, region_source = resolve_effective_region(
|
|
232
|
+
region,
|
|
233
|
+
effective_profile,
|
|
234
|
+
default=ctx_region or "us-east-1",
|
|
235
|
+
)
|
|
236
|
+
if region_source == "default" and ctx_region:
|
|
237
|
+
region_source = "context"
|
|
229
238
|
|
|
230
239
|
# Use effective_region as primary_region default if not specified
|
|
231
240
|
effective_primary_region = primary_region or effective_region
|