<?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: Verify Policy Ansible with Checkpoint in DevSecOps</title>
    <link>https://community.checkpoint.com/t5/DevSecOps/Verify-Policy-Ansible-with-Checkpoint/m-p/110361#M33</link>
    <description>&lt;P&gt;Thanks, everyone. Everyone's contribution on here was a solution. It works!!!&lt;/P&gt;</description>
    <pubDate>Tue, 09 Feb 2021 22:23:08 GMT</pubDate>
    <dc:creator>ukohae</dc:creator>
    <dc:date>2021-02-09T22:23:08Z</dc:date>
    <item>
      <title>Verify Policy Ansible with Checkpoint</title>
      <link>https://community.checkpoint.com/t5/DevSecOps/Verify-Policy-Ansible-with-Checkpoint/m-p/110336#M27</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&lt;STRONG&gt;Goal&lt;/STRONG&gt;:&lt;FONT color="#FF0000"&gt; I am trying to&amp;nbsp;&lt;/FONT&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;Verify Access Control Policy using Ansible for a particular domain&amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;I used the documentation&amp;nbsp;&lt;A href="https://docs.ansible.com/ansible/latest/collections/check_point/mgmt/cp_mgmt_verify_policy_module.html#ansible-collections-check-point-mgmt-cp-mgmt-verify-policy-module" target="_blank" rel="noopener"&gt;https://docs.ansible.com/ansible/latest/collections/check_point/mgmt/cp_mgmt_verify_policy_module.html#ansible-collections-check-point-mgmt-cp-mgmt-verify-policy-module&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="p p-Indicator"&gt;-&lt;/SPAN&gt; &lt;SPAN class="nt"&gt;name&lt;/SPAN&gt;&lt;SPAN class="p"&gt;:&lt;/SPAN&gt; &lt;SPAN class="l l-Scalar l-Scalar-Plain"&gt;verify-policy&lt;/SPAN&gt;
  &lt;SPAN class="nt"&gt;cp_mgmt_verify_policy&lt;/SPAN&gt;&lt;SPAN class="p"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="nt"&gt;policy_package&lt;/SPAN&gt;&lt;SPAN class="p"&gt;:&lt;/SPAN&gt; &lt;SPAN class="l l-Scalar l-Scalar-Plain"&gt;standard&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;I set&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="p p-Indicator"&gt;-&lt;/SPAN&gt; &lt;SPAN class="nt"&gt;name&lt;/SPAN&gt;&lt;SPAN class="p"&gt;:&lt;/SPAN&gt; &lt;SPAN class="l l-Scalar l-Scalar-Plain"&gt;verify-policy&lt;/SPAN&gt;
  &lt;SPAN class="nt"&gt;cp_mgmt_verify_policy&lt;/SPAN&gt;&lt;SPAN class="p"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="nt"&gt;policy_package&lt;/SPAN&gt;&lt;SPAN class="p"&gt;:&lt;/SPAN&gt; #the UID or String of the device&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;I got an error message when I ran my playbook&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Playbook.yml&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="p p-Indicator"&gt;---&lt;BR /&gt;&lt;/SPAN&gt;- hosts: check_point&lt;BR /&gt;  connection: httpapi&lt;BR /&gt;  gather_facts: False&lt;BR /&gt;  vars_files:&lt;BR /&gt;    - 'my_var.yaml'&lt;BR /&gt;    - 'login.yml'
  tasks:&lt;BR /&gt;  - name: verify-policy&lt;BR /&gt;    check_point.mgmt.cp_mgmt_verify_policy:&lt;BR /&gt;      policy_package: #device name or UID added here&lt;BR /&gt;    #&lt;SPAN class="nt"&gt;cp_mgmt_verify_policy&lt;/SPAN&gt;&lt;SPAN class="p"&gt;:&lt;/SPAN&gt;
       #&lt;SPAN class="nt"&gt;policy_package&lt;/SPAN&gt;&lt;SPAN class="p"&gt;:&lt;/SPAN&gt; &lt;SPAN class="l l-Scalar l-Scalar-Plain"&gt;standard&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;my_var.yaml&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="p p-Indicator"&gt;ansible_httpapi_validate_certs: False&lt;BR /&gt;&lt;/SPAN&gt;ansible_httpapi_use_ssl: True&lt;BR /&gt;ansible_network_os: check_point.mgmt.checkpoint&lt;BR /&gt;ansible_python_interpreter: /usr/bin/python3&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;login.yml&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;ansible_user: #checkpoint username&lt;BR /&gt;&lt;SPAN class="nt"&gt;ansible_password: #checkpoint password&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;host inventory&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="p p-Indicator"&gt;[check_point]&lt;BR /&gt;#ip address of my checkpoint device&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial black,avant garde" color="#FF0000"&gt;&lt;STRONG&gt;Error Message&lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;$ ansible-playbook Playbook.yml&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="p p-Indicator"&gt;PLAY [check_point] **************************************************************************************&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;TASK [verify-policy]&lt;BR /&gt;fatal: [checkpoint]: FAILED! =&amp;gt; {"changed": false, "msg": "Checkpoint device returned error 404 with message {'code: 'generic_err_object_not_found'} Unpublished chnages were dicharged"}&lt;BR /&gt;&lt;BR /&gt;PLAY RECAP **********************************************************************************************&lt;BR /&gt;checkpoint        :ok=0     changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;I'm I doing anything wrong here, is there anything&amp;nbsp; I should be aware of?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 18:21:02 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/DevSecOps/Verify-Policy-Ansible-with-Checkpoint/m-p/110336#M27</guid>
      <dc:creator>ukohae</dc:creator>
      <dc:date>2021-02-09T18:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: Verify Policy Ansible with Checkpoint</title>
      <link>https://community.checkpoint.com/t5/DevSecOps/Verify-Policy-Ansible-with-Checkpoint/m-p/110344#M28</link>
      <description>&lt;PRE&gt;policy_package: &lt;/PRE&gt;
