|
| 1 | +import warnings |
| 2 | + |
| 3 | +from dashboard.common_methods import get_section_containers_cis |
| 4 | + |
| 5 | +warnings.filterwarnings("ignore") |
| 6 | + |
| 7 | + |
| 8 | +def get_table(data): |
| 9 | + aux = data[ |
| 10 | + [ |
| 11 | + "REQUIREMENTS_ID", |
| 12 | + "REQUIREMENTS_DESCRIPTION", |
| 13 | + "REQUIREMENTS_ATTRIBUTES_SECTION", |
| 14 | + "CHECKID", |
| 15 | + "STATUS", |
| 16 | + "REGION", |
| 17 | + "ACCOUNTID", |
| 18 | + "RESOURCEID", |
| 19 | + ] |
| 20 | + ].copy() |
| 21 | + |
| 22 | + # Shorten the long FedRAMP KSI descriptions for better display |
| 23 | + ksi_short_names = { |
| 24 | + "A secure cloud service offering will protect user data, control access, and apply zero trust principles": "Identity and Access Management", |
| 25 | + "A secure cloud service offering will use cloud native architecture and design principles to enforce and enhance the Confidentiality, Integrity and Availability of the system": "Cloud Native Architecture", |
| 26 | + "A secure cloud service provider will ensure that all system changes are properly documented and configuration baselines are updated accordingly": "Change Management", |
| 27 | + "A secure cloud service provider will continuously educate their employees on cybersecurity measures, testing them regularly": "Cybersecurity Education", |
| 28 | + "A secure cloud service offering will document, report, and analyze security incidents to ensure regulatory compliance and continuous security improvement": "Incident Reporting", |
| 29 | + "A secure cloud service offering will monitor, log, and audit all important events, activity, and changes": "Monitoring, Logging, and Auditing", |
| 30 | + "A secure cloud service offering will have intentional, organized, universal guidance for how every information resource, including personnel, is secured": "Policy and Inventory", |
| 31 | + "A secure cloud service offering will define, maintain, and test incident response plan(s) and recovery capabilities to ensure minimal service disruption and data loss": "Recovery Planning", |
| 32 | + "A secure cloud service offering will follow FedRAMP encryption policies, continuously verify information resource integrity, and restrict access to third-party information resources": "Service Configuration", |
| 33 | + "A secure cloud service offering will understand, monitor, and manage supply chain risks from third-party information resources": "Third-Party Information Resources", |
| 34 | + } |
| 35 | + |
| 36 | + # Replace long descriptions with short names - use contains for partial matching |
| 37 | + if not aux.empty: |
| 38 | + for long_desc, short_name in ksi_short_names.items(): |
| 39 | + mask = aux["REQUIREMENTS_DESCRIPTION"].str.contains( |
| 40 | + long_desc, na=False, regex=False |
| 41 | + ) |
| 42 | + aux.loc[mask, "REQUIREMENTS_DESCRIPTION"] = short_name |
| 43 | + |
| 44 | + return get_section_containers_cis( |
| 45 | + aux, "REQUIREMENTS_ID", "REQUIREMENTS_ATTRIBUTES_SECTION" |
| 46 | + ) |
0 commit comments