Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Enterprise License Job PodSecurityPolicy #325

Merged
merged 2 commits into from
Jan 10, 2020
Merged

Enterprise License Job PodSecurityPolicy #325

merged 2 commits into from
Jan 10, 2020

Conversation

lkysow
Copy link
Member

@lkysow lkysow commented Jan 6, 2020

  • add podsecuritypolicy for enterprise license job following the pattern
    for other psps
  • set same requirements across resources for rendering: servers enabled
    and enterprise license secret fully specified. The different resources
    had different requirements before, for example that clients are running
    or that bootstrapACLs are true
  • always create a separate service account for the job, even if acls are
    disabled. This is to match the pattern across the rest of the templates
    where we always create a separate service account
  • remove comment across our PSP's that RunAsAny prevented running as root. This is not correct.

RunAsAny means "No default provided. Allows any runAsUser to be
specified.", it does not mean that the container must run as non-root.
That rule is MustRunAsNonRoot.
@lkysow
Copy link
Member Author

lkysow commented Jan 6, 2020

@adilyse would appreciate a look at this from you. In #172 you made using a separate service account for the ent-license job dependent on whether ACLs were enabled. This was because the clusterrole was only needed if acls were enabled.

Now the clusterrole is needed if ACLs are enabled or if psp's are enabled. I could add that conditional to the service account but I looked at the rest of our templates and we're always creating a service account, even if we don't need to target it via a clusterrole rule. I think this pattern makes sense (to always have a service account per component) but would like your review.

@lkysow lkysow requested a review from a team January 6, 2020 20:36
@lkysow lkysow force-pushed the psps branch 3 times, most recently from c6ec995 to fcd7d3f Compare January 9, 2020 16:59
Copy link
Contributor

@ishustava ishustava left a comment

Choose a reason for hiding this comment

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

Looks good to me! I left a couple of comments, but nothing blocking.

templates/enterprise-license-clusterrole.yaml Show resolved Hide resolved
@@ -41,7 +41,6 @@ spec:
hostIPC: false
hostPID: false
runAsUser:
# Require the container to run without root privileges.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious, are you deleting these comments because of duplication?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm deleting them because they're incorrect. RunAsAny means the container can run as anything. It doesn't prevent root. MustRunAs or MayRunAs can be used to prevent root.

- add podsecuritypolicy for enterprise license job following the pattern
for other psps
- set same requirements across resources for rendering: servers enabled
and enterprise license secret fully specified. The different resources
had different requirements before, for example that clients are running
or that bootstrapACLs are true
- always create a separate service account for the job, even if acls are
disabled. This is to match the pattern across the rest of the templates
where we always create a separate service account
@lkysow lkysow merged commit 1e9f22f into master Jan 10, 2020
@lkysow lkysow deleted the psps branch January 10, 2020 17:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants