Harden SSH Admission And Credential Input

This commit is contained in:
2026-09-15 20:49:04 +02:00
parent 436c27adb1
commit 751dfb9ddb
32 changed files with 1751 additions and 39 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env python3
"""Compile and run the actual allocation-free firmware policy on the host."""
import os
from pathlib import Path
import shlex
import subprocess
import tempfile
ROOT = Path(__file__).resolve().parents[2]
env = dict(os.environ, CCACHE_DISABLE="1")
with tempfile.TemporaryDirectory(prefix="ssh-auth-policy-") as temporary:
binary = Path(temporary) / "test"
command = shlex.split(env.get("CC", "cc")) + [
"-std=c11", "-Wall", "-Wextra", "-Werror", "-pedantic",
*shlex.split(env.get("CFLAGS", """-O2""")),
"-I", str(ROOT / "src"),
str(ROOT / "src/ssh_auth_policy.c"),
str(ROOT / "tests/ssh_auth_policy/test.c"),
"-o", str(binary),
]
subprocess.run(command, env=env, check=True)
subprocess.run([str(binary)], env=env, check=True)