All of lore.kernel.org
 help / color / mirror / Atom feed
From: Casey Schaufler <casey@schaufler-ca.com>
To: Paul Moore <paul@paul-moore.com>,
	John Johansen <john.johansen@canonical.com>
Cc: casey.schaufler@intel.com, James Morris <jmorris@namei.org>,
	linux-security-module@vger.kernel.org, selinux@vger.kernel.org,
	keescook@chromium.org, penguin-kernel@i-love.sakura.ne.jp,
	Stephen Smalley <sds@tycho.nsa.gov>,
	Eric Paris <eparis@redhat.com>,
	linux-audit@redhat.com, casey@schaufler-ca.com
Subject: Re: [PATCH v3 21/24] Audit: Store LSM audit information in an lsmblob
Date: Tue, 25 Jun 2019 08:30:35 -0700	[thread overview]
Message-ID: <c231726e-5235-1dae-8fb9-6f89db406260@schaufler-ca.com> (raw)
In-Reply-To: <CAHC9VhSSMjCdT8gfB03gh8VvJngTHnsUsDCpseMUiEPQM9z_FQ@mail.gmail.com>

On 6/24/2019 7:42 PM, Paul Moore wrote:
> On Mon, Jun 24, 2019 at 10:15 PM John Johansen
> <john.johansen@canonical.com> wrote:
>> On 6/24/19 6:46 PM, Paul Moore wrote:
>>> On Mon, Jun 24, 2019 at 9:01 PM Casey Schaufler <casey@schaufler-ca.com> wrote:
>>>> On 6/24/2019 2:33 PM, John Johansen wrote:
>>>>> On 6/21/19 11:52 AM, Casey Schaufler wrote:
>>>>>> Change the audit code to store full lsmblob data instead of
>>>>>> a single u32 secid. This allows for multiple security modules
>>>>>> to use the audit system at the same time. It also allows the
>>>>>> removal of scaffolding code that was included during the
>>>>>> revision of LSM interfaces.
>>>>>>
>>>>>> Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
>>>>> I know Kees raised this too, but I haven't seen a reply
>>>>>
>>>>> Eric (Paul is already CCed): I have directly added you because of
>>>>> the question below.
>>>>>
>>>>> In summary there isn't necessarily a single secid any more, and
>>>>> we need to know whether dropping the logging of the secid or
>>>>> logging all secids is the correct action.
>>>> It is to be considered that this is an error case. If
>>>> everything is working normally you should have produced
>>>> a secctx previously, which you'll have included in the
>>>> audit record. Including the secid in the record ought to
>>>> be pointless, as the secid is strictly an internal token
>>>> with no meaning outside the running kernel. You are providing
>>>> no security relevant information by providing the secid.
>>>> I will grant the possibility that the secid might be useful
>>>> in debugging, but for that a pr_warn is more appropriate
>>>> than a field in the audit record.
>>> FWIW, this probably should have been CC'd to the audit list.
>>>
>> hrmm indeed, sorry
>>
>>> I agree that this is an error case (security_secid_to_secctx() failed
>>> to resolve the secid) and further that logging the secid, or a
>>> collection of secids, has little value the way things currently work.
>>> Since secids are a private kernel implementation detail, we don't
>>> really display them outside the context of the kernel, including in
>>> the audit logs.  Recording a secid in this case doesn't provide
>>> anything meaningful since secids aren't recorded in the audit record
>>> stream, only the secctxs, and there is no "magic decoder ring" to go
>>> between the two in the audit logs, or anywhere else in userspace for
>>> that matter.
>> Okay, thanks. Casey I am good with just a pr_warn here. I just didn't
>> have context of why it was going to the audit_log and didn't want
>> to change that without some more input.
> Hmm.  Actually, let me change my comments slightly ... perhaps what we
> should do here is keep the audit_log_format(), but change it from
> audit_log_format("osid=%u",...) to audit_log_format("obj=?").  The "?"
> is used in audit when we can't determine a piece of information, but
> we normally log it.  It wasn't used very widely originally, which is
> probably why it isn't in this piece of code.

Works for me. I'll make the change. Thank you.
??


WARNING: multiple messages have this Message-ID (diff)
From: Casey Schaufler <casey@schaufler-ca.com>
To: Paul Moore <paul@paul-moore.com>,
	John Johansen <john.johansen@canonical.com>
Cc: selinux@vger.kernel.org, James Morris <jmorris@namei.org>,
	linux-security-module@vger.kernel.org, linux-audit@redhat.com,
	casey.schaufler@intel.com, Stephen Smalley <sds@tycho.nsa.gov>
Subject: Re: [PATCH v3 21/24] Audit: Store LSM audit information in an lsmblob
Date: Tue, 25 Jun 2019 08:30:35 -0700	[thread overview]
Message-ID: <c231726e-5235-1dae-8fb9-6f89db406260@schaufler-ca.com> (raw)
In-Reply-To: <CAHC9VhSSMjCdT8gfB03gh8VvJngTHnsUsDCpseMUiEPQM9z_FQ@mail.gmail.com>

