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,90 @@
1
+ """
2
+ FedRAMP 20x MCP Server - Ksi Tools
3
+
4
+ This module contains tool implementation functions for ksi.
5
+ """
6
+ import json
7
+ import logging
8
+ from typing import Any
9
+
10
+ logger = logging.getLogger(__name__)
11
+
12
+ async def get_ksi_impl(ksi_id: str, data_loader) -> str:
13
+ """
14
+ Get detailed information about a specific Key Security Indicator.
15
+
16
+ Args:
17
+ ksi_id: The KSI identifier (e.g., "KSI-ALL-01")
18
+
19
+ Returns:
20
+ Detailed KSI information
21
+ """
22
+ try:
23
+ # Ensure data is loaded
24
+ await data_loader.load_data()
25
+
26
+ # Get the KSI
27
+ ksi = data_loader.get_ksi(ksi_id)
28
+
29
+ if not ksi:
30
+ return f"Key Security Indicator {ksi_id} not found. Use list_ksi() to see all available indicators."
31
+
32
+ # Format the KSI information
33
+ result = f"# Key Security Indicator: {ksi.get('id', ksi_id)}\n\n"
34
+
35
+ # Add all KSI fields
36
+ for key, value in ksi.items():
37
+ if key not in ["id", "document", "document_name", "section"]:
38
+ result += f"**{key.replace('_', ' ').title()}:**\n"
39
+ if isinstance(value, (dict, list)):
40
+ result += f"```json\n{json.dumps(value, indent=2)}\n```\n\n"
41
+ else:
42
+ result += f"{value}\n\n"
43
+
44
+ # Add context
45
+ result += f"**Document:** {ksi.get('document_name', 'Unknown')}\n"
46
+
47
+ return result
48
+
49
+ except Exception as e:
50
+ logger.error(f"Error fetching KSI {ksi_id}: {e}")
51
+ return f"Error retrieving KSI {ksi_id}: {str(e)}"
52
+
53
+
54
+
55
+ async def list_ksi_impl(data_loader) -> str:
56
+ """
57
+ List all Key Security Indicators.
58
+
59
+ Returns:
60
+ Complete list of all Key Security Indicators
61
+ """
62
+ try:
63
+ # Ensure data is loaded
64
+ await data_loader.load_data()
65
+
66
+ # Get all KSI
67
+ ksi_list = data_loader.list_all_ksi()
68
+
69
+ if not ksi_list:
70
+ return "No Key Security Indicators found in the data."
71
+
72
+ # Sort by ID
73
+ sorted_ksi = sorted(ksi_list, key=lambda x: x.get("id", ""))
74
+
75
+ # Format the results
76
+ result = f"# Key Security Indicators\n\n"
77
+ result += f"Total: {len(ksi_list)} indicators\n\n"
78
+
79
+ for ksi in sorted_ksi:
80
+ ksi_id = ksi.get("id", "Unknown")
81
+ title = ksi.get("title", ksi.get("name", "No title"))
82
+ result += f"- **{ksi_id}**: {title}\n"
83
+
84
+ result += "\n*Use get_ksi(ksi_id) to see full details for any indicator.*\n"
85
+
86
+ return result
87
+
88
+ except Exception as e:
89
+ logger.error(f"Error listing KSI: {e}")
90
+ return f"Error retrieving KSI: {str(e)}"
@@ -0,0 +1,163 @@
1
+ """
2
+ FedRAMP 20x MCP Server - Requirements Tools
3
+
4
+ This module contains tool implementation functions for requirements.
5
+ """
6
+ import json
7
+ import logging
8
+ from typing import Any
9
+
10
+ logger = logging.getLogger(__name__)
11
+
12
+ async def get_control_impl(control_id: str, data_loader) -> str:
13
+ """
14
+ Get detailed information about a specific FedRAMP 20x requirement.
15
+
16
+ Args:
17
+ control_id: The requirement identifier (e.g., "FRD-ALL-01", "VDR-ALL-02")
18
+
19
+ Returns:
20
+ Detailed information about the requirement including definition,
21
+ notes, references, and related information
22
+ """
23
+ try:
24
+ # Ensure data is loaded
25
+ await data_loader.load_data()
26
+
27
+ # Get the requirement
28
+ req = data_loader.get_control(control_id)
29
+
30
+ if not req:
31
+ return f"Requirement {control_id} not found in FedRAMP 20x data."
32
+
33
+ # Format the requirement information
34
+ result = f"# Requirement: {req.get('id', control_id)}\n\n"
35
+
36
+ # Add term if present
37
+ if "term" in req:
38
+ result += f"## Term: {req['term']}\n\n"
39
+
40
+ # Add definition
41
+ if "definition" in req:
42
+ result += f"**Definition:**\n{req['definition']}\n\n"
43
+
44
+ # Add alternatives
45
+ if "alts" in req and req["alts"]:
46
+ result += f"**Also known as:** {', '.join(req['alts'])}\n\n"
47
+
48
+ # Add notes
49
+ if "note" in req:
50
+ result += f"**Note:**\n{req['note']}\n\n"
51
+ elif "notes" in req and isinstance(req["notes"], list):
52
+ result += "**Notes:**\n"
53
+ for note in req["notes"]:
54
+ result += f"- {note}\n"
55
+ result += "\n"
56
+
57
+ # Add references
58
+ if "reference" in req:
59
+ ref_url = req.get("reference_url", "")
60
+ if ref_url:
61
+ result += f"**Reference:** [{req['reference']}]({ref_url})\n\n"
62
+ else:
63
+ result += f"**Reference:** {req['reference']}\n\n"
64
+
65
+ # Add document context
66
+ result += f"**Document:** {req.get('document_name', 'Unknown')}\n"
67
+ result += f"**Section:** {req.get('section', 'Unknown')}\n"
68
+
69
+ return result
70
+
71
+ except Exception as e:
72
+ logger.error(f"Error fetching requirement {control_id}: {e}")
73
+ return f"Error retrieving requirement {control_id}: {str(e)}"
74
+
75
+
76
+
77
+ async def list_family_controls_impl(family: str, data_loader) -> str:
78
+ """
79
+ List all requirements within a specific document family.
80
+
81
+ Args:
82
+ family: The document family identifier (e.g., "FRD", "VDR", "CCM")
83
+
84
+ Returns:
85
+ List of all requirements in the specified family with brief descriptions
86
+ """
87
+ try:
88
+ # Ensure data is loaded
89
+ await data_loader.load_data()
90
+
91
+ # Get family requirements
92
+ reqs = data_loader.get_family_controls(family)
93
+
94
+ if not reqs:
95
+ return f"No requirements found for family {family}. Common families include: FRD (FedRAMP Definitions), VDR (Vulnerability Detection and Response), CCM (Collaborative Continuous Monitoring), etc."
96
+
97
+ # Format the results
98
+ result = f"# Requirements in Family: {family.upper()}\n\n"
99
+ result += f"Found {len(reqs)} requirements:\n\n"
100
+
101
+ for req in reqs:
102
+ req_id = req.get("id", "Unknown")
103
+ term = req.get("term", req.get("title", "No term"))
104
+ result += f"- **{req_id}**: {term}\n"
105
+
106
+ return result
107
+
108
+ except Exception as e:
109
+ logger.error(f"Error listing family {family}: {e}")
110
+ return f"Error retrieving family {family}: {str(e)}"
111
+
112
+
113
+
114
+ async def search_requirements_impl(keywords: str, data_loader) -> str:
115
+ """
116
+ Search for FedRAMP 20x requirements containing specific keywords.
117
+
118
+ Args:
119
+ keywords: Keywords to search for in requirement text (space-separated)
120
+
121
+ Returns:
122
+ Matching requirements with IDs and relevant excerpts
123
+ """
124
+ try:
125
+ # Ensure data is loaded
126
+ await data_loader.load_data()
127
+
128
+ # Search for requirements
129
+ reqs = data_loader.search_controls(keywords)
130
+
131
+ if not reqs:
132
+ return f"No requirements found matching keywords: '{keywords}'"
133
+
134
+ # Format the results
135
+ result = f"# Search Results for: '{keywords}'\n\n"
136
+ result += f"Found {len(reqs)} matching requirements:\n\n"
137
+
138
+ # Limit to first 20 results to avoid overwhelming output
139
+ for req in reqs[:20]:
140
+ req_id = req.get("id", "Unknown")
141
+ term = req.get("term", "")
142
+ definition = req.get("definition", "")
143
+
144
+ result += f"## {req_id}"
145
+ if term:
146
+ result += f": {term}"
147
+ result += "\n"
148
+
149
+ # Show a snippet of the definition
150
+ if definition:
151
+ snippet = definition[:200] + "..." if len(definition) > 200 else definition
152
+ result += f"{snippet}\n\n"
153
+ else:
154
+ result += "Match found in requirement data.\n\n"
155
+
156
+ if len(reqs) > 20:
157
+ result += f"\n*Showing first 20 of {len(reqs)} results. Refine your search for more specific results.*\n"
158
+
159
+ return result
160
+
161
+ except Exception as e:
162
+ logger.error(f"Error searching for '{keywords}': {e}")
163
+ return f"Error searching for '{keywords}': {str(e)}"