fedramp-20x-mcp 0.4.8__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 (55) hide show
  1. fedramp_20x_mcp/__init__.py +14 -0
  2. fedramp_20x_mcp/__main__.py +12 -0
  3. fedramp_20x_mcp/data_loader.py +673 -0
  4. fedramp_20x_mcp/prompts/__init__.py +62 -0
  5. fedramp_20x_mcp/prompts/api_design_guide.txt +432 -0
  6. fedramp_20x_mcp/prompts/ato_package_checklist.txt +75 -0
  7. fedramp_20x_mcp/prompts/audit_preparation.txt +592 -0
  8. fedramp_20x_mcp/prompts/authorization_boundary_review.txt +76 -0
  9. fedramp_20x_mcp/prompts/azure_ksi_automation.txt +997 -0
  10. fedramp_20x_mcp/prompts/continuous_monitoring_setup.txt +61 -0
  11. fedramp_20x_mcp/prompts/documentation_generator.txt +499 -0
  12. fedramp_20x_mcp/prompts/gap_analysis.txt +25 -0
  13. fedramp_20x_mcp/prompts/initial_assessment_roadmap.txt +202 -0
  14. fedramp_20x_mcp/prompts/ksi_implementation_priorities.txt +283 -0
  15. fedramp_20x_mcp/prompts/migration_from_rev5.txt +440 -0
  16. fedramp_20x_mcp/prompts/quarterly_review_checklist.txt +231 -0
  17. fedramp_20x_mcp/prompts/significant_change_assessment.txt +50 -0
  18. fedramp_20x_mcp/prompts/vendor_evaluation.txt +349 -0
  19. fedramp_20x_mcp/prompts/vulnerability_remediation_timeline.txt +45 -0
  20. fedramp_20x_mcp/server.py +270 -0
  21. fedramp_20x_mcp/templates/__init__.py +75 -0
  22. fedramp_20x_mcp/templates/bicep/afr.txt +33 -0
  23. fedramp_20x_mcp/templates/bicep/cna.txt +48 -0
  24. fedramp_20x_mcp/templates/bicep/generic.txt +47 -0
  25. fedramp_20x_mcp/templates/bicep/iam.txt +211 -0
  26. fedramp_20x_mcp/templates/bicep/mla.txt +82 -0
  27. fedramp_20x_mcp/templates/bicep/rpl.txt +44 -0
  28. fedramp_20x_mcp/templates/bicep/svc.txt +54 -0
  29. fedramp_20x_mcp/templates/code/generic_csharp.txt +65 -0
  30. fedramp_20x_mcp/templates/code/generic_powershell.txt +65 -0
  31. fedramp_20x_mcp/templates/code/generic_python.txt +63 -0
  32. fedramp_20x_mcp/templates/code/iam_csharp.txt +150 -0
  33. fedramp_20x_mcp/templates/code/iam_powershell.txt +162 -0
  34. fedramp_20x_mcp/templates/code/iam_python.txt +224 -0
  35. fedramp_20x_mcp/templates/code/mla_python.txt +124 -0
  36. fedramp_20x_mcp/templates/terraform/afr.txt +29 -0
  37. fedramp_20x_mcp/templates/terraform/cna.txt +50 -0
  38. fedramp_20x_mcp/templates/terraform/generic.txt +40 -0
  39. fedramp_20x_mcp/templates/terraform/iam.txt +219 -0
  40. fedramp_20x_mcp/templates/terraform/mla.txt +29 -0
  41. fedramp_20x_mcp/templates/terraform/rpl.txt +32 -0
  42. fedramp_20x_mcp/templates/terraform/svc.txt +46 -0
  43. fedramp_20x_mcp/tools/__init__.py +167 -0
  44. fedramp_20x_mcp/tools/definitions.py +154 -0
  45. fedramp_20x_mcp/tools/documentation.py +155 -0
  46. fedramp_20x_mcp/tools/enhancements.py +2256 -0
  47. fedramp_20x_mcp/tools/evidence.py +701 -0
  48. fedramp_20x_mcp/tools/export.py +753 -0
  49. fedramp_20x_mcp/tools/ksi.py +90 -0
  50. fedramp_20x_mcp/tools/requirements.py +163 -0
  51. fedramp_20x_mcp-0.4.8.dist-info/METADATA +877 -0
  52. fedramp_20x_mcp-0.4.8.dist-info/RECORD +55 -0
  53. fedramp_20x_mcp-0.4.8.dist-info/WHEEL +4 -0
  54. fedramp_20x_mcp-0.4.8.dist-info/entry_points.txt +2 -0
  55. fedramp_20x_mcp-0.4.8.dist-info/licenses/LICENSE +27 -0
