<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Gaurav Bankar on Medium]]></title>
        <description><![CDATA[Stories by Gaurav Bankar on Medium]]></description>
        <link>https://medium.com/@gauravpbankar?source=rss-210b55b5cfa5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Z0F2f8Vp77bL53PK</url>
            <title>Stories by Gaurav Bankar on Medium</title>
            <link>https://medium.com/@gauravpbankar?source=rss-210b55b5cfa5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 19:10:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gauravpbankar/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Configuring a PCI-DSS compliant OpenShift Container Platform cluster
on IBM Power]]></title>
            <link>https://medium.com/@gauravpbankar/configuring-a-pci-dss-compliant-openshift-container-platform-cluster-on-ibm-power-cb79ba07b376?source=rss-210b55b5cfa5------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb79ba07b376</guid>
            <category><![CDATA[ppc64le]]></category>
            <category><![CDATA[openshift]]></category>
            <category><![CDATA[pci-dss-compliance]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[ibm]]></category>
            <dc:creator><![CDATA[Gaurav Bankar]]></dc:creator>
            <pubDate>Wed, 11 Jan 2023 13:51:01 GMT</pubDate>
            <atom:updated>2023-01-11T13:51:01.927Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi Folks</p><p>If you’re processing Credit Card Payments, you ‘really’ care about security and following the PCI-DSS standard. Once you have the <a href="https://docs.openshift.com/container-platform/4.11/security/compliance_operator/compliance-operator-understanding.html">OpenShift Compliance Operator</a> installed on the OpenShift Container Platform (OCP) cluster and the <a href="https://listings.pcisecuritystandards.org/documents/PCIDSS_QRGv3_1.pdf">PCI-DSS v1.3</a> profile enabled, you want to configure a compliant cluster.</p><p>If you want to learn how to install and setup the Compliance Operator with PCI-DSS, you can see my colleague’s <a href="https://medium.com/@aditijadhav38/using-the-compliance-operator-to-support-pci-dss-on-openshift-container-platform-on-power-21a085cf4624">post</a>.</p><p>This document outlines how to verify the profiles, check for the scan results, and configure a compliant cluster.</p><p><strong>1. Verify the Profiles</strong></p><p>After installing the compliance operator, you can see the PCI-DSS profiles are enabled using below command.</p><pre># oc get -n openshift-compliance profiles.compliance<br>NAME                             AGE<br>ocp4-cis                         5m14s<br>ocp4-cis-node                    5m14s<br>ocp4-pci-dss                     5m12s<br>ocp4-pci-dss-node                5m12s</pre><p>You see the ocp4-pci-dss and ocp4-pci-dss-node profiles are listed.</p><p><strong>2. Check the Scan Results</strong></p><p>Once your first scan completes, setup and run in the prior blog post from my colleague, you should be able to list and filter on issues with regards to the <em>compliancecheckresult</em>.</p><pre># oc get compliancecheckresult -n openshift-compliance | grep pci | grep FAIL</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*gatkJq3gzHfj6VXNPn4GBQ.png" /></figure><p><strong>3. Configure the Compliant Cluster</strong></p><p>To configure a PCI-DSS compliant cluster, I’ve included several recipes:</p><p><strong>1. The ocp4-pci-dss-machine-volume-encryption Recipe</strong></p><p>To apply above compliance check you need to enable FIPS and LUKS encryptions in the OCP cluster to setup a cluster, you can refer this <a href="https://medium.com/@gauravpbankar/encrypting-openshift-container-platform-disks-on-power-systems-d336af4d9af6">post</a> in which you can configure an external Tang cluster, setting up OCP cluster and verification of FIPS and LUKS encryption.</p><p>Note, you need to setup FIPS on the initial creation of the cluster, and for LUKS you can configure post creation. Once these are configured, the <em>compliancecheckresult</em> is marked PASS.</p><p><strong>2. The ocp4-pci-dss-audit-log-forwarding-enabled Recipe</strong></p><p>To apply above compliance check related to audit log forwarding you need to install <a href="https://docs.openshift.com/container-platform/4.11/logging/cluster-logging-deploying.html">ElasticSearch and the OpenShift Logging Operators</a> from the OperatorHub and setup cluster log forwarding.</p><p>1. Install Elasticsearch and logging operator from operator hub (from web console)</p><p>I. In the OpenShift Container Platform web console, click Operators → OperatorHub.</p><p>II. Choose OpenShift Elasticsearch Operator and logging operator from the list of available Operators and click Install.</p><p>III. Configure the Operator using the <a href="https://docs.openshift.com/container-platform/4.11/logging/cluster-logging-deploying.html">documentation</a></p><p>2. Create the YAML for forwarding cluster log — ClusterLogForwarder.yaml</p><pre># cat ClusterLogForwarder.yaml<br>apiVersion: &quot;logging.openshift.io/v1&quot;<br>kind: ClusterLogForwarder<br>metadata:<br>  name: instance<br>  namespace: openshift-logging<br>spec:<br>  outputs:<br>   - name: elasticsearch-secure<br>     type: &quot;elasticsearch&quot;<br>     url: https://elasticsearch.secure.com:9200<br>     secret:<br>        name: es-secret<br>  pipelines:<br>   - name: application-logs<br>     inputRefs:<br>     - application<br>     - audit<br>     outputRefs:<br>     - elasticsearch-secure<br>     - default<br>     labels:<br>       myLabel: &quot;myValue&quot;<br>   - name: infrastructure-audit-logs<br>     inputRefs:<br>     - infrastructure<br>     outputRefs:<br>     - elasticsearch-insecure<br>     labels:<br>       logs: &quot;audit-infra&quot;</pre><p>3. Create ClusterLogForwarder object using below command:</p><pre># oc create -f ClusterLogForwarder.yaml</pre><p>Once you perform these steps, the ocp4-pci-dss-audit-log-forwarding-enabled compliance check is marked PASS.</p><p>Note, it is best practice for the logs to be outside of the cluster.</p><p><strong>3. The ocp4-pci-dss-configure-network-policies-namespaces Recipe</strong></p><p>To apply above compliance check related to network policy namespaces you need to create namespace and need to create Network policy on same namespace and to achieve this you use below steps:</p><ol><li>Create a namespace named as test1.</li></ol><pre># oc create ns test1</pre><p>2. Create yaml file with below configuration:</p><pre>apiVersion: networking.k8s.io/v1<br>kind: NetworkPolicy<br>metadata:<br>  name: test-network-policy<br>  namespace: test1<br>spec:<br>  podSelector: {}<br>  policyTypes:<br>  - Ingress<br>  - Egress</pre><p>3. Create above network policy using below command.</p><pre># oc create -f file1.yaml</pre><p>Once you perform above steps, The ocp4-pci-dss-configure-network-policies-namespaces compliance check will be passed.</p><p><strong>4. The idp-dss configuration Recipe</strong></p><p>The default identity provider included in OpenShift is not approved for the PCI-DSS profile. To configure an alternative identity provider, such as the GitHub identity provider for OpenShift or one of the many other supported iDPs. You can configure the GitHub iDP as described <a href="https://docs.openshift.com/container-platform/4.11/authentication/identity_providers/configuring-github-identity-provider.html">Configuring a GitHub or GitHub Enterprise identity provider</a>.</p><p>Once you configure an alternative identity provider, the idp-dss configuration compliance check is passed.</p><p><strong>5. The ocp4-pci-dss-kubeadmin-removed Recipe</strong></p><p>The kubeadmin is a default superuser. As a best practice, you should remove this default superuser from your OpenShift cluster. The OpenShift documentation describes the process of <a href="https://docs.openshift.com/container-platform/4.11/authentication/remove-kubeadmin.html">Removing the kubeadmin user</a>.</p><p>Once you complete the process outlined in the documentation, the ocp4-pci-dss-kubeadmin-removed check is marked PASS.</p><p><strong>6. The ocp4-pci-dss-file-integrity-exists and ocp4-pci-dss-file-integrity-notification Recipe</strong></p><p>The <a href="https://docs.openshift.com/container-platform/4.11/security/file_integrity_operator/file-integrity-operator-installation.html">File Integrity Operator</a> acts on the FileIntegrity resource which can be used to continually runs file integrity checks on the cluster nodes. It deploys a DaemonSet that initializes and runs privileged AIDE (Advanced Intrusion Detection Environment) containers on each node, providing a log of files that have been modified since the initial run of the DaemonSet pods.</p><p>1. Install the <a href="https://docs.openshift.com/container-platform/4.11/security/file_integrity_operator/file-integrity-operator-installation.html">File Integrity Operator</a></p><p>2. Create file-object yaml file using below configuration.</p><pre>apiVersion: fileintegrity.openshift.io/v1alpha1<br>kind: FileIntegrity<br>metadata:<br>  name: example-fileintegrity<br>  namespace: openshift-file-integrity<br>spec:<br>  nodeSelector:<br>    kubernetes.io/hostname: &quot;ip-10-10-10-1&quot;<br>  tolerations:<br>  - key: &quot;myNode&quot;<br>    operator: &quot;Exists&quot;<br>    effect: &quot;NoSchedule&quot;<br>  config:<br>    name: &quot;myconfig&quot;<br>    namespace: &quot;openshift-file-integrity&quot;<br>    key: &quot;config&quot;<br>    gracePeriod: 20<br>    maxBackups: 5<br>  debug: false<br>status:<br>  phase: Active</pre><p>3. Create FileIntegrity object by using below command.</p><pre># oc apply -f file-object.yaml</pre><p>Once you apply both recipes, the ocp4-pci-dss-file-integrity-exists and ocp4-pci-dss-file-integrity-notification-enabled check will be passed.</p><p>Once all recipes are the cluster will be PCI-DSS compliant. This post you’ve seen how to setup the profiles, check for the scan results, and successfully configure the cluster.</p><p>Thanks for reading! I hope you found this helpful :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb79ba07b376" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenShift TLS Security Profiles on IBM Power]]></title>
            <link>https://medium.com/@gauravpbankar/openshift-tls-security-profiles-on-ibm-power-ae1124245db6?source=rss-210b55b5cfa5------2</link>
            <guid isPermaLink="false">https://medium.com/p/ae1124245db6</guid>
            <category><![CDATA[openshift]]></category>
            <category><![CDATA[ibm]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[ppc64le]]></category>
            <category><![CDATA[security-profile]]></category>
            <dc:creator><![CDATA[Gaurav Bankar]]></dc:creator>
            <pubDate>Mon, 12 Dec 2022 12:14:56 GMT</pubDate>
            <atom:updated>2022-12-12T12:14:56.021Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi Folks</p><p>As part of a series of posts about OpenShift Container Platform on IBM Power Systems, I wanted to share my notes with you about <a href="https://docs.openshift.com/container-platform/4.11/security/tls-security-profiles.html#tls-profiles-kubelet-configuring_tls-security-profiles">Configuring the OpenShift Container Platform Transport Layer Security (TLS) security profiles</a>.</p><p>This document outlines the core OpenShift components that use network traffic, the available security profiles, how to configure each component, and verify each component is properly enabled.</p><p><strong>The Components and the Profiles</strong></p><p>The OpenShift Container Platform is composed of many components. Three components in particular, the <em>ingress controller</em>, the <em>control plane</em> and <em>kubelet</em> can be configured to support specific TLS versions and settings. These versions, the minimum, and TLS settings are bound into profiles:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*o6SCsKCiqN9uo5yrhZJQBA.png" /></figure><p>You can view each component’s TLS profile and see the version and ciphers used</p><pre>$ oc explain &lt;component&gt;.spec.tlsSecurityProfile.&lt;profile&gt;</pre><p>For &lt;component&gt;, specify IngressController, apiserver, or kubeletconfig .</p><p>For &lt;profile&gt;, specify old, intermediate, customand modern.</p><p>If you are looking for custom examples, then you explain the <em>tlsSecurityProfile</em>.</p><h3>Configuring the TLS security profile</h3><p>You can configure TLS security profile for the ingress controller, control plane and kubelet with one of the three predefine TLS profiles (Old, Intermediate, Modern) which do not accept a list of explicit ciphers and a minimum TLS version. If you want to have explicit ciphers and TLS version, you setup the <em>custom</em> profile.</p><p>To configure a TLS security profile for an OpenShift component, you edit the custom resource to specify a predefined or custom profile. To set the ciphers and minimum TLS version of the configured TLS security profile, you look at the IngressController custom resource and search for the field status.tlsProfile and the configured TLS security profile under spec.tlsSecurityProfile. For the custom TLS security profile, the specific ciphers and minimum TLS version are listed under both parameters.</p><p><strong>1.</strong> <strong>Setting TLS security profile for an ingress Controller</strong></p><p>The IngressController is a single component, to configure the IngressController for TLS Security Profile:</p><p>i. Edit the IngressController CR in the openshift-ingress-operatorproject:</p><pre>$ oc edit IngressController default -n openshift-ingress-operator</pre><p>ii. Add the spec.tlsSecurityProfile field, such as the following:</p><pre>apiVersion: operator.openshift.io/v1<br>kind: IngressController<br> ...<br>spec:<br>  tlsSecurityProfile:<br>    type: Custom <br>    custom: <br>      ciphers: <br>        ECDHE-ECDSA-CHACHA20-POLY1305<br>        ECDHE-RSA-CHACHA20-POLY1305<br>        ECDHE-RSA-AES128-GCM-SHA256<br>        ECDHE-ECDSA-AES128-GCM-SHA256<br>      Min TLS Version:  VersionTLS11<br>    Type:               Custom<br> ...</pre><p>iii. Save the file to apply the changes.</p><p><strong>2.</strong> <strong>Setting TLS security profile for an APIServer</strong></p><p>The APIServer wraps multiple components into a single custom resource — Kubernetes API server, Kubernetes controller manager, Kubernetes scheduler, OpenShift API server, OpenShift OAuth API server, OpenShift OAuth server, etcd. The default TLS security profile is Intermediate.</p><p>To configure the TLS Security profile, you can:</p><p>i. Edit the default APIServer CR to configure the TLS security profile:</p><pre>$ oc edit APIServer cluster</pre><p>ii. Add the spec.tlsSecurityProfile field:</p><p>Sample APIServer CR for a Custom profile</p><pre>apiVersion: config.openshift.io/v1<br>kind: APIServer<br>metadata:<br>  name: cluster<br>spec:<br>  tlsSecurityProfile:<br>    type: Custom     <br>    custom: <br>      ciphers: <br>        ECDHE-ECDSA-CHACHA20-POLY1305<br>        ECDHE-RSA-CHACHA20-POLY1305<br>        ECDHE-RSA-AES128-GCM-SHA256<br>        ECDHE-ECDSA-AES128-GCM-SHA256<br>      Min TLS Version:  VersionTLS11<br>    Type:               Custom</pre><p>iii. Save the file to apply the changes.</p><p><strong>3.</strong> <strong>Setting TLS security profile for kubelet</strong></p><p>The kubelet component is configured with the KubeletConfig to set a TLS Security Profile for specific nodes. The default TLS security profile for kubelet is Intermediate.</p><p>To configure the TLS Security profile, you can:</p><p>i. Create a KubeletConfig CR to configure the TLS security profile:</p><pre>apiVersion: machineconfiguration.openshift.io/v1<br>kind: KubeletConfig<br>metadata:<br>  name: set-kubelet-tls-security-profile<br>spec:<br>  tlsSecurityProfile:<br>    type: Custom  <br>    custom: <br>      ciphers: <br>        ECDHE-ECDSA-CHACHA20-POLY1305<br>        ECDHE-RSA-CHACHA20-POLY1305<br>        ECDHE-RSA-AES128-GCM-SHA256<br>        ECDHE-ECDSA-AES128-GCM-SHA256<br>      Min TLS Version:  VersionTLS11<br>    Type:               Custom<br>  machineConfigPoolSelector:<br>    matchLabels:<br>      pools.operator.machineconfiguration.openshift.io/worker: &quot;&quot;</pre><p>ii. Create the KubeletConfig object:</p><pre>$ oc create -f &lt;filename&gt;</pre><p>You should wait for the configured nodes to be rebooted one by one.</p><p><strong>Verification of the TLS security profiles</strong></p><p>In this section you can perform verification steps for all components — ingress controller, control plane and kubelet:</p><ol><li><strong>Verification steps for Ingress-controller to see the profile and the TLS version and ciphers.</strong></li></ol><pre>$ oc describe IngressController default -n openshift-ingress-operator</pre><p>Output:</p><pre>Name:         default<br>Namespace:    openshift-ingress-operator<br>Labels:       &lt;none&gt;<br>Annotations:  &lt;none&gt;<br>API Version:  operator.openshift.io/v1<br>Kind:         IngressController<br> ...<br>Spec:<br> ...<br>  Tls Security Profile:<br>    Custom:<br>      Ciphers:<br>        ECDHE-ECDSA-CHACHA20-POLY1305<br>        ECDHE-RSA-CHACHA20-POLY1305<br>        ECDHE-RSA-AES128-GCM-SHA256<br>        ECDHE-ECDSA-AES128-GCM-SHA256<br>      Min TLS Version:  VersionTLS11<br>    Type:               Custom<br>...</pre><p><strong>2 . Verification steps for Control plane</strong></p><p>Verify that the TLS security profile is set in the APIServer Custom Resource:</p><pre>$ oc describe apiserver cluster</pre><p>Output:</p><pre>Name:         cluster<br>Namespace:<br> ...<br>API Version:  config.openshift.io/v1<br>Kind:         APIServer<br> ...<br>Spec:<br>  Audit:<br>    Profile:  Default<br>  Tls Security Profile:<br>    Custom:<br>      Ciphers:<br>         ECDHE-ECDSA-CHACHA20-POLY1305<br>        ECDHE-RSA-CHACHA20-POLY1305<br>        ECDHE-RSA-AES128-GCM-SHA256<br>        ECDHE-ECDSA-AES128-GCM-SHA256<br>    Type:               Custom<br> ...</pre><p>Verify that the TLS security profile is set in the etcd Custom Resource</p><pre>$ oc describe etcd cluster</pre><p>Output:</p><pre>Name:         cluster<br>Namespace:<br> ...<br>API Version:  operator.openshift.io/v1<br>Kind:         Etcd<br> ...<br>Spec:<br>  Log Level:         Normal<br>  Management State:  Managed<br>  Observed Config:<br>    Serving Info:<br>      Cipher Suites:<br>    &quot;TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256&quot;,<br>    &quot;TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256&quot;,<br>    &quot;TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384&quot;,<br>    &quot;TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384&quot;,<br>    &quot;TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256&quot;,<br>    &quot;TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256&quot;<br>],<br>      Min TLS Version:           VersionTLS12</pre><p><strong>3 . Verification steps for kubelet</strong></p><p>Perform the following steps after the nodes are in the Ready state:</p><p>I. Start a debug session for a configured node:</p><pre>$ oc debug node/&lt;node_name&gt;</pre><p>II. Set /host as the root directory within the debug shell:</p><pre>$ chroot /host</pre><p>III. View the kubelet.conf file:</p><pre>$ cat /etc/kubernetes/kubelet.conf</pre><p>Example output</p><pre>kind: KubeletConfiguration<br>apiVersion: kubelet.config.k8s.io/v1beta1<br> ...<br>  &quot;tlsCipherSuites&quot;: [<br>    &quot;TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256&quot;,<br>    &quot;TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256&quot;,<br>    &quot;TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384&quot;,<br>    &quot;TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384&quot;,<br>    &quot;TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256&quot;,<br>    &quot;TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256&quot;<br>],<br>  &quot;tlsMinVersion&quot;: &quot;VersionTLS12&quot;,</pre><p>Verification of TLS on the Kubelet OpenSSL commands:</p><p>I. Get the list of nodes (you can check a control plane and worker node)​</p><pre>$ oc get nodes</pre><p>II. Connect via Debug​</p><pre>$ oc debug node/mon01-worker-0.dsop0-power-211a.ibm.com</pre><p>III. Change root​</p><pre>$ chroot /host</pre><p>IV. Check which ports are running for kubelet​</p><pre>$ netstat -plutn | grep kubelet<br>tcp 0 0 127.0.0.1:10248 0.0.0.0:* LISTEN 1695/kubelet<br>tcp6 0 0 :::10250 :::* LISTEN 1695/kubelet</pre><p>V. Using the port for tcp</p><pre>$ openssl s_client -connect localhost:10250</pre><p>You should see a negotiated TLS version​, such as:</p><pre>New, TLSv1.3, Cipher is TLS_AES_256_GCM_SHA384</pre><p>VI. You can test the specific cipher using:​</p><pre>$ openssl s_client -connect localhost:10250 -cipher &#39;ECDHE-ECDSA-AES256-SHA&#39;</pre><p>You should see the cipher used successfully or not (if not supported)</p><p>Verification with tls1_2, tls1_1, tls1 TLS versions using OpenSSL commands for kubelet on same node:</p><p>I. Check for TLS1.2 version</p><pre><em>$ openssl s_client -connect localhost:10250 -tls1_2</em><br><br>SSL-Session:<br>    Protocol  : TLSv1.2</pre><p>II. Check for TLS1.1 version</p><pre>$ openssl s_client -connect localhost:10250 -tls1_1<br>SSL-Session:<br>    Protocol  : TLSv1.1</pre><p>III. Check for TLS1 version</p><pre>$ openssl s_client -connect localhost:10250 -tls1<br>SSL-Session:<br>    Protocol  : TLSv1</pre><p>This post you’ve learned how to configure TLS security profiles for the OpenShift Container Platform.</p><p>Thanks for reading! I hope you found this helpful:)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae1124245db6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Encrypting OpenShift Container Platform
