Skip to content
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

Add ctr_id_short to Audit log #293

Conversation

TomSweeneyRedHat
Copy link

Signed-off-by: TomSweeneyRedHat tsweeney@redhat.com
Audit logging was not showing the containers id. Unlike docker-1.12.6, the audit middleware is being initialized appropriately in this version and dockerd/daemon.go did not need to be fixed. This change only adds the short container id to the audit log.

This addresses https://bugzilla.redhat.com/show_bug.cgi?id=1496176

  • What I did
    I've added a 'ctr_id_short' field to the audit logging and a couple of debug messages.

  • How I did it
    Changed the code and lots of testing.

  • How to verify it

The old audit log entries looked like:

type=VIRT_CONTROL msg=audit(1512770060.628:254): pid=1768 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:container_runtime_t:s0 msg='op=attach vm-pid=? auid=0 hostname=? reason=api vm=? user=root exe=? exe="/usr/bin/dockerd-current" hostname=? addr=? terminal=? res=success'

The new ones look like:

type=VIRT_CONTROL msg=audit(1515610710.130:485): pid=19793 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:container_runtime_t:s0 msg='reason=api auid=0 exe=sleep hostname=8386cb7735f4 ctr_id_short=8386cb7735f4 op=attach vm=centos vm-pid=0 user=root exe="/usr/bin/dockerd-current" hostname=? addr=? terminal=? res=success'

Note the addition of the ctr_id_short field and the appropriate values in the vm, vm-pid, exed and other fields.

  • Description for the changelog
    Correct audit logging for container operations.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
@TomSweeneyRedHat
Copy link
Author

@jwhonce @rhatdan @runcom PTAL

@TomSweeneyRedHat
Copy link
Author

@rhatdan
Copy link
Member

rhatdan commented Jan 15, 2018

LGTM

@TomSweeneyRedHat
Copy link
Author

@rhatdan @runcom Can this be merged? If not, please let me know what (if anything) I can do. This will address https://bugzilla.redhat.com/show_bug.cgi?id=1496176 which is on the 7.5 blocker list.

@rhatdan
Copy link
Member

rhatdan commented Feb 2, 2018

Merging.

@rhatdan rhatdan merged commit 530ea05 into projectatomic:docker-1.13.1-rhel Feb 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants