forked from mtusi2026/mtusi2026lab7
lab7: безопасность, mTLS, OpenBao и PKI lifecycle
This commit is contained in:
@@ -12,12 +12,6 @@ PATTERNS = {
|
||||
'private key': re.compile(r'BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY'),
|
||||
'bearer token': re.compile(r'Bearer\s+[A-Za-z0-9._-]{20,}'),
|
||||
}
|
||||
ALLOW = {
|
||||
'PASSWORD=messenger',
|
||||
'PASSWORD=messenger',
|
||||
'password: messenger',
|
||||
'POSTGRES_PASSWORD: messenger',
|
||||
}
|
||||
|
||||
def main():
|
||||
failures = []
|
||||
@@ -31,8 +25,6 @@ def main():
|
||||
for name, pattern in PATTERNS.items():
|
||||
for match in pattern.finditer(text):
|
||||
line = text[text.rfind('\n', 0, match.start()) + 1:text.find('\n', match.end())].strip()
|
||||
if any(allowed in line for allowed in ALLOW):
|
||||
continue
|
||||
failures.append(f'{path.relative_to(ROOT)}: {name}: {line[:160]}')
|
||||
if failures:
|
||||
print('FAIL: evidence scanner found possible secrets/signatures')
|
||||
|
||||
Reference in New Issue
Block a user