MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _map_lynis_code

Method _map_lynis_code

compliance_report.py:120–129  ·  view source on GitHub ↗
(self, code: str)

Source from the content-addressed store, hash-verified

118 # ------------------------------------------------------------------
119
120 def _map_lynis_code(self, code: str) -> Dict[str, Any]:
121 cis = self.mappings.get("cis", {})
122 exact = cis.get("lynis_to_cis", {})
123 prefix = cis.get("prefix_to_cis", {})
124 if code in exact:
125 return exact[code]
126 head = code.split("-", 1)[0] if code else ""
127 if head in prefix:
128 return prefix[head]
129 return {"title": "Unmapped finding (informational)", "controls": ["Unmapped (informational)"]}
130
131 def build_cis_report(self, host: Optional[str] = None) -> Dict[str, Any]:
132 lynis = self._collect_lynis(host)

Callers 1

bucketMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected