-
Notifications
You must be signed in to change notification settings - Fork 323
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
Support running with restricted PSA enforcement enabled (part 1) #2572
Commits on Jul 14, 2023
-
Support restricted PSA enforcement in basic setup
This enables running Consul in a basic configuration with PSA enforcement set to restricted on the namespace where Consul is deployed. (This requires deploying the CNI to a different privileged namespace). On OpenShift, we have the option to set the security context or not. If the security context is unset, then it is set automatically by OpenShift SCCs. However, we prefer to set the security context to avoid useless warnings on OpenShift and to reduce the config difference between OpenShift and plain Kube. By default, OpenShift namespaces have the audit and warn PSA labels set to restricted, so we receive pod security warnings when deploying Consul to OpenShift even though the pods will be able to run.
Paul Glass committedJul 14, 2023 Configuration menu - View commit details
-
Copy full SHA for 45d3af0 - Browse repository at this point
Copy the full SHA 45d3af0View commit details -
Test: Support
TestConnectInject
on OpenShift + CNI* When `-enable-openshift` and `-enable-cni` are set, configure the CNI settings correctly for OpenShift, which must look like: ``` connectInject: cni: enabled: true multus: true cniBinDir: /var/lib/cni/bin cniNetDir: /etc/kubernetes/cni/net. ``` * Add `-cni-namespace` flag to support deploying the CNI into a separate namespace. This is needed to testing with the CNI when restricted PSA enforcement is enabled on the namespace where Consul is deployed because the CNI cannot run in a PSA-restricted namespace. * Add `-app-namespace` and `-secondary-app-namespace` flags to support deploying test applications into a specific namespace. This is needed to test with restricted PSA enforcement enabled on the Consul namespace because our test applications require a bit more privilege. * Update the ConnectHelper to configure the NetworkAttachmentDefinition required to be compatible with the CNI on OpenShift. * Add fixtures for static-client and static-server for OpenShift. This is necessary because the deployment configs must reference the network attachment definition when using the CNI on OpenShift. * Update tests in the `acceptance/tests/connect` directory to either run or skip based on -enable-cni and -enable-openshift (all but two cases are skipped for now).
Paul Glass committedJul 14, 2023 Configuration menu - View commit details
-
Copy full SHA for cf9715f - Browse repository at this point
Copy the full SHA cf9715fView commit details -
fix: Use security context template
Paul Glass committedJul 14, 2023 Configuration menu - View commit details
-
Copy full SHA for ff5c24b - Browse repository at this point
Copy the full SHA ff5c24bView commit details -
tests: Add static-client and static-server fixtures for OpenShift
Paul Glass committedJul 14, 2023 Configuration menu - View commit details
-
Copy full SHA for 9e83262 - Browse repository at this point
Copy the full SHA 9e83262View commit details -
fix: Respect user-provided securityContext settings
Paul Glass committedJul 14, 2023 Configuration menu - View commit details
-
Copy full SHA for e45cc5a - Browse repository at this point
Copy the full SHA e45cc5aView commit details
Commits on Jul 19, 2023
-
Merge remote-tracking branch 'origin/main' into pglass/NET-185/basic-…
…connect-test Also (oops I did this as part of the rebase/merge): - Remove the -app-namespace test flags. - Instead, support enabling an app namespace in Connect Helper so that tests can choose which namespace to use for applications. - Add -restricted-psa-enforcement-enabled flag.
Paul Glass committedJul 19, 2023 Configuration menu - View commit details
-
Copy full SHA for 0671525 - Browse repository at this point
Copy the full SHA 0671525View commit details -
Paul Glass committed
Jul 19, 2023 Configuration menu - View commit details
-
Copy full SHA for cbc48f7 - Browse repository at this point
Copy the full SHA cbc48f7View commit details
Commits on Jul 20, 2023
-
Paul Glass committed
Jul 20, 2023 Configuration menu - View commit details
-
Copy full SHA for 2790c63 - Browse repository at this point
Copy the full SHA 2790c63View commit details -
Paul Glass committed
Jul 20, 2023 Configuration menu - View commit details
-
Copy full SHA for 7b2e6d3 - Browse repository at this point
Copy the full SHA 7b2e6d3View commit details -
Setting a non-root user is necessary when `runAsNotRoot: true` is configured in the securityContext. By setting `runAsUser: 100`, we are most compatible with all of the consul, consul-dataplane, and consul-k8s-control-plane images which all contain a user id 100. On OpenShift, this is unnecessary because `runAsUser` is set automatically (if it is unset), and by setting it explicitly we would require the `anyuid` SCC which would bump the namespace out of the `restricted` PSA profile.
Paul Glass committedJul 20, 2023 Configuration menu - View commit details
-
Copy full SHA for 2b2eefb - Browse repository at this point
Copy the full SHA 2b2eefbView commit details -
Fix acceptance framework unit test
Paul Glass committedJul 20, 2023 Configuration menu - View commit details
-
Copy full SHA for d0af4f0 - Browse repository at this point
Copy the full SHA d0af4f0View commit details
Commits on Jul 21, 2023
-
Merge remote-tracking branch 'origin/main' into pglass/NET-185/basic-…
…connect-test
Paul Glass committedJul 21, 2023 Configuration menu - View commit details
-
Copy full SHA for fb98d10 - Browse repository at this point
Copy the full SHA fb98d10View commit details -
Paul Glass committed
Jul 21, 2023 Configuration menu - View commit details
-
Copy full SHA for 57c89ab - Browse repository at this point
Copy the full SHA 57c89abView commit details -
Rename flag to -enabled-restricted-psa-enforcement
Paul Glass committedJul 21, 2023 Configuration menu - View commit details
-
Copy full SHA for b8c37fb - Browse repository at this point
Copy the full SHA b8c37fbView commit details