public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: Gao feng <gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
To: Gao feng <gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
Cc: toshi.okajima-+CUm20s59erQFUHtdCDX3A@public.gmane.org,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	serge.hallyn-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	eparis-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	Richard Guy Briggs <rgb-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	linux-audit-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org,
	sgrubb-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Subject: Re: [RFC Part1 PATCH 00/20 v2] Add namespace support for audit
Date: Tue, 05 Nov 2013 15:51:55 +0800	[thread overview]
Message-ID: <5278A39B.6000303@cn.fujitsu.com> (raw)
In-Reply-To: <5271D3FC.8000709-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>

Ping...

On 10/31/2013 11:52 AM, Gao feng wrote:
> Hi Eric Paris,
> 
> Can you give me some comments?
> 
> You think the tying audit namespace to user namespace is a bad idea,
> so this patchset doesn't assign auditns to userns and introduce an
> new audit netlink type to help to create audit namespace.
> 
> and this patchset also introduces an new proc interface to make
> sure container can't influence the whole system.
> 
> and the audit rules are not namespace aware, all of audit namespaces
> should comply with the rules. in next step, if we find it's need to
> make audit rules per audit namespace, then it's the time to do that
> job.
> 
> This patchset also makes all of net namespaces have ability to send/
> receive audit netlink message.
> 
> I may miss some points, if you find there are some shortage or loophole,
> please let me know.
> 
> Thanks!
> 
> On 10/24/2013 03:31 PM, Gao feng wrote:
>> Here is the v1 patchset: http://lwn.net/Articles/549546/
>>
>> The main target of this patchset is allowing user in audit
>> namespace to generate the USER_MSG type of audit message,
>> some userspace tools need to generate audit message, or
>> these tools will broken.
>>
>> And the login process in container may want to setup
>> /proc/<pid>/loginuid, right now this value is unalterable
>> once it being set. this will also broke the login problem
>> in container. After this patchset, we can reset this loginuid
>> to zero if task is running in a new audit namespace.
>>
>> Same with v1 patchset, in this patchset, only the privileged
>> user in init_audit_ns and init_user_ns has rights to
>> add/del audit rules. and these rules are gloabl. all
>> audit namespace will comply with the rules.
>>
>> Compared with v1, v2 patch has some big changes.
>> 1, the audit namespace is not assigned to user namespace.
>>    since there is no available bit of flags for clone, we
>>    create audit namespace through netlink, patch[18/20]
>>    introduces a new audit netlink type AUDIT_CREATE_NS.
>>    the privileged user in userns has rights to create a
>>    audit namespace, it means the unprivileged user can
>>    create auditns through create userns first. In order
>>    to prevent them from doing harm to host, the default
>>    audit_backlog_limit of un-init-audit-ns is zero(means
>>    audit is unavailable in audit namespace). and it can't
>>    be changed in auditns through netlink.
>>
>> 2, introduce /proc/<pid>/audit_log_limit
>>    this interface is used to setup log_limit of audit
>>    namespace.  we need this interface to make audit
>>    available in un-init-audit-ns. Only the privileged user
>>    has right to set this value, it means only the root user
>>    of host can change it.
>>
>> 3, make audit namespace don't depend on net namespace.
>>    patch[1/20] add a compare function audit_compare for
>>    audit netlink, it always return true, it means the
>>    netlink subsystem will find out the netlink socket
>>    only through portid and netlink type. So we needn't
>>    to create kernel side audit netlink socket for per
>>    net namespace, all userspace audit netlink socket
>>    can find out the audit_sock, and audit_sock can
>>    communicate with them through the proper portid.
>>    it's just like the behavior we don't have net
>>    namespace before.
>>
>>
>> This patchset still need some work, such as allow changing
>> audit_enabled in audit namespace, auditd wants this feature.
>>
>> I send this patchset now in order to get more comments, so
>> I can keep on improving namespace support for audit.
>>
>> Gao feng (20):
>>   Audit: make audit netlink socket net namespace unaware
>>   audit: introduce configure option CONFIG_AUDIT_NS
>>   audit: make audit_skb_queue per audit namespace
>>   audit: make audit_skb_hold_queue per audit namespace
>>   audit: make audit_pid per audit namespace
>>   audit: make kauditd_task per audit namespace
>>   aduit: make audit_nlk_portid per audit namespace
>>   audit: make kaudit_wait queue per audit namespace
>>   audit: make audit_backlog_wait per audit namespace
>>   audit: allow un-init audit ns to change pid and portid only
>>   audit: use proper audit namespace in audit_receive_msg
>>   audit: use proper audit_namespace in kauditd_thread
>>   audit: introduce new audit logging interface for audit namespace
>>   audit: pass proper audit namespace to audit_log_common_recv_msg
>>   audit: Log audit pid config change in audit namespace
>>   audit: allow GET,SET,USER MSG operations in audit namespace
>>   nsproxy: don't make create_new_namespaces static
>>   audit: add new message type AUDIT_CREATE_NS
>>   audit: make audit_backlog_limit per audit namespace
>>   audit: introduce /proc/<pid>/audit_backlog_limit
>>
>>  fs/proc/base.c                  |  53 ++++++
>>  include/linux/audit.h           |  26 ++-
>>  include/linux/audit_namespace.h |  92 ++++++++++
>>  include/linux/nsproxy.h         |  15 +-
>>  include/uapi/linux/audit.h      |   1 +
>>  init/Kconfig                    |  10 ++
>>  kernel/Makefile                 |   2 +-
>>  kernel/audit.c                  | 364 +++++++++++++++++++++++++---------------
>>  kernel/audit.h                  |   5 +-
>>  kernel/audit_namespace.c        | 123 ++++++++++++++
>>  kernel/auditsc.c                |   6 +-
>>  kernel/nsproxy.c                |  18 +-
>>  12 files changed, 561 insertions(+), 154 deletions(-)
>>  create mode 100644 include/linux/audit_namespace.h
>>  create mode 100644 kernel/audit_namespace.c
>>
> 
> 

  parent reply	other threads:[~2013-11-05  7:51 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-24  7:31 [RFC Part1 PATCH 00/20 v2] Add namespace support for audit Gao feng
2013-10-24  7:31 ` [PATCH 01/20] Audit: make audit netlink socket net namespace unaware Gao feng
     [not found] ` <1382599925-25143-1-git-send-email-gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2013-10-24  7:31   ` [PATCH 02/20] audit: introduce configure option CONFIG_AUDIT_NS Gao feng
2013-10-24  7:31   ` [PATCH 03/20] audit: make audit_skb_queue per audit namespace Gao feng
2013-10-24  7:31   ` [PATCH 04/20] audit: make audit_skb_hold_queue " Gao feng
2013-10-24  7:31   ` [PATCH 06/20] audit: make kauditd_task " Gao feng
2013-10-24  7:31   ` [PATCH 08/20] audit: make kaudit_wait queue " Gao feng
2013-10-24  7:32   ` [PATCH 15/20] audit: Log audit pid config change in " Gao feng
2013-10-31  3:52   ` [RFC Part1 PATCH 00/20 v2] Add namespace support for audit Gao feng
     [not found]     ` <5271D3FC.8000709-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2013-11-05  7:51       ` Gao feng [this message]
     [not found]         ` <5278A39B.6000303-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2013-11-05  7:52           ` Gao feng
     [not found]             ` <5278A3D5.3010309-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2013-11-05  8:11               ` Li Zefan
     [not found]                 ` <5278A828.50406-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2013-11-05  8:56                   ` Gao feng
     [not found]                     ` <5278B2D7.6060409-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2013-11-05 19:14                       ` Richard Guy Briggs
     [not found]                         ` <20131105191459.GF24236-bcJWsdo4jJjeVoXN4CMphl7TgLCtbB0G@public.gmane.org>
2013-11-07  5:51                           ` Gao feng
2013-11-21  7:57                           ` Gao feng
2013-12-06 21:31   ` Serge E. Hallyn
     [not found]     ` <20131206213135.GA22445-7LNsyQBKDXoIagZqoN9o3w@public.gmane.org>
2013-12-09  2:29       ` Gao feng
     [not found]         ` <52A52AFB.2020703-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2013-12-23 23:47           ` Richard Guy Briggs
     [not found]             ` <20131223234723.GA23101-bcJWsdo4jJjeVoXN4CMphl7TgLCtbB0G@public.gmane.org>
2013-12-24  9:53               ` Gao feng
2013-10-24  7:31 ` [PATCH 05/20] audit: make audit_pid per audit namespace Gao feng
2013-10-24  7:31 ` [PATCH 07/20] aduit: make audit_nlk_portid " Gao feng
2013-10-24  7:31 ` [PATCH 09/20] audit: make audit_backlog_wait " Gao feng
2013-10-24  7:31 ` [PATCH 10/20] audit: allow un-init audit ns to change pid and portid only Gao feng
2013-10-24  7:31 ` [PATCH 11/20] audit: use proper audit namespace in audit_receive_msg Gao feng
2013-10-24  7:31 ` [PATCH 12/20] audit: use proper audit_namespace in kauditd_thread Gao feng
2013-10-24  7:31 ` [PATCH 13/20] audit: introduce new audit logging interface for audit namespace Gao feng
2013-10-24  7:31 ` [PATCH 14/20] audit: pass proper audit namespace to audit_log_common_recv_msg Gao feng
2013-10-24  7:32 ` [PATCH 16/20] audit: allow GET, SET, USER MSG operations in audit namespace Gao feng
     [not found]   ` <1382599925-25143-17-git-send-email-gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2013-12-06 22:00     ` Serge E. Hallyn
     [not found]       ` <20131206220033.GB22445-7LNsyQBKDXoIagZqoN9o3w@public.gmane.org>
2013-12-09  1:47         ` Gao feng
2013-10-24  7:32 ` [PATCH 17/20] nsproxy: don't make create_new_namespaces static Gao feng
2013-10-24  7:32 ` [PATCH 18/20] audit: add new message type AUDIT_CREATE_NS Gao feng
     [not found]   ` <1382599925-25143-19-git-send-email-gaofeng-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2013-12-06 22:10     ` Serge E. Hallyn
     [not found]       ` <20131206221014.GC22445-7LNsyQBKDXoIagZqoN9o3w@public.gmane.org>
2013-12-09  1:59         ` Gao feng
     [not found]           ` <52A52400.7060008-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2013-12-09 17:53             ` Serge Hallyn
2013-12-10  5:34               ` Gao feng
2013-10-24  7:32 ` [PATCH 19/20] audit: make audit_backlog_limit per audit namespace Gao feng
2013-10-24  7:32 ` [PATCH 20/20] audit: introduce /proc/<pid>/audit_backlog_limit Gao feng
2013-12-04  8:31 ` [RFC Part1 PATCH 00/20 v2] Add namespace support for audit Gao feng
     [not found]   ` <529EE877.7030701-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2013-12-06 22:12     ` Serge E. Hallyn
     [not found]       ` <20131206221241.GD22445-7LNsyQBKDXoIagZqoN9o3w@public.gmane.org>
2013-12-09  2:06         ` Gao feng
     [not found]           ` <52A52599.3070502-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2013-12-09 18:26             ` Serge Hallyn
2013-12-10  8:16               ` Gao feng
     [not found]                 ` <52A6CDE1.8090404-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2013-12-10 16:51                   ` Serge Hallyn
2013-12-10 19:50                     ` Eric Paris
     [not found]                       ` <1386705056.23829.13.camel-OjZBOOqb7SR7cYLChsl7DafLeoKvNuZc@public.gmane.org>
2013-12-10 20:36                         ` Serge E. Hallyn
     [not found]                           ` <20131210203648.GA5835-7LNsyQBKDXoIagZqoN9o3w@public.gmane.org>
2013-12-16  3:39                             ` Gao feng
     [not found]                               ` <52AE75D7.4020604-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2013-12-20 21:15                                 ` Serge E. Hallyn
     [not found]                                   ` <20131220211557.GA418-7LNsyQBKDXoIagZqoN9o3w@public.gmane.org>
2013-12-24  9:32                                     ` Gao feng

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=5278A39B.6000303@cn.fujitsu.com \
    --to=gaofeng-bthxqxjhjhxqfuhtdcdx3a@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org \
    --cc=eparis-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-audit-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rgb-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=serge.hallyn-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org \
    --cc=sgrubb-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=toshi.okajima-+CUm20s59erQFUHtdCDX3A@public.gmane.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