|
oc_connect
|
Classes | |
| class | EgressFinding |
| class | EgressBlockedError |
Functions | |
| float | shannon_entropy (str value) |
| tuple[EgressFinding,...] | scan_text (str text) |
| None | require_safe (str text) |
Variables | |
| int | _MIN_ENTROPY_LENGTH = 24 |
| float | _ENTROPY_THRESHOLD = 4.5 |
| _GITHUB_SHAPE = re.compile("gh" + "[pousr]_" + "[A-Za-z0-9]" + "{20,}") | |
| _AWS_SHAPE = re.compile("AKIA" + "[0-9A-Z]" + "{16}") | |
| _OPENAI_SHAPE = re.compile("sk-" + "[A-Za-z0-9]" + "{20,}") | |
| _TELEGRAM_SHAPE = re.compile("[0-9]" + "{6,12}:" + "[A-Za-z0-9_-]" + "{30,}") | |
| _TOKEN_SHAPE = re.compile("[A-Za-z0-9_" + "+/=-]" + "{24,}") | |
| tuple | _LABELS |
| _NAMED_VALUE_SHAPE | |
| tuple | THREE_OPTIONS_ESCALATION |
Plain-text outbound scanner derived from OCT's secret-scanner heuristics. Provenance: the pattern vocabulary and Shannon-entropy formula are ported from ``oct/oct/tools/secret_scanner.py``. OCT's scanner itself is intentionally not imported: it walks Python AST nodes and cannot certify ordinary message prose. This module scans content tokens and well-known credential shapes instead. Dependencies ------------ - oc_diagnostics (_dbg structured logging of text length and finding count per scan, and of each block by finding count only)
| None oc_connect.egress.require_safe | ( | str | text | ) |
| tuple[EgressFinding, ...] oc_connect.egress.scan_text | ( | str | text | ) |
| float oc_connect.egress.shannon_entropy | ( | str | value | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| tuple oc_connect.egress.THREE_OPTIONS_ESCALATION |