From: Paul Moore <paul@paul-moore.com>
To: libseccomp-discuss@lists.sourceforge.net
Cc: David Windsor <dwindsor@gmail.com>,
linux-security-module@vger.kernel.org,
Will Drewry <wad@chromium.org>,
linux-kernel@vger.kernel.org
Subject: Re: [libseccomp-discuss] ANN: libseccomp
Date: Mon, 16 Apr 2012 10:09:50 -0400 [thread overview]
Message-ID: <30335309.9kgxB5Lv94@sifl> (raw)
In-Reply-To: <CAEXv5_jiZsd6t=H1KWMNhUdgMez0B-WdC5XAHzdHffjOQh_J4A@mail.gmail.com>
On Saturday, April 14, 2012 10:10:28 AM David Windsor wrote:
> Out of curiosity, are there any current efforts towards creating a "learning
> mode" type of application for seccomp? I.e. creating a profile for a
> particular application based upon which syscalls it makes during normal
> operation. I realize that many people consider this a security anti-
> pattern, but it could be useful for the initial creation of a seccomp filter
> for a particular application, and other security subsystems already do this
> (ala AppArmor's learning/complain mode). IIUC, no other kernel mechanisms
> would need to be created; ptrace could accomplish syscall monitoring.
I'm not aware of any serious efforts, but as Kees already pointed out, his
seccomp tutorial could be extended to do something similar to what you
describe. Kees' tutorial uses raw BPF, but the same basic principles would
work with libseccomp as well if you wanted a higher level interface.
The libseccomp sources also contain a simple little script which runs an
application via strace and presents a slightly cleaned up version of the
strace report which shows the syscalls, their frequency (important if you want
to tune the seccomp filter), and some of the arguments you're likely to want
to filter on. Simple example:
# ./tools/sys_inspector -h
usage ./tools/sys_inspector [-f] [-a] [-o <file>] <command> [<args>]
# ./tools/sys_inspector -f /bin/true
============================================================
Syscall Report ("/bin/true")
freq syscall
============================================================
8 mmap
4 mprotect
2 open
2 fstat
2 close
1 read
1 munmap
1 exit_group
1 execve
1 brk
1 arch_prctl
1 access
--
paul moore
www.paul-moore.com
prev parent reply other threads:[~2012-04-16 14:09 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-09 18:58 ANN: libseccomp Paul Moore
2012-04-09 19:16 ` Kees Cook
2012-04-09 21:32 ` Paul Moore
2012-04-09 21:51 ` Will Drewry
2012-04-09 22:46 ` Paul Moore
2012-04-13 20:14 ` Paul Moore
2012-04-14 2:47 ` Henrique de Moraes Holschuh
2012-04-16 14:15 ` [libseccomp-discuss] " Paul Moore
2012-04-09 22:56 ` Serge Hallyn
2012-04-09 19:25 ` Josh Boyer
2012-04-09 20:02 ` H. Peter Anvin
2012-04-09 20:14 ` Josh Boyer
2012-04-09 21:28 ` Paul Moore
2012-04-10 20:29 ` Paul Moore
2012-04-11 0:27 ` Josh Boyer
[not found] ` <CAEXv5_jiZsd6t=H1KWMNhUdgMez0B-WdC5XAHzdHffjOQh_J4A@mail.gmail.com>
2012-04-15 16:20 ` Kees Cook
2012-04-16 14:09 ` Paul Moore [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=30335309.9kgxB5Lv94@sifl \
--to=paul@paul-moore.com \
--cc=dwindsor@gmail.com \
--cc=libseccomp-discuss@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=wad@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox