Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE: add support for SECCOMP_RET_AUDIT #64

Closed
wants to merge 4 commits into from

Conversation

tyhicks
Copy link
Contributor

@tyhicks tyhicks commented Jan 2, 2017

This pull request adds support for SECCOMP_RET_AUDIT which is a newly proposed seccomp return action that audits the syscall before allowing it to happen. It is similar to SECCOMP_RET_ALLOW in that the syscall is allowed but differs in that the syscall will be audited.

Extend libseccomp to support SECCOMP_RET_AUDIT, which is intended to
audit before allowing an action.

Signed-off-by: Tyler Hicks <[email protected]>
The basics needed to handle tests that use the new SCMP_ACT_AUDIT
action.

Signed-off-by: Tyler Hicks <[email protected]>
Extend the 06-sim-actions set of tests to include tests for
SCMP_ACT_AUDIT.

Signed-off-by: Tyler Hicks <[email protected]>
Test SCMP_ACT_AUDIT as the default action which all syscalls trigger.

Signed-off-by: Tyler Hicks <[email protected]>
@pcmoore pcmoore changed the title Add support for SECCOMP_RET_AUDIT RFE: add support for SECCOMP_RET_AUDIT Jan 2, 2017
@pcmoore
Copy link
Member

pcmoore commented Jan 2, 2017

Thanks for the PR. I'm going to defer looking at this until we see if/when the kernel functionality lands upstream. However, one thing to think about, and my apologies if you've already taken this into consideration in this PR, how do we detect if SECCOMP_RET_AUDIT is supported at runtime?

@tyhicks
Copy link
Contributor Author

tyhicks commented Jan 3, 2017 via email

@pcmoore
Copy link
Member

pcmoore commented Jan 3, 2017

  1. The seccomp kernel code fails close to SECCOMP_RET_KILL when the return action is unrecognized.

While this may be the "safe" option, it seems unlikely that application developers like converting an AUDIT action into a KILL action. I can already see the bug reports and hate mail flowing into my inbox ...

  1. Runtime detection wasn't added for the kill, trap, or errno actions (commit 308ad5f).

Look again at when that commit landed in libseccomp. Those actions have been supported by libseccomp since our first tagged release (v0.1.0) and were supported by the current kernel at that time. Since there was no libseccomp "legacy" at that point it was reasonable to require certain things, now that libseccomp is a bit more mature and is in use by a number of projects, we have to be more careful about older kernel versions.

Do you consider runtime detection for SECCOMP_RET_AUDIT to be a requirement? If so, it'll likely drive changes in the kernel patch set.

We need some way to safely handle SECCOMP_RET_AUDIT on older kernels that are not aware of this action; that's the requirement, and runtime detection is one way to solve that (we can safely avoid using AUDIT on kernels where it is not supported), but there may be others. Don't be afraid to get clever if needed, just remember that the code can't be too ugly, I've got to maintain this thing for a while ;)

@pcmoore
Copy link
Member

pcmoore commented Jan 3, 2017

You've probably already seen this, but if you haven't, we do have some detection hacks in src/system.c ... look at sys_chk_seccomp_syscall().

@tyhicks
Copy link
Contributor Author

tyhicks commented Jan 4, 2017 via email

@pcmoore
Copy link
Member

pcmoore commented Jan 25, 2017

@tyhicks what is the status of the kernel patches? I thought you were planning on submitting a revision taking into account the feedback you received, but I haven't seen anything; is this still on your todo list?

@tyhicks
Copy link
Contributor Author

tyhicks commented Jan 25, 2017

@pcmoore I'm still working on the second revision. A couple weeks travel and another week of catchup starved those patches for time but look for the patch set to go out later this week or early next.

@pcmoore
Copy link
Member

pcmoore commented Jan 28, 2017

@tyhicks Great, no rush, I just wanted to make sure someone was still working on this; I'm happy to hear you are following up with a second revision.

@pcmoore
Copy link
Member

pcmoore commented Aug 17, 2017

I think we can close this PR since it isn't relevant anymore, right @tyhicks?

@tyhicks
Copy link
Contributor Author

tyhicks commented Aug 17, 2017 via email

@pcmoore pcmoore closed this Aug 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants