Skip to content

Commit

Permalink
ZED tool parser to mark also HTTP best practices
Browse files Browse the repository at this point in the history
  • Loading branch information
raulikak committed Sep 2, 2024
1 parent 6dec6ee commit b7b23f0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tcsfw/zed_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ def process_file(self, data: BytesIO, file_name: str, interface: EventInterface,
ep = EndpointAddress(DNSName.name_or_ip(host), Protocol.TCP, port)
ps = self._read_alerts(interface, evidence, ep, raw.get("alerts", []))
exp = f"{self.tool.name} scan completed"
ev = PropertyAddressEvent(evidence, ep, Properties.WEB_BEST.value_set(ps, explanation=exp))
# Web best practice
web_key = Properties.WEB_BEST
ev = PropertyAddressEvent(evidence, ep, web_key.value_set(ps, explanation=exp))
interface.property_address_update(ev)
# also HTTP best practice
http_key = Properties.PROTOCOL.append_key(Protocol.HTTP.value).append_key("best-practices")
ev = PropertyAddressEvent(evidence, ep, http_key.value_set({web_key}))
interface.property_address_update(ev)

return True
Expand Down

0 comments on commit b7b23f0

Please sign in to comment.