Skip to content

RFE: add test support for session ID user filter #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

rgbriggs
Copy link
Contributor

test: RFE: add a session ID filter to the kernel's user filter
https://github.com/linux-audit/audit-kernel/issues/4

Signed-off-by: Richard Guy Briggs [email protected]

@pcmoore pcmoore changed the title tests: add support for session ID user filter RFE: add test support for session ID user filter May 10, 2016
while ($line = <$fh_out>) {
# test if we generate a PATH record
if ($line =~ m?^type=PATH ? and
$line =~ m? name=/tmp/$key ? and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to matching on the key we should also match on session ID given the nature of the test ... and yes, I realize you are passing the session ID to ausearch already.

@rgbriggs
Copy link
Contributor Author

Since the key is only in the SYSCALL message type and not in the PATH, CWD or PROCTITLE message types, I'd have to match on two messages from the same record, which is doable, but more complex than I figured was necessary since we are already requesting only records with a matching session ID, PID and key. How will this modification improve on what is already coded? Would adding "-ts recent" to the ausearch command be appropriate?

@pcmoore
Copy link
Contributor

pcmoore commented May 11, 2016

Since the key is only in the SYSCALL message type and not in the PATH, CWD or PROCTITLE message types, I'd have to match on two messages from the same record, which is doable, but more complex than I figured was necessary ....

Simply match on the SYSCALL record, this particular test does not need to match on the pathname; I would say that they key and session ID are the important fields for this test.

How will this modification improve on what is already coded?

It would ensure a positive match on the session ID, which is the point of this test.

Would adding "-ts recent" to the ausearch command be appropriate?

I don't think it matters, I would assume leave it out as passing the key filter to ausearch should help limit the results.

@rgbriggs rgbriggs force-pushed the lagh4-test-for-sessionID-user-filter branch from 43d47b0 to 1a30291 Compare May 12, 2016 12:31
@rgbriggs
Copy link
Contributor Author

Ok, pushed an update that adds an explicit check of the session ID in the SYSCALL message.

@pcmoore
Copy link
Contributor

pcmoore commented May 20, 2016

Wait, why are we still testing for a PATH record? A SYSCALL record with the correct session ID should be sufficient, yes?

@pcmoore
Copy link
Contributor

pcmoore commented May 25, 2016

@rgbriggs See above. Why do we care about the PATH record in this test?

@rgbriggs
Copy link
Contributor Author

Ok, strictly speaking that PATH record test doesn't belong in this one, but should be moved/retained for a dedicated test...

@pcmoore
Copy link
Contributor

pcmoore commented May 26, 2016

We already have several tests that check for the presence and correctness of PATH records, see the file_* tests.

@rgbriggs
Copy link
Contributor Author

There's a new version of the test script available here: https://github.com/rgbriggs/audit-testsuite/tree/ghak4-test-for-sessionID-user-filter
This doesn't yet address SESSIONID_SET.

@rgbriggs
Copy link
Contributor Author

rgbriggs commented Aug 2, 2016

There's a new version of the test script that now addresses SESSIONID_SET.

@rgbriggs
Copy link
Contributor Author

And yet another newer version of this test script at rgbriggs@c265e9f

It isn't tracking properly because I renamed the branch... I suppose I could push it to the lagh4... branch.

@pcmoore
Copy link
Contributor

pcmoore commented Aug 18, 2016

No worries on the tracking, links to the mailing list posts are probably more helpful anyway as they capture the discussion.

@pcmoore
Copy link
Contributor

pcmoore commented Aug 30, 2016

Commit rgbriggs@13f5d6f looks reasonable, although I would prefer if we renamed the directory from "sessionid_filter" to "filter_sessionid". Does that sound reasonable @rgbriggs ?

@pcmoore
Copy link
Contributor

pcmoore commented Aug 30, 2016

I added one comment to the rgbriggs@c265e9f patch.

    test: RFE: add a session ID filter to the kernel's user filter
    linux-audit/audit-kernel#4

Signed-off-by: Richard Guy Briggs <[email protected]>
@rgbriggs
Copy link
Contributor Author

rgbriggs commented Sep 8, 2016

I've already argued against flipping the name around, but I don't care enough to press it... This pull request is stale since my branch got renamed on my local machine to reflect the new naming convention. The up to date branch is: https://github.com/rgbriggs/audit-testsuite/tree/ghak4-test-for-sessionID-user-filter

@rgbriggs rgbriggs force-pushed the lagh4-test-for-sessionID-user-filter branch from 1a30291 to 2584bcc Compare September 8, 2016 03:40
@rgbriggs
Copy link
Contributor Author

rgbriggs commented Sep 8, 2016

On 2016-08-30 12:41, Paul Moore wrote:

I added one comment to the rgbriggs@c265e9f patch.

This is also stale.

  • RGB

Richard Guy Briggs [email protected]
Kernel Security Engineering, Base Operating Systems, Red Hat
Remote, Ottawa, Canada
Voice: +1.647.777.2635, Internal: (81) 32635

@pcmoore
Copy link
Contributor

pcmoore commented Sep 27, 2016

For reference, the latest draft from @rgbriggs appears to be here: rgbriggs@2584bcc

@pcmoore
Copy link
Contributor

pcmoore commented Sep 27, 2016

I made one small comment on this revision, once we resolve this I think we are good to go as soon as the kernel/userspace patches are merged.

@rgbriggs
Copy link
Contributor Author

@pcmoore ok grab rgbriggs@ec6d30f

@pcmoore
Copy link
Contributor

pcmoore commented Sep 30, 2016

I'll trust that the perl expression matching is correct. Looks like we are just waiting on Steve now.

@pcmoore
Copy link
Contributor

pcmoore commented Nov 29, 2016

Adjusting the pending label, it looks like we are just waiting on a rework for the tests to remove the set flag. Also, a reminder to @rgbriggs that we need this test and RFE wiki page done before I send the kernel patches to Linus.

@rgbriggs
Copy link
Contributor Author

Both the test update and push and the RFE update were done last week.

@rgbriggs
Copy link
Contributor Author

rgbriggs@94e418b

@pcmoore
Copy link
Contributor

pcmoore commented Nov 30, 2016

@rgbriggs great, I'll take a look at them today. For future reference, when you update a PR I think it would be good practice to comment on the PR/thread as GitHub doesn't appear to send notifications that you updated the code in your PR.

@pcmoore
Copy link
Contributor

pcmoore commented Nov 30, 2016

The test looks good to me, but since we don't have a released version of the audit userspace that supports the session ID filter (waiting on audit userspace v2.7) I'm not going to merge this just yet as I don't want to keep seeing failures when I run the testsuite.

@stevegrubb has mentioned that he intends to release the audit userspace v2.7 this month (December 2016) so we shouldn't have to wait long.

@pcmoore
Copy link
Contributor

pcmoore commented Dec 19, 2016

Merged via b378225.

@pcmoore pcmoore closed this Dec 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants