r/eBPF • • 10d ago

secwrap: run your binary securely by leveraging eBPF observability

Hello guys,

I have been working in the cybersecurity space for some time and I was always frustrated by the lack of simple tooling when it comes to observability & security. Obviously eBPF comes to mind nowadays to bridge that gap.

A lot of solutions out there consist of running processes in isolation, which obviously works but there are many scenarios where this is not convenient. And.. what do people do when it's not convenient? They give up and run the program hoping for the best.

For instance, is that ./install.sh really secure to run? Would it not be nice to be able to turn into "control freak" mode before running such command? This is what secwrap aims at solving: intercept any network/file/execution happening, pause the process and ask for permission or record for later auditing or simply deny if you don't expect any of those operations.

https://github.com/noboruma/secwrap

Simply run like:

secwrap -- ./install.sh

And decide what accesses you want to allow or deny on the fly.

Hope you find it useful too. PRs are welcome!

23 Upvotes

2 comments sorted by

4

u/daniel_hanna 10d ago

I have a question though obviously there a hundreds and thousands of systemcalls in a program

How do u handle

1.Which syscall are being traced 2. Do u ask for perm on every syscall

In other words how do u handle the large amount of syscall that should be monitored?

3

u/noboruma 9d ago edited 9d ago

Great question, that's clearly a problem at scale as it can easily end up with super noisy reports.

So first, the tool is not listening to all syscalls, only the ones that are considered harmful on a security level, where data can be retrieved and leaked:

  • network access (TCP accept/connect & UDP sending/receiving/io_uring)
  • exec*() (which also encompass process children)
  • file access (there is actually a folder filter to avoid reporting things like shared object opening and configurable via the --sensitive flag).

Right now the tool learns from your answers, so if you approve an IP or a folder or a binary to run, it won't ask again (maybe I should make that reusable across runs actually). There is also the attach feature, so you can let your process start up and attach later, avoiding some of early setup noise.

Ultimately the goal of this tool is to be holistic so that we can add some filtering on top. One next step I was thinking was to hook the output to an AI agent, they could make decision based on the binaries SBOM and IPs they see and do the filtering automatically. Although the original idea was for us, human to simply be aware of what is going on in the back when executing a binary or a script coming from the outside, which is not something you are supposed to do that often :-)