cybersecurity · beginner · ~15 min · safe pentest lab

Default-deny action

Encode the default-deny policy.

Challenge

A seccomp filter should default-deny. Implement int seccomp_action(int allowed) returning 0 (ALLOW) if allowed is true, else -1 (KILL).

Starter code

int seccomp_action(int allowed) {
    /* TODO */
    return -1;
}

Solve this exercise in the browser editor — compile and run against the test harness, no setup required.