<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to Automate Onboarding an Openshift cluster to Check Point CloudGuard Native in DevSecOps</title>
    <link>https://community.checkpoint.com/t5/DevSecOps/How-to-Automate-Onboarding-an-Openshift-cluster-to-Check-Point/m-p/116282#M68</link>
    <description>&lt;P&gt;Hi Jayden,&lt;/P&gt;&lt;P&gt;thank you for your work! I currently try to onboard my Lab OpenShift Cluster to Cloudguard. I managed to get the deployment running, but found some caveats.&lt;/P&gt;&lt;P&gt;First, I found a bug in your onboard-1.sh script: At line 9 you define a namespace variable, which is never used later on:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;namespace="checkpoint"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Later in the script you use the name $myns, which was never defined before. For example in line 24:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;oc create namespace $myns&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another issue I found, is located in line 43:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;oc create -f uid1000.json --as system:admin&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You use a lowercase filename, but the filename of the referenced file in the repo is UID1000.json, which won't work on case-sensitive filesystems.&lt;/P&gt;&lt;P&gt;I created a pull-request to address these issues.&lt;/P&gt;&lt;P&gt;Also there is a bug in this file: On line 18 you define the UID as a string, which has to be an integer:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;"runAsUser": {
   "type": "MustRunAs",
   "uid": 1000
},&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also created a PR for that.&lt;/P&gt;&lt;P&gt;Currently I am stuck when creating the cluster via the CG API as I do not get the expected response from the API. When running the request via Postman or via curl, I see the the API sends an&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;HTTP/1.1 401 Invalid username or password&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I doublechecked the API key I created for that at&amp;nbsp;&lt;A href="https://portal.checkpoint.com/dashboard/cloudguard#/v2/settings/credentials" target="_blank" rel="noopener"&gt;https://portal.checkpoint.com/dashboard/cloudguard#/v2/settings/credentials&lt;/A&gt;&amp;nbsp;and I also tried it with a Service Account with the Kubernetes Agent role, but both did not work. I currently have an open SR for that.&lt;/P&gt;&lt;P&gt;Can you confirm, that&amp;nbsp;&lt;A href="https://portal.checkpoint.com/dashboard/cloudguard#/v2/settings/credentials" target="_blank" rel="noopener"&gt;https://portal.checkpoint.com/dashboard/cloudguard#/v2/settings/credentials&lt;/A&gt;&amp;nbsp;is the correct location for creating an API key for onboarding the cluster?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Thomas&lt;/P&gt;</description>
    <pubDate>Mon, 19 Apr 2021 06:46:38 GMT</pubDate>
    <dc:creator>Thomas-Marko</dc:creator>
    <dc:date>2021-04-19T06:46:38Z</dc:date>
    <item>
      <title>How to Automate Onboarding an Openshift cluster to Check Point CloudGuard Native</title>
      <link>https://community.checkpoint.com/t5/DevSecOps/How-to-Automate-Onboarding-an-Openshift-cluster-to-Check-Point/m-p/114195#M64</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(I'll be only maintaining this Original GitHub repo:&amp;nbsp;&lt;A href="https://github.com/jaydenaung/cloudguard-onboard-openshift" target="_blank"&gt;https://github.com/jaydenaung/cloudguard-onboard-openshift)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This tutorial is details how to onboard Openshift cluster to CloudGuard native using automation scripts.&lt;/P&gt;
