complio 0.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. CHANGELOG.md +208 -0
  2. README.md +343 -0
  3. complio/__init__.py +48 -0
  4. complio/cli/__init__.py +0 -0
  5. complio/cli/banner.py +87 -0
  6. complio/cli/commands/__init__.py +0 -0
  7. complio/cli/commands/history.py +439 -0
  8. complio/cli/commands/scan.py +700 -0
  9. complio/cli/main.py +115 -0
  10. complio/cli/output.py +338 -0
  11. complio/config/__init__.py +17 -0
  12. complio/config/settings.py +333 -0
  13. complio/connectors/__init__.py +9 -0
  14. complio/connectors/aws/__init__.py +0 -0
  15. complio/connectors/aws/client.py +342 -0
  16. complio/connectors/base.py +135 -0
  17. complio/core/__init__.py +10 -0
  18. complio/core/registry.py +228 -0
  19. complio/core/runner.py +351 -0
  20. complio/py.typed +0 -0
  21. complio/reporters/__init__.py +7 -0
  22. complio/reporters/generator.py +417 -0
  23. complio/tests_library/__init__.py +0 -0
  24. complio/tests_library/base.py +492 -0
  25. complio/tests_library/identity/__init__.py +0 -0
  26. complio/tests_library/identity/access_key_rotation.py +302 -0
  27. complio/tests_library/identity/mfa_enforcement.py +327 -0
  28. complio/tests_library/identity/root_account_protection.py +470 -0
  29. complio/tests_library/infrastructure/__init__.py +0 -0
  30. complio/tests_library/infrastructure/cloudtrail_encryption.py +286 -0
  31. complio/tests_library/infrastructure/cloudtrail_log_validation.py +274 -0
  32. complio/tests_library/infrastructure/cloudtrail_logging.py +400 -0
  33. complio/tests_library/infrastructure/ebs_encryption.py +244 -0
  34. complio/tests_library/infrastructure/ec2_security_groups.py +321 -0
  35. complio/tests_library/infrastructure/iam_password_policy.py +460 -0
  36. complio/tests_library/infrastructure/nacl_security.py +356 -0
  37. complio/tests_library/infrastructure/rds_encryption.py +252 -0
  38. complio/tests_library/infrastructure/s3_encryption.py +301 -0
  39. complio/tests_library/infrastructure/s3_public_access.py +369 -0
  40. complio/tests_library/infrastructure/secrets_manager_encryption.py +248 -0
  41. complio/tests_library/infrastructure/vpc_flow_logs.py +287 -0
  42. complio/tests_library/logging/__init__.py +0 -0
  43. complio/tests_library/logging/cloudwatch_alarms.py +354 -0
  44. complio/tests_library/logging/cloudwatch_logs_encryption.py +281 -0
  45. complio/tests_library/logging/cloudwatch_retention.py +252 -0
  46. complio/tests_library/logging/config_enabled.py +393 -0
  47. complio/tests_library/logging/eventbridge_rules.py +460 -0
  48. complio/tests_library/logging/guardduty_enabled.py +436 -0
  49. complio/tests_library/logging/security_hub_enabled.py +416 -0
  50. complio/tests_library/logging/sns_encryption.py +273 -0
  51. complio/tests_library/network/__init__.py +0 -0
  52. complio/tests_library/network/alb_nlb_security.py +421 -0
  53. complio/tests_library/network/api_gateway_security.py +452 -0
  54. complio/tests_library/network/cloudfront_https.py +332 -0
  55. complio/tests_library/network/direct_connect_security.py +343 -0
  56. complio/tests_library/network/nacl_configuration.py +367 -0
  57. complio/tests_library/network/network_firewall.py +355 -0
  58. complio/tests_library/network/transit_gateway_security.py +318 -0
  59. complio/tests_library/network/vpc_endpoints_security.py +339 -0
  60. complio/tests_library/network/vpn_security.py +333 -0
  61. complio/tests_library/network/waf_configuration.py +428 -0
  62. complio/tests_library/security/__init__.py +0 -0
  63. complio/tests_library/security/kms_key_rotation.py +314 -0
  64. complio/tests_library/storage/__init__.py +0 -0
  65. complio/tests_library/storage/backup_encryption.py +288 -0
  66. complio/tests_library/storage/dynamodb_encryption.py +280 -0
  67. complio/tests_library/storage/efs_encryption.py +257 -0
  68. complio/tests_library/storage/elasticache_encryption.py +370 -0
  69. complio/tests_library/storage/redshift_encryption.py +252 -0
  70. complio/tests_library/storage/s3_versioning.py +264 -0
  71. complio/utils/__init__.py +26 -0
  72. complio/utils/errors.py +179 -0
  73. complio/utils/exceptions.py +151 -0
  74. complio/utils/history.py +243 -0
  75. complio/utils/logger.py +391 -0
  76. complio-0.1.1.dist-info/METADATA +385 -0
  77. complio-0.1.1.dist-info/RECORD +79 -0
  78. complio-0.1.1.dist-info/WHEEL +4 -0
  79. complio-0.1.1.dist-info/entry_points.txt +3 -0
