(self, context: Context, hit, value: str)
| 120 | yield self.__generate_hit(context, hit, value) |
| 121 | |
| 122 | def __generate_hit(self, context: Context, hit, value: str): |
| 123 | score = hit._signature.get("score", 0) |
| 124 | return Detection( |
| 125 | detection_type="StringMatch", |
| 126 | message=hit.message, |
| 127 | extra={ |
| 128 | "signature_id": hit._signature["id"], |
| 129 | "string": value |
| 130 | }, |
| 131 | signature=f"string_finder#{hit._signature['id']}#{utils.fast_checksum(value)}#{context.signature}", |
| 132 | score=score, |
| 133 | node=context.node, |
| 134 | location=context.visitor.path, |
| 135 | tags=set(hit._signature.get("tags", [])), |
| 136 | informational=hit._signature.get("informational", (score==0)) |
| 137 | ) |
no test coverage detected