Giter Club home page Giter Club logo

Comments (12)

pjbgf avatar pjbgf commented on May 24, 2024 2

This method is ideal for long running containers which would be "monitored" as its functionality is being used, as it only captures the syscalls made during the execution of the container being observed. The more permutations of execution paths ran, the more accurate will be the resulting profile.

A challenge on using seccomp-bpf-hook on a cluster is that it will need to run as root and with CAP_SYS_ADMIN capability, which effectively allows that container to bypass a considerable amount of security isolation primitives in the nodes. This can put end-users at risk if they were to decide using such feature in production or mixed usage clusters/nodes.

Ideally such approach would be used on ephemeral non-production clusters with the assistance of E2E tests which would be executed against the container being observed.

from security-profiles-operator.

saschagrunert avatar saschagrunert commented on May 24, 2024 1

/assign
I'll take over the work from @rhafer :)

from security-profiles-operator.

saschagrunert avatar saschagrunert commented on May 24, 2024

/priority important-longterm

from security-profiles-operator.

saschagrunert avatar saschagrunert commented on May 24, 2024

Moving to v2.

from security-profiles-operator.

saschagrunert avatar saschagrunert commented on May 24, 2024

cc @rhafer @ereslibre @mrostecki

from security-profiles-operator.

moolen avatar moolen commented on May 24, 2024

I did a bit of reasearch, i just want to cross-reference them:

  • cri-containerd doesn't support oci-hooks yet, this is IMO a major blocker for this (containerd/containerd#6645)
  • ftrace could be a different option (depends on oci-hooks, but doesn't require kernel headers): https://github.com/KentaTada/oci-ftrace-syscall-analyzer
  • we could talk to containerd directly to get a PID and inject the eBPF tracer after the container starts (far from ideal, but currently possible)

from security-profiles-operator.

saschagrunert avatar saschagrunert commented on May 24, 2024

Interesting approaches @moolen and thank you for the insights. 🙏 From my perspective the most clean way would be to let containerd suppport OCI hooks, where I see no major blockers for it. 🤷

from security-profiles-operator.

rhafer avatar rhafer commented on May 24, 2024

A challenge on using seccomp-bpf-hook on a cluster is that it will need to run as root and with CAP_SYS_ADMIN capability, which effectively allows that container to bypass a considerable amount of security isolation primitives in the nodes. This can put end-users at risk if they were to decide using such feature in production or mixed usage clusters/nodes.

@pjbgf Isn't it only the hook itself that needs CAP_SYS_ADMIN (in order to setup the bpf tracer). IIUC this doesn't mean that the container itself needs the CAP_SYS_ADMIN capability.

from security-profiles-operator.

rhafer avatar rhafer commented on May 24, 2024

I did a bit of reasearch, i just want to cross-reference them:

Yeah, that might be worth a look. Another option would be to utilize the seccomp notifcation mechanism (as already mentioned in initial post), but that does require some changes on lower level runtimes (runc, crun, ...)

  • we could talk to containerd directly to get a PID and inject the eBPF tracer after the container starts (far from ideal, but currently possible)

Hm, I guess at that point it might already have missed a couple of syscalls? So result would be imcomplete. I agree with @saschagrunert here, it would be cool if containerd would finally get support for oci-hooks.

from security-profiles-operator.

pjbgf avatar pjbgf commented on May 24, 2024

@pjbgf Isn't it only the hook itself that needs CAP_SYS_ADMIN (in order to setup the bpf tracer). IIUC this doesn't mean that the container itself needs the CAP_SYS_ADMIN capability.

Very fair observation. Overall my concern is that requiring users to have something running with CAP_SYS_ADMIN capability within their clusters may lead a few potential route of privesc/security features bypass that cannot go unchecked. This is not a show stopper in itself, however we need to think what compensating controls we would put in place to limit potential damage.

Once we get to a working prototype we can brainstorm around it.

from security-profiles-operator.

saschagrunert avatar saschagrunert commented on May 24, 2024

Let's close this for now, more enhancements to the feature to come.
/close

from security-profiles-operator.

k8s-ci-robot avatar k8s-ci-robot commented on May 24, 2024

@saschagrunert: Closing this issue.

In response to this:

Let's close this for now, more enhancements to the feature to come.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

from security-profiles-operator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.