On 6/24/2019 7:42 PM, Paul Moore wrote:
> On Mon, Jun 24, 2019 at 10:15 PM John Johansen
> <john.johansen@canonical.com> wrote:
>> On 6/24/19 6:46 PM, Paul Moore wrote:
>>> On Mon, Jun 24, 2019 at 9:01 PM Casey Schaufler <casey@schaufler-ca.com> wrote:
>>>> On 6/24/2019 2:33 PM, John Johansen wrote:
>>>>> On 6/21/19 11:52 AM, Casey Schaufler wrote:
>>>>>> Change the audit code to store full lsmblob data instead of
>>>>>> a single u32 secid. This allows for multiple security modules
>>>>>> to use the audit system at the same time. It also allows the
>>>>>> removal of scaffolding code that was included during the
>>>>>> revision of LSM interfaces.
>>>>>>
>>>>>> Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
>>>>> I know Kees raised this too, but I haven't seen a reply
>>>>>
>>>>> Eric (Paul is already CCed): I have directly added you because of
>>>>> the question below.
>>>>>
>>>>> In summary there isn't necessarily a single secid any more, and
>>>>> we need to know whether dropping the logging of the secid or
>>>>> logging all secids is the correct action.
>>>> It is to be considered that this is an error case. If
>>>> everything is working normally you should have produced
>>>> a secctx previously, which you'll have included in the
>>>> audit record. Including the secid in the record ought to
>>>> be pointless, as the secid is strictly an internal token
>>>> with no meaning outside the running kernel. You are providing
>>>> no security relevant information by providing the secid.
>>>> I will grant the possibility that the secid might be useful
>>>> in debugging, but for that a pr_warn is more appropriate
>>>> than a field in the audit record.
>>> FWIW, this probably should have been CC'd to the audit list.
>>>
>> hrmm indeed, sorry
>>
>>> I agree that this is an error case (security_secid_to_secctx() failed
>>> to resolve the secid) and further that logging the secid, or a
>>> collection of secids, has little value the way things currently work.
>>> Since secids are a private kernel implementation detail, we don't
>>> really display them outside the context of the kernel, including in
>>> the audit logs.  Recording a secid in this case doesn't provide
>>> anything meaningful since secids aren't recorded in the audit record
>>> stream, only the secctxs, and there is no "magic decoder ring" to go
>>> between the two in the audit logs, or anywhere else in userspace for
>>> that matter.
>> Okay, thanks. Casey I am good with just a pr_warn here. I just didn't
>> have context of why it was going to the audit_log and didn't want
>> to change that without some more input.
> Hmm.  Actually, let me change my comments slightly ... perhaps what we
> should do here is keep the audit_log_format(), but change it from
> audit_log_format("osid=%u",...) to audit_log_format("obj=?").  The "?"
> is used in audit when we can't determine a piece of information, but
> we normally log it.  It wasn't used very widely originally, which is
> probably why it isn't in this piece of code.

Works for me. I'll make the change. Thank you.
??

  reply	other threads:[~2019-06-25 15:30 UTC|newest]