&lt;P&gt;i guess that it refers to the policy/security package that you are running the verification for.&lt;/P&gt;
&lt;P&gt;dunno if it's case sensitive.&lt;/P&gt;
&lt;P&gt;L.E. just saw that you are doing it for a specific domain in an MDS env. try and add at end&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN class="p p-Indicator"&gt;---&lt;BR /&gt;&lt;/SPAN&gt;- hosts: check_point&lt;BR /&gt;  connection: httpapi&lt;BR /&gt;  gather_facts: False&lt;BR /&gt;  vars_files:&lt;BR /&gt;    - 'my_var.yaml'&lt;BR /&gt;    - 'login.yml'
  tasks:&lt;BR /&gt;  - name: verify-policy&lt;BR /&gt;    check_point.mgmt.cp_mgmt_verify_policy:&lt;BR /&gt;      policy_package: policy-name&lt;BR /&gt;    &lt;BR /&gt;    vars:&lt;BR /&gt;      ansible_checkpoint_domain: "domain"&lt;CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 19:39:19 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/DevSecOps/Verify-Policy-Ansible-with-Checkpoint/m-p/110344#M28</guid>
      <dc:creator>funkylicious</dc:creator>
      <dc:date>2021-02-09T19:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: Verify Policy Ansible with Checkpoint</title>
      <link>https://community.checkpoint.com/t5/DevSecOps/Verify-Policy-Ansible-with-Checkpoint/m-p/110347#M29</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am very confused, it in terms of policy/security package,&amp;nbsp; can you give me an example?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would I say&lt;/P&gt;&lt;PRE&gt;policy_package: Access Control &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Feb 2021 19:52:18 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/DevSecOps/Verify-Policy-Ansible-with-Checkpoint/m-p/110347#M29</guid>
      <dc:creator>ukohae</dc:creator>
      <dc:date>2021-02-09T19:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: Verify Policy Ansible with Checkpoint</title>
      <link>https://community.checkpoint.com/t5/DevSecOps/Verify-Policy-Ansible-with-Checkpoint/m-p/110348#M30</link>
      <description>&lt;P&gt;hi,&lt;/P&gt;
&lt;P&gt;the name of the policy package that you are setting rules in and installing on the gateways.&lt;/P&gt;
&lt;P&gt;you can see it in Security Policies ( default name is Standard ) or from the firewall with fw stat.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="Screenshot 2021-02-09 at 21.55.29.png" style="width: 295px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/10515iAB5E2ED705BFCD1E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2021-02-09 at 21.55.29.png" alt="Screenshot 2021-02-09 at 21.55.29.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;DIV id="tinyMceEditor_42e8fecd7f7383funkylicious_0" class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 09 Feb 2021 19:56:34 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/DevSecOps/Verify-Policy-Ansible-with-Checkpoint/m-p/110348#M30</guid>
      <dc:creator>funkylicious</dc:creator>
      <dc:date>2021-02-09T19:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: Verify Policy Ansible with Checkpoint</title>
      <link>https://community.checkpoint.com/t5/DevSecOps/Verify-Policy-Ansible-with-Checkpoint/m-p/110358#M31</link>
      <description>&lt;P&gt;Technically, access control is an ordered layer and policy package would be the name of the policy that you gave (I dont know, could be standard, or companyname_policy or whatever you named it)&lt;/P&gt;
&lt;P&gt;Andy&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 21:09:10 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/DevSecOps/Verify-Policy-Ansible-with-Checkpoint/m-p/110358#M31</guid>
      <dc:creator>the_rock</dc:creator>
      <dc:date>2021-02-09T21:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Verify Policy Ansible with Checkpoint</title>
      <link>https://community.checkpoint.com/t5/DevSecOps/Verify-Policy-Ansible-with-Checkpoint/m-p/110360#M32</link>
      <description>&lt;P&gt;You said you are executing against the domain, so you are in MDS environment. You have to provide the CMA/Domain/DMS name as in the MDS as well. See the README and search for &lt;EM&gt;&lt;STRONG&gt;ansible_checkpoint_domain&lt;/STRONG&gt;&lt;/EM&gt;:&amp;nbsp;&lt;A href="https://galaxy.ansible.com/check_point/mgmt" target="_blank"&gt;https://galaxy.ansible.com/check_point/mgmt&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In short, you have to give the variable&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;ansible_checkpoint_domain&lt;/STRONG&gt;&lt;/EM&gt; the CMA domain name as in the MDS at either the inventory level, the playbook, or the task level.&lt;/P&gt;
