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,62 @@
1
+ """
2
+ Prompt loader for FedRAMP 20x MCP Server.
3
+
4
+ This module provides functions to load prompt templates from external files.
5
+ """
6
+ import logging
7
+ from pathlib import Path
8
+ from typing import Optional
9
+
10
+ logger = logging.getLogger(__name__)
11
+
12
+ # Get the directory containing prompt files
13
+ PROMPTS_DIR = Path(__file__).parent
14
+
15
+
16
+ def load_prompt(prompt_name: str) -> str:
17
+ """
18
+ Load a prompt template from file.
19
+
20
+ Args:
21
+ prompt_name: Name of the prompt (without .txt extension)
22
+
23
+ Returns:
24
+ The prompt text content
25
+
26
+ Raises:
27
+ FileNotFoundError: If the prompt file doesn't exist
28
+ """
29
+ prompt_file = PROMPTS_DIR / f"{prompt_name}.txt"
30
+
31
+ if not prompt_file.exists():
32
+ logger.error(f"Prompt file not found: {prompt_file}")
33
+ raise FileNotFoundError(f"Prompt template '{prompt_name}' not found")
34
+
35
+ try:
36
+ with open(prompt_file, 'r', encoding='utf-8') as f:
37
+ content = f.read()
38
+ logger.debug(f"Loaded prompt: {prompt_name} ({len(content)} chars)")
39
+ return content
40
+ except Exception as e:
41
+ logger.error(f"Error loading prompt {prompt_name}: {e}")
42
+ raise
43
+
44
+
45
+ def get_prompt(prompt_name: str, default: Optional[str] = None) -> str:
46
+ """
47
+ Get a prompt template, with optional fallback.
48
+
49
+ Args:
50
+ prompt_name: Name of the prompt (without .txt extension)
51
+ default: Default text to return if prompt not found
52
+
53
+ Returns:
54
+ The prompt text content, or default if not found and default provided
55
+ """
56
+ try:
57
+ return load_prompt(prompt_name)
58
+ except FileNotFoundError:
59
+ if default is not None:
60
+ logger.warning(f"Prompt {prompt_name} not found, using default")
61
+ return default
62
+ raise
@@ -0,0 +1,432 @@
1
+ I'll help you design your FedRAMP 20x Authorization Data Sharing API.
2
+
3
+ # Authorization Data Sharing API Design Guide (FRR-ADS)
4
+
5
+ ## Overview
6
+
7
+ FedRAMP 20x requires CSPs to share authorization data via API rather than document uploads. This API must provide machine-readable access to your security posture.
8
+
9
+ **Important: Format Requirements**
10
+ - **Required:** Machine-readable formats (JSON, XML, or other structured data)
11
+ - **Optional:** OSCAL is a NIST standard that can be used as one implementation approach
12
+ - FRR-ADS requirements specify "machine-readable" only - OSCAL is NOT mentioned in FedRAMP 20x
13
+ - Choose custom JSON/XML or OSCAL based on your implementation needs
14
+
15
+ ## Required Endpoints
16
+
17
+ ### 1. System Information
18
+ ```
19
+ GET /api/v1/system
20
+ GET /api/v1/authorization-boundary
21
+ GET /api/v1/system-characteristics
22
+ ```
23
+
24
+ **Response Format Example (Using OSCAL - One Option):**
25
+ ```json
26
+ {
27
+ "system-security-plan": {
28
+ "uuid": "12345678-1234-1234-1234-123456789abc",
29
+ "metadata": {
30
+ "title": "My Cloud Service SSP",
31
+ "last-modified": "2025-11-26T10:00:00Z",
32
+ "version": "1.2.0",
33
+ "oscal-version": "1.1.2"
34
+ },
35
+ "system-characteristics": {
36
+ "system-ids": [...],
37
+ "system-name": "My Cloud Service",
38
+ "description": "...",
39
+ "security-sensitivity-level": "moderate",
40
+ "authorization-boundary": {
41
+ "description": "...",
42
+ "diagrams": [...],
43
+ "remarks": "..."
44
+ }
45
+ },
46
+ "system-implementation": {
47
+ "users": [...],
48
+ "components": [...],
49
+ "leveraged-authorizations": [...]
50
+ }
51
+ }
52
+ }
53
+ ```
54
+
55
+ ### 2. Vulnerability Data
56
+ ```
57
+ GET /api/v1/vulnerabilities
58
+ GET /api/v1/vulnerabilities?status=open
59
+ GET /api/v1/vulnerabilities?severity=high
60
+ GET /api/v1/vulnerabilities/{vuln-id}
61
+ ```
62
+
63
+ **Response Format:**
64
+ ```json
65
+ {
66
+ "vulnerabilities": [
67
+ {
68
+ "id": "vuln-2025-001",
69
+ "cve_id": "CVE-2025-12345",
70
+ "severity": "HIGH",
71
+ "cvss_score": 8.5,
72
+ "discovered_date": "2025-11-20",
73
+ "status": "remediation_in_progress",
74
+ "remediation_deadline": "2025-11-27",
75
+ "affected_components": ["web-server-prod-01"],
76
+ "description": "...",
77
+ "remediation_plan": "..."
78
+ }
79
+ ],
80
+ "metadata": {
81
+ "total_count": 45,
82
+ "open_count": 12,
83
+ "last_scan": "2025-11-26T08:00:00Z"
84
+ }
85
+ }
86
+ ```
87
+
88
+ ### 3. Key Security Indicators
89
+ ```
90
+ GET /api/v1/ksi
91
+ GET /api/v1/ksi/{category}
92
+ GET /api/v1/ksi/{ksi-id}
93
+ GET /api/v1/ksi/metrics?start_date=2025-10-01&end_date=2025-12-31
94
+ ```
95
+
96
+ **Response Format:**
97
+ ```json
98
+ {
99
+ "ksi_metrics": [
100
+ {
101
+ "id": "KSI-IAM-01",
102
+ "name": "Phishing-Resistant MFA",
103
+ "status": "compliant",
104
+ "metric_value": "100%",
105
+ "measurement_date": "2025-11-26",
106
+ "details": {
107
+ "total_users": 150,
108
+ "users_with_mfa": 150,
109
+ "mfa_type": "FIDO2"
110
+ },
111
+ "evidence": {
112
+ "type": "automated_report",
113
+ "location": "https://evidencestorage.blob.core.windows.net/reports/iam-mfa-report-2025-11.pdf"
114
+ }
115
+ }
116
+ ]
117
+ }
118
+ ```
119
+
120
+ ### 4. Incidents
121
+ ```
122
+ GET /api/v1/incidents
123
+ GET /api/v1/incidents?start_date=2025-10-01
124
+ GET /api/v1/incidents/{incident-id}
125
+ ```
126
+
127
+ **Response Format:**
128
+ ```json
129
+ {
130
+ "incidents": [
131
+ {
132
+ "id": "INC-2025-003",
133
+ "type": "security_event",
134
+ "severity": "medium",
135
+ "detected_date": "2025-11-15T14:30:00Z",
136
+ "resolved_date": "2025-11-15T18:45:00Z",
137
+ "affected_agencies": [],
138
+ "description": "Suspicious login attempts detected",
139
+ "response_actions": "Account locked, investigation completed",
140
+ "status": "closed"
141
+ }
142
+ ]
143
+ }
144
+ ```
145
+
146
+ ### 5. Changes
147
+ ```
148
+ GET /api/v1/changes
149
+ GET /api/v1/changes?type=significant
150
+ GET /api/v1/changes/{change-id}
151
+ ```
152
+
153
+ **Response Format:**
154
+ ```json
155
+ {
156
+ "changes": [
157
+ {
158
+ "id": "CHG-2025-042",
159
+ "type": "transformative",
160
+ "date": "2025-11-20",
161
+ "description": "Added new microservice for analytics",
162
+ "impact_assessment": "New component added to boundary",
163
+ "notification_sent": true,
164
+ "notification_date": "2025-11-20",
165
+ "approvals": [...]
166
+ }
167
+ ]
168
+ }
169
+ ```
170
+
171
+ ### 6. POA&M
172
+ ```
173
+ GET /api/v1/poam
174
+ GET /api/v1/poam?status=open
175
+ GET /api/v1/poam/{poam-id}
176
+ ```
177
+
178
+ **Response Format (OSCAL POA&M):**
179
+ ```json
180
+ {
181
+ "plan-of-action-and-milestones": {
182
+ "uuid": "...",
183
+ "metadata": {...},
184
+ "poam-items": [
185
+ {
186
+ "uuid": "...",
187
+ "title": "Implement automated log forwarding",
188
+ "description": "...",
189
+ "risk-statement": "...",
190
+ "remediation-tracking": {
191
+ "tracking-entry": [
192
+ {
193
+ "date-time-stamp": "2025-11-26T10:00:00Z",
194
+ "title": "Initial identification",
195
+ "description": "..."
196
+ }
197
+ ]
198
+ }
199
+ }
200
+ ]
201
+ }
202
+ }
203
+ ```
204
+
205
+ ## Authentication & Authorization
206
+
207
+ ### Option 1: OAuth 2.0 (Recommended for Multiple Consumers)
208
+
209
+ **Flow:**
210
+ ```
211
+ 1. Agency registers as OAuth client with FedRAMP
212
+ 2. FedRAMP provides client_id and client_secret
213
+ 3. Agency requests token:
214
+ POST /oauth/token
215
+ {
216
+ "grant_type": "client_credentials",
217
+ "client_id": "agency-xyz",
218
+ "client_secret": "..."
219
+ }
220
+ 4. Use token in requests:
221
+ GET /api/v1/system
222
+ Authorization: Bearer {token}
223
+ ```
224
+
225
+ **Implementation:**
226
+ ```python
227
+ # Using FastAPI + OAuth2
228
+ from fastapi import FastAPI, Depends, HTTPException
229
+ from fastapi.security import OAuth2PasswordBearer
230
+
231
+ oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
232
+
233
+ @app.get("/api/v1/system")
234
+ async def get_system(token: str = Depends(oauth2_scheme)):
235
+ # Validate token
236
+ client = validate_token(token)
237
+ if not client:
238
+ raise HTTPException(status_code=401)
239
+
240
+ # Return system data
241
+ return get_system_data()
242
+ ```
243
+
244
+ ### Option 2: Mutual TLS (mTLS) (Recommended for High Security)
245
+
246
+ **Configuration:**
247
+ ```
248
+ 1. FedRAMP/Agency provides client certificate
249
+ 2. Configure API to require client certificates
250
+ 3. Validate certificate on each request
251
+ ```
252
+
253
+ **Nginx Configuration:**
254
+ ```nginx
255
+ server {
256
+ listen 443 ssl;
257
+ server_name api.myservice.com;
258
+
259
+ ssl_certificate /etc/nginx/ssl/server.crt;
260
+ ssl_certificate_key /etc/nginx/ssl/server.key;
261
+
262
+ # Require client certificate
263
+ ssl_client_certificate /etc/nginx/ssl/ca.crt;
264
+ ssl_verify_client on;
265
+
266
+ location /api/ {
267
+ proxy_pass http://backend;
268
+ proxy_set_header X-SSL-Client-Cert $ssl_client_cert;
269
+ }
270
+ }
271
+ ```
272
+
273
+ ## Access Control
274
+
275
+ **Principle: Least Privilege**
276
+
277
+ Different consumers should have different access levels:
278
+
279
+ ```json
280
+ {
281
+ "client_id": "fedramp-pmo",
282
+ "permissions": [
283
+ "read:system",
284
+ "read:vulnerabilities",
285
+ "read:ksi",
286
+ "read:incidents",
287
+ "read:changes",
288
+ "read:poam"
289
+ ]
290
+ },
291
+ {
292
+ "client_id": "agency-xyz",
293
+ "permissions": [
294
+ "read:system",
295
+ "read:vulnerabilities",
296
+ "read:incidents:agency-xyz", // Only their incidents
297
+ "read:ksi"
298
+ ]
299
+ }
300
+ ```
301
+
302
+ ## API Versioning
303
+
304
+ **Use URL versioning:**
305
+ ```
306
+ /api/v1/system (current)
307
+ /api/v2/system (future)
308
+ ```
309
+
310
+ **Include version in responses:**
311
+ ```json
312
+ {
313
+ "api_version": "1.0.0",
314
+ "data": {...}
315
+ }
316
+ ```
317
+
318
+ ## Rate Limiting
319
+
320
+ **Recommended limits:**
321
+ ```
322
+ - Per client: 1000 requests/hour
323
+ - Per endpoint: 100 requests/minute
324
+ - Burst: Allow 10 requests/second
325
+ ```
326
+
327
+ **Headers:**
328
+ ```
329
+ X-RateLimit-Limit: 1000
330
+ X-RateLimit-Remaining: 850
331
+ X-RateLimit-Reset: 1701014400
332
+ ```
333
+
334
+ ## Error Handling
335
+
336
+ **Standard error format:**
337
+ ```json
338
+ {
339
+ "error": {
340
+ "code": "unauthorized",
341
+ "message": "Invalid or expired token",
342
+ "details": "Token expired at 2025-11-26T10:00:00Z",
343
+ "timestamp": "2025-11-26T12:30:00Z",
344
+ "request_id": "req-abc-123"
345
+ }
346
+ }
347
+ ```
348
+
349
+ ## Monitoring & Logging
350
+
351
+ **Log all API access:**
352
+ ```json
353
+ {
354
+ "timestamp": "2025-11-26T10:00:00Z",
355
+ "client_id": "fedramp-pmo",
356
+ "endpoint": "/api/v1/vulnerabilities",
357
+ "method": "GET",
358
+ "status_code": 200,
359
+ "response_time_ms": 145,
360
+ "user_agent": "FedRAMP-Client/1.0"
361
+ }
362
+ ```
363
+
364
+ **Alert on:**
365
+ - Repeated authentication failures
366
+ - Unusual access patterns
367
+ - High error rates
368
+ - Slow response times
369
+
370
+ ## Testing
371
+
372
+ **Provide test credentials:**
373
+ ```
374
+ Test API endpoint: https://api-test.myservice.com
375
+ Client ID: test-client
376
+ Client Secret: (provided securely)
377
+ ```
378
+
379
+ **Sample queries:**
380
+ ```bash
381
+ # Test authentication
382
+ curl -X POST https://api-test.myservice.com/oauth/token \
383
+ -d "grant_type=client_credentials&client_id=test-client&client_secret=..."
384
+
385
+ # Test system endpoint
386
+ curl https://api-test.myservice.com/api/v1/system \
387
+ -H "Authorization: Bearer {token}"
388
+
389
+ # Test vulnerabilities
390
+ curl https://api-test.myservice.com/api/v1/vulnerabilities?status=open \
391
+ -H "Authorization: Bearer {token}"
392
+ ```
393
+
394
+ ## Documentation
395
+
396
+ **Provide OpenAPI/Swagger spec:**
397
+ ```yaml
398
+ openapi: 3.0.0
399
+ info:
400
+ title: Authorization Data Sharing API
401
+ version: 1.0.0
402
+ description: FedRAMP 20x compliant API for sharing authorization data
403
+
404
+ servers:
405
+ - url: https://api.myservice.com
406
+ description: Production API
407
+
408
+ paths:
409
+ /api/v1/system:
410
+ get:
411
+ summary: Get system information
412
+ security:
413
+ - oauth2: [read:system]
414
+ responses:
415
+ '200':
416
+ description: System information in OSCAL format
417
+ ```
418
+
419
+ ## Implementation Checklist
420
+
421
+ - [ ] Choose authentication method (OAuth 2.0 or mTLS)
422
+ - [ ] Implement all required endpoints
423
+ - [ ] Use machine-readable formats (JSON/XML) - custom or OSCAL based on your needs
424
+ - [ ] Add proper error handling
425
+ - [ ] Implement rate limiting
426
+ - [ ] Add comprehensive logging
427
+ - [ ] Write API documentation (OpenAPI)
428
+ - [ ] Create test credentials
429
+ - [ ] Test with FedRAMP/agency
430
+ - [ ] Monitor API usage and performance
431
+
432
+ Use get_implementation_examples('FRR-ADS-01') for more detailed implementation guidance.
@@ -0,0 +1,75 @@
1
+ I'll help you prepare a complete FedRAMP Authorization to Operate (ATO) package checklist.
2
+
3
+ **FedRAMP 20x Documentation Requirements**:
4
+
5
+ **1. Minimum Assessment Scope (MAS)**
6
+ - System boundary definition
7
+ - Information resources inventory
8
+ - Federal customer data handling documentation
9
+ - Third-party service dependencies
10
+
11
+ **2. Authorization Data Sharing (ADS)**
12
+ - Access control matrix
13
+ - Trust center documentation
14
+ - Authorization sharing agreements
15
+
16
+ **3. FedRAMP Definitions (FRD)**
17
+ - Verify all terminology usage aligns with official definitions
18
+ - Document any service-specific interpretations
19
+
20
+ **4. Key Security Indicators (KSI) - 72 total indicators across:**
21
+ - Authorization & Accreditation (AFR)
22
+ - Cybersecurity Education (CED)
23
+ - Commitment (CMT)
24
+ - Change Management & Notifications (CNA)
25
+ - Identity & Access Management (IAM)
26
+ - Information Resources (INR)
27
+ - Monitoring, Logging & Analysis (MLA)
28
+ - Privacy (PIY)
29
+ - Reporting (RPL)
30
+ - Service Offerings (SVC)
31
+ - Third Party Resources (TPR)
32
+
33
+ **5. Vulnerability Detection & Response (VDR)**
34
+ - Vulnerability scanning procedures
35
+ - Remediation timeframes by severity
36
+ - Exception documentation
37
+ - Agency-specific requirements
38
+
39
+ **6. Incident Communications Procedures (ICP)**
40
+ - Incident response plan
41
+ - Communication protocols
42
+ - Escalation procedures
43
+
44
+ **7. Collaborative Continuous Monitoring (CCM)**
45
+ - Quarterly review procedures
46
+ - Continuous monitoring documentation
47
+ - Agency collaboration processes
48
+
49
+ **8. Persistent Validation & Assessment (PVA)**
50
+ - Assessment schedules by impact level
51
+ - Validation procedures
52
+ - Remediation tracking
53
+
54
+ **9. Recommended Secure Configuration (RSC)**
55
+ - Baseline configurations
56
+ - Configuration management procedures
57
+
58
+ **10. Significant Change Notifications (SCN)**
59
+ - Change classification procedures
60
+ - Notification protocols
61
+ - Impact assessment process
62
+
63
+ **11. Using Cryptographic Modules (UCM)**
64
+ - FIPS 140 compliance documentation
65
+ - Cryptographic module inventory
66
+
67
+ **12. FedRAMP Security Inbox (FSI)**
68
+ - Security inbox setup
69
+ - Response procedures
70
+ - Communication protocols
71
+
72
+ **What to do next**:
73
+ 1. Use the search_requirements tool to find specific details for each area
74
+ 2. Use get_definition to clarify any terminology
75
+ 3. Use list_ksi to review all Key Security Indicators you need to address