Thread overview: 85+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-21 18:52 [PATCH v3 00/24] LSM: Module stacking for AppArmor Casey Schaufler
2019-06-21 18:52 ` [PATCH v3 01/24] LSM: Infrastructure management of the superblock Casey Schaufler
2019-06-24 18:31   ` John Johansen
2019-06-21 18:52 ` [PATCH v3 02/24] LSM: Infrastructure management of the sock security Casey Schaufler
2019-06-24 18:33   ` John Johansen
2019-06-21 18:52 ` [PATCH v3 03/24] LSM: Infrastructure management of the key blob Casey Schaufler
2019-06-24 18:33   ` John Johansen
2019-06-21 18:52 ` [PATCH v3 04/24] LSM: Create and manage the lsmblob data structure Casey Schaufler
2019-06-22 22:42   ` Kees Cook
2019-06-24 18:38   ` John Johansen
2019-06-21 18:52 ` [PATCH v3 05/24] Use lsmblob in security_audit_rule_match Casey Schaufler
2019-06-22 22:43   ` Kees Cook
2019-06-24 18:39   ` John Johansen
2019-06-21 18:52 ` [PATCH v3 06/24] LSM: Use lsmblob in security_kernel_act_as Casey Schaufler
2019-06-22 22:43   ` Kees Cook
2019-06-24 18:38   ` John Johansen
2019-06-21 18:52 ` [PATCH v3 07/24] net: Prepare UDS for secuirty module stacking Casey Schaufler
2019-06-22 22:43   ` Kees Cook
2019-06-24 18:39   ` John Johansen
2019-06-21 18:52 ` [PATCH v3 08/24] LSM: Use lsmblob in security_secctx_to_secid Casey Schaufler
2019-06-22 22:44   ` Kees Cook
2019-06-24 18:38   ` John Johansen
2019-06-21 18:52 ` [PATCH v3 09/24] LSM: Use lsmblob in security_secid_to_secctx Casey Schaufler
2019-06-22 22:44   ` Kees Cook
2019-06-24 18:39   ` John Johansen
2019-06-21 18:52 ` [PATCH v3 10/24] Use lsmblob in security_ipc_getsecid Casey Schaufler
2019-06-22 22:48   ` Kees Cook
2019-06-24 16:39     ` Casey Schaufler
2019-06-24 17:20       ` Casey Schaufler
2019-06-24 21:09       ` Kees Cook
2019-06-24 18:39   ` John Johansen
2019-06-21 18:52 ` [PATCH v3 11/24] LSM: Use lsmblob in security_task_getsecid Casey Schaufler
2019-06-22 22:49   ` Kees Cook
2019-06-24 18:40   ` John Johansen
2019-06-21 18:52 ` [PATCH v3 12/24] LSM: Use lsmblob in security_inode_getsecid Casey Schaufler
2019-06-22 22:49   ` Kees Cook
2019-06-24 18:40   ` John Johansen
2019-06-21 18:52 ` [PATCH v3 13/24] LSM: Use lsmblob in security_cred_getsecid Casey Schaufler
2019-06-22 22:50   ` Kees Cook
2019-06-24 18:40   ` John Johansen
2019-06-21 18:52 ` [PATCH v3 14/24] IMA: Change internal interfaces to use lsmblobs Casey Schaufler
2019-06-22 22:51   ` Kees Cook
2019-06-24 18:40   ` John Johansen
2019-06-21 18:52 ` [PATCH v3 15/24] LSM: Specify which LSM to display Casey Schaufler
2019-06-22 22:51   ` Kees Cook
2019-06-24 18:48   ` John Johansen
2019-06-21 18:52 ` [PATCH v3 16/24] LSM: Ensure the correct LSM context releaser Casey Schaufler
2019-06-22 22:52   ` Kees Cook
2019-06-24 21:46   ` John Johansen
2019-06-21 18:52 ` [PATCH v3 17/24] LSM: Use lsmcontext in security_secid_to_secctx Casey Schaufler
2019-06-22 22:52   ` Kees Cook
2019-06-24 21:46   ` John Johansen
2019-06-21 18:52 ` [PATCH v3 18/24] LSM: Use lsmcontext in security_dentry_init_security Casey Schaufler
2019-06-22 22:54   ` Kees Cook
2019-06-24 21:46   ` John Johansen
2019-06-21 18:52 ` [PATCH v3 19/24] LSM: Use lsmcontext in security_inode_getsecctx Casey Schaufler
2019-06-22 22:56   ` Kees Cook
2019-06-24 21:46   ` John Johansen
2019-06-21 18:52 ` [PATCH v3 20/24] LSM: security_secid_to_secctx in netlink netfilter Casey Schaufler
2019-06-22 22:57   ` Kees Cook
2019-06-24 21:47   ` John Johansen
2019-06-21 18:52 ` [PATCH v3 21/24] Audit: Store LSM audit information in an lsmblob Casey Schaufler
2019-06-22 23:12   ` Kees Cook
2019-06-24 21:33   ` John Johansen
2019-06-25  1:01     ` Casey Schaufler
2019-06-25  1:46       ` Paul Moore
2019-06-25  1:46         ` Paul Moore
2019-06-25  2:14         ` John Johansen
2019-06-25  2:14           ` John Johansen
2019-06-25  2:42           ` Paul Moore
2019-06-25  2:42             ` Paul Moore
2019-06-25 15:30             ` Casey Schaufler [this message]
2019-06-25 15:30               ` Casey Schaufler
2019-06-21 18:52 ` [PATCH v3 22/24] LSM: Return the lsmblob slot on initialization Casey Schaufler
2019-06-22 23:13   ` Kees Cook
2019-06-24 21:39     ` John Johansen
2019-06-24 21:50       ` Kees Cook
2019-06-24 21:53       ` Casey Schaufler
2019-06-24 21:47   ` John Johansen
2019-06-21 18:52 ` [PATCH v3 23/24] NET: Store LSM netlabel data in a lsmblob Casey Schaufler
2019-06-22 23:15   ` Kees Cook
2019-06-24 21:44   ` John Johansen
2019-06-21 18:52 ` [PATCH v3 24/24] AppArmor: Remove the exclusive flag Casey Schaufler
2019-06-22 23:15   ` Kees Cook
2019-06-24 21:45   ` John Johansen

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=c231726e-5235-1dae-8fb9-6f89db406260@schaufler-ca.com \
    --to=casey@schaufler-ca.com \
    --cc=casey.schaufler@intel.com \
    --cc=eparis@redhat.com \
    --cc=jmorris@namei.org \
    --cc=john.johansen@canonical.com \
    --cc=keescook@chromium.org \
    --cc=linux-audit@redhat.com \
    --cc=linux-security-module@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.