@@ -0,0 +1,701 @@
1
+ """
2
+ FedRAMP 20x MCP Server - Evidence Tools
3
+
4
+ This module contains tool implementation functions for evidence.
5
+ """
6
+ import json
7
+ import logging
8
+ from typing import Any
9
+
10
+ logger = logging.getLogger(__name__)
11
+
12
+ async def get_infrastructure_code_for_ksi_impl(ksi_id: str, data_loader, get_infrastructure_template, infrastructure_type: str = "bicep") -> str:
13
+ """
14
+ Get Infrastructure-as-Code templates for automated KSI evidence collection.
15
+
16
+ Provides Bicep or Terraform templates to deploy Azure resources needed for
17
+ collecting and storing evidence for specific KSI requirements.
18
+
19
+ Args:
20
+ ksi_id: The KSI identifier (e.g., "KSI-IAM-01", "KSI-MLA-01")
21
+ infrastructure_type: Type of IaC template ("bicep" or "terraform")
22
+
23
+ Returns:
24
+ Infrastructure-as-Code template with deployment instructions
25
+ """
26
+ # Normalize inputs
27
+ ksi_id = ksi_id.upper()
28
+ infrastructure_type = infrastructure_type.lower()
29
+
30
+ # Get the KSI details
31
+ ksi = data_loader.get_ksi(ksi_id)
32
+ if not ksi:
33
+ return f"KSI '{ksi_id}' not found. Use list_ksi to see all available KSIs."
34
+
35
+ ksi_name = ksi.get("name", ksi_id)
36
+ ksi_description = ksi.get("description", "")
37
+
38
+ # Build the response based on KSI family
39
+ family = ksi_id.split("-")[1] if "-" in ksi_id else ""
40
+
41
+ result = f"""# Infrastructure-as-Code for {ksi_id}: {ksi_name}
42
+
43
+ **Requirement:** {ksi_description}
44
+
45
+ ## Evidence Collection Strategy
46
+
47
+ This infrastructure automates evidence collection for {ksi_id} by:
48
+ 1. Deploying necessary Azure resources for monitoring/logging
49
+ 2. Configuring automated data collection
50
+ 3. Storing evidence in secure, immutable storage
51
+ 4. Providing APIs for Authorization Data Sharing (FRR-ADS)
52
+
53
+ """
54
+
55
+ # Add specific IaC templates based on KSI family
56
+ if family == "IAM":
57
+ result += _get_iam_infrastructure(ksi_id, infrastructure_type, get_infrastructure_template)
58
+ elif family == "MLA":
59
+ result += _get_mla_infrastructure(ksi_id, infrastructure_type, get_infrastructure_template)
60
+ elif family == "AFR":
61
+ result += _get_afr_infrastructure(ksi_id, infrastructure_type, get_infrastructure_template)
62
+ elif family == "CNA":
63
+ result += _get_cna_infrastructure(ksi_id, infrastructure_type, get_infrastructure_template)
64
+ elif family == "RPL":
65
+ result += _get_rpl_infrastructure(ksi_id, infrastructure_type, get_infrastructure_template)
66
+ elif family == "SVC":
67
+ result += _get_svc_infrastructure(ksi_id, infrastructure_type, get_infrastructure_template)
68
+ else:
69
+ result += _get_generic_infrastructure(ksi_id, infrastructure_type, get_infrastructure_template)
70
+
71
+ result += """
72
+
73
+ ## Deployment Instructions
74
+
75
+ ### Prerequisites
76
+ - Azure CLI installed and authenticated
77
+ - Appropriate Azure subscription permissions
78
+ - Resource group created for FedRAMP resources
79
+
80
+ ### Deploy with Azure CLI
81
+ ```bash
82
+ # Create resource group if needed
83
+ az group create --name rg-fedramp-evidence --location eastus
84
+
85
+ # Deploy template
86
+ az deployment group create \\
87
+ --resource-group rg-fedramp-evidence \\
88
+ --template-file main.bicep \\
89
+ --parameters @parameters.json
90
+
91
+ # Verify deployment
92
+ az deployment group show \\
93
+ --resource-group rg-fedramp-evidence \\
94
+ --name main
95
+ ```
96
+
97
+ ### Post-Deployment Configuration
98
+ 1. Configure data sources to send logs/metrics to deployed resources
99
+ 2. Set up automated collection schedules (Azure Functions/Automation)
100
+ 3. Test evidence collection end-to-end
101
+ 4. Integrate with Authorization Data Sharing API
102
+ 5. Document infrastructure in System Security Plan
103
+
104
+ ## Maintenance
105
+ - Review storage capacity monthly
106
+ - Update retention policies as needed
107
+ - Test evidence retrieval quarterly
108
+ - Update IaC templates when Azure resources change
109
+
110
+ *Generated by FedRAMP 20x MCP Server - Infrastructure Code Tool*
111
+ """
112
+
113
+ return result
114
+
115
+
116
+ def _get_iam_infrastructure(ksi_id: str, infra_type: str, get_infrastructure_template) -> str:
117
+ """Generate IAM-specific infrastructure code using templates."""
118
+ return get_infrastructure_template('iam', infra_type)
119
+
120
+
121
+ def _get_mla_infrastructure(ksi_id: str, infra_type: str, get_infrastructure_template) -> str:
122
+ """Generate MLA (Monitoring, Logging & Analysis) infrastructure code using templates."""
123
+ return get_infrastructure_template('mla', infra_type)
124
+
125
+
126
+ def _get_afr_infrastructure(ksi_id: str, infra_type: str, get_infrastructure_template) -> str:
127
+ """Generate Authorization Framework infrastructure code using templates."""
128
+ return get_infrastructure_template('afr', infra_type)
129
+
130
+
131
+ def _get_cna_infrastructure(ksi_id: str, infra_type: str, get_infrastructure_template) -> str:
132
+ """Generate Cloud Native Architecture infrastructure code using templates."""
133
+ return get_infrastructure_template('cna', infra_type)
134
+
135
+
136
+ def _get_rpl_infrastructure(ksi_id: str, infra_type: str, get_infrastructure_template) -> str:
137
+ """Generate Recovery & Planning infrastructure code using templates."""
138
+ return get_infrastructure_template('rpl', infra_type)
139
+
140
+
141
+ def _get_svc_infrastructure(ksi_id: str, infra_type: str, get_infrastructure_template) -> str:
142
+ """Generate Service Management infrastructure code using templates."""
143
+ return get_infrastructure_template('svc', infra_type)
144
+
145
+
146
+ def _get_generic_infrastructure(ksi_id: str, infra_type: str, get_infrastructure_template) -> str:
147
+ """Generate generic evidence collection infrastructure using templates."""
148
+ return get_infrastructure_template('generic', infra_type)
149
+
150
+
151
+
152
+ async def get_evidence_collection_code_impl(ksi_id: str, data_loader, get_code_template, language: str = "python") -> str:
153
+ """
154
+ Get code examples for collecting KSI evidence programmatically.
155
+
156
+ Provides production-ready code in Python, C#, or PowerShell for automating
157
+ evidence collection and storage for specific KSI requirements.
158
+
159
+ Args:
160
+ ksi_id: The KSI identifier (e.g., "KSI-IAM-01", "KSI-MLA-01")
161
+ language: Programming language ("python", "csharp", or "powershell")
162
+
163
+ Returns:
164
+ Code examples with explanations for evidence collection
165
+ """
166
+ # Normalize inputs
167
+ ksi_id = ksi_id.upper()
168
+ language = language.lower()
169
+
170
+ if language not in ["python", "csharp", "powershell"]:
171
+ return f"Language '{language}' not supported. Choose: python, csharp, or powershell"
172
+
173
+ # Get the KSI details
174
+ ksi = data_loader.get_ksi(ksi_id)
175
+ if not ksi:
176
+ return f"KSI '{ksi_id}' not found. Use list_ksi to see all available KSIs."
177
+
178
+ ksi_name = ksi.get("name", ksi_id)
179
+ ksi_description = ksi.get("description", "")
180
+
181
+ result = f"""# Evidence Collection Code for {ksi_id}: {ksi_name}
182
+
183
+ **Requirement:** {ksi_description}
184
+
185
+ **Language:** {language.title()}
186
+
187
+ ## Overview
188
+
189
+ This code automates evidence collection for {ksi_id} by:
190
+ 1. Querying Azure resources for compliance data
191
+ 2. Formatting evidence in a structured format
192
+ 3. Storing evidence in Azure Blob Storage
193
+ 4. Generating metadata for Authorization Data Sharing API
194
+
195
+ """
196
+
197
+ # Generate language-specific code based on KSI family
198
+ family = ksi_id.split("-")[1] if "-" in ksi_id else ""
199
+
200
+ if language == "python":
201
+ result += _get_python_evidence_code(ksi_id, family, get_code_template)
202
+ elif language == "csharp":
203
+ result += _get_csharp_evidence_code(ksi_id, family, get_code_template)
204
+ elif language == "powershell":
205
+ result += _get_powershell_evidence_code(ksi_id, family, get_code_template)
206
+
207
+ result += """
208
+
209
+ ## Deployment
210
+
211
+ ### Option 1: Azure Function (Scheduled)
212
+ Deploy as an Azure Function with timer trigger for automated daily collection.
213
+
214
+ ### Option 2: Azure Automation Runbook
215
+ Deploy as an Automation Runbook for scheduled execution.
216
+
217
+ ### Option 3: GitHub Actions
218
+ Run via GitHub Actions on a schedule for evidence collection.
219
+
220
+ ## Testing
221
+
222
+ Test the code locally before deploying:
223
+ 1. Set up Azure authentication (Azure CLI or Managed Identity)
224
+ 2. Run the script with test parameters
225
+ 3. Verify evidence is collected and stored correctly
226
+ 4. Check evidence format matches OSCAL/FRR-ADS requirements
227
+
228
+ ## Monitoring
229
+
230
+ - Log all collection runs to Azure Monitor
231
+ - Alert on collection failures
232
+ - Track evidence volume over time
233
+ - Monitor storage costs
234
+
235
+ *Generated by FedRAMP 20x MCP Server - Evidence Collection Code Tool*
236
+ """
237
+
238
+ return result
239
+
240
+
241
+ def _get_python_evidence_code(ksi_id: str, family: str, get_code_template) -> str:
242
+ """Generate Python evidence collection code using templates."""
243
+ return get_code_template(family, 'python')
244
+
245
+
246
+ def _get_csharp_evidence_code(ksi_id: str, family: str, get_code_template) -> str:
247
+ """Generate C# evidence collection code using templates."""
248
+ return get_code_template(family, 'csharp')
249
+
250
+
251
+ def _get_powershell_evidence_code(ksi_id: str, family: str, get_code_template) -> str:
252
+ """Generate PowerShell evidence collection code using templates."""
253
+ return get_code_template(family, 'powershell')
254
+
255
+
256
+
257
+
258
+
259
+ async def get_evidence_automation_architecture_impl(data_loader, scope: str = "all") -> str:
260
+ """
261
+ Get end-to-end architecture guidance for automated evidence collection.
262
+
263
+ Provides architectural patterns, best practices, and complete automation
264
+ strategies for FedRAMP 20x evidence collection across all KSIs.
265
+
266
+ Args:
267
+ scope: Scope of architecture ("all", "single-ksi", "category", or "minimal")
268
+
269
+ Returns:
270
+ Architecture guidance with diagrams and implementation roadmap
271
+ """
272
+ scope = scope.lower()
273
+
274
+ result = """# Evidence Collection Automation Architecture for FedRAMP 20x
275
+
276
+ ## Overview
277
+
278
+ This architecture automates evidence collection for all FedRAMP 20x KSIs, providing:
279
+ - Continuous, automated evidence gathering
280
+ - Secure, immutable evidence storage
281
+ - API access for Authorization Data Sharing (FRR-ADS)
282
+ - Compliance tracking and reporting
283
+
284
+ """
285
+
286
+ if scope == "minimal":
287
+ result += """## Minimal Viable Architecture
288
+
289
+ ### Components
290
+ 1. **Azure Log Analytics** - Central logging repository
291
+ 2. **Azure Blob Storage** - Evidence storage with immutability
292
+ 3. **Azure Function** - Scheduled evidence collection
293
+ 4. **Managed Identity** - Secure authentication
294
+
295
+ ### Data Flow
296
+ ```
297
+ Azure Resources → Log Analytics → Azure Function (daily) → Blob Storage → FRR-ADS API
298
+ ```
299
+
300
+ ### Setup Time: 2-3 days
301
+ ### Covers: 40-50 KSIs
302
+
303
+ ### Quick Start
304
+ ```bash
305
+ # Deploy infrastructure
306
+ az deployment group create --template-file minimal-architecture.bicep
307
+
308
+ # Deploy collection function
309
+ func azure functionapp publish func-evidence-collector
310
+
311
+ # Verify
312
+ curl https://func-evidence-collector.azurewebsites.net/api/health
313
+ ```
314
+
315
+ Use `get_infrastructure_code_for_ksi` and `get_evidence_collection_code` for implementation details.
316
+ """
317
+ elif scope == "single-ksi":
318
+ result += """## Single KSI Architecture
319
+
320
+ For implementing evidence collection for a single KSI:
321
+
322
+ ### Components
323
+ 1. **Data Source** - The Azure resource being monitored (e.g., Entra ID, Key Vault)
324
+ 2. **Collection Logic** - Script/Function to gather evidence
325
+ 3. **Evidence Storage** - Blob container for this KSI's evidence
326
+ 4. **Scheduler** - Timer trigger or schedule
327
+
328
+ ### Architecture Pattern
329
+ ```
330
+ ┌─────────────────┐
331
+ │ Azure Resource │ (Data Source)
332
+ │ (e.g., Entra) │
333
+ └────────┬────────┘
334
+ │ API Query
335
+
336
+ ┌─────────────────┐
337
+ │ Azure Function │ (Collection Logic)
338
+ │ or Automation │
339
+ └────────┬────────┘
340
+ │ Store Evidence
341
+
342
+ ┌─────────────────┐
343
+ │ Blob Storage │ (Evidence Repository)
344
+ │ /ksi-iam-01/ │
345
+ └─────────────────┘
346
+ ```
347
+
348
+ ### Implementation Steps
349
+ 1. Use `get_infrastructure_code_for_ksi(ksi_id)` to deploy infrastructure
350
+ 2. Use `get_evidence_collection_code(ksi_id, language)` to implement collection
351
+ 3. Test manually, then enable scheduling
352
+ 4. Monitor for 1 week before marking as production-ready
353
+
354
+ ### Timeline: 1-2 days per KSI
355
+ """
356
+ elif scope == "category":
357
+ result += """## Category-Based Architecture
358
+
359
+ For implementing evidence collection by KSI category (IAM, MLA, etc.):
360
+
361
+ ### Architecture by Category
362
+
363
+ #### 1. IAM (Identity & Access Management) - 7 KSIs
364
+ ```
365
+ Microsoft Entra ID → Microsoft Graph API → Evidence Collector → Blob Storage
366
+
367
+ Log Analytics (audit)
368
+ ```
369
+ **Collection Method:** Microsoft Graph API queries
370
+ **Frequency:** Daily
371
+ **Storage:** /iam-evidence/
372
+
373
+ #### 2. MLA (Monitoring, Logging & Analysis) - 8 KSIs
374
+ ```
375
+ All Azure Resources → Log Analytics Workspace → KQL Queries → Evidence Export
376
+
377
+ Blob Storage /mla-evidence/
378
+ ```
379
+ **Collection Method:** Kusto (KQL) queries
380
+ **Frequency:** Continuous ingestion, daily export
381
+ **Storage:** /mla-evidence/
382
+
383
+ #### 3. AFR (Authorization Framework) - 11 KSIs
384
+ ```
385
+ Multiple Sources → Aggregation Function → Unified Evidence Format → Blob Storage
386
+ ├─ Defender for Cloud (vulnerabilities)
387
+ ├─ Policy Compliance (assessments)
388
+ ├─ Log Analytics (CCM data)
389
+ └─ Azure Resource Graph (inventory)
390
+ ```
391
+ **Collection Method:** Multiple APIs aggregated
392
+ **Frequency:** Daily
393
+ **Storage:** /afr-evidence/
394
+
395
+ #### 4. CNA (Cloud Native Architecture) - 8 KSIs
396
+ ```
397
+ AKS Cluster → Container Insights → Log Analytics → Evidence Collector
398
+ ├─ Network Policies
399
+ ├─ Pod Security Standards
400
+ └─ Policy Enforcement (OPA/Kyverno)
401
+ ```
402
+ **Collection Method:** Kubernetes API + Container Insights
403
+ **Frequency:** Continuous monitoring, daily summary
404
+ **Storage:** /cna-evidence/
405
+
406
+ #### 5. RPL (Recovery & Planning) - 4 KSIs
407
+ ```
408
+ Recovery Services Vault → Backup Reports API → Evidence Collector → Blob Storage
409
+ Azure Site Recovery → Replication Status API →
410
+ ```
411
+ **Collection Method:** Backup/DR APIs
412
+ **Frequency:** Daily
413
+ **Storage:** /rpl-evidence/
414
+
415
+ ### Implementation Approach
416
+ 1. Deploy category infrastructure (use `get_infrastructure_code_for_ksi`)
417
+ 2. Implement all KSIs in category together
418
+ 3. Share collection logic where possible
419
+ 4. Test category as a unit
420
+
421
+ ### Timeline: 1 week per category
422
+ """
423
+ else: # "all" or default
424
+ result += """## Complete Enterprise Architecture
425
+
426
+ ### High-Level Architecture
427
+
428
+ ```
429
+ ┌─────────────────────────────────────────────────────────────────────┐
430
+ │ Azure Subscription │
431
+ │ │
432
+ │ ┌──────────────────┐ ┌──────────────────┐ │
433
+ │ │ Data Sources │ │ Collection │ │
434
+ │ │ │ │ Orchestration │ │
435
+ │ │ • Entra ID │───────▶│ │ │
436
+ │ │ • Defender │ │ Azure Functions │ │
437
+ │ │ • Log Analytics │───────▶│ (Timer Triggers) │ │
438
+ │ │ • Key Vault │ │ │ │
439
+ │ │ • AKS Clusters │───────▶│ OR │ │
440
+ │ │ • Backup Vaults │ │ │ │
441
+ │ │ • Policy │───────▶│ Azure Automation │ │
442
+ │ └──────────────────┘ │ (Runbooks) │ │
443
+ │ └────────┬──────────┘ │
444
+ │ │ │
445
+ │ ▼ │
446
+ │ ┌─────────────────┐ │
447
+ │ │ Evidence Storage │ │
448
+ │ │ │ │
449
+ │ │ Blob Storage │ │
450
+ │ │ (GRS, Immutable) │ │
451
+ │ │ │ │
452
+ │ │ /iam-evidence/ │ │
453
+ │ │ /mla-evidence/ │ │
454
+ │ │ /afr-evidence/ │ │
455
+ │ │ /cna-evidence/ │ │
456
+ │ │ /... │ │
457
+ │ └────────┬──────────┘ │
458
+ │ │ │
459
+ │ ▼ │
460
+ │ ┌─────────────────┐ │
461
+ │ │ FRR-ADS API │ │
462
+ │ │ │ │
463
+ │ │ App Service │ │
464
+ │ │ (OSCAL Format) │ │
465
+ │ └────────┬──────────┘ │
466
+ │ │ │
467
+ └───────────────────────────────────────┼────────────────────────────┘
468
+ │ HTTPS
469
+
470
+ ┌─────────────────┐
471
+ │ Consumers │
472
+ │ • FedRAMP PMO │
473
+ │ • Agencies │
474
+ │ • 3PAO │
475
+ └─────────────────┘
476
+ ```
477
+
478
+ ### Core Components
479
+
480
+ #### 1. Data Collection Layer
481
+ - **Azure Functions** (Recommended)
482
+ - Serverless, cost-effective
483
+ - Easy scheduling with timer triggers
484
+ - Supports Python, C#, PowerShell
485
+ - Managed Identity for authentication
486
+
487
+ - **Azure Automation** (Alternative)
488
+ - PowerShell-focused
489
+ - Built-in scheduling
490
+ - Better for complex workflows
491
+
492
+ **Recommendation:** Use Functions for new implementations
493
+
494
+ #### 2. Evidence Storage Layer
495
+ - **Azure Blob Storage**
496
+ - Geo-redundant (GRS) for durability
497
+ - Immutability enabled (WORM)
498
+ - 7-year retention for FedRAMP
499
+ - Encrypted at rest (Microsoft-managed keys)
500
+ - Soft delete enabled
501
+
502
+ **Container Structure:**
503
+ ```
504
+ evidence-storage/
505
+ ├── iam-evidence/
506
+ │ ├── ksi-iam-01/
507
+ │ │ ├── 2025-12-01.json
508
+ │ │ └── 2025-12-02.json
509
+ │ └── ksi-iam-05/
510
+ ├── mla-evidence/
511
+ ├── afr-evidence/
512
+ └── metadata/
513
+ └── collection-log.json
514
+ ```
515
+
516
+ #### 3. Authorization Data Sharing API
517
+ - **Azure App Service** or **Azure Functions** (HTTP triggers)
518
+ - OAuth 2.0 or mTLS authentication
519
+ - OSCAL format responses
520
+ - Rate limiting (1000 req/hour per client)
521
+ - Integrated with Blob Storage
522
+
523
+ #### 4. Monitoring & Alerting
524
+ - **Azure Monitor**
525
+ - Collection success/failure alerts
526
+ - Evidence storage metrics
527
+ - API performance monitoring
528
+
529
+ - **Log Analytics**
530
+ - Centralized logging for all collection activities
531
+ - Retention: 2 years minimum
532
+
533
+ ### Implementation Phases
534
+
535
+ #### Phase 1: Foundation (Week 1-2)
536
+ - [ ] Deploy core infrastructure (Blob Storage, Log Analytics)
537
+ - [ ] Set up Managed Identity and RBAC
538
+ - [ ] Create evidence storage containers
539
+ - [ ] Deploy monitoring and alerting
540
+
541
+ **Deliverables:** Infrastructure ready to receive evidence
542
+
543
+ #### Phase 2: Priority KSIs (Week 3-6)
544
+ Implement high-priority KSIs first:
545
+ - [ ] KSI-MLA-01: SIEM/Logging (enables others)
546
+ - [ ] KSI-IAM-01: MFA (quick win)
547
+ - [ ] KSI-AFR-04: Vulnerability scanning
548
+ - [ ] KSI-PIY-01: Automated inventory
549
+ - [ ] KSI-SVC-06: Secret management
550
+
551
+ **Deliverables:** 5 KSIs collecting evidence automatically
552
+
553
+ #### Phase 3: Core Security (Week 7-10)
554
+ - [ ] All IAM KSIs (7 total)
555
+ - [ ] All MLA KSIs (8 total)
556
+ - [ ] Incident Response KSIs (3 total)
557
+
558
+ **Deliverables:** 18 KSIs operational
559
+
560
+ #### Phase 4: Cloud Native & Operations (Week 11-14)
561
+ - [ ] All CNA KSIs (8 total)
562
+ - [ ] All CMT KSIs (5 total)
563
+ - [ ] All RPL KSIs (4 total)
564
+
565
+ **Deliverables:** 35 KSIs operational
566
+
567
+ #### Phase 5: Governance & Compliance (Week 15-18)
568
+ - [ ] All AFR KSIs (11 total)
569
+ - [ ] All CED KSIs (4 total)
570
+ - [ ] All PIY KSIs (10 total)
571
+ - [ ] All SVC KSIs (10 total)
572
+ - [ ] All TPR KSIs (4 total)
573
+
574
+ **Deliverables:** All 72 KSIs operational
575
+
576
+ #### Phase 6: API & Integration (Week 19-20)
577
+ - [ ] Deploy FRR-ADS API
578
+ - [ ] Integrate with evidence storage
579
+ - [ ] Test with sample queries
580
+ - [ ] Document API for consumers
581
+
582
+ **Deliverables:** Complete evidence collection and sharing system
583
+
584
+ ### Technology Stack
585
+
586
+ **Recommended:**
587
+ - **Language:** Python (best Azure SDK support, easiest for ops teams)
588
+ - **Compute:** Azure Functions (serverless, cost-effective)
589
+ - **Storage:** Azure Blob Storage GRS (built-in redundancy)
590
+ - **Secrets:** Azure Key Vault (managed, audited)
591
+ - **Monitoring:** Azure Monitor + Log Analytics
592
+ - **Identity:** Managed Identity (no credentials to manage)
593
+ - **API:** Azure App Service or API Management
594
+
595
+ **Alternative (PowerShell-focused):**
596
+ - **Language:** PowerShell
597
+ - **Compute:** Azure Automation
598
+ - **Rest:** Same as recommended
599
+
600
+ ### Security Architecture
601
+
602
+ #### Authentication & Authorization
603
+ ```
604
+ Collection Functions
605
+ ↓ (Managed Identity)
606
+ Azure Resources (RBAC: Reader, Monitoring Reader)
607
+
608
+ Evidence Storage (RBAC: Storage Blob Data Contributor)
609
+
610
+ FRR-ADS API (OAuth 2.0 / mTLS)
611
+
612
+ External Consumers (Per-client permissions)
613
+ ```
614
+
615
+ #### Network Security
616
+ - Private Endpoints for Storage (optional but recommended)
617
+ - Function App: VNet integration if needed
618
+ - API: Application Gateway + WAF for external access
619
+
620
+ #### Data Security
621
+ - Encryption at rest: Microsoft-managed keys (or BYOK)
622
+ - Encryption in transit: TLS 1.2+
623
+ - Immutability: WORM enabled on evidence containers
624
+ - Access logging: All blob access logged to Log Analytics
625
+
626
+ ### Scaling Considerations
627
+
628
+ **Small Organization (< 50 resources):**
629
+ - Single Function App
630
+ - Standard Blob Storage
631
+ - Basic monitoring
632
+
633
+ **Medium Organization (50-500 resources):**
634
+ - Multiple Function Apps (by category)
635
+ - Premium Blob Storage
636
+ - Enhanced monitoring
637
+
638
+ **Large Organization (500+ resources):**
639
+ - Dedicated Function Apps per category
640
+ - Premium storage with Private Endpoints
641
+ - Application Insights Premium
642
+ - API Management for FRR-ADS API
643
+
644
+ ### Disaster Recovery
645
+
646
+ - **RTO:** < 4 hours (redeploy Functions from IaC)
647
+ - **RPO:** 0 (evidence written immediately to GRS storage)
648
+ - **Backup:** Evidence stored in GRS (replicated to paired region)
649
+ - **Testing:** Quarterly DR drill (fail over to secondary region)
650
+
651
+ ### Compliance Considerations
652
+
653
+ **FedRAMP Requirements Met:**
654
+ - ✅ Automated evidence collection (FRD-ALL-07)
655
+ - ✅ Immutable storage (FRR-AFR-09)
656
+ - ✅ Authorization Data Sharing API (FRR-ADS)
657
+ - ✅ Continuous monitoring (FRR-CCM)
658
+ - ✅ Audit logging (KSI-MLA-02)
659
+
660
+ ### Next Steps
661
+
662
+ 1. **Assess Current State**
663
+ - What evidence is already being collected?
664
+ - What infrastructure exists?
665
+ - What gaps need to be filled?
666
+
667
+ 2. **Plan Implementation**
668
+ - Choose implementation order (by priority or category)
669
+ - Allocate resources (team, budget, time)
670
+ - Set milestones and deadlines
671
+
672
+ 3. **Deploy Foundation**
673
+ - Use `get_infrastructure_code_for_ksi` for Bicep templates
674
+ - Deploy core infrastructure first
675
+ - Test with one KSI before scaling
676
+
677
+ 4. **Implement KSIs**
678
+ - Use `get_evidence_collection_code` for each KSI
679
+ - Start with high-priority KSIs
680
+ - Test thoroughly before production
681
+
682
+ 5. **Integrate & Test**
683
+ - Deploy FRR-ADS API
684
+ - Test end-to-end evidence flow
685
+ - Conduct security review
686
+
687
+ 6. **Document & Train**
688
+ - Update System Security Plan
689
+ - Train operations team
690
+ - Create runbooks for troubleshooting
691
+
692
+ *Generated by FedRAMP 20x MCP Server - Evidence Automation Architecture Tool*
693
+ """
694
+
695
+ return result
696
+
697
+
698
+ def main():
699
+ """Run the FedRAMP 20x MCP server."""
700
+ logger.info("Starting FedRAMP 20x MCP Server")
701
+ mcp.run(transport="stdio")