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

apparmor: Add log-enricher support #1298

Merged
merged 2 commits into from
Nov 14, 2022

Conversation

pjbgf
Copy link
Member

@pjbgf pjbgf commented Nov 12, 2022

What type of PR is this?

/kind feature

What this PR does / why we need it:

As part of making AppArmor a first class citizen within SPO, the log enrichment features needs to be improved, so that user can have a better view of AppArmor operations across the cluster.

Show AppArmor profiles being reloaded

What pod loaded a new or replaced an existing AppArmor into the node:

I1112 09:12:13.236328   10696 enricher.go:514] log-enricher "msg"="audit" "apparmor"="STATUS" "container"="security-profiles-operator" "executable"="security-profil" "name"="flux-controllers" "namespace"="security-profiles-operator" "node"="kube-worker1" "operation"="profile_replace" "pid"=10591 "pod"="spod-hgxd7" "profile"="unconfined" "timestamp"="1668244333.228:485" "type"="apparmor"
Normal AppArmor Entries

Entries include extra to expand on additional information:

I1112 09:14:23.418753   14721 enricher.go:514] log-enricher "msg"="audit" "apparmor"="ALLOWED" "container"="manager" "executable"="ash" "extra"="requested_mask='r' denied_mask='r' fsuid=65534 ouid=0" "name"="/dev/tty" "namespace"="flux-system" "node"="kube-worker2" "operation"="open" "pid"=15860 "pod"="target-pod-7f69cdb69d-lw8bd" "profile"="complain-mmode-profile" "timestamp"="1668244463.390:2224" "type"="apparmor"

Which issue(s) this PR fixes:

Relates to #718

Does this PR have test?

Yes

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Log-enricher support for both short and long AppArmor log entries

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. labels Nov 12, 2022
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 12, 2022
@codecov-commenter
Copy link

codecov-commenter commented Nov 12, 2022

Codecov Report

Merging #1298 (e1479e5) into main (308b783) will increase coverage by 0.17%.
The diff coverage is 56.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1298      +/-   ##
==========================================
+ Coverage   43.92%   44.09%   +0.17%     
==========================================
  Files          49       49              
  Lines        5514     5563      +49     
==========================================
+ Hits         2422     2453      +31     
- Misses       2972     2991      +19     
+ Partials      120      119       -1     

Signed-off-by: Paulo Gomes <pjbgf@linux.com>
Signed-off-by: Paulo Gomes <pjbgf@linux.com>
@pjbgf pjbgf force-pushed the apparmor-enricher branch from 7635322 to e1479e5 Compare November 12, 2022 10:30
@pjbgf
Copy link
Member Author

pjbgf commented Nov 12, 2022

/test pull-security-profiles-operator-test-e2e

@pjbgf pjbgf mentioned this pull request Nov 12, 2022
7 tasks
Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

Awesome work, thank you!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 14, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JAORMX, pjbgf, saschagrunert

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [JAORMX,pjbgf,saschagrunert]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 448bd3a into kubernetes-sigs:main Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants