Skip to content

Conversation

ivanfetch-wt
Copy link
Contributor

@ivanfetch-wt ivanfetch-wt commented Aug 31, 2022

See also ticket 3025 which describes results testing these checks in some live environments.

Checklist

  • I have signed the CLA
  • I have updated/added any relevant documentation

Description

What's the goal of this PR?

These checks are now enabled in the default Polaris configuration:

  • linuxHardening
  • sensitiveConfigmapContent and sensitiveContainerEnvVar
  • clusterrolebindingClusterAdmin, rolebindingClusterAdminClusterRole, and rolebindingClusterAdminRole
  • clusterrolePodExecAttach, rolePodExecAttach, clusterrolebindingPodExecAttach, rolebindingClusterRolePodExecAttach, and rolebindingRolePodExecAttach

These checks are listed in the default configuration but remain set to ignore to avoid a storm of results:

  • automountServiceAccountToken
  • missingNetworkPolicy

Fixed the sensitiveContainerEnvVar check to ignore sensitive environment
variable names when those variables use valueFrom to reference an
external resource.

Added exemptions to RBAC related checks for names prefixed with system:, and also gce:podsecuritypolicy:calico-sa. This avoids chasing a growing list of exemptions as new versions of Kube adjust built-in resources.

Added the *ClusterAdmin checks to examples/config-full.yaml.

…tainerENvVar to ignore `valueFrom`, add ClusterAdmin checks to config-full.yaml

Enable and add exemptions for these checks:
* automountServiceAccountToken
* linuxHardening
* missingNetworkPolicy
* sensitiveConfigmapContent and sensitiveContainerEnvVar
* clusterrolebindingClusterAdmin, rolebindingClusterAdminClusterRole, and rolebindingClusterAdminRole
* clusterrolePodExecAttach, rolePodExecAttach, clusterrolebindingPodExecAttach, rolebindingClusterRolePodExecAttach, and  rolebindingRolePodExecAttach

Fix the `sensitiveContainerEnvVar` check to ignore sensitive environment
variable names when those variables use `valueFrom` to reference an
external resource.

Add the `*ClusterAdmin` checks to `examples/config-full.yaml`.
@fairwinds-insights
Copy link

Fairwinds Insights CI Report

View the Full Report

✅ No new Action Items detected!

@ivanfetch-wt ivanfetch-wt changed the title FWI-2719: Enable and add exemptions for recently-added checks, fix sensitiveCon… FWI-2719: Enable and add exemptions for recently-added checks Aug 31, 2022
@ivanfetch-wt
Copy link
Contributor Author

I'm waiting to merge this (making these checks live for the Polaris community) until a deeper round of initial testing has completed.

Ivan Fetch and others added 7 commits September 16, 2022 15:26
…sSuffix` functions are available in the go template, exempt the prefix `system:` instead of indifidual entries for RBAC checks (#871)

* `hasPrefix` and `hasSuffix` functions are available in the go template, exempt the prefix `system:` instead of indifidual entries for RBAC checks

* The RBAC checks `clusterrolebindingClusterAdmin` and `clusterrolebindingPodExecAttach` now exempt bindings that start with `system:`, instead of listing explicit strings.
* The RBAC check `clusterrolePodExecAttach` now exempt ClusterRoles that start with `system:`, instead of listing explicit strings.

* Update documentation to include additional Go template functions

* Set the `automountServiceAccountToken` check to ignore by default
…policy:sa` exemptions also to Role and ClusterRole related RBAC checks
@ivanfetch-wt ivanfetch-wt requested review from rbren and removed request for makoscafee November 10, 2022 22:12
@rbren
Copy link
Contributor

rbren commented Nov 11, 2022

Thanks for adding all the new test cases!

@ivanfetch-wt ivanfetch-wt merged commit 467d06f into master Nov 14, 2022
@ivanfetch-wt ivanfetch-wt deleted the if/enable-new-checks branch November 14, 2022 22:05
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