aws-cis-controls-assessment 1.0.7__py3-none-any.whl → 1.0.9__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.
- aws_cis_assessment/__init__.py +1 -1
- aws_cis_assessment/controls/ig1/control_advanced_security.py +2 -2
- aws_cis_assessment/core/assessment_engine.py +4 -0
- aws_cis_assessment/core/models.py +1 -0
- aws_cis_assessment/core/scoring_engine.py +30 -0
- aws_cis_assessment/reporters/base_reporter.py +2 -0
- aws_cis_assessment/reporters/html_reporter.py +826 -45
- {aws_cis_controls_assessment-1.0.7.dist-info → aws_cis_controls_assessment-1.0.9.dist-info}/METADATA +6 -1
- {aws_cis_controls_assessment-1.0.7.dist-info → aws_cis_controls_assessment-1.0.9.dist-info}/RECORD +20 -16
- docs/README.md +1 -0
- docs/dual-scoring-implementation.md +303 -0
- docs/html-report-improvements.md +422 -0
- docs/installation.md +78 -27
- docs/scoring-comparison-aws-config.md +379 -0
- docs/scoring-methodology.md +350 -0
- docs/user-guide.md +7 -1
- {aws_cis_controls_assessment-1.0.7.dist-info → aws_cis_controls_assessment-1.0.9.dist-info}/WHEEL +0 -0
- {aws_cis_controls_assessment-1.0.7.dist-info → aws_cis_controls_assessment-1.0.9.dist-info}/entry_points.txt +0 -0
- {aws_cis_controls_assessment-1.0.7.dist-info → aws_cis_controls_assessment-1.0.9.dist-info}/licenses/LICENSE +0 -0
- {aws_cis_controls_assessment-1.0.7.dist-info → aws_cis_controls_assessment-1.0.9.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
# Scoring Comparison: Our Approach vs AWS Config Conformance Packs
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
This document compares our weighted scoring methodology with AWS Config's Conformance Pack approach.
|
|
6
|
+
|
|
7
|
+
## AWS Config Conformance Pack Approach
|
|
8
|
+
|
|
9
|
+
### Formula
|
|
10
|
+
```
|
|
11
|
+
Compliance Score = Compliant Rule-Resources / Total Rule-Resources
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### Characteristics
|
|
15
|
+
- **Simple percentage** - No weighting applied
|
|
16
|
+
- **Flat structure** - All rules treated equally
|
|
17
|
+
- **Resource-centric** - Counts individual rule-resource combinations
|
|
18
|
+
- **No prioritization** - Critical and minor rules have equal impact
|
|
19
|
+
|
|
20
|
+
### Example Calculation
|
|
21
|
+
```
|
|
22
|
+
Rule 1: 90/100 resources compliant
|
|
23
|
+
Rule 2: 50/50 resources compliant
|
|
24
|
+
Rule 3: 10/50 resources compliant
|
|
25
|
+
|
|
26
|
+
Total: (90 + 50 + 10) / (100 + 50 + 50)
|
|
27
|
+
= 150 / 200
|
|
28
|
+
= 75% compliance
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Our Weighted Approach
|
|
32
|
+
|
|
33
|
+
### Formula
|
|
34
|
+
```
|
|
35
|
+
Overall Score = Σ(IG Score × IG Weight) / Σ(IG Weights)
|
|
36
|
+
where IG Score = Σ(Control Score × Control Weight) / Σ(Control Weights)
|
|
37
|
+
where Control Score = Compliant Resources / Total Resources
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Characteristics
|
|
41
|
+
- **Weighted average** - Critical controls have more impact
|
|
42
|
+
- **Hierarchical structure** - Controls → IGs → Overall
|
|
43
|
+
- **Security-centric** - Prioritizes critical security controls
|
|
44
|
+
- **Maturity-aware** - Advanced IGs (IG2/IG3) weighted higher
|
|
45
|
+
|
|
46
|
+
### Example Calculation
|
|
47
|
+
```
|
|
48
|
+
Control 1 (weight 1.0): 90/100 = 90%
|
|
49
|
+
Control 2 (weight 1.5): 50/50 = 100%
|
|
50
|
+
Control 3 (weight 1.0): 10/50 = 20%
|
|
51
|
+
|
|
52
|
+
Weighted: (90×1.0 + 100×1.5 + 20×1.0) / (1.0 + 1.5 + 1.0)
|
|
53
|
+
= (90 + 150 + 20) / 3.5
|
|
54
|
+
= 260 / 3.5
|
|
55
|
+
= 74.3% compliance
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Side-by-Side Comparison
|
|
59
|
+
|
|
60
|
+
| Aspect | AWS Config Conformance Pack | Our Weighted Approach |
|
|
61
|
+
|--------|----------------------------|----------------------|
|
|
62
|
+
| **Formula** | Simple average | Weighted average |
|
|
63
|
+
| **Structure** | Flat (all rules equal) | Hierarchical (Controls → IGs → Overall) |
|
|
64
|
+
| **Weighting** | None | Control weights + IG weights |
|
|
65
|
+
| **Prioritization** | No | Yes (critical controls weighted higher) |
|
|
66
|
+
| **Maturity Levels** | Not considered | IG1/IG2/IG3 weighted differently |
|
|
67
|
+
| **Complexity** | Low | Medium |
|
|
68
|
+
| **Customization** | Limited | Highly customizable |
|
|
69
|
+
| **Focus** | Resource compliance | Security posture |
|
|
70
|
+
|
|
71
|
+
## Real-World Impact Comparison
|
|
72
|
+
|
|
73
|
+
### Scenario 1: Critical Control Failure
|
|
74
|
+
|
|
75
|
+
**Setup:**
|
|
76
|
+
- 3 controls assessed
|
|
77
|
+
- Control 1 (Asset Inventory, weight 1.0): 90/100 = 90%
|
|
78
|
+
- Control 2 (Encryption at Rest, weight 1.4): 10/100 = 10% ⚠️ CRITICAL
|
|
79
|
+
- Control 3 (Logging, weight 1.2): 80/100 = 80%
|
|
80
|
+
|
|
81
|
+
**AWS Config Approach:**
|
|
82
|
+
```
|
|
83
|
+
Score = (90 + 10 + 80) / (100 + 100 + 100)
|
|
84
|
+
= 180 / 300
|
|
85
|
+
= 60% compliance
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**Our Weighted Approach:**
|
|
89
|
+
```
|
|
90
|
+
Score = (90×1.0 + 10×1.4 + 80×1.2) / (1.0 + 1.4 + 1.2)
|
|
91
|
+
= (90 + 14 + 96) / 3.6
|
|
92
|
+
= 200 / 3.6
|
|
93
|
+
= 55.6% compliance
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Analysis:**
|
|
97
|
+
- Our approach scores **4.4% lower** because encryption (critical) is weighted higher
|
|
98
|
+
- This better reflects the **security risk** of poor encryption compliance
|
|
99
|
+
- AWS Config treats encryption failure same as asset inventory issues
|
|
100
|
+
|
|
101
|
+
### Scenario 2: Minor Control Failure
|
|
102
|
+
|
|
103
|
+
**Setup:**
|
|
104
|
+
- 3 controls assessed
|
|
105
|
+
- Control 1 (Asset Inventory, weight 1.0): 10/100 = 10% ⚠️ MINOR
|
|
106
|
+
- Control 2 (Encryption at Rest, weight 1.4): 90/100 = 90%
|
|
107
|
+
- Control 3 (Logging, weight 1.2): 80/100 = 80%
|
|
108
|
+
|
|
109
|
+
**AWS Config Approach:**
|
|
110
|
+
```
|
|
111
|
+
Score = (10 + 90 + 80) / (100 + 100 + 100)
|
|
112
|
+
= 180 / 300
|
|
113
|
+
= 60% compliance
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**Our Weighted Approach:**
|
|
117
|
+
```
|
|
118
|
+
Score = (10×1.0 + 90×1.4 + 80×1.2) / (1.0 + 1.4 + 1.2)
|
|
119
|
+
= (10 + 126 + 96) / 3.6
|
|
120
|
+
= 232 / 3.6
|
|
121
|
+
= 64.4% compliance
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Analysis:**
|
|
125
|
+
- Our approach scores **4.4% higher** because critical controls (encryption) are compliant
|
|
126
|
+
- This better reflects the **actual security posture** despite asset inventory issues
|
|
127
|
+
- AWS Config penalizes equally regardless of control importance
|
|
128
|
+
|
|
129
|
+
### Scenario 3: Multiple Implementation Groups
|
|
130
|
+
|
|
131
|
+
**Setup:**
|
|
132
|
+
- IG1: 85% compliance (74 controls)
|
|
133
|
+
- IG2: 75% compliance (58 additional controls)
|
|
134
|
+
- IG3: 60% compliance (13 additional controls)
|
|
135
|
+
|
|
136
|
+
**AWS Config Approach:**
|
|
137
|
+
```
|
|
138
|
+
All rules treated equally:
|
|
139
|
+
Score = (85 + 75 + 60) / 3
|
|
140
|
+
= 73.3% compliance
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Our Weighted Approach:**
|
|
144
|
+
```
|
|
145
|
+
Score = (85×1.0 + 75×1.5 + 60×2.0) / (1.0 + 1.5 + 2.0)
|
|
146
|
+
= (85 + 112.5 + 120) / 4.5
|
|
147
|
+
= 317.5 / 4.5
|
|
148
|
+
= 70.6% compliance
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Analysis:**
|
|
152
|
+
- Our approach scores **2.7% lower** because IG3 (advanced security) is weighted higher
|
|
153
|
+
- This reflects that **advanced security failures** are more concerning
|
|
154
|
+
- AWS Config doesn't distinguish between basic and advanced security
|
|
155
|
+
|
|
156
|
+
## Key Differences Explained
|
|
157
|
+
|
|
158
|
+
### 1. Security Prioritization
|
|
159
|
+
|
|
160
|
+
**AWS Config:**
|
|
161
|
+
- Treats all rules equally
|
|
162
|
+
- 100 non-compliant S3 buckets = 100 non-compliant IAM users
|
|
163
|
+
- No distinction between critical and minor issues
|
|
164
|
+
|
|
165
|
+
**Our Approach:**
|
|
166
|
+
- Critical controls (encryption, access control) weighted higher
|
|
167
|
+
- 100 non-encrypted databases > 100 untagged EC2 instances
|
|
168
|
+
- Reflects actual security risk
|
|
169
|
+
|
|
170
|
+
### 2. Maturity Recognition
|
|
171
|
+
|
|
172
|
+
**AWS Config:**
|
|
173
|
+
- No concept of security maturity levels
|
|
174
|
+
- Basic and advanced controls treated the same
|
|
175
|
+
|
|
176
|
+
**Our Approach:**
|
|
177
|
+
- IG1 (Essential) = baseline weight
|
|
178
|
+
- IG2 (Enhanced) = 1.5x weight
|
|
179
|
+
- IG3 (Advanced) = 2x weight
|
|
180
|
+
- Encourages progression to higher security maturity
|
|
181
|
+
|
|
182
|
+
### 3. Resource Distribution Impact
|
|
183
|
+
|
|
184
|
+
**AWS Config:**
|
|
185
|
+
- Heavily influenced by resource count
|
|
186
|
+
- 1 rule with 1000 resources dominates score
|
|
187
|
+
- Can mask issues in rules with fewer resources
|
|
188
|
+
|
|
189
|
+
**Our Approach:**
|
|
190
|
+
- Each control scored independently first
|
|
191
|
+
- Then weighted and averaged
|
|
192
|
+
- Prevents resource count from dominating
|
|
193
|
+
- Better reflects control-level compliance
|
|
194
|
+
|
|
195
|
+
### 4. Actionable Insights
|
|
196
|
+
|
|
197
|
+
**AWS Config:**
|
|
198
|
+
- Simple percentage
|
|
199
|
+
- Doesn't indicate which areas need focus
|
|
200
|
+
- All non-compliance treated equally
|
|
201
|
+
|
|
202
|
+
**Our Approach:**
|
|
203
|
+
- Identifies high-priority remediation areas
|
|
204
|
+
- Weights guide where to focus effort
|
|
205
|
+
- Risk areas highlighted based on criticality
|
|
206
|
+
|
|
207
|
+
## Practical Examples
|
|
208
|
+
|
|
209
|
+
### Example 1: Encryption Compliance
|
|
210
|
+
|
|
211
|
+
**Scenario:** Organization has poor encryption but good asset management
|
|
212
|
+
|
|
213
|
+
| Control | Resources | Compliant | AWS Config Impact | Our Impact |
|
|
214
|
+
|---------|-----------|-----------|-------------------|------------|
|
|
215
|
+
| Asset Inventory (1.0) | 1000 | 950 (95%) | 950/1000 | 95% × 1.0 |
|
|
216
|
+
| Encryption at Rest (1.4) | 100 | 20 (20%) | 20/100 | 20% × 1.4 |
|
|
217
|
+
|
|
218
|
+
**AWS Config Score:**
|
|
219
|
+
```
|
|
220
|
+
(950 + 20) / (1000 + 100) = 970/1100 = 88.2%
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
**Our Score:**
|
|
224
|
+
```
|
|
225
|
+
(95×1.0 + 20×1.4) / (1.0 + 1.4) = (95 + 28) / 2.4 = 51.3%
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
**Difference:** -36.9%
|
|
229
|
+
|
|
230
|
+
**Why?** Our approach correctly identifies this as a **critical security issue** despite high resource compliance in less critical areas.
|
|
231
|
+
|
|
232
|
+
### Example 2: Balanced Compliance
|
|
233
|
+
|
|
234
|
+
**Scenario:** Organization has consistent compliance across all controls
|
|
235
|
+
|
|
236
|
+
| Control | Resources | Compliant | Compliance % |
|
|
237
|
+
|---------|-----------|-----------|--------------|
|
|
238
|
+
| Control 1 (1.0) | 100 | 80 | 80% |
|
|
239
|
+
| Control 2 (1.5) | 100 | 80 | 80% |
|
|
240
|
+
| Control 3 (1.2) | 100 | 80 | 80% |
|
|
241
|
+
|
|
242
|
+
**AWS Config Score:**
|
|
243
|
+
```
|
|
244
|
+
(80 + 80 + 80) / (100 + 100 + 100) = 240/300 = 80%
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
**Our Score:**
|
|
248
|
+
```
|
|
249
|
+
(80×1.0 + 80×1.5 + 80×1.2) / (1.0 + 1.5 + 1.2) = (80 + 120 + 96) / 3.7 = 80%
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
**Difference:** 0%
|
|
253
|
+
|
|
254
|
+
**Why?** When compliance is **consistent across controls**, both approaches yield the same result.
|
|
255
|
+
|
|
256
|
+
### Example 3: Resource Count Skew
|
|
257
|
+
|
|
258
|
+
**Scenario:** One rule has many resources, others have few
|
|
259
|
+
|
|
260
|
+
| Control | Resources | Compliant | Compliance % |
|
|
261
|
+
|---------|-----------|-----------|--------------|
|
|
262
|
+
| Control 1 (1.0) | 1000 | 900 | 90% |
|
|
263
|
+
| Control 2 (1.5) | 10 | 2 | 20% |
|
|
264
|
+
| Control 3 (1.2) | 10 | 2 | 20% |
|
|
265
|
+
|
|
266
|
+
**AWS Config Score:**
|
|
267
|
+
```
|
|
268
|
+
(900 + 2 + 2) / (1000 + 10 + 10) = 904/1020 = 88.6%
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
**Our Score:**
|
|
272
|
+
```
|
|
273
|
+
(90×1.0 + 20×1.5 + 20×1.2) / (1.0 + 1.5 + 1.2) = (90 + 30 + 24) / 3.7 = 38.9%
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
**Difference:** -49.7%
|
|
277
|
+
|
|
278
|
+
**Why?** AWS Config is **dominated by the high resource count** in Control 1. Our approach treats each control equally, revealing the **poor compliance in critical areas**.
|
|
279
|
+
|
|
280
|
+
## When Each Approach is Better
|
|
281
|
+
|
|
282
|
+
### AWS Config Approach is Better When:
|
|
283
|
+
|
|
284
|
+
1. **Simplicity is paramount** - Easy to understand and explain
|
|
285
|
+
2. **All rules are equally important** - No need for prioritization
|
|
286
|
+
3. **Resource-level tracking** - Focus on individual resource compliance
|
|
287
|
+
4. **Regulatory compliance** - Simple pass/fail requirements
|
|
288
|
+
5. **Audit purposes** - Straightforward percentage for auditors
|
|
289
|
+
|
|
290
|
+
### Our Weighted Approach is Better When:
|
|
291
|
+
|
|
292
|
+
1. **Security prioritization matters** - Critical controls should have more impact
|
|
293
|
+
2. **Risk-based decision making** - Focus on highest-risk areas
|
|
294
|
+
3. **Maturity progression** - Encouraging advancement through IG levels
|
|
295
|
+
4. **Executive reporting** - Reflects actual security posture
|
|
296
|
+
5. **Remediation planning** - Guides where to focus effort
|
|
297
|
+
6. **Resource optimization** - Prevents resource count from dominating
|
|
298
|
+
|
|
299
|
+
## Conversion Between Approaches
|
|
300
|
+
|
|
301
|
+
### Converting Our Score to AWS Config Style
|
|
302
|
+
|
|
303
|
+
To get an "unweighted" score similar to AWS Config:
|
|
304
|
+
|
|
305
|
+
```python
|
|
306
|
+
# Sum all compliant resources across all controls
|
|
307
|
+
total_compliant = sum(control.compliant_resources for control in controls)
|
|
308
|
+
|
|
309
|
+
# Sum all total resources across all controls
|
|
310
|
+
total_resources = sum(control.total_resources for control in controls)
|
|
311
|
+
|
|
312
|
+
# Calculate simple percentage
|
|
313
|
+
aws_config_style_score = (total_compliant / total_resources) * 100
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### Converting AWS Config to Our Style
|
|
317
|
+
|
|
318
|
+
To add weighting to AWS Config scores:
|
|
319
|
+
|
|
320
|
+
```python
|
|
321
|
+
# Apply control weights to each rule's compliance
|
|
322
|
+
weighted_scores = []
|
|
323
|
+
for rule in rules:
|
|
324
|
+
rule_compliance = rule.compliant / rule.total
|
|
325
|
+
weight = get_control_weight(rule.control_id)
|
|
326
|
+
weighted_scores.append(rule_compliance * weight)
|
|
327
|
+
|
|
328
|
+
# Calculate weighted average
|
|
329
|
+
our_style_score = sum(weighted_scores) / sum(weights)
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
## Recommendations
|
|
333
|
+
|
|
334
|
+
### Use AWS Config Approach If:
|
|
335
|
+
- You need simple, auditable compliance reporting
|
|
336
|
+
- All controls have equal business importance
|
|
337
|
+
- You're reporting to non-technical stakeholders
|
|
338
|
+
- Regulatory requirements specify simple percentage
|
|
339
|
+
|
|
340
|
+
### Use Our Weighted Approach If:
|
|
341
|
+
- You need risk-based security prioritization
|
|
342
|
+
- Critical controls should influence score more
|
|
343
|
+
- You're managing security maturity progression
|
|
344
|
+
- You need actionable remediation guidance
|
|
345
|
+
- You want to prevent resource count skew
|
|
346
|
+
|
|
347
|
+
### Use Both Approaches:
|
|
348
|
+
- Report **AWS Config style** for auditors and compliance
|
|
349
|
+
- Use **weighted approach** for security decision-making
|
|
350
|
+
- Track both metrics over time for comprehensive view
|
|
351
|
+
|
|
352
|
+
## Summary Table
|
|
353
|
+
|
|
354
|
+
| Metric | AWS Config | Our Approach | Difference |
|
|
355
|
+
|--------|-----------|--------------|------------|
|
|
356
|
+
| **Complexity** | Low | Medium | More complex but more insightful |
|
|
357
|
+
| **Accuracy** | Resource-level | Security-level | Better reflects security posture |
|
|
358
|
+
| **Actionability** | Limited | High | Clear prioritization guidance |
|
|
359
|
+
| **Customization** | None | High | Adaptable to organization needs |
|
|
360
|
+
| **Audit-friendly** | Very | Moderate | May need explanation |
|
|
361
|
+
| **Risk-awareness** | No | Yes | Reflects actual security risk |
|
|
362
|
+
|
|
363
|
+
## Conclusion
|
|
364
|
+
|
|
365
|
+
**AWS Config's approach** is simpler and more straightforward - it counts compliant resources and divides by total resources. This works well for basic compliance tracking but doesn't reflect security priorities.
|
|
366
|
+
|
|
367
|
+
**Our weighted approach** adds complexity but provides **better security insights** by:
|
|
368
|
+
1. Prioritizing critical controls (encryption, access control)
|
|
369
|
+
2. Recognizing security maturity levels (IG1/IG2/IG3)
|
|
370
|
+
3. Preventing resource count from dominating scores
|
|
371
|
+
4. Providing actionable remediation guidance
|
|
372
|
+
|
|
373
|
+
**Best Practice:** Use both approaches:
|
|
374
|
+
- **AWS Config style** for compliance reporting and audits
|
|
375
|
+
- **Weighted approach** for security decision-making and prioritization
|
|
376
|
+
|
|
377
|
+
---
|
|
378
|
+
|
|
379
|
+
**Recommendation:** Consider adding an "unweighted score" output option to provide both perspectives to users.
|