Compliance controls are treated as covered solely from a security-domain match
Source references: 4The mapper treats every requirement in a related security domain as matching the associated control IDs; it does not inspect requirement substance, control version, implementation evidence, or test results. Its own method describes the matches as requirements that “satisfy a compliance control.”
A user could incorrectly conclude that PCI DSS, HIPAA, GDPR, or OWASP controls are satisfied, leading to release approval, reduced audit scope, or missed control gaps.
The example returns preset control IDs solely from a requirement's security domain and describes same-domain requirements as satisfying the control; it does not inspect the requirement text, framework version, implementation, or test evidence. Using its matrix for compliance decisions could overstate coverage. This is template code, not proof of execution; users can require control-by-control review, applicable versions, and implementation evidence.
def map_requirement_to_compliance( self, requirement: SecurityRequirement, frameworks: List[ComplianceFramework] ) -> Dict[str, List[str]]: """Map a requirement to compliance controls.""" mapping = {} for framework in frameworks: controls = self.FRAMEWORK_CONTROLS.get(framework, {}) domain_controls = controls.get(requirement.domain, []) if domain_controls: mapping[framework.value] = domain_controls return mappingShow 3 other places
def get_requirements_for_control( self, requirement_set: RequirementSet, framework: ComplianceFramework, control_id: str ) -> List[SecurityRequirement]: """Find requirements that satisfy a compliance control.""" matching = [] framework_controls = self.FRAMEWORK_CONTROLS.get(framework, {}) for domain, controls in framework_controls.items(): if control_id in controls: matching.extend(requirement_set.get_by_domain(domain)) return matching ) if not matching: gaps["missing_controls"].append(f"{framework.value}:{control}") elif len(matching) < 2: gaps["weak_coverage"].append(f"{framework.value}:{control}") for domain, controls in framework_controls.items(): for control in controls: reqs = self.get_requirements_for_control( requirement_set, framework, control ) if reqs: matrix[framework.value][control] = [r.id for r in reqs]