Disks on Power Systems]]></title>
            <link>https://medium.com/@gauravpbankar/encrypting-openshift-container-platform-disks-on-power-systems-d336af4d9af6?source=rss-210b55b5cfa5------2</link>
            <guid isPermaLink="false">https://medium.com/p/d336af4d9af6</guid>
            <category><![CDATA[ibm]]></category>
            <category><![CDATA[ppc64le]]></category>
            <category><![CDATA[pci-dss]]></category>
            <category><![CDATA[luks]]></category>
            <category><![CDATA[openshift]]></category>
            <dc:creator><![CDATA[Gaurav Bankar]]></dc:creator>
            <pubDate>Thu, 08 Dec 2022 10:04:50 GMT</pubDate>
            <atom:updated>2022-12-08T10:04:50.023Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi Folks</p><p>I’m guessing you’re here as you want to encrypt your OpenShift Container Platform’s disks on IBM Power Systems.</p><p>This document outlines the encryption concepts, how to setup an external tang cluster on <a href="https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-about-virtual-server">IBM PowerVS</a>, how to setup a cluster on <a href="https://cloud.ibm.com/docs/power-iaas?topic=power-iaas-about-virtual-server">IBM PowerVS</a> and how to confirm the encrypted disk setup.</p><p><strong>Encryption Concepts</strong></p><p>When configuring a Linux Server and an OpenShift Cluster for encrypted disks, there are a few concepts that are important to know about:</p><p><strong>Network-Bound Disk Encryption</strong> (NBDE) ties an encryption key to a set of external servers in a secure and anonymous way across the network.</p><p><strong>Clevis</strong> is a client that enables Linux servers to connect to the server and works in conjunction with Linux Unified Key Setup-on-disk-format (LUKS) to encrypt and decrypt root and non-root storage volumes. The client is a pluggable framework to automate encryption and decryption. The client is a package that runs on the node and enables a plugin with a ‘pin’.</p><p><strong>Tang</strong> is a server for binding data to network presence. It makes a node containing the data available when the node is bound to a certain secure network. Tang is stateless and does not require Transport Layer Security (TLS) or authentication. Unlike escrow-based solutions, where the key server stores all encryption keys and has knowledge of every encryption key, Tang never interacts with any node keys, so it never gains any identifying information from the node. Tang binds the disk encryption to a Tang server to enable NBDE.</p><p>For OpenShift, <strong>Red Hat Enterprise Linux CoreOS (RHCOS)</strong> uses clevis to encrypt and decrypt storage volumes. When a node starts, it attempts to contact a predefined set of Tang servers by performing a cryptographic handshake. If it can reach the required number of Tang servers, the node can construct its disk decryption key and unlock the disks to continue booting. If the node cannot access a Tang server due to a network outage or server unavailability, the node cannot boot and continues retrying indefinitely until the Tang servers become available again.</p><p>The key is effectively tied to the node’s presence in a network, an attacker attempting to gain access to the data at rest would need to obtain both the disks on the node, and network access to the Tang server as well.</p><p><strong>Setting up an External Tang Cluster on IBM PowerVS</strong></p><p>The<em> </em><a href="https://github.com/IBM/powervs-tang-server-automation">powervs-tang-server-automation </a>provides Terraform based automation code to help with the deployment of <a href="https://github.com/linux-system-roles/nbde_server">Network Bound Disk Encryption (NBDE)</a> on <a href="https://www.ibm.com/cloud/power-virtual-server">IBM® Power Systems™ Virtual Server on IBM Cloud</a>.</p><p>The NBDE Server, also called the tang server, is deployed in a 3-node cluster with a single <a href="https://en.wikipedia.org/wiki/Bastion_host">bastion host</a>. The tang server socket listens on port 7500.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*xATug77zxkjFANLJhzq1fw.jpeg" /><figcaption><em>Figure 1 Topology of the External Tang Cluster</em></figcaption></figure><p>To install the tang infrastructure, you can follow these steps:</p><ol><li>Clone the automation repository</li></ol><pre># git clone https://github.com/ibm/powervs-tang-server-automation<br># cd powervs-tang-server-automation</pre><p>Update following variables in the <a href="https://github.com/IBM/powervs-tang-server-automation/blob/var.tfvars">var.tfvars</a> based on your environment. There is more detail on the variables included in the documentation in the repository’s docs folder.</p><pre>ibmcloud_api_key    = &quot;xyzaaaaaaaabcdeaaaaaa&quot;<br>ibmcloud_region     = &quot;xya&quot;<br>ibmcloud_zone       = &quot;abc&quot;<br>service_instance_id = &quot;abc123xyzaaaa&quot;<br>rhel_image_name     = &quot;&lt;rhel_or_centos_image-name&gt;&quot;<br>network_name        = &quot;ocp-net&quot;<br>public_key_file             = &quot;data/id_rsa.pub&quot;<br>private_key_file            = &quot;data/id_rsa&quot;<br>rhel_subscription_username  = &quot;user@test.com&quot;<br>rhel_subscription_password  = &quot;mypassword&quot;</pre><p>2. Configure and install using terraform:</p><pre># terraform init<br># terraform plan --var-file=var.tfvars<br># terraform apply -var-file=var.tfvars</pre><p><strong>3.</strong> Once the deployment is completed, fetch the keys from Bastion Node:</p><pre># cat /root/tang-keys/allnodes.txt</pre><p>From the terraform automation and the allnodes.txt file you have the thumbprints and URLs for the Tang Infrastructure; you can proceed with the <a href="https://github.com/ocp-power-automation/ocp4-upi-powervs">ocp4-powervs-upi</a> project.</p><p><strong>Setting up an OpenShift Cluster on IBM PowerVS</strong></p><p>With the thumbprint and IPs of the tang servers, you are ready to setup an OpenShift cluster using <a href="https://github.com/ocp-power-automation/ocp4-upi-powervs">ocp4-powervs-upi</a> with LUKS encryption and encrypted disks.</p><ol><li>Clone the repository</li></ol><pre># git clone https://github.com/ocp-power-automation/ocp4-upi-powervs.git<br># cd ocp4-upi-powervs</pre><p>2. Update below parameters related to LUKS. e.g., for parameters which needs to update in var.tfvars file.</p><pre>luks_compliant      = true <br>luks_config         = [ { thumbprint = &quot;*****&quot;, url = &quot;*.*.*.*:7500&quot; }, { thumbprint = &quot;*****&quot;, url = &quot;*.*.*.*:7500&quot;}, thumbprint = &quot;*****&quot;, url = &quot;*.*.*.*:7500&quot;} ]</pre><p>And below are the parameters if you want to use as user defined then you can update it otherwise you can keep them as commented so that it can use default values.</p><pre>luks_filesystem_device      = &quot;&quot;  <br>luks_format                 = &quot;&quot; <br>luks_wipe_filesystem         = &quot;&quot; <br>luks_device                 = &quot;&quot;  <br>luks_label                  = &quot;&quot;  <br>luks_options                = []  <br>luks_wipe_volume             = &quot;&quot;<br>luks_name                   = &quot;&quot;</pre><p>Note: If you want to enable FIPS encryption in same OCP deployment you can update below parameter in var.tfvar file and also if you want to know more about FIPS encryption you can follow <a href="https://medium.com/@gauravpbankar/fips-enabling-in-ocp-openshift-cluster-platform-cluster-4-11-on-power-78910b69cf96">this</a> blogpost.</p><p>Once you update all the required parameters you can start the deployment using below steps:</p><p><strong>3.</strong> Run the following commands from within the directory.</p><pre># terraform init<br># terraform plan<br># terraform apply -var-file var.tfvars -parallelism=3</pre><p>Now wait for the installation to complete. It may take around 60 to 90 mins to complete provisioning.</p><p>On successful install cluster details are printed.</p><pre>bastion_private_ip = *.*.*.*<br>bastion_public_ip = *.*.*.*<br>bastion_ssh_command = ssh -i data/id_rsa root@bastion_public_ip<br>bootstrap_ip = *.*.*.*<br>cluster_authentication_details = Cluster authentication details are available in *.*.*.* under ~/openstack-upi/auth<br>cluster_id = test-cluster-9a4f<br>etc_hosts_entries =<br>*.*.*.* api.test-cluster-9a4f.mydomain.com console-openshift-console.apps.test-cluster-9a4f.mydomain.com integrated-oauth-server-openshift-authentication.apps.test-cluster-9a4f.mydomain.com oauth-openshift.apps.test-cluster-9a4f.mydomain.com prometheus-k8s-openshift-monitoring.apps.test-cluster-9a4f.mydomain.com grafana-openshift-monitoring.apps.test-cluster-9a4f.mydomain.com example.apps.test-cluster-9a4f.mydomain.com<br><br>install_status = COMPLETED<br>master_ips = [<br>  &quot;*.*.*.*&quot;,<br>  &quot;*.*.*.*&quot;,<br>]<br>oc_server_url = https://test-cluster-9a4f.mydomain.com:6443<br>storageclass_name = nfs-storage-provisioner<br>web_console_url = https://console-openshift-console.apps.test-cluster-9a4f.mydomain.com<br>worker_ips = [<br>  &quot;*.*.*.*&quot;,<br>  &quot;*.*.*.*&quot;,</pre><p><strong>Confirm the Disk Encryption</strong></p><p>After successful deployment, you can verify LUKS using these steps:</p><p>I.List the master nodes or worker nodes</p><pre># oc get nodes -lnode-role.kubernetes.io/master <br>NAME          STATUS   ROLES    AGE   VERSION <br>tor01-master-0 Ready    master   17h   v1.24.6+5157800 <br>tor01-master-1 Ready    master   17h   v1.24.6+5157800 <br>tor01-master-2 Ready    master   17h   v1.24.6+5157800</pre><p>II<strong>.</strong> Login to debug shell of master node:</p><pre># oc debug node/tor01-master-0</pre><p>III. To use host binaries, run `chroot /host`:</p><pre># chroot /host</pre><p>IV. Review the status of the root mapping on the node:</p><pre># cryptsetup status root<br>/dev/mapper/root is active and is in use.<br>  type:    LUKS2<br>  cipher:  aes-cbc-essiv:sha256<br>  keysize: 256 bits<br>  key location: keyring<br>  device:  /dev/sdg4<br>  sector size:  512<br>  offset:  32768 sectors<br>  size:    250826719 sectors<br>  mode:    read/write</pre><p>V. List the Clevis plug-ins that are bound to the encrypted device:</p><pre># clevis luks list -d  /dev/sdg4<br>1: sss &#39;{&quot;t&quot;:1,&quot;pins&quot;:{&quot;tang&quot;:[{&quot;url&quot;:&quot;http://*.*.*.*:7500&quot;}]}}&#39;</pre><p>Note, you can verify the settings for all masters and worker nodes</p><p>This post you’ve learned the encryption concepts for the OpenShift Container Platform, setting up an external tang cluster and setting up a cluster with encrypted disks, confirming the encrypted disk setup.</p><p>If you want to read more, you can read <a href="https://docs.openshift.com/container-platform/4.11/installing/install_config/installing-customizing.html#installation-special-config-storage_installing-customizing">OpenShift 4.11: Encrypting and mirroring disks during installation</a>.</p><p>Thanks for reading! I hope you found this helpful :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d336af4d9af6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Encrypting etcd data on Power]]></title>
            <link>https://medium.com/@gauravpbankar/encrypting-etcd-data-on-power-1e034598fcb0?source=rss-210b55b5cfa5------2</link>
            <guid isPermaLink="false">https://medium.com/p/1e034598fcb0</guid>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[ppc64le]]></category>
            <category><![CDATA[ibm]]></category>
            <category><![CDATA[openshift]]></category>
            <category><![CDATA[etcd]]></category>
            <dc:creator><![CDATA[Gaurav Bankar]]></dc:creator>
            <pubDate>Tue, 29 Nov 2022 11:21:28 GMT</pubDate>
            <atom:updated>2022-11-29T11:21:28.077Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi Folks, I am introducing a topic related to OpenShift Container Platform (OCP) security on Power.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/629/1*dLNOe3LcYexFpaMv_SOt2A.png" /></figure><p>You might be aware that I am working on blogpost series for security tasks for OCP on Power and this is also one of the interesting topics related to security.</p><p>Let’s deep dive into the topic…!!!</p><p><strong>Why encrypt etcd data on Power?</strong></p><p>By default, etcd data is not encrypted in the OpenShift Container Platform. You can enable etcd encryption for your cluster to provide an additional layer of data security. For example, it can help protect against the loss of sensitive data if an etcd backup is exposed to the incorrect parties.</p><p>When you enable etcd encryption, encryption keys are created and the following OpenShift and Kubernetes resources are encrypted:</p><p>· Secrets</p><p>· Config maps</p><p>· Routes</p><p>· OAuth access tokens</p><p>· OAuth authorize tokens</p><p>To further protect etcd, the encryption keys are rotated on a weekly basis. You must have these keys to restore from an etcd backup.</p><h3><strong>Step A: Encrypting etcd data</strong></h3><ol><li><strong>Modify the APIServer object:</strong></li></ol><pre>oc edit apiserver</pre><p><strong>2. Set the encryption field type to <em>aescbc</em>:</strong></p><pre>spec:<br>  encryption:<br>    type: aescbc</pre><p>The asecbctype means that AES-CBC with PKCS#7 padding and a 32 byte key are used to perform the encryption.</p><p><strong>3. Save the file to apply the changes.</strong></p><p>The encryption process starts. It can take 20 minutes or longer for this process to complete, depending on your cluster size.</p><p><strong>4. Verify that the etcd encryption was successful.</strong></p><p>a. Review the Encrypted status condition for the OpenShift API server to verify that its resources were successfully decrypted:</p><pre>oc get openshiftapiserver -o=jsonpath=&#39;{range .items[0].status.conditions[?(@.type==&quot;Encrypted&quot;)]}{.reason}{&quot;\n&quot;}{.message}{&quot;\n&quot;}&#39;</pre><p>The output shows EncryptionCompleted upon successful encryption:</p><pre>EncryptionCompleted<br>All resources encrypted: routes.route.openshift.io</pre><p>b. Review the Encrypted status condition for the Kubernetes API server to verify that its resources were successfully encrypted:</p><pre>oc get kubeapiserver -o=jsonpath=&#39;{range .items[0].status.conditions[?(@.type==&quot;Encrypted&quot;)]}{.reason}{&quot;\n&quot;}{.message}{&quot;\n&quot;}&#39;</pre><p>The output shows EncryptionCompleted upon successful encryption:</p><pre>EncryptionCompleted<br>All resources encrypted: secrets, configmaps</pre><p>c. Review the Encrypted status condition for the OpenShift OAuth API server to verify that its resources were successfully encrypted:</p><pre>oc get authentication.operator.openshift.io -o=jsonpath=&#39;{range .items[0].status.conditions[?(@.type==&quot;Encrypted&quot;)]}{.reason}{&quot;\n&quot;}{.message}{&quot;\n&quot;}&#39;</pre><p>The output shows EncryptionCompleted upon successful encryption:</p><pre>EncryptionCompleted<br>All resources encrypted: oauthaccesstokens.oauth.openshift.io, oauthauthorizetokens.oauth.openshift.io</pre><p><strong>Note: If the output shows EncryptionInProgress, encryption is still in progress. Wait for a few minutes and try again.</strong></p><h3><strong>Step B: Disabling etcd encryption:</strong></h3><ol><li><strong>Modify the APIServer object:</strong></li></ol><pre>oc edit apiserver</pre><p><strong>2. Set the encryption field type to identity:</strong></p><pre>spec:<br>  encryption:<br>    type: identity</pre><p>The identity type is the default value and means that no encryption is performed.</p><p><strong>3. Save the file to apply the changes.</strong></p><p>The decryption process starts. It can take 20 minutes or longer for this process to complete, depending on the size of your cluster.</p><p><strong>4. Verify that etcd decryption was successful.</strong></p><p>a. Review the Encrypted status condition for the OpenShift API server to verify that its resources were successfully decrypted:</p><pre>oc get openshiftapiserver -o=jsonpath=&#39;{range .items[0].status.conditions[?(@.type==&quot;Encrypted&quot;)]}{.reason}{&quot;\n&quot;}{.message}{&quot;\n&quot;}</pre><p>The output shows DecryptionCompleted upon successful decryption:</p><pre>DecryptionCompleted<br>Encryption mode set to identity and everything is decrypted</pre><p>b.Review the Encrypted status condition for the Kubernetes API server to verify that its resources were successfully decrypted:</p><pre>oc get kubeapiserver -o=jsonpath=&#39;{range .items[0].status.conditions[?(@.type==&quot;Encrypted&quot;)]}{.reason}{&quot;\n&quot;}{.message}{&quot;\n&quot;}&#39;</pre><p>The output shows DecryptionCompleted upon successful decryption:</p><pre>DecryptionCompleted<br>Encryption mode set to identity and everything is decrypted</pre><p>c. Review the Encrypted status condition for the OpenShift OAuth API server to verify that its resources were successfully decrypted:</p><pre>oc get authentication.operator.openshift.io -o=jsonpath=&#39;{range .items[0].status.conditions[?(@.type==&quot;Encrypted&quot;)]}{.reason}{&quot;\n&quot;}{.message}{&quot;\n&quot;}&#39;</pre><p>The output shows DecryptionCompleted upon successful decryption:</p><pre>DecryptionCompleted<br>Encryption mode set to identity and everything is decrypted</pre><h3><strong>Step C: </strong>Force encryption key rotation for etcd datastore</h3><p>This step is for verification of how key rotation will work for etcd datastore.</p><p><strong>1: Enable encryption. (Encryption is already enabled.</strong></p><p>To check secret before patching, below are the secrets.</p><pre># oc get secret -n openshift-config-managed | grep enc<br>encryption-config-openshift-apiserver         Opaque                                1      20h<br>encryption-config-openshift-kube-apiserver    Opaque                                1      20h<br>encryption-config-openshift-oauth-apiserver   Opaque                                1      22h<br>encryption-key-openshift-apiserver-1          Opaque                                1      22h<br>encryption-key-openshift-apiserver-3          Opaque                                1      20h<br>encryption-key-openshift-apiserver-4          Opaque                                1      20h<br>encryption-key-openshift-apiserver-5          Opaque                                1      5h23m<br>encryption-key-openshift-kube-apiserver-1     Opaque                                1      22h<br>encryption-key-openshift-kube-apiserver-3     Opaque                                1      20h<br>encryption-key-openshift-kube-apiserver-4     Opaque                                1      5h23m<br>encryption-key-openshift-oauth-apiserver-1    Opaque                                1      22h</pre><pre># oc get po -n openshift-apiserver -l apiserver --show-labels</pre><pre>NAME                         READY   STATUS    RESTARTS   AGE     LABELS</pre><pre>apiserver-7fb8886978-j94hj   2/2     Running   0          5h14m   apiserver=true,app=openshift-apiserver-a,openshift-apiserver-anti-affinity=true,pod-template-hash=7fb8886978,revision=13</pre><pre>apiserver-7fb8886978-kj7mv   2/2     Running   0          5h12m   apiserver=true,app=openshift-apiserver-a,openshift-apiserver-anti-affinity=true,pod-template-hash=7fb8886978,revision=13</pre><pre>apiserver-7fb8886978-rv9x2   2/2     Running   0          5h14m   apiserver=true,app=openshift-apiserver-a,openshift-apiserver-anti-affinity=true,pod-template-hash=7fb8886978,revision=13</pre><p><strong>2: Before patching we can create secret file</strong></p><p>Check existing and newly created resources are ALL encrypted in etcd. <br>Get openshift etcd pods select one pod and log in it:</p><pre># ETCD_POD=$(oc get po -n openshift-etcd -l app=etcd | grep ^etcd- | head -1 | awk &#39;{print $1}&#39;)</pre><p>Command for login into the pod:</p><pre>oc rsh -n openshift-etcd $ETCD_POD<br>Defaulted container &quot;etcdctl&quot; out of: etcdctl, etcd, etcd-metrics, etcd-health-monitor, etcd-readyz, setup (init), etcd-ensure-env-vars (init), etcd-resources-copy (init)</pre><p>Steps to generate secret file with keys:</p><pre>sh-4.4# NUMBER=4<br>sh-4.4# for i in /kubernetes.io/secrets /kubernetes.io/configmaps /openshift.io/routes /openshift.io/oauth/accesstokens<br> do<br>   FILE=/tmp/&quot;${i##*/}&quot;-values-$NUMBER.txt<br>   etcdctl get $i --prefix -w fields &gt; &quot;$FILE-with-key&quot;<br>   etcdctl get $i --prefix -w fields | grep -e &#39;&quot;Value&quot;&#39; &gt; $FILE<br>   echo &quot;${i##*/} items: `cat $FILE | wc -l` prefix: `grep k8s:enc:aescbc:v1:$NUMBER $FILE | wc -l`&quot;<br> done</pre><p>These resource values should <strong>all</strong> have the k8s:enc:aescbc:v1:<strong>$NUMBER</strong> prefix:<br> Get below output, <strong>item number == prefix number</strong>, means <strong>all</strong> resources are</p><pre>encrypted:<br>secrets items: 988 prefix: 988<br>configmaps items: 314 prefix: 314<br>routes items: 9 prefix: 9<br>accesstokens items: 2 prefix: 2</pre><pre>secrets items: 917 prefix: 917<br>configmaps items: 549 prefix: 549<br>routes items: 8 prefix: 0<br>accesstokens items: 16 prefix: 0</pre><p>Below are the Files which are created for secret by using above scripts.(Before patching )</p><pre>sh-4.4# ls<br>configmaps-values-4.txt           secrets-values-4.txt<br>accesstokens-values-4.txt           configmaps-values-4.txt-with-key  routes-values-4.txt           secrets-values-4.txt-with-key<br>accesstokens-values-4.txt-with-key  routes-values-4.txt-with-key  secrets-values-5.txt</pre><p>Before patching value of key:</p><pre>cat secrets-values-4.txt</pre><pre>key name is: &quot;Key&quot; : &quot;/kubernetes.io/secrets/default/builder-dockercfg-mlf9c&quot;</pre><pre>&quot;Value&quot; : &quot;k8s:enc:aescbc:v1:4:\x83\xa5\xba\xeev\x1b\xc5gO\x15▒~T\r#▒~I\x9e\x16a\x05\xf1\xddP\x97\xfaW:ice\xbe0E\xd4\u007f|\x92\xf4N\xfe\xd4d\x1a*\xe</pre><p><strong>3: Force key rotation</strong></p><p>To rotate key forcefully we can use below steps:</p><ul><li>Force key rotation by adding below:</li></ul><pre># oc patch openshiftapiserver cluster --type merge -p &quot;<br> spec:<br>   unsupportedConfigOverrides:<br>     encryption:<br>       reason: force OAS rotation `date`<br> &quot;<br>openshiftapiserver.operator.openshift.io/cluster patched</pre><pre># oc patch kubeapiserver cluster --type merge -p &quot;<br> spec:<br>   unsupportedConfigOverrides:<br>     encryption:<br>       reason: force KAS rotation `date`<br> &quot;<br>kubeapiserver.operator.openshift.io/cluster patched</pre><ul><li>Verification of secret after patching:</li></ul><pre>oc get secret encryption-key-openshift-kube-apiserver-5 encryption-key-openshift-apiserver-5 -n openshift-config-managed -o yaml | grep migrated</pre><pre>     encryption.apiserver.operator.openshift.io/migrated-resources: &#39;{&quot;resources&quot;:[{&quot;Group&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;configmaps&quot;},{&quot;Group&quot;:&quot;&quot;,&quot;Resource&quot;:&quot;secrets&quot;}]}&#39;<br>      encryption.apiserver.operator.openshift.io/migrated-timestamp: &quot;2022-09-21T14:08:16Z&quot;<br>      encryption.apiserver.operator.openshift.io/migrated-resources: &#39;{&quot;resources&quot;:[{&quot;Group&quot;:&quot;route.openshift.io&quot;,&quot;Resource&quot;:&quot;routes&quot;}]}&#39;<br>      encryption.apiserver.operator.openshift.io/migrated-timestamp: &quot;2022-09-21T08:10:02Z&quot;</pre><ul><li>Command to verify new secret after patching:</li></ul><pre>oc get secret -n openshift-config-managed | grep enc<br>encryption-config-openshift-apiserver         Opaque                                1      22h<br>encryption-config-openshift-kube-apiserver    Opaque                                1      22h<br>encryption-config-openshift-oauth-apiserver   Opaque                                1      24h<br>encryption-key-openshift-apiserver-1          Opaque                                1      24h<br>encryption-key-openshift-apiserver-3          Opaque                                1      22h<br>encryption-key-openshift-apiserver-4          Opaque                                1      22h<br>encryption-key-openshift-apiserver-5          Opaque                                1      7h9m<br>encryption-key-openshift-apiserver-6          Opaque                                1      82m<br>encryption-key-openshift-kube-apiserver-1     Opaque                                1      24h<br>encryption-key-openshift-kube-apiserver-3     Opaque                                1      22h<br>encryption-key-openshift-kube-apiserver-4     Opaque                                1      7h8m<br>encryption-key-openshift-kube-apiserver-5     Opaque                                1      82m<br>encryption-key-openshift-oauth-apiserver-1    Opaque                                1      24h</pre><p><strong>Step 4: To verify value of key after Force key rotation</strong></p><p>Check existing and newly created resources are ALL encrypted in etcd.</p><ul><li>Get openshift etcd pods select one pod and log in it:</li></ul><pre># ETCD_POD=$(oc get po -n openshift-etcd -l app=etcd | grep ^etcd- | head -1 | awk &#39;{print $1}&#39;)</pre><ul><li>Command for login into the pod:</li></ul><pre>oc rsh -n openshift-etcd $ETCD_POD</pre><pre>Defaulted container &quot;etcdctl&quot; out of: etcdctl, etcd, etcd-metrics, etcd-health-monitor, etcd-readyz, setup (init), etcd-ensure-env-vars (init), etcd-res                               ources-copy (init)</pre><pre>sh-4.4# NUMBER=5</pre><ul><li>To generate secret file with keys:</li></ul><pre>sh-4.4# for i in /kubernetes.io/secrets /kubernetes.io/configmaps /openshift.io/routes /openshift.io/oauth/accesstokens<br> do<br>   FILE=/tmp/&quot;${i##*/}&quot;-values-$NUMBER.txt<br>   etcdctl get $i --prefix -w fields &gt; &quot;$FILE-with-key&quot;<br>   etcdctl get $i --prefix -w fields | grep -e &#39;&quot;Value&quot;&#39; &gt; $FILE<br>   echo &quot;${i##*/} items: `cat $FILE | wc -l` prefix: `grep k8s:enc:aescbc:v1:$NUMBER $FILE | wc -l`&quot;<br> done</pre><p>These resource values should <strong>all</strong> have the k8s:enc:aescbc:v1:<strong>$NUMBER</strong> prefix:<br> Get below output, <strong>item number == prefix number</strong>, means <strong>all</strong> resources are encrypted:</p><pre>secrets items: 988 prefix: 988<br>configmaps items: 314 prefix: 314<br>routes items: 9 prefix: 9<br>accesstokens items: 2 prefix: 2</pre><pre>secrets items: 917 prefix: 917<br>configmaps items: 549 prefix: 549<br>routes items: 8 prefix: 0<br>accesstokens items: 16 prefix: 0<br>sh-4.4# cd /tmp</pre><p>Below are the Files which are created for secret by using above scripts. (Before patching i.e. prefix with 4 and after patching prefix with 5 )</p><pre>sh-4.4# ls</pre><pre>configmaps-values-4.txt              secrets-values-4.txt       accesstokens-values-4.txt           configmaps-values-4.txt-with-key  routes-values-4.txt           secrets-values-4.txt-with-key</pre><pre>accesstokens-values-4.txt-with-key  configmaps-values-5.txt           routes-values-4.txt-with-key  secrets-values-5.txt</pre><pre>accesstokens-values-5.txt           configmaps-values-5.txt-with-key  routes-values-5.txt           secrets-values-5.txt-with-key</pre><pre>accesstokens-values-5.txt-with-key  ks-script-3y_ml57e                routes-values-5.txt-with-key</pre><ul><li>Values of keys after patching:</li></ul><p>Here we have compared values of secret file of secrets-values-4.txt and secrets-values-5.txt</p><pre>key name is:<br>&quot;Key&quot; : &quot;/kubernetes.io/secrets/default/builder-dockercfg-mlf9c&quot;</pre><pre>&quot;Value&quot; : &quot;k8s:enc:aescbc:v1:5:\xa4E\xd7oA▒~N\x9e+\xe4\x83\n\x83\xb5_\xe5\xcd\x10\x9a\x06\x82T\xa2\xfc\x14\xa5\x17\xb5\x05\xd9o\x83b&lt;H\xe8\xc6\xcb&lt;▒~D\&quot;</pre><p>So, if we see version as 5 in this file and values are different in both the files which is expected.</p><p>As you can see we have covered important points related to Encrypting etcd data, we can conclude this blogpost for now.</p><p>Thanks for reading! I hope you found this tutorial helpful :)</p><p><strong>References</strong></p><p>OpenShift reference document Encrypting etcd data on Power:</p><p><a href="https://docs.openshift.com/container-platform/4.11/security/encrypting-etcd.html">https://docs.openshift.com/container-platform/4.11/security/encrypting-etcd.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e034598fcb0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Build Golang and Kubernetes using source code and deploy Kubernetes on ppc64le by using kubeadm]]></title>
            <link>https://medium.com/@gauravpbankar/build-golang-and-kubernetes-using-source-code-and-deploy-kubernetes-on-ppc64le-by-using-kubeadm-f287b27f5b90?source=rss-210b55b5cfa5------2</link>
            <guid isPermaLink="false">https://medium.com/p/f287b27f5b90</guid>
            <dc:creator><![CDATA[Gaurav Bankar]]></dc:creator>
            <pubDate>Fri, 29 Apr 2022 13:17:28 GMT</pubDate>
            <atom:updated>2022-04-29T13:23:43.468Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi Folks, I am introducing topic for building golang and kubernetes using source code and deploy kubernetes using kubeadm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/693/1*jytQh5EKOv1rBgQdpFOyCg.png" /></figure><h3>There are three high-level steps :</h3><h4>Step A: To build golang using source code with recent version.</h4><h4>Step B : To build kubernetes using source code and recent golang which we have build in previous step.</h4><h4>Sterp C: To deploy kubernetes using binary which we have generated in previous step and using kubeadm.</h4><h4>Step A: To build golang using source code with recent version.</h4><p>To build golang using source code we should have installed golang using package, so old version can be used to build recent version of golang using source code.</p><p>Install golang using packages.</p><pre>wget <a href="https://go.dev/dl/go1.17.9.linux-ppc64le.tar.gz">https://go.dev/dl/go1.17.9.linux-ppc64le.tar.gz</a></pre><p>Set path for golang.</p><pre>tar -C /usr/local -xzf go1.17.9.linux-ppc64le.tar.gz<br>export PATH=$PATH:/usr/local/go/bin<br>go version<br>go version go1.17.9 linux/ppc64le</pre><h4>Build golang using source code:</h4><p>Clone the code from official go repo:</p><pre>git clone <a href="https://github.com/golang/go">https://github.com/golang/go</a></pre><p>Build golang with recent version:</p><pre> cd src/<br>./make.bash</pre><p>Set path for golang which we have build.</p><pre>rm -rf /usr/local/go<br>cp -r /root/go /usr/local/<br>go version<br>go version devel go1.19-24b570354c Wed Apr 27 00:11:22 2022 +0000 linux/ppc64le</pre><h4>Step B : To build kubernetes using source code and recent golang which we have build in previous step.</h4><p>Build Kubernestes using source code:</p><pre> git clone <a href="https://github.com/kubernetes/kubernetes">https://github.com/kubernetes/kubernetes</a> -b release-1.23</pre><pre> cd kubernetes/</pre><pre> make</pre><p>Verify binaries are present in below path:</p><pre> cd _output/bin/</pre><pre> ls</pre><p>Copy this binary under /usr/local/bin path.</p><h4>Sterp 3: To deploy kubernetes using binary which we have generated in previous step and using kubeadm.</h4><p>Run below command:</p><pre>yum install -y gcc make git socat</pre><pre>sudo yum -y update &amp;&amp; sudo systemctl reboot</pre><p>Disable SELinux and Swap</p><pre>sudo setenforce 0<br>sudo sed -i &#39;s/^SELINUX=.*/SELINUX=permissive/g&#39; /etc/selinux/config</pre><pre>sudo sed -i &#39;/ swap / s/^\(.*\)$/#\1/g&#39; /etc/fstab<br>sudo swapoff -a</pre><pre>sudo modprobe overlay<br>sudo modprobe br_netfilter<br>sudo tee /etc/sysctl.d/kubernetes.conf&lt;&lt;EOF<br>net.bridge.bridge-nf-call-ip6tables = 1<br>net.bridge.bridge-nf-call-iptables = 1<br>net.ipv4.ip_forward = 1<br>EOF<br><br>sudo sysctl --system</pre><p>Install Container runtime — Containerd</p><pre>sudo tee /etc/modules-load.d/containerd.conf &lt;&lt;EOF<br>overlay<br>br_netfilter<br>EOF</pre><p>Install required packages</p><pre>sudo yum install -y yum-utils device-mapper-persistent-data lvm2</pre><p>Add Docker repo</p><pre>sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo</pre><p>Install containerd</p><pre>sudo yum install -y containerd.io</pre><p>Configure containerd and start service</p><pre>sudo mkdir -p /etc/containerd<br>sudo containerd config default &gt; /etc/containerd/config.toml</pre><p>restart containerd</p><pre>sudo systemctl restart containerd<br>sudo systemctl enable containerd</pre><p>Using the systemd cgroup driver To use the systemd cgroup driver in /etc/containerd/config.toml with runc, set</p><pre>[plugins.&quot;io.containerd.grpc.v1.cri&quot;.containerd.runtimes.runc]<br>  ...<br>  [plugins.&quot;io.containerd.grpc.v1.cri&quot;.containerd.runtimes.runc.options]<br>    SystemdCgroup = true</pre><p>If you apply this change make sure to restart containerd again:</p><pre>sudo systemctl restart containerd</pre><p><strong>Configure Firewall</strong></p><p>Master Server ports:</p><pre>sudo firewall-cmd --add-port={6443,2379-2380,10250,10251,10252,5473,179,5473}/tcp --permanent<br>sudo firewall-cmd --add-port={4789,8285,8472}/udp --permanent<br>sudo firewall-cmd --reload</pre><h4>Initialize your control-plane node</h4><p>Login to the server to be used as master and make sure that the br_netfilter module is loaded:</p><pre>$ lsmod | grep br_netfilter<br>br_netfilter           22256  0 <br>bridge                151336  2 br_netfilter,ebtable_broute</pre><p>Before enabling kubelet service we need to update some configuration related to kubelet:</p><p>Write systemd kubelet.service file to /etc/systemd/system</p><pre>[Unit]<br>Description=kubelet: The Kubernetes Node Agent<br>Documentation=https://kubernetes.io/docs/home/<br>Wants=network-online.target<br>After=network-online.target<br><br>[Service]<br>ExecStart=/usr/local/bin/kubelet<br>Restart=always<br>StartLimitInterval=0<br>RestartSec=10<br><br>[Install]<br>WantedBy=multi-user.target</pre><p>Write kubelet config named 10-kubeadm.conf file to /etc/systemd/system/kubelet.service.d</p><pre># Note: This dropin only works with kubeadm and kubelet v1.11+<br>[Service]<br>Environment=&quot;KUBELET_KUBECONFIG_ARGS=--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf&quot;<br>Environment=&quot;KUBELET_CONFIG_ARGS=--config=/var/lib/kubelet/config.yaml&quot;<br># This is a file that &quot;kubeadm init&quot; and &quot;kubeadm join&quot; generates at runtime, populating the KUBELET_KUBEADM_ARGS variable dynamically<br>EnvironmentFile=-/var/lib/kubelet/kubeadm-flags.env<br># This is a file that the user can use for overrides of the kubelet args as a last resort. Preferably, the user should use<br># the .NodeRegistration.KubeletExtraArgs object in the configuration files instead. KUBELET_EXTRA_ARGS should be sourced from this file.<br>EnvironmentFile=-/etc/default/kubelet<br>Environment=&quot;KUBELET_AUTHZ_ARGS=--authorization-mode=Webhook --client-ca-file=/etc/kubernetes/pki/ca.crt&quot;<br>Environment=&quot;KUBELET_CGROUP_ARGS=--cgroup-driver=systemd&quot;<br>ExecStart=<br>ExecStart=/usr/local/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS</pre><p>Enable kubelet service.</p><pre>sudo systemctl enable kubelet</pre><p>Install conntrack</p><pre>yum install -y conntrack</pre><p>Install crictl</p><pre>VERSION=&quot;v1.23.0&quot;<br>wget <a href="https://github.com/kubernetes-sigs/cri-tools/releases/download/$VERSION/crictl-$VERSION-linux-ppc64le.tar.gz">https://github.com/kubernetes-sigs/cri-tools/releases/download/$VERSION/crictl-$VERSION-linux-ppc64le.tar.gz</a></pre><pre>sudo tar zxvf crictl-$VERSION-linux-ppc64le.tar.gz -C /usr/local/bin<br>crictl</pre><pre>which crictl</pre><pre>echo 1 &gt; /proc/sys/net/ipv4/ip_forward</pre><p>Initialize kubeadm</p><pre>cd /usr/local/bin/<br>./kubeadm init</pre><p>Once deployment is doen you will get below message.</p><pre>Your Kubernetes control-plane has initialized successfully!</pre><pre>To start using your cluster, you need to run the following as a regular user:</pre><pre>mkdir -p $HOME/.kube<br>  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config<br>  sudo chown $(id -u):$(id -g) $HOME/.kube/config</pre><pre>Alternatively, if you are the root user, you can run:</pre><pre>export KUBECONFIG=/etc/kubernetes/admin.conf</pre><pre>You should now deploy a pod network to the cluster.<br>Run &quot;kubectl apply -f [podnetwork].yaml&quot; with one of the options listed at:<br>  <a href="https://kubernetes.io/docs/concepts/cluster-administration/addons/">https://kubernetes.io/docs/concepts/cluster-administration/addons/</a></pre><pre>Then you can join any number of worker nodes by running the following on each as root:</pre><pre>kubeadm join 9.30.94.112:6443 --token 0udlvw.ir8jz9xm0nheujox \<br>        --discovery-token-ca-cert-hash sha256:a8b8306125a0587bb525facea3248fab30442c74525590d31cee426b9a69a465</pre><p>Configure kubectl</p><pre>mkdir -p $HOME/.kube<br>sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config<br>sudo chown $(id -u):$(id -g) $HOME/.kube/config</pre><h4><strong>Install network plugin (Calico)</strong></h4><ul><li>kubectl apply -f <a href="https://docs.projectcalico.org/manifests/calico.yaml">https://docs.projectcalico.org/manifests/calico.yaml</a></li><li>Confirm that all the pods are running kubectl get pods --all-namespaces</li><li>Confirm master node is ready kubectl get nodes -o wide</li></ul><p>verify pods and nodes</p><pre>kubectl get nodes -o wide</pre><pre>NAME                     STATUS   ROLES                  AGE    VERSION                         INTERNAL-IP    EXTERNAL-IP   OS-IMAGE          KERNEL-VERSION           CONTAINER-RUNTIME<br>jingoism1.fyre.ibm.com   Ready    control-plane,master   7m7s   v1.23.7-rc.0.4+d962aaf35c60ca   10.11.42.106   &lt;none&gt;        CentOS Stream 8   4.18.0-383.el8.ppc64le   containerd://1.5.11<br></pre><pre>kubectl get pods --all-namespaces</pre><pre>NAMESPACE     NAME                                             READY   STATUS    RESTARTS   AGE<br>kube-system   calico-kube-controllers-7c845d499-mvj6d          1/1     Running   0          5m17s<br>kube-system   calico-node-x2qw4                                1/1     Running   0          5m17s<br>kube-system   coredns-64897985d-qk9vb                          1/1     Running   0          6m52s<br>kube-system   coredns-64897985d-qvhgh                          1/1     Running   0          6m52s<br>kube-system   etcd-jingoism1.fyre.ibm.com                      1/1     Running   0          6m50s<br>kube-system   kube-apiserver-jingoism1.fyre.ibm.com            1/1     Running   0          6m50s<br>kube-system   kube-controller-manager-jingoism1.fyre.ibm.com   1/1     Running   0          6m57s<br>kube-system   kube-proxy-blw78                                 1/1     Running   0          6m53s<br>kube-system   kube-scheduler-jingoism1.fyre.ibm.com            1/1     Running   0          6m58s</pre><p>As we are doing deployment using kubeadm some of the pods used images from outside, but in this condition we should use images which are generated from our binary for that i am sharing one of the example so that you can follow for all.</p><p>Dockerfile Example:</p><pre>FROM busybox<br>ADD ./kube-proxy /usr/local/bin/kube-proxy</pre><p>Build this images</p><pre>docker build -f Dockerfile_prx -t my-kube-proxy:1.0 .</pre><pre>docker images<br>REPOSITORY                                         TAG       IMAGE ID       CREATED          SIZE<br><strong>my-kube-proxy </strong>                                     1.0       fae60ed0438b   20 seconds ago   47MB</pre><p>Edit the pod with the updated images.</p><p>Verify updated images are present in the pod</p><pre>kubectl describe pod kube-proxy-lpxp9 -n kube-system</pre><pre>Name: kube-proxy-lpxp9<br>Namespace: kube-system<br>Priority: 2000001000<br>Priority Class Name: system-node-critical<br>Node: crypto1.fyre.ibm.com/10.11.115.193<br>Start Time: Mon, 25 Apr 2022 05:07:47 -0700<br>Labels: controller-revision-hash=549f7469d9<br>k8s-app=kube-proxy<br>pod-template-generation=1<br>Annotations: &lt;none&gt;<br>Status: Running<br>IP: 10.11.115.193<br>IPs:<br>IP: 10.11.115.193<br>Controlled By: DaemonSet/kube-proxy<br>Containers:<br>kube-proxy:<br>Container ID: docker://25d4c1352e66896e85eafcd42d73bc6e28bc697570ef732189efe48a4fb69b3d<br>Image: <strong>my-kube-proxy:1.0</strong></pre><p>Thanks for reading ! I hope you found this tutorial helpful :)</p><p>reference links :</p><p><a href="https://go.dev/doc/install/source">https://go.dev/doc/install/source</a></p><p><a href="https://github.com/kubernetes/kubernetes">https://github.com/kubernetes/kubernetes</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f287b27f5b90" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FIPS enabling in OCP(Openshift Cluster Platform) Cluster 4.11 on Power]]></title>
            <link>https://medium.com/@gauravpbankar/fips-enabling-in-ocp-openshift-cluster-platform-cluster-4-11-on-power-78910b69cf96?source=rss-210b55b5cfa5------2</link>
            <guid isPermaLink="false">https://medium.com/p/78910b69cf96</guid>
            <dc:creator><![CDATA[Gaurav Bankar]]></dc:creator>
            <pubDate>Thu, 21 Apr 2022 06:06:08 GMT</pubDate>
            <atom:updated>2022-04-21T06:06:08.446Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi Folks, I am introducing topic which is related to security of Openshift Cluster Platform 4.11</p><p>I’m guessing you’re here as a security/technical expert who wants to have their openshift cluster FIPS certified.</p><p>For this article, I’ll focus on the FIPS enabling in OCP 4.11 cluster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f9M5-yj56jMyL34mR7JUVg.png" /></figure><h3><strong>What is FIPS 140–2 ?</strong></h3><p>The 140 series of Federal Information Processing Standards (FIPS) are U.S. government computer security standards that specify requirements for cryptography modules.</p><h3><strong>Purpose of FIPS 140 ?</strong></h3><p>The National Institute of Standards and Technology (NIST) issues the 140 Publication Series to coordinate the requirements and standards for cryptographic modules which include both hardware and software components for use by departments and agencies of the United States federal government. FIPS 140 does not purport to provide sufficient conditions to guarantee that a module conforming to its requirements is secure, still less that a system built using such modules is secure. The requirements cover not only the cryptographic modules themselves but also their documentation and (at the highest security level) some aspects of the comments contained in the source code.</p><p>User agencies desiring to implement cryptographic modules should confirm that the module they are using is covered by an existing validation certificate. FIPS 140–1 and FIPS 140–2 validation certificates specify the exact module name, hardware, software, firmware, and/or applet version numbers. For Levels 2 and higher, the operating platform upon which the validation is applicable is also listed. Vendors do not always maintain their baseline validations.</p><h3>Support for FIPS cryptography in OCP cluster 4.11:</h3><p>We can install an OpenShift Container Platform cluster that uses FIPS Validated / Modules in Process cryptographic libraries on the ppc64le i.e. Power architecture.</p><p>For the Red Hat Enterprise Linux CoreOS (RHCOS) machines in your cluster, this change is applied when the machines are deployed based on the status of an option in the install-config.yaml file, which governs the cluster options that a user can change during cluster deployment. With Red Hat Enterprise Linux (RHEL) machines, you must enable FIPS mode when you install the operating system on the machines that you plan to use as worker machines. These configuration methods ensure that your cluster meet the requirements of a FIPS compliance audit: only FIPS Validated / Modules in Process cryptography packages are enabled before the initial system boot.</p><p>To install a cluster in FIPS mode, follow the instructions to install a customized cluster on your preferred infrastructure. Ensure that you set<strong><em> fips: true</em></strong> in the install-config.yaml file before you deploy your cluster.</p><h3>Enabling FIPS for OpenShift Cluster Platform 4.11 using PowerVS UI automation code.</h3><p>To enable FIPS mode in OpenShift cluster 4.11 we are using PowerVS automation code for ppc64le architecture.</p><p>Click <a href="https://github.com/ocp-power-automation/ocp4-upi-powervs">here</a> for accessing git repository of PowerVS automation code.</p><p>Steps for Enabling FIPS in OCP Cluster on Power using terraform automation script ocp4-upi-powervs.</p><h4>Step 1: Clone the ocp4-upi-powervs repository for the deployment of OCP cluster on Power.</h4><pre>git clone https://github.com/ocp-power-automation/ocp4-upi-powervs.git</pre><h4>Step 2 : For Enabling FIPS on OCP cluster update the fips_compliant variable to true in var.tfvar file under this below path :</h4><pre>ocp4-upi-powervs/var.tfvars</pre><h4>screenshot for the reference FIle name and Parameter:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*ixW_tjq4W0jDZs9ISdVFgQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uIJUT4lQqJz7WyDf6OJ6eQ.png" /></figure><p><strong>Note: Once fips_compliant set to true it will enable FIPS on the OCP cluster and also on bastion nodes. At the end of install the bastion nodes will be rebooted.</strong></p><h4>Step 3: Once you updated FIPS variable Please click <a href="https://github.com/ocp-power-automation/ocp4-upi-powervs/blob/master/docs/quickstart.md">here</a> for the installation of OCP cluster steps.</h4><p>Once the deployment is successfully done we can verify it by using some test cases:</p><h4>Command to check whether FIPS in enabled in cluster:</h4><pre>oc get cm cluster-config-v1 -n kube-system -o json | jq -r ‘.data’ | grep -i “fips”</pre><h4>The result is highlighted in Bold “true”</h4><pre>[root@new-test-ocp-e007-syd04-bastion-0 ~]# oc get cm cluster-config-v1 -n kube-system -o json | jq -r ‘.data’ | grep -i “fips”<br> “install-config”: “apiVersion: v1\nbaseDomain: 130.198.103.67.nip.io\ncompute:\n- architecture: ppc64le\n hyperthreading: Enabled\n name: worker\n platform: {}\n replicas: 0\ncontrolPlane:\n architecture: ppc64le\n hyperthreading: Enabled\n name: master\n platform: {}\n replicas: 3<strong>\</strong>n<strong>fips: true</strong>\nmetadata:\n creationTimestamp: null\n name: new-test-ocp-e007\nnetworking:\n clusterNetwork:\n — cidr: 10.128.0.0/14\n hostPrefix: 23\n machineNetwork:\n — cidr: 10.0.0.0/16\n networkType: OpenShiftSDN\n serviceNetwork:\n — 172.30.0.0/16\nplatform:\n none: {}\nproxy:\n httpProxy: http://new-test-ocp-e007-syd04-bastion-0:3128\n httpsProxy: http://new-test-ocp-e007-syd04-bastion-0:3128\n noProxy: .new-test-ocp-e007.130.198.103.67.nip.io,192.168.0.0/24\npublish: External\npullSecret: \”\”\nsshKey: ‘ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDapU96JVZzPZz2cVqjP2sPVfxbzLt5IefF4o7uQ1IVjTYDLWvXQjdJeK8T6ninsArk/N7xD1kGD/aFsBXh2jBmm4ABr5ydbAnskE2QDMZphMLL+TdpxS7Ssm4Z4GVrpQWEVCWwfG/GSIkCDTZMazxml+WETykcrUzqbS1yw+PALgZqanNJt0ydeD6NWFWfHLsgH69/lO1oPIsW06AQeWJ2aRwqcicog14VJPZjlxrSCQedbI4NonW+VePTrYj4lNOH3RhbYyL8r1/e2/PDQTLd0G5RMg6yvXIEwXrVufxHMChg15FdQlSUYfH/I65Rj1HsKZJ1F4If1tYCMGpG8qmLtKQUkJpsY/WYLWqiphZEENPfKkOvyvxxP8Ock5RR2PhcOfMMYKGX5gfnsKCp0hLg0VRIb6lV+6EBU1LeK/bdr9uMRA0JC817nr9Z2z4b1vZ9ijAUF9k3tIbe6OV+zrdyiW8wyy6wx8a8q7yAzIiz0u0bFVd+0NrPgK9gVecTWeE=\n root@stocked1.fyre.ibm.com ‘\n”</pre><h4>Testing for master node:</h4><pre>[root@new-test-ocp-e007-syd04-bastion-0 ~]# <strong>oc debug syd04-master-0.new-test-ocp-e007.130.198.103.67.nip.io</strong><br>Error from server (NotFound): pods “syd04-master-0.new-test-ocp-e007.130.198.103.67.nip.io” not found<br>[root@new-test-ocp-e007-syd04-bastion-0 ~]# oc debug node/syd04-master-0.new-test-ocp-e007.130.198.103.67.nip.io<br>Starting pod/syd04-master-0new-test-ocp-e00713019810367nipio-debug …<br>To use host binaries, run `chroot /host`<br>Pod IP: 192.168.0.99<br>If you don’t see a command prompt, try pressing enter.<br>sh-4.4# chroot /host<br>sh-4.4# fips-mode-setup — check<br><strong>FIPS mode is enabled.</strong><br>sh-4.4# update-crypto-policies — show<br>FIPS<br>sh-4.4# cat /etc/system-fips<br># FIPS module installation complete<br>sh-4.4# cat /etc/system-fips<br># FIPS module installation complete<br>sh-4.4# cat /proc/sys/crypto/fips_enabled<br>1<br>sh-4.4# sysctl crypto.fips_enabled<br>crypto.fips_enabled = 1<br>sh-4.4#</pre><h4>Testing for Worker node:</h4><pre>[root@new-test-ocp-e007-syd04-bastion-0 ~]# <strong>oc debug node/syd04-worker-0.new-test-ocp-e007.130.198.103.67.nip.io</strong><br>Starting pod/syd04-worker-0new-test-ocp-e00713019810367nipio-debug …<br>To use host binaries, run `chroot /host`<br>Pod IP: 192.168.0.73<br>If you don’t see a command prompt, try pressing enter.<br>sh-4.4# chroot /host<br>sh-4.4# fips-mode-setup — check<br><strong>FIPS mode is enabled.</strong><br>sh-4.4# update-crypto-policies — show<br>FIPS<br>sh-4.4# cat /etc/system-fips<br># FIPS module installation complete<br>sh-4.4# cat /proc/sys/crypto/fips_enabled<br>1<br>sh-4.4# sysctl crypto.fips_enabled<br>crypto.fips_enabled = 1<br>sh-4.4#</pre><h4>Testing for Bastion Node:</h4><pre>[root@new-test-ocp-e007-syd04-bastion-0 ~]# <strong>fips-mode-setup — check<br>FIPS mode is enabled.</strong><br>[root@new-test-ocp-e007-syd04-bastion-0 ~]# update-crypto-policies — show<br>FIPS<br>[root@new-test-ocp-e007-syd04-bastion-0 ~]# cat /etc/system-fips<br># FIPS module installation complete<br>[root@new-test-ocp-e007-syd04-bastion-0 ~]# sysctl crypto.fips_enabled<br>crypto.fips_enabled = 1<br>[root@new-test-ocp-e007-syd04-bastion-0 ~]#</pre><p>Thanks for reading! I hope you found this tutorial helpful :)</p><p>reference links :</p><p><a href="https://en.wikipedia.org/wiki/FIPS_140-2">https://en.wikipedia.org/wiki/FIPS_140-2</a></p><p><a href="https://docs.openshift.com/container-platform/4.10/installing/installing-fips.html">https://docs.openshift.com/container-platform/4.10/installing/installing-fips.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78910b69cf96" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>