All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Grubb <sgrubb@redhat.com>
To: Paul Moore <paul@paul-moore.com>
Cc: Linux Audit <linux-audit@redhat.com>
Subject: Re: [PATCH 1/1] audit: add missing fields to AUDIT_CONFIG_CHANGE event
Date: Thu, 12 Oct 2017 20:34:30 -0400	[thread overview]
Message-ID: <1672807.xxOxSvl8QK@x2> (raw)
In-Reply-To: <CAHC9VhSbWx8Cb4hXU8aUJ7evo-uP6wTThCkRz8ffr0Q2-Pd88w@mail.gmail.com>

On Thursday, October 12, 2017 6:51:19 PM EDT Paul Moore wrote:
> On Thu, Oct 12, 2017 at 6:13 PM, Steve Grubb <sgrubb@redhat.com> wrote:
> > On Thursday, October 12, 2017 5:04:41 PM EDT Paul Moore wrote:
> >> Another reminder that in general I'm not going to accept patches that
> >> shuffle the fields or insert fields in the middle of a record; if you
> >> want to add new fields to a record, add them at the end.  I see no
> >> reason to break with the rule for this patch.
> > 
> > This has never been a rule ...
> 
> Yes it has, one I've mentioned to you several times both on and off
> the list.  You may disagree with it, but that doesn't mean you are
> exempt.

I'm speaking on behalf of everyone that has to deal with the events. If we 
need to have 9 parsers for the same event, its really doing a disservice to 
everyone that works on audit events. Besides, since you don't write any user 
space code or do things that have to make sense of it, why would you block 
something that is fixing problems? Did you run any tests with the events I 
supplied to verify things for yourself?

Look at this mess:

1)	audit_log_format(ab, "%s=%u old=%u", function_name, new, old);
	audit_log_session_info(ab);
	rc = audit_log_task_context(ab);

2) 	audit_log_common_recv_msg(&ab, AUDIT_CONFIG_CHANGE);
	audit_log_format(ab, " audit_enabled=%d res=0", audit_enabled);

3)	audit_log_common_recv_msg(&ab, AUDIT_CONFIG_CHANGE);
	audit_log_format(ab, " op=trim res=1");

4)  audit_log_common_recv_msg(&ab, AUDIT_CONFIG_CHANGE);
	audit_log_format(ab, " op=make_equiv old=");
	audit_log_untrustedstring(ab, old);
	audit_log_format(ab, " new=");
	audit_log_untrustedstring(ab, new);
	audit_log_format(ab, " res=%d", !err);

5)	audit_log_common_recv_msg(&ab, AUDIT_CONFIG_CHANGE);
	audit_log_format(ab, " op=tty_set old-enabled=%d new-enabled=%d"
		" old-log_passwd=%d new-log_passwd=%d res=%d",
		old.enabled, s.enabled, old.log_passwd,
		s.log_passwd, !err);

6)	audit_log_format(ab, "auid=%u ses=%u" ,loginuid, sessionid);
	audit_log_task_context(ab);
	audit_log_format(ab, " op=%s", action);
	audit_log_key(ab, rule->filterkey);
	audit_log_format(ab, " list=%d res=%d", rule->listnr, res);

7)	audit_log_format(ab, "auid=%u ses=%u op=%s",
		from_kuid(&init_user_ns, audit_get_loginuid(current)),
		audit_get_sessionid(current), op);
	audit_log_format(ab, " path=");
	audit_log_untrustedstring(ab, audit_mark->path);
	audit_log_key(ab, rule->filterkey);
	audit_log_format(ab, " list=%d res=1", rule->listnr);

8)	audit_log_format(ab, "op=remove_rule");
	audit_log_format(ab, " dir=");
	audit_log_untrustedstring(ab, rule->tree->pathname);
	audit_log_key(ab, rule->filterkey);
	audit_log_format(ab, " list=%d res=1", rule->listnr);

9)	audit_log_format(ab, "auid=%u ses=%u op=%s",
		from_kuid(&init_user_ns, audit_get_loginuid(current)),
		audit_get_sessionid(current), op);
	audit_log_format(ab, " path=");
	audit_log_untrustedstring(ab, w->path);
	audit_log_key(ab, r->filterkey);
	audit_log_format(ab, " list=%d res=1", r->listnr);

Of these 7 & 9 are the same. So that means following your suggestion, everyone 
has to write 8 parsers for the same event. Does that sound like good 
engineering practice? Also, it will cause subtle changes that break bigger 
rules than this - like all events everywhere end with the results. They are 
always the last item. Everywhere. This is a self evident rule that you are 
suggesting we break. We can't do that.

Meanwhile...there is a problem that needs to be fixed....

-Steve

  reply	other threads:[~2017-10-13  0:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-12 19:57 [PATCH 1/1] audit: add missing fields to AUDIT_CONFIG_CHANGE event Steve Grubb
2017-10-12 21:04 ` Paul Moore
2017-10-12 22:13   ` Steve Grubb
2017-10-12 22:51     ` Paul Moore
2017-10-13  0:34       ` Steve Grubb [this message]
2017-10-13  1:58         ` Paul Moore
2017-10-13 19:54 ` Richard Guy Briggs
2017-10-13 21:11   ` Paul Moore
2017-10-16 15:27     ` Richard Guy Briggs
2017-10-16 20:16       ` Paul Moore
2017-10-16 21:17       ` Steve Grubb
2017-10-17 15:17         ` Paul Moore

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=1672807.xxOxSvl8QK@x2 \
    --to=sgrubb@redhat.com \
    --cc=linux-audit@redhat.com \
    --cc=paul@paul-moore.com \
    /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.