-
Notifications
You must be signed in to change notification settings - Fork 40k
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 AppArmor validation logic #29812
Conversation
0b3398f
to
e38ece9
Compare
Rebased and updated boilerplate (again!). |
Reassigning review to Dawn since I'm blocked on this. |
/cc @Amey-D |
return fmt.Errorf("could not read loaded profiles: %v", err) | ||
} | ||
|
||
for _, container := range pod.Spec.Containers { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If pod has initContainers, should we validate its profile too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Done.
@dchen1107 ping :) |
return nil | ||
} | ||
|
||
func (v *validator) getLoadedProfiles() (map[string]bool, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if the format here is guaranteed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked into it a bit, and couldn't find the profiles format documented anywhere (AppArmor documentation seems scarce), but I did find the kernel implementation, and the parsing done by the aa-status
tool. I updated the parsing to be a bit more precise.
88058d5
to
283c63f
Compare
Thanks @jfrazelle |
LGTM |
LGTM overall except one comment which should be addressed through doc, and outside this pr: Based on current proposed design, app profile is opaque to Kubernetes, including kubelet, which is good. But ubuntu apparmor has more features (more "hooks") than the upstream one which we are validating today through GCI image. But if the customers bring apparmor profiles from their ubuntu installations, in which case the profiles may not work correctly on GKE/GCI. This is a portability issue, and we should document it. Please squash the commits, we are ready to go. |
@jfrazelle Thanks for reviewing this. I temporarily removed lgtm label so that @timstclair can have enough time to squash his commits. :-) Tim, please feel free to readd the label once you are done with squash. |
283c63f
to
336b7fa
Compare
Squashed. Thanks all! |
oh so sorry!! On Wed, Aug 10, 2016 at 3:08 PM, Dawn Chen notifications@github.com wrote:
|
The validation checks the prerequisites described in the [AppArmor proposal](https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/apparmor.md#prerequisites)
336b7fa
to
bdc306b
Compare
Rebased. |
GCE e2e build/test passed for commit bdc306b. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit bdc306b. |
Automatic merge from submit-queue |
Automatic merge from submit-queue Implement AppArmor Kubelet support Includes PR #29812 Implements the Kubelet logic for AppArmor based on the alpha API proposed [here](https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/apparmor.md). Also adds an E2E test, and I ran manual tests. Remaining work: PodSecurityPolicy support, profile loader daemon, documentation, (maybe) beta API. /cc @jfrazelle @Amey-D @kubernetes/sig-node *Note on release-note-none: I am implementing AppArmor over multiple PRs. I will submit a single release note once the implementation is done to cover all of them.*
The validation checks the prerequisites described in the AppArmor proposal.
In order to unblock the AppArmor implementation from waiting on the APIs to merge, this PR uses 2 helper stubs for handling the Pod API.
This change is