<?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: Ansible - Privilege Escalation in Tools</title>
    <link>https://community.cisco.com/t5/tools/ansible-privilege-escalation/m-p/4932225#M3399</link>
    <description>&lt;P&gt;Hi Marcel.&lt;/P&gt;&lt;P&gt;I chose the path of creating Vault file containing the encrypted password:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; vars_files:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- /home/ciscoUser/Ansible/vault_password.yml&lt;/P&gt;&lt;P&gt;&amp;nbsp; vars:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ansible_become_pass: "{{ vault_sudo_password }}"&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ansible_python_interpreter: /usr/bin/python3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 02 Oct 2023 05:01:41 GMT</pubDate>
    <dc:creator>Netmart</dc:creator>
    <dc:date>2023-10-02T05:01:41Z</dc:date>
    <item>
      <title>Ansible - Privilege Escalation</title>
      <link>https://community.cisco.com/t5/tools/ansible-privilege-escalation/m-p/4908549#M3379</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I wanted to add config changes to to Cisco IOS XE.&lt;/P&gt;&lt;P&gt;When on node also enable password is set up, how is Ansible able to access privilege level to add for example a loopback interface.&lt;/P&gt;&lt;P&gt;I found the following.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;vars/ios.yml&lt;FONT size="2"&gt;&lt;A title="Permalink to this heading" href="https://docs.ansible.com/ansible/latest/network/user_guide/platform_ios.html#example-cli-group-vars-ios-yml" target="_blank" rel="noopener"&gt;&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;ansible_connection&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;ansible.netcommon.network_cli&lt;/SPAN&gt;
&lt;SPAN class=""&gt;ansible_network_os&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;cisco.ios.ios&lt;/SPAN&gt;
&lt;SPAN class=""&gt;ansible_user&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;myuser&lt;/SPAN&gt;
&lt;SPAN class=""&gt;ansible_password&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;!vault...&lt;/SPAN&gt;
&lt;SPAN class=""&gt;ansible_become&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;true&lt;/SPAN&gt;
&lt;SPAN class=""&gt;ansible_become_method&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;enable&lt;/SPAN&gt;
&lt;SPAN class=""&gt;ansible_become_password&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;!vault...&lt;/SPAN&gt;
&lt;SPAN class=""&gt;ansible_ssh_common_args&lt;/SPAN&gt;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;'-o&lt;/SPAN&gt; &lt;SPAN class=""&gt;ProxyCommand="ssh&lt;/SPAN&gt; &lt;SPAN class=""&gt;-W&lt;/SPAN&gt; &lt;SPAN class=""&gt;%h:%p&lt;/SPAN&gt; &lt;SPAN class=""&gt;-q&lt;/SPAN&gt; &lt;SPAN class=""&gt;bastion01"&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;However, I am wondering what the best practice is to get into&amp;nbsp;&lt;SPAN&gt;Enable Mode (&lt;/SPAN&gt;&lt;SPAN&gt;(Privilege Escalation).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Netmart&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2023 03:48:56 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/ansible-privilege-escalation/m-p/4908549#M3379</guid>
      <dc:creator>Netmart</dc:creator>
      <dc:date>2023-08-21T03:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible - Privilege Escalation</title>
      <link>https://community.cisco.com/t5/tools/ansible-privilege-escalation/m-p/4908569#M3380</link>
      <description>&lt;P&gt;Hi Netmart&lt;/P&gt;
&lt;P&gt;What you found is how it's done - regarding the enable password (and any other password) - best practice is using a vault encrypted password (like in your example) or get the password from an envioronment variable (in the example the enable password is stored in the variable EN_PASSWORD):&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN class="nt"&gt;ansible_become&lt;/SPAN&gt;&lt;SPAN class="p"&gt;:&lt;/SPAN&gt; &lt;SPAN class="l l-Scalar l-Scalar-Plain"&gt;true&lt;/SPAN&gt;
&lt;SPAN class="nt"&gt;ansible_become_method&lt;/SPAN&gt;&lt;SPAN class="p"&gt;:&lt;/SPAN&gt; &lt;SPAN class="l l-Scalar l-Scalar-Plain"&gt;enable&lt;/SPAN&gt;
&lt;SPAN class="nt"&gt;ansible_become_password: "{{ lookup( ansible.builtin.env , EN_PASSWORD) }}"&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Aug 2023 05:23:16 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/ansible-privilege-escalation/m-p/4908569#M3380</guid>
      <dc:creator>Marcel Zehnder</dc:creator>
      <dc:date>2023-08-21T05:23:16Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible - Privilege Escalation</title>
      <link>https://community.cisco.com/t5/tools/ansible-privilege-escalation/m-p/4932225#M3399</link>
      <description>&lt;P&gt;Hi Marcel.&lt;/P&gt;&lt;P&gt;I chose the path of creating Vault file containing the encrypted password:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; vars_files:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- /home/ciscoUser/Ansible/vault_password.yml&lt;/P&gt;&lt;P&gt;&amp;nbsp; vars:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ansible_become_pass: "{{ vault_sudo_password }}"&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; ansible_python_interpreter: /usr/bin/python3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Oct 2023 05:01:41 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/ansible-privilege-escalation/m-p/4932225#M3399</guid>
      <dc:creator>Netmart</dc:creator>
      <dc:date>2023-10-02T05:01:41Z</dc:date>
    </item>
  </channel>
</rss>

