(self, context)
| 17 | """Look for leaking secrets such as passwords or API tokens""" |
| 18 | |
| 19 | def node_Var(self, context): |
| 20 | name = str(context.node.var_name) |
| 21 | |
| 22 | if not SECRET_REGEX.match(name): |
| 23 | return |
| 24 | elif not isinstance(context.node.value, String): |
| 25 | return |
| 26 | |
| 27 | secret = str(context.node.value) |
| 28 | |
| 29 | yield from self._gen_hit(context, name, secret, extra={"type": "variable"}) |
| 30 | |
| 31 | def _gen_hit(self, context, name, secret, **extra): |
| 32 | if len(secret) < 5: |