&lt;P&gt;Inventory file for your host:&lt;BR /&gt;&lt;STRONG&gt;mds-cma-name ansible_host=192.168.1.111 ansible_checkpoint_domain=CMA1&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;That should be it.&lt;BR /&gt;Also, when you execute the playbook, add 1 verbosity level (&lt;EM&gt;&lt;STRONG&gt;-v&lt;/STRONG&gt;&lt;/EM&gt;) so that you can see more stdout than just "changed".&lt;BR /&gt;Furthermore, as this is just a verify and no changes are made, consider adding&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;changed_when: false&lt;/STRONG&gt;&lt;/EM&gt;&lt;EM&gt; to the root level of the task.&lt;/EM&gt;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;---
- name: Verify Policy
  hosts: mds-cma1
  connection: httpapi
  tasks:
    - name: verify-policy
      check_point.mgmt.cp_mgmt_verify_policy:
        policy_package: "My_Policy"
      changed_when: false&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 09 Feb 2021 22:12:24 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/DevSecOps/Verify-Policy-Ansible-with-Checkpoint/m-p/110360#M32</guid>
      <dc:creator>Art_Zalenekas</dc:creator>
      <dc:date>2021-02-09T22:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Verify Policy Ansible with Checkpoint</title>
      <link>https://community.checkpoint.com/t5/DevSecOps/Verify-Policy-Ansible-with-Checkpoint/m-p/110361#M33</link>
      <description>&lt;P&gt;Thanks, everyone. Everyone's contribution on here was a solution. It works!!!&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 22:23:08 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/DevSecOps/Verify-Policy-Ansible-with-Checkpoint/m-p/110361#M33</guid>
      <dc:creator>ukohae</dc:creator>
      <dc:date>2021-02-09T22:23:08Z</dc:date>
    </item>
    <item>
      <title>Re: Verify Policy Ansible with Checkpoint</title>
      <link>https://community.checkpoint.com/t5/DevSecOps/Verify-Policy-Ansible-with-Checkpoint/m-p/110366#M34</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;what if I have multiple domains with many policies in them. How do I write my inventories to contain those domains and policies?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 23:40:53 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/DevSecOps/Verify-Policy-Ansible-with-Checkpoint/m-p/110366#M34</guid>
      <dc:creator>ukohae</dc:creator>
      <dc:date>2021-02-09T23:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: Verify Policy Ansible with Checkpoint</title>
      <link>https://community.checkpoint.com/t5/DevSecOps/Verify-Policy-Ansible-with-Checkpoint/m-p/110383#M35</link>
      <description>&lt;P&gt;well, in the ini format you can list the hosts as if they are CMAs with the variable&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;ansible_checkpoint_domain&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;[cmas]
cma1 ansible_host=192.168.1.11 ansible_checkpoint_domain=cma1
cma2 ansible_host=192.168.1.11 ansible_checkpoint_domain=cma2
cma3 ansible_host=192.168.1.11 ansible_checkpoint_domain=cma3&lt;/LI-CODE&gt;
&lt;P&gt;I believe there is a bug in the&amp;nbsp;&lt;EM&gt;login/discard/logout&lt;/EM&gt; process of each&amp;nbsp;&lt;EM&gt;httpapi&lt;/EM&gt; plugin connection instantiation, because if in the playbook we call&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;hosts:&lt;/STRONG&gt;&lt;/EM&gt;&lt;STRONG&gt; cmas&lt;/STRONG&gt; or multi-host execution, we don't relogin but reuse the same session. That is a bug. So for now if you want to loop all hosts in the&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;cmas&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;hosts group, you will have to write a separate playbook and call it for each CMA, or can still have the same playbook with the same hosts-group &lt;EM&gt;&lt;STRONG&gt;cmas&lt;/STRONG&gt;&lt;/EM&gt;, and limit the execution to a host in the group like&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;ansible-playbook &lt;/STRONG&gt;&lt;STRONG&gt;...&lt;/STRONG&gt;&lt;STRONG&gt; --limit=cma2&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Sorry, but this is the workaround for now.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Feb 2021 04:36:30 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/DevSecOps/Verify-Policy-Ansible-with-Checkpoint/m-p/110383#M35</guid>
      <dc:creator>Art_Zalenekas</dc:creator>
      <dc:date>2021-02-10T04:36:30Z</dc:date>
    </item>
  </channel>
</rss>

