Bug 2009763 - Kube API Server Static pod has user-serving-cert with 644 permissions
Summary: Kube API Server Static pod has user-serving-cert with 644 permissions
Keywords:
Status: CLOSED DUPLICATE of bug 1977730
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: kube-apiserver
Version: 4.7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Emily Moss
QA Contact: Ke Wang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-10-01 14:06 UTC by Matthew Robson
Modified: 2021-10-11 19:09 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-10-11 19:09:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Matthew Robson 2021-10-01 14:06:24 UTC
Description of problem:

This is causing failures in the CIS check from the compliance operator:

# oc -n openshift-compliance get compliancecheckresults -l 'compliance.openshift.io/check-status=FAIL,!compliance.openshift.io/automated-remediation'
NAME                                                                           STATUS   SEVERITY
ocp4-cis-node-master-file-permissions-openshift-pki-cert-files                 FAIL     medium
ocp4-cis-node-master-file-permissions-openshift-pki-key-files                  FAIL     medium

Looking at the masters, you can see it has 644 permissions:
[root@master-02 ~]# ls -l /etc/kubernetes/static-pod-resources/kube-*/secrets/*/tls.crt /etc/kubernete
s/static-pod-resources/*/*/*/*.key | grep -v -- '-rw-------'
-rw-r--r--. 1 root root 5859 Apr 13 18:32 /etc/kubernetes/static-pod-resources/kube-apiserver-certs/secrets/user-serving-cert-000/tls.crt
-rw-r--r--. 1 root root 1704 Apr 13 18:32 /etc/kubernetes/static-pod-resources/kube-apiserver-certs/secrets/user-serving-cert-000/tls.key

You can see the CIS benchmark here:
https://github.com/ComplianceAsCode/content/blob/master/applications/openshift/master/file_permissions_openshift_pki_cert_files/rule.yml#L5

Its expecting certificates permissions to be 600.


Version-Release number of selected component (if applicable):
4.7

How reproducible:
Always

Steps to Reproduce:
1. Using the default compliance operator
2.
3.

Actual results:
644 permissions

Expected results:
600 permissions for CIS compliance

Additional info:

Comment 1 Emily Moss 2021-10-11 19:09:08 UTC

*** This bug has been marked as a duplicate of bug 1977730 ***


Note You need to log in before you can comment on or make changes to this bug.