&lt;P&gt;(Manual onboarding guide is&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/jaydenaung/cloudguard-OpenShift" target="_blank"&gt;here&lt;/A&gt;. The original repo is forked from&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/chkp-dhouari/cloudguard-OpenShift" target="_blank"&gt;Dean Houari's Repo&lt;/A&gt;.&lt;/P&gt;
&lt;H2&gt;&lt;A id="user-content-prerequisites" class="anchor" href="https://github.com/jaydenaung/cloudguard-onboard-openshift#prerequisites" aria-hidden="true" target="_blank"&gt;&lt;/A&gt;Prerequisites&lt;/H2&gt;
&lt;UL&gt;
&lt;LI&gt;Register for a CloudGuard native account.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://secure.dome9.com/v2/register/invite" rel="nofollow" target="_blank"&gt;https://secure.dome9.com/v2/register/invite&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Generate CloudGuard API key and secret here&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://secure.dome9.com/v2/settings/credentials" rel="nofollow" target="_blank"&gt;https://secure.dome9.com/v2/settings/credentials&lt;/A&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;H3&gt;&lt;A id="user-content-run-the-following-command" class="anchor" href="https://github.com/jaydenaung/cloudguard-onboard-openshift#run-the-following-command" aria-hidden="true" target="_blank"&gt;&lt;/A&gt;Run the following command:&lt;/H3&gt;
&lt;PRE&gt;&lt;CODE&gt;git clone https://github.com/jaydenaung/cloudguard-onboard-openshift
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;H2&gt;&lt;A id="user-content-using-automation-scripts-to-automate-the-onboarding-process" class="anchor" href="https://github.com/jaydenaung/cloudguard-onboard-openshift#using-automation-scripts-to-automate-the-onboarding-process" aria-hidden="true" target="_blank"&gt;&lt;/A&gt;Using automation scripts to automate the onboarding process&lt;/H2&gt;
&lt;H3&gt;&lt;A id="user-content-bash-shell" class="anchor" href="https://github.com/jaydenaung/cloudguard-onboard-openshift#bash-shell" aria-hidden="true" target="_blank"&gt;&lt;/A&gt;Bash Shell&lt;/H3&gt;
&lt;OL&gt;
&lt;LI&gt;Make sure that&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/jaydenaung/cloudguard-onboard-openshift/blob/main/uid1000.json" target="_blank"&gt;uid1000.json&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/jaydenaung/cloudguard-onboard-openshift/blob/main/cp-cloudguard-openshift.yaml" target="_blank"&gt;cp-cloudguard-openshift.yaml&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;are in the same directory as&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/jaydenaung/cloudguard-onboard-openshift/blob/main/onboard-1.sh" target="_blank"&gt;onboard-1.sh&lt;/A&gt;.&lt;/LI&gt;
&lt;LI&gt;Edit variables and run&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/jaydenaung/cloudguard-onboard-openshift/blob/main/onboard-1.sh" target="_blank"&gt;onboard-1.sh&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to onboard the cluster.&lt;/LI&gt;
&lt;/OL&gt;
&lt;PRE lang="chmod"&gt;&lt;CODE&gt;    ./onboard-1.sh
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Alternatively, you can follow the instructions below and execute command lines manually.&lt;/P&gt;
&lt;H3&gt;&lt;A id="user-content-python-script-work-in-progress" class="anchor" href="https://github.com/jaydenaung/cloudguard-onboard-openshift#python-script-work-in-progress" aria-hidden="true" target="_blank"&gt;&lt;/A&gt;Python Script (Work in Progress))&lt;/H3&gt;
&lt;P&gt;You can use the python script&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://github.com/jaydenaung/cloudguard-onboard-openshift/blob/main/onboard_oc_1.py" target="_blank"&gt;onboard_oc_1.py&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to onboard or remove an OpenShift cluster to and from CloudGuard.&lt;/P&gt;
&lt;DIV class="highlight highlight-source-shell"&gt;
&lt;PRE&gt;&lt;SPAN class="pl-c"&gt;# Install requirements&lt;/SPAN&gt;
pip3 install -r requirements.txt
&lt;SPAN class="pl-c"&gt;# Execute script&lt;/SPAN&gt;
python3 onboard_oc_1.py onboard
&lt;/PRE&gt;
&lt;/DIV&gt;
&lt;P&gt;For cluster onboarding you will need to provide:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Your Cluster Name (e.g. my_cluster)&lt;/LI&gt;
&lt;LI&gt;Namespace (e.g. checkpoint)&lt;/LI&gt;
&lt;LI&gt;CloudGuard API Key (you can export environment variable CHKP_CLOUDGUARD_ID and script will detect it)&lt;/LI&gt;
&lt;LI&gt;CloudGUard API Secret (you can export environment variable CHKP_CLOUDGUARD_SECRET and script will detect it)&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;For cluster removal you will need to provide:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;The path to the yaml file that was generated during onboarding. The script will try to find a yaml file in the current directory.&lt;/LI&gt;
&lt;LI&gt;CloudGuard API Key (Alternatively, can export environment variable CHKP_CLOUDGUARD_ID and the script will detect it)&lt;/LI&gt;
&lt;LI&gt;CloudGUard API Secret (you can also export environment. variable CHKP_CLOUDGUARD_SECRET and the script will detect it.)&lt;/LI&gt;
&lt;/OL&gt;
&lt;HR /&gt;
&lt;H2&gt;&lt;A id="user-content-verififcation" class="anchor" href="https://github.com/jaydenaung/cloudguard-onboard-openshift#verififcation" aria-hidden="true" target="_blank"&gt;&lt;/A&gt;Verififcation&lt;/H2&gt;
&lt;P&gt;Log onto CloudGuard native and wait for the initial sync process to be completed.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Mar 2021 06:32:03 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/DevSecOps/How-to-Automate-Onboarding-an-Openshift-cluster-to-Check-Point/m-p/114195#M64</guid>
      <dc:creator>JaydenAung</dc:creator>
      <dc:date>2021-03-22T06:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to Automate Onboarding an Openshift cluster to Check Point CloudGuard Native</title>
      <link>https://community.checkpoint.com/t5/DevSecOps/How-to-Automate-Onboarding-an-Openshift-cluster-to-Check-Point/m-p/116282#M68</link>
      <description>&lt;P&gt;Hi Jayden,&lt;/P&gt;&lt;P&gt;thank you for your work! I currently try to onboard my Lab OpenShift Cluster to Cloudguard. I managed to get the deployment running, but found some caveats.&lt;/P&gt;&lt;P&gt;First, I found a bug in your onboard-1.sh script: At line 9 you define a namespace variable, which is never used later on:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;namespace="checkpoint"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Later in the script you use the name $myns, which was never defined before. For example in line 24:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;oc create namespace $myns&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another issue I found, is located in line 43:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;oc create -f uid1000.json --as system:admin&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You use a lowercase filename, but the filename of the referenced file in the repo is UID1000.json, which won't work on case-sensitive filesystems.&lt;/P&gt;&lt;P&gt;I created a pull-request to address these issues.&lt;/P&gt;&lt;P&gt;Also there is a bug in this file: On line 18 you define the UID as a string, which has to be an integer:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;"runAsUser": {
   "type": "MustRunAs",
   "uid": 1000
},&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also created a PR for that.&lt;/P&gt;&lt;P&gt;Currently I am stuck when creating the cluster via the CG API as I do not get the expected response from the API. When running the request via Postman or via curl, I see the the API sends an&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;HTTP/1.1 401 Invalid username or password&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I doublechecked the API key I created for that at&amp;nbsp;&lt;A href="https://portal.checkpoint.com/dashboard/cloudguard#/v2/settings/credentials" target="_blank" rel="noopener"&gt;https://portal.checkpoint.com/dashboard/cloudguard#/v2/settings/credentials&lt;/A&gt;&amp;nbsp;and I also tried it with a Service Account with the Kubernetes Agent role, but both did not work. I currently have an open SR for that.&lt;/P&gt;&lt;P&gt;Can you confirm, that&amp;nbsp;&lt;A href="https://portal.checkpoint.com/dashboard/cloudguard#/v2/settings/credentials" target="_blank" rel="noopener"&gt;https://portal.checkpoint.com/dashboard/cloudguard#/v2/settings/credentials&lt;/A&gt;&amp;nbsp;is the correct location for creating an API key for onboarding the cluster?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Thomas&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 06:46:38 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/DevSecOps/How-to-Automate-Onboarding-an-Openshift-cluster-to-Check-Point/m-p/116282#M68</guid>
      <dc:creator>Thomas-Marko</dc:creator>
      <dc:date>2021-04-19T06:46:38Z</dc:date>
    </item>
  </channel>
</rss>