CHANGELOG.md ADDED
@@ -0,0 +1,208 @@
1
+ # Changelog
2
+
3
+ All notable changes to Complio 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
+ ## [0.1.0] - 2025-12-29
9
+
10
+ ### 🎉 Initial Alpha Release
11
+
12
+ First public release of Complio - Compliance-as-Code Platform for AWS infrastructure.
13
+
14
+ ### Added
15
+
16
+ #### Core Features
17
+ - **Secure Credential Management**
18
+ - AES-256 encrypted credential storage at `~/.complio/credentials.enc`
19
+ - PBKDF2 key derivation with 480,000 iterations (OWASP recommended)
20
+ - Secure file permissions (chmod 600) automatically applied
21
+ - Zero credential logging - credentials filtered from all logs
22
+
23
+ - **Interactive CLI**
24
+ - Rich terminal output with colors and formatting
25
+ - ASCII art banner and branding
26
+ - Commands: `configure`, `list-profiles`, `remove-profile`, `scan`, `activate`, `license`, `deactivate`
27
+ - Progress bars for long-running operations
28
+
29
+ - **AWS Connector**
30
+ - boto3 integration for AWS API calls
31
+ - Connection pooling and credential validation
32
+ - Multi-region support
33
+ - Multi-profile support for managing multiple AWS accounts
34
+
35
+ #### Compliance Testing Framework
36
+
37
+ - **ISO 27001 Annex A Compliance Tests (4 total)**:
38
+ 1. **S3 Bucket Encryption** (A.8.2.3) - Validates encryption configuration
39
+ 2. **EC2 Security Groups** (A.13.1.1) - Detects overly permissive network rules
40
+ 3. **IAM Password Policy** (A.9.4.3) - Validates password requirements
41
+ 4. **CloudTrail Logging** (A.12.4.1) - Verifies audit logging configuration
42
+
43
+ - **Test Execution Engine**
44
+ - Parallel test execution with ThreadPoolExecutor
45
+ - Sequential execution mode for debugging
46
+ - Progress callbacks for real-time UI updates
47
+ - Comprehensive error handling
48
+
49
+ - **Evidence Collection**
50
+ - SHA-256 cryptographic signatures for tamper detection
51
+ - Timestamped evidence with AWS account ID
52
+ - Structured evidence format (JSON-serializable)
53
+
54
+ #### Reporting
55
+
56
+ - **Report Formats**:
57
+ - JSON reports - Machine-readable with full metadata
58
+ - Markdown reports - Human-readable with emoji indicators
59
+
60
+ - **Report Features**:
61
+ - Executive summary with compliance score
62
+ - Detailed findings by severity (CRITICAL, HIGH, MEDIUM, LOW)
63
+ - Remediation steps for each finding
64
+ - Evidence chain with signatures
65
+ - Export to file or display in terminal
66
+
67
+ #### Licensing System
68
+
69
+ - **Early Access Licensing**
70
+ - License activation with cryptographic key validation
71
+ - Offline caching with 7-day grace period
72
+ - Feature gating per tier (free, early_access, pro, enterprise)
73
+ - Founder badge for first 50 customers
74
+
75
+ - **DEV MODE for Development**:
76
+ - Environment variable bypass: `COMPLIO_DEV_MODE=true`
77
+ - Test license keys: `TEST-TEST-TEST-TEST`, `DEV0-DEV0-DEV0-DEV0`, `DEMO-DEMO-DEMO-DEMO`
78
+ - Offline fallback for localhost API URLs
79
+
80
+ - **License Commands**:
81
+ - `complio activate` - Activate license key with celebration messaging
82
+ - `complio license` - Display current license status with upgrade pitch
83
+ - `complio deactivate` - Remove local license cache
84
+
85
+ ### Security
86
+
87
+ - **Security Audit Completed**
88
+ - 131 unit and security tests passing
89
+ - All P0 (Critical) vulnerabilities fixed
90
+ - All P1 (High) vulnerabilities fixed
91
+ - Comprehensive input validation
92
+ - SQL injection prevention (parameterized queries)
93
+ - XSS prevention (proper output encoding)
94
+ - CSRF protection (stateless API design)
95
+ - Authentication/authorization checks
96
+
97
+ - **Security Best Practices**
98
+ - Credential encryption at rest (AES-256)
99
+ - Secure random number generation
100
+ - Rate limiting considerations
101
+ - Dependency vulnerability scanning
102
+ - Type safety with mypy strict mode
103
+
104
+ ### Developer Experience
105
+
106
+ - **Code Quality**
107
+ - Black formatting (line length 100)
108
+ - Ruff linting (pycodestyle, pyflakes, isort)
109
+ - mypy strict type checking
110
+ - 100% type annotation coverage
111
+
112
+ - **Testing**
113
+ - pytest with 131 tests passing
114
+ - Unit tests for all modules
115
+ - Integration tests for AWS operations (using moto)
116
+ - Security audit tests
117
+ - Coverage reporting (HTML, XML, terminal)
118
+
119
+ - **Documentation**
120
+ - Comprehensive README with Quick Start
121
+ - QUICKSTART.md for 5-minute setup
122
+ - TESTING_GUIDE.md for comprehensive testing docs
123
+ - Inline code documentation with docstrings
124
+ - Type hints for all functions
125
+
126
+ ### Technical Details
127
+
128
+ - **Dependencies**:
129
+ - Python 3.11+ (required)
130
+ - click 8.1.7+ (CLI framework)
131
+ - rich 13.7.0+ (terminal output)
132
+ - boto3 1.34.0+ (AWS SDK)
133
+ - pydantic 2.5.3+ (data validation)
134
+ - cryptography 42.0.0+ (encryption)
135
+ - structlog 24.1.0+ (structured logging)
136
+ - requests 2.31.0+ (HTTP client for licensing API)
137
+
138
+ - **Package Distribution**:
139
+ - Available on PyPI as `complio`
140
+ - Installable via `pip install complio`
141
+ - Poetry-managed dependencies
142
+ - Entry point: `complio` CLI command
143
+
144
+ ### Known Limitations
145
+
146
+ - **AWS Only**: Currently supports AWS infrastructure only (Azure and GCP planned)
147
+ - **Limited Test Coverage**: 4 compliance tests (40+ planned)
148
+ - **No PDF Reports**: PDF generation coming in Week 6
149
+ - **No Scheduled Scans**: Cron/scheduled scanning coming in Week 7
150
+ - **No Historical Trends**: Trend analysis coming in Week 9
151
+ - **No CI/CD Integration**: GitHub Actions/GitLab CI plugins coming in Week 10
152
+
153
+ ### Upgrade Notes
154
+
155
+ This is the initial release, no upgrade path required.
156
+
157
+ ### Breaking Changes
158
+
159
+ None (initial release).
160
+
161
+ ### Deprecations
162
+
163
+ None (initial release).
164
+
165
+ ### Contributors
166
+
167
+ - Complio Team <team@compl.io>
168
+
169
+ ### Links
170
+
171
+ - **Homepage**: https://compl.io
172
+ - **Repository**: https://github.com/complio/complio
173
+ - **Documentation**: https://docs.compl.io
174
+ - **Issue Tracker**: https://github.com/complio/complio/issues
175
+ - **Early Access**: https://compl.io/early-access
176
+
177
+ ---
178
+
179
+ ## [Unreleased]
180
+
181
+ ### Planned for v0.2.0 (Week 5)
182
+
183
+ - Expand to 10+ compliance tests
184
+ - Add VPC security group tests
185
+ - Add RDS encryption tests
186
+ - Add Lambda configuration tests
187
+ - Add KMS key rotation tests
188
+ - Add Secrets Manager tests
189
+
190
+ ### Planned for v0.3.0 (Week 6)
191
+
192
+ - PDF report generation with charts
193
+ - Executive summary reports
194
+ - Compliance trend charts
195
+ - Custom branding support
196
+
197
+ ### Planned for v0.4.0 (Week 7-10)
198
+
199
+ - Email notifications and scheduling
200
+ - SOC 2 compliance framework
201
+ - Historical trend analysis
202
+ - CI/CD integration (GitHub Actions, GitLab CI, Jenkins)
203
+ - Multi-cloud support (Azure, GCP)
204
+
205
+ ---
206
+
207
+ [0.1.0]: https://github.com/complio/complio/releases/tag/v0.1.0
208
+ [Unreleased]: https://github.com/complio/complio/compare/v0.1.0...HEAD
README.md ADDED
@@ -0,0 +1,343 @@
1
+ # Complio - Scanner de Conformité ISO 27001 pour AWS
2
+
3
+ [![Version Python](https://img.shields.io/badge/python-3.11%2B-blue)](https://www.python.org/downloads/)
4
+ [![Licence : MIT](https://img.shields.io/badge/Licence-MIT-green.svg)](https://opensource.org/licenses/MIT)
5
+ [![Tests](https://img.shields.io/badge/tests-40-success)](https://github.com/Tiger972/complio)
6
+ ```
7
+ ██████╗ ██████╗ ███╗ ███╗██████╗ ██╗ ██╗ ██████╗
8
+ ██╔════╝██╔═══██╗████╗ ████║██╔══██╗██║ ██║██╔═══██╗
9
+ ██║ ██║ ██║██╔████╔██║██████╔╝██║ ██║██║ ██║
10
+ ██║ ██║ ██║██║╚██╔╝██║██╔═══╝ ██║ ██║██║ ██║
11
+ ╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ███████╗██║╚██████╔╝
12
+ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚══════╝╚═╝ ╚═════╝
13
+ ```
14
+
15
+ **Tests de conformité automatisés open source pour l'infrastructure AWS selon les contrôles ISO 27001:2022.**
16
+
17
+ Complio aide les équipes DevSecOps à réussir leurs audits plus rapidement en automatisant les vérifications de conformité de l'infrastructure, en fournissant des recommandations de remédiation actionnables et en générant des rapports de preuves prêts pour l'audit.
18
+
19
+ ---
20
+
21
+ ## 🎯 Fonctionnalités
22
+
23
+ - ✅ **40 Tests ISO 27001:2022** - Couverture complète du chiffrement, réseau, IAM et journalisation
24
+ - ⚡ **Scans Rapides** - Exécution parallèle avec suivi de progression
25
+ - 📊 **Formats de Rapports Multiples** - Rapports JSON et Markdown avec preuves signées SHA-256
26
+ - 📈 **Historique des Scans** - Suivez la conformité dans le temps et comparez les résultats
27
+ - 🔒 **Lecture Seule** - Utilise les credentials AWS CLI standard, nécessite uniquement des permissions de lecture
28
+ - 🎨 **CLI Élégant** - Sortie terminal enrichie avec résultats colorés
29
+
30
+ ---
31
+
32
+ ## 🚀 Démarrage Rapide
33
+
34
+ ### Prérequis
35
+
36
+ - Python 3.11 ou supérieur
37
+ - AWS CLI configuré (`aws configure`)
38
+ - Credentials AWS avec accès en lecture seule
39
+
40
+ ### Installation
41
+ ```bash
42
+ pip install complio
43
+ ```
44
+
45
+ ### Premier Scan
46
+ ```bash
47
+
48
+ # Lancer votre premier scan de conformité
49
+ complio scan
50
+
51
+ # Scanner une région spécifique
52
+ complio scan --region eu-west-3
53
+
54
+ # Utiliser un profil AWS spécifique
55
+ complio scan --profile production
56
+ ```
57
+
58
+ **Exemple de Sortie :**
59
+ ```
60
+ ╔════════════════════════════════════════════════════════╗
61
+ ║ Scan de Conformité Terminé ║
62
+ ╚════════════════════════════════════════════════════════╝
63
+
64
+ Résumé
65
+ ───────────────────────────────────────────────────────
66
+ Score Global : 92% ✅ CONFORME
67
+ Tests Totaux : 40
68
+ Réussis : ✅ 37
69
+ Échoués : ❌ 3
70
+ Temps d'Exécution : 4.2s
71
+
72
+ Résultats par Catégorie
73
+ ───────────────────────────────────────────────────────
74
+ 🔐 Chiffrement & Sécurité des Données (12/12) 100% ✅
75
+ 🌐 Sécurité Réseau (9/11) 82% ⚠️
76
+ 👤 Gestion des Identités et Accès (7/7) 100% ✅
77
+ 📊 Journalisation & Surveillance (9/10) 90% ✅
78
+ ```
79
+
80
+ ---
81
+
82
+ ## 📦 Couverture Complète des Tests (40 Tests)
83
+
84
+ ### 🔐 Chiffrement & Sécurité des Données (12 tests)
85
+
86
+ | # | Test | Contrôle ISO | Description |
87
+ |---|------|--------------|-------------|
88
+ | 1 | **Chiffrement des Buckets S3** | A.8.2 | Valide le chiffrement des buckets S3 (AES-256, KMS) |
89
+ | 2 | **Versioning S3** | A.8.13 | Vérifie le versioning des buckets S3 pour la récupération des données |
90
+ | 3 | **Chiffrement des Volumes EBS** | A.8.2 | Vérifie le chiffrement au repos des volumes EBS |
91
+ | 4 | **Chiffrement des Instances RDS** | A.8.2 | Valide le chiffrement des bases de données RDS |
92
+ | 5 | **Chiffrement DynamoDB** | A.8.2 | Vérifie le chiffrement des tables DynamoDB (KMS) |
93
+ | 6 | **Chiffrement ElastiCache** | A.8.24 | Vérifie le chiffrement Redis/Memcached |
94
+ | 7 | **Chiffrement Redshift** | A.8.24 | Valide le chiffrement des clusters Redshift |
95
+ | 8 | **Chiffrement EFS** | A.8.11 | Vérifie le chiffrement du système de fichiers EFS |
96
+ | 9 | **Chiffrement des Sauvegardes** | A.8.24 | Vérifie le chiffrement des coffres AWS Backup |
97
+ | 10 | **Chiffrement Secrets Manager** | A.8.2 | Valide le chiffrement KMS de Secrets Manager |
98
+ | 11 | **Chiffrement des Topics SNS** | A.8.24 | Vérifie le chiffrement des topics SNS avec KMS |
99
+ | 12 | **Chiffrement des Logs CloudWatch** | A.8.24 | Vérifie le chiffrement des groupes de logs CloudWatch |
100
+
101
+ ### 🌐 Sécurité Réseau (11 tests)
102
+
103
+ | # | Test | Contrôle ISO | Description |
104
+ |---|------|--------------|-------------|
105
+ | 13 | **Groupes de Sécurité EC2** | A.8.20 | Détecte les règles trop permissives (SSH, RDP) |
106
+ | 14 | **ACL Réseau** | A.8.20 | Valide la configuration des NACL |
107
+ | 15 | **Blocage d'Accès Public S3** | A.8.22 | Vérifie les paramètres de blocage d'accès public S3 |
108
+ | 16 | **Flow Logs VPC** | A.8.15 | Vérifie que les flow logs VPC sont activés |
109
+ | 17 | **Configuration WAF** | A.8.20 | Vérifie les règles et la journalisation WAF WebACL |
110
+ | 18 | **Sécurité API Gateway** | A.8.22 | Valide l'authentification et le throttling d'API Gateway |
111
+ | 19 | **HTTPS CloudFront** | A.8.24 | Impose HTTPS pour les distributions |
112
+ | 20 | **Sécurité VPN** | A.8.22 | Vérifie le chiffrement des tunnels VPN |
113
+ | 21 | **Sécurité Transit Gateway** | A.8.22 | Valide les paramètres de Transit Gateway |
114
+ | 22 | **Sécurité des Endpoints VPC** | A.8.22 | Vérifie les politiques des endpoints VPC |
115
+ | 23 | **Network Firewall** | A.8.20 | Vérifie le déploiement d'AWS Network Firewall |
116
+
117
+ ### 👤 Gestion des Identités et Accès (7 tests)
118
+
119
+ | # | Test | Contrôle ISO | Description |
120
+ |---|------|--------------|-------------|
121
+ | 24 | **Politique de Mots de Passe IAM** | A.9.4.3 | Valide les exigences de mot de passe |
122
+ | 25 | **Application du MFA** | A.9.4.3 | Vérifie que le MFA est activé pour les utilisateurs IAM |
123
+ | 26 | **Protection du Compte Root** | A.9.2.1 | Vérifie le MFA du compte root |
124
+ | 27 | **Rotation des Clés d'Accès IAM** | A.9.2.4 | Valide l'âge des clés (max 90 jours) |
125
+ | 28 | **Permissions des Utilisateurs IAM** | A.9.2.3 | Vérifie les privilèges excessifs |
126
+ | 29 | **Politiques de Confiance des Rôles IAM** | A.9.2.5 | Valide les relations de confiance des rôles |
127
+ | 30 | **Rotation des Clés KMS** | A.8.24 | Vérifie la rotation des clés KMS |
128
+
129
+ ### 📊 Journalisation & Surveillance (10 tests)
130
+
131
+ | # | Test | Contrôle ISO | Description |
132
+ |---|------|--------------|-------------|
133
+ | 31 | **Journalisation CloudTrail** | A.8.15 | Vérifie CloudTrail multi-région |
134
+ | 32 | **Validation des Logs CloudTrail** | A.8.16 | Vérifie que la validation des fichiers de logs est activée |
135
+ | 33 | **Chiffrement CloudTrail** | A.8.24 | Valide le chiffrement des logs avec KMS |
136
+ | 34 | **Rétention des Logs CloudWatch** | A.8.15 | Assure les politiques de rétention (90+ jours) |
137
+ | 35 | **Alarmes CloudWatch** | A.8.16 | Vérifie la configuration des alarmes |
138
+ | 36 | **AWS Config Activé** | A.8.16 | Vérifie l'enregistrement Config |
139
+ | 37 | **GuardDuty Activé** | A.8.16 | Vérifie la détection des menaces GuardDuty |
140
+ | 38 | **Security Hub Activé** | A.8.16 | Valide Security Hub |
141
+ | 39 | **Règles EventBridge** | A.8.16 | Vérifie les règles d'événements de sécurité |
142
+ | 40 | **Couverture Flow Logs VPC** | A.8.15 | Vérifie la couverture complète |
143
+
144
+ **Tous les tests sont mappés aux contrôles de l'Annexe A ISO 27001:2022 (A.8.x, A.9.x)**
145
+
146
+ ---
147
+
148
+ ## 📖 Utilisation
149
+
150
+ ### Commandes
151
+ ```bash
152
+ # Lancer un scan de conformité
153
+ complio scan [OPTIONS]
154
+
155
+ # Voir l'historique des scans
156
+ complio history [OPTIONS]
157
+
158
+ # Comparer deux scans
159
+ complio compare <scan-id-1> <scan-id-2>
160
+
161
+ # Effacer l'historique des scans
162
+ complio clear-history
163
+ ```
164
+
165
+ ### Options de Scan
166
+ ```bash
167
+ # Scanner une région spécifique
168
+ complio scan --region us-east-1
169
+
170
+ # Utiliser un profil AWS spécifique
171
+ complio scan --profile production
172
+
173
+ # Sauvegarder le rapport dans un fichier
174
+ complio scan --output rapport.json --format json
175
+ complio scan --output rapport.md --format markdown
176
+
177
+ # Exécuter en parallèle (plus rapide)
178
+ complio scan --parallel
179
+
180
+ # Scanner toutes les régions
181
+ complio scan --all-regions
182
+
183
+ # Lister les tests disponibles
184
+ complio scan --list-tests
185
+ ```
186
+
187
+ ### Historique & Comparaison
188
+ ```bash
189
+ # Voir les scans passés
190
+ complio history
191
+
192
+ # Afficher les 10 derniers scans
193
+ complio history --limit 10
194
+
195
+ # Comparer deux scans pour voir les changements
196
+ complio compare scan-abc123 scan-def456
197
+
198
+ # Effacer l'ancien historique des scans
199
+ complio clear-history
200
+ ```
201
+
202
+ ---
203
+
204
+ ## 🔧 Configuration
205
+
206
+ Complio utilise les credentials AWS CLI standard depuis `~/.aws/credentials` et `~/.aws/config`.
207
+
208
+ ### Permissions AWS
209
+
210
+ Complio nécessite un accès **lecture seule** aux services AWS. Exemple de politique IAM :
211
+ ```json
212
+ {
213
+ "Version": "2012-10-17",
214
+ "Statement": [
215
+ {
216
+ "Effect": "Allow",
217
+ "Action": [
218
+ "s3:GetBucketEncryption",
219
+ "s3:GetBucketVersioning",
220
+ "s3:GetBucketPublicAccessBlock",
221
+ "s3:ListAllMyBuckets",
222
+ "ec2:DescribeSecurityGroups",
223
+ "ec2:DescribeVolumes",
224
+ "ec2:DescribeVpcs",
225
+ "ec2:DescribeFlowLogs",
226
+ "rds:DescribeDBInstances",
227
+ "dynamodb:DescribeTable",
228
+ "iam:GetAccountPasswordPolicy",
229
+ "iam:ListUsers",
230
+ "iam:ListVirtualMFADevices",
231
+ "cloudtrail:DescribeTrails",
232
+ "cloudtrail:GetTrailStatus",
233
+ "logs:DescribeLogGroups",
234
+ "kms:DescribeKey",
235
+ "kms:GetKeyRotationStatus",
236
+ "guardduty:ListDetectors",
237
+ "securityhub:DescribeHub",
238
+ "wafv2:ListWebACLs"
239
+ ],
240
+ "Resource": "*"
241
+ }
242
+ ]
243
+ }
244
+ ```
245
+
246
+ ---
247
+
248
+ ## 🛡️ Sécurité
249
+
250
+ - **Opérations en Lecture Seule** : Tous les tests effectuent des appels API en lecture seule
251
+ - **Aucune Collecte de Données** : Aucune donnée n'est envoyée vers des serveurs externes
252
+ - **Stockage Local** : Les résultats des scans sont stockés localement dans `~/.complio/history`
253
+ - **Authentification AWS Standard** : Utilise la chaîne de credentials standard boto3
254
+
255
+ ---
256
+
257
+ ## 📊 Formats de Rapports
258
+
259
+ ### Rapport JSON
260
+ ```bash
261
+ complio scan --output rapport.json --format json
262
+ ```
263
+
264
+ JSON structuré avec :
265
+ - Score de conformité global
266
+ - Résultats par test avec statut réussi/échoué
267
+ - Données de preuves avec signatures SHA-256
268
+ - Constatations avec étapes de remédiation
269
+ - Métadonnées (horodatage, région, compte AWS)
270
+
271
+ ### Rapport Markdown
272
+ ```bash
273
+ complio scan --output rapport.md --format markdown
274
+ ```
275
+
276
+ Markdown lisible avec :
277
+ - Résumé exécutif
278
+ - Résultats des tests par catégorie
279
+ - Constatations détaillées avec remédiation
280
+ - Références des preuves
281
+
282
+ ---
283
+
284
+ ## 🤝 Contribution
285
+
286
+ **Phase Actuelle** : 40 Tests Complétés ✅
287
+ **Statut** : ✅ Couverture complète des tests de conformité ISO 27001:2022 opérationnelle
288
+ ```bash
289
+ # Lancer les tests
290
+ poetry run pytest
291
+ ```
292
+
293
+ - Génération de rapports PDF avec graphiques
294
+ - Notifications email et planification
295
+ - Framework de conformité SOC 2
296
+ - Analyse de tendances historiques
297
+ - Intégration CI/CD et support multi-cloud
298
+
299
+ ---
300
+
301
+ ## 📄 Licence
302
+
303
+ Ce projet est sous licence MIT - voir le fichier [LICENSE](LICENSE) pour plus de détails.
304
+
305
+ ---
306
+
307
+ ## 🙏 Support
308
+
309
+ - **Email** : andy.piquonne@complio.tech
310
+ - **Documentation** : [GitHub Wiki](https://github.com/Tiger972/complio/)
311
+
312
+ ---
313
+
314
+ ## ⭐ Montrez Votre Soutien
315
+
316
+ Si vous trouvez Complio utile, pensez à :
317
+
318
+ - ⭐ Mettre une étoile au dépôt
319
+ - 🐛 Signaler des bugs et suggérer des fonctionnalités
320
+ - 📝 Contribuer au code ou à la documentation
321
+ - 📢 Partager avec votre réseau
322
+
323
+ ---
324
+
325
+ ## 🗺️ Roadmap
326
+
327
+ - [ ] Génération de rapports PDF
328
+ - [ ] Tableau de bord HTML
329
+ - [ ] Intégrations CI/CD (GitHub Actions, GitLab CI)
330
+ - [ ] Frameworks de conformité additionnels (SOC 2, HIPAA, NIST)
331
+ - [ ] Support multi-cloud (Azure, GCP)
332
+ - [ ] Création de tests personnalisés
333
+ - [ ] Notifications Slack/Email
334
+
335
+ ---
336
+
337
+ ## 📝 Journal des Modifications
338
+
339
+ Voir [CHANGELOG.md](CHANGELOG.md) pour les détails des versions.
340
+
341
+ ---
342
+
343
+ **Construit avec ❤️ pour la communauté Cloud**
complio/__init__.py ADDED
@@ -0,0 +1,48 @@
1
+ """
2
+ Complio - Open Source ISO 27001 Compliance Scanner for AWS
3
+
4
+ Automated ISO 27001 infrastructure compliance testing for AWS.
5
+
6
+ Example:
7
+ >>> from complio import AWSConnector
8
+ >>> from complio.core.registry import TestRegistry
9
+ >>> from complio.core.runner import TestRunner
10
+ >>>
11
+ >>> connector = AWSConnector("default", "us-east-1")
12
+ >>> connector.connect()
13
+ >>>
14
+ >>> runner = TestRunner(connector)
15
+ >>> results = runner.run_all()
16
+ """
17
+
18
+ from complio.utils.exceptions import (
19
+ AWSConnectionError,
20
+ AWSCredentialsError,
21
+ AWSError,
22
+ ComplioError,
23
+ InvalidRegionError,
24
+ ValidationError,
25
+ )
26
+ from complio.config.settings import ComplioSettings, get_settings
27
+ from complio.connectors.aws.client import AWSConnector
28
+
29
+ __version__ = "0.1.0"
30
+
31
+ __all__ = [
32
+ # Version
33
+ "__version__",
34
+ # Configuration
35
+ "ComplioSettings",
36
+ "get_settings",
37
+ # AWS Connector
38
+ "AWSConnector",
39
+ # Exceptions - Base
40
+ "ComplioError",
41
+ "AWSError",
42
+ # Exceptions - AWS
43
+ "AWSConnectionError",
44
+ "AWSCredentialsError",
45
+ "InvalidRegionError",
46
+ # Exceptions - Validation
47
+ "ValidationError",
48
+ ]
File without changes
complio/cli/banner.py ADDED
@@ -0,0 +1,87 @@
1
+ """
2
+ CLI banner and branding utilities.
3
+
4
+ This module provides ASCII art branding for the Complio CLI.
5
+ The banner displays when launching the CLI to provide visual identity.
6
+ """
7
+
8
+ from rich.console import Console
9
+ from rich.text import Text
10
+
11
+ console = Console()
12
+
13
+
14
+ def print_banner() -> None:
15
+ """Print the Complio ASCII art banner.
16
+
17
+ Displays a stylized "COMPLIO" logo with tagline in cyan/blue colors.
18
+
19
+ Example:
20
+ >>> print_banner()
21
+ ██████╗ ██████╗ ███╗ ███╗██████╗ ██╗ ██╗ ██████╗
22
+ ██╔════╝██╔═══██╗████╗ ████║██╔══██╗██║ ██║██╔═══██╗
23
+ ██║ ██║ ██║██╔████╔██║██████╔╝██║ ██║██║ ██║
24
+ ██║ ██║ ██║██║╚██╔╝██║██╔═══╝ ██║ ██║██║ ██║
25
+ ╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ███████╗██║╚██████╔╝
26
+ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚══════╝╚═╝ ╚═════╝
27
+ """
28
+ banner = """
29
+ ██████╗ ██████╗ ███╗ ███╗██████╗ ██╗ ██╗ ██████╗
30
+ ██╔════╝██╔═══██╗████╗ ████║██╔══██╗██║ ██║██╔═══██╗
31
+ ██║ ██║ ██║██╔████╔██║██████╔╝██║ ██║██║ ██║
32
+ ██║ ██║ ██║██║╚██╔╝██║██╔═══╝ ██║ ██║██║ ██║
33
+ ╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ███████╗██║╚██████╔╝
34
+ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚══════╝╚═╝ ╚═════╝
35
+ """
36
+
37
+ # Print banner in cyan/blue gradient
38
+ text = Text(banner)
39
+ text.stylize("bold cyan")
40
+ console.print(text)
41
+
42
+ # Print tagline
43
+ tagline = Text()
44
+ tagline.append("Automated ", style="dim white")
45
+ tagline.append("ISO 27001 compliance testing", style="bold cyan")
46
+ tagline.append(" for AWS infrastructure.", style="dim white")
47
+
48
+ console.print(tagline)
49
+ console.print()
50
+
51
+
52
+ def print_simple_banner() -> None:
53
+ """Print a simpler, more compact Complio banner.
54
+
55
+ Alternative banner for smaller terminals or less verbose output.
56
+
57
+ Example:
58
+ >>> print_simple_banner()
59
+ ╔═══════════════════════════════════════════════════════════╗
60
+ ║ COMPLIO - Compliance-as-Code Platform ║
61
+ ║ Automated ISO 27001 compliance testing for AWS ║
62
+ ╚═══════════════════════════════════════════════════════════╝
63
+ """
64
+ text = Text()
65
+ text.append("\n╔═══════════════════════════════════════════════════════════╗\n", style="cyan")
66
+ text.append("║ ", style="cyan")
67
+ text.append("COMPLIO", style="bold cyan")
68
+ text.append(" - Compliance-as-Code Platform", style="white")
69
+ text.append(" ║\n", style="cyan")
70
+ text.append("║ Automated ISO 27001 compliance testing for AWS ║\n", style="cyan")
71
+ text.append("╚═══════════════════════════════════════════════════════════╝\n", style="cyan")
72
+
73
+ console.print(text)
74
+
75
+
76
+ def print_minimal_banner() -> None:
77
+ """Print minimal banner for compact display.
78
+
79
+ Example:
80
+ >>> print_minimal_banner()
81
+ COMPLIO v0.1.0 - Compliance-as-Code Platform
82
+ """
83
+ text = Text()
84
+ text.append("COMPLIO", style="bold cyan")
85
+ text.append(" v0.1.0", style="dim cyan")
86
+ text.append(" - Compliance-as-Code Platform\n", style="white")
87
+ console.print(text)
File without changes