| 96 | |
| 97 | @staticmethod |
| 98 | def _convert_to_artifact(detection) -> dict: |
| 99 | artifact = { |
| 100 | "location": { |
| 101 | "uri": detection.scan_location.location.as_uri() |
| 102 | }, |
| 103 | "length": detection.scan_location.size, |
| 104 | "hashes": { |
| 105 | "md5": detection.scan_location.metadata["md5"], |
| 106 | "sha-1": detection.scan_location.metadata["sha1"], |
| 107 | "sha-256": detection.scan_location.metadata["sha256"], |
| 108 | "sha-512": detection.scan_location.metadata["sha512"], |
| 109 | "tlsh": detection.scan_location.metadata["tlsh"] |
| 110 | } |
| 111 | } |
| 112 | return artifact |