public inbox for gentoo-hardened@lists.gentoo.org
 help / color / mirror / Atom feed
From: Alex Efros <powerman@powerman.name>
To: gentoo-hardened@lists.gentoo.org
Subject: [gentoo-hardened] GRKERNSEC_PROC_USERGROUP and docker exec
Date: Fri, 8 Sep 2017 22:20:45 +0300	[thread overview]
Message-ID: <20170908192045.GC2677@home.power> (raw)

Hi!

It looks like when connecting to existing docker container with `docker
exec` CONFIG_GRKERNSEC_PROC_USERGROUP (and probably
CONFIG_GRKERNSEC_PROC_USER too) hide processes started by `docker run`
from processes started by `docker exec` (all processes are running as
docker "root", docker daemon is started with default options, i.e. without
--userns-remap).

Why is this happens and is there any workaround?


$ sudo zgrep GRKERNSEC_PROC_USER /proc/config.gz
# CONFIG_GRKERNSEC_PROC_USER is not set
CONFIG_GRKERNSEC_PROC_USERGROUP=y

$ docker run -d -it --rm --init alpine sh -c 'ps ax; exec sleep 42'
49bec4451495563d702ad0edb9a7c80a9a7f5918fab4eb67e5a44b803f3ac656

$ docker logs 49bec4451495
PID   USER     TIME   COMMAND
    1 root       0:00 /dev/init -- sh -c ps ax; exec sleep 42
    7 root       0:00 sh -c ps ax; exec sleep 42
    8 root       0:00 ps ax

$ docker exec -it 49bec4451495 ps ax
PID   USER     TIME   COMMAND
    9 root       0:00 ps ax

-- 
			WBR, Alex.


             reply	other threads:[~2017-09-08 19:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-08 19:20 Alex Efros [this message]
2017-09-09  9:23 ` [gentoo-hardened] GRKERNSEC_PROC_USERGROUP and docker exec "Tóth Attila"
2017-09-09  9:39   ` Alex Efros

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=20170908192045.GC2677@home.power \
    --to=powerman@powerman.name \
    --cc=gentoo-hardened@lists.gentoo.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