<?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: Re writing ACL with Log keyword in Network Security</title>
    <link>https://community.cisco.com/t5/network-security/re-writing-acl-with-log-keyword/m-p/4167919#M1074848</link>
    <description>&lt;P&gt;Hi Balaji,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am very new to automation, could you please suggest to me any document or example article.&lt;/P&gt;</description>
    <pubDate>Fri, 16 Oct 2020 03:48:19 GMT</pubDate>
    <dc:creator>CSCO12053961</dc:creator>
    <dc:date>2020-10-16T03:48:19Z</dc:date>
    <item>
      <title>Re writing ACL with Log keyword</title>
      <link>https://community.cisco.com/t5/network-security/re-writing-acl-with-log-keyword/m-p/4165612#M1074662</link>
      <description>&lt;DIV class="o9v6fnle cxmmr5t8 oygrvhab hcukyx3x c1et5uql ii04i59q"&gt;&lt;DIV&gt;Hi Team,&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="o9v6fnle cxmmr5t8 oygrvhab hcukyx3x c1et5uql ii04i59q"&gt;&lt;DIV&gt;I am looking for some convenient option to add a log statement to the existing access-list on multi-context ASA running 9.14(1), the ACL count is more than 1000.&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="o9v6fnle cxmmr5t8 oygrvhab hcukyx3x c1et5uql ii04i59q"&gt;&lt;DIV&gt;I figured out 2 options :&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="o9v6fnle cxmmr5t8 oygrvhab hcukyx3x c1et5uql ii04i59q"&gt;&lt;DIV&gt;1. Using ASDM, which has the limitation of one ACL at a time.&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="o9v6fnle cxmmr5t8 oygrvhab hcukyx3x c1et5uql ii04i59q"&gt;&lt;DIV&gt;2. Re-adding all ACL via CLI, any other options may save some effort.&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 13 Oct 2020 05:25:16 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/re-writing-acl-with-log-keyword/m-p/4165612#M1074662</guid>
      <dc:creator>CSCO12053961</dc:creator>
      <dc:date>2020-10-13T05:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: Re writing ACL with Log keyword</title>
      <link>https://community.cisco.com/t5/network-security/re-writing-acl-with-log-keyword/m-p/4165661#M1074663</link>
      <description>&lt;P&gt;The second option is reasonable. if you can do some automation that will do the job. do this task offline and publish online to device using script.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 07:07:16 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/re-writing-acl-with-log-keyword/m-p/4165661#M1074663</guid>
      <dc:creator>balaji.bandi</dc:creator>
      <dc:date>2020-10-13T07:07:16Z</dc:date>
    </item>
    <item>
      <title>Re: Re writing ACL with Log keyword</title>
      <link>https://community.cisco.com/t5/network-security/re-writing-acl-with-log-keyword/m-p/4165700#M1074665</link>
      <description>Hi, you might have a problem with cpu if this acl is matched at high rate&lt;BR /&gt;(hence the restriction on asdm). If you want to match specific line, create&lt;BR /&gt;an acl matching your specific 5-tuples with log option. This is safe&lt;BR /&gt;approach.  Your approach seems very risky to add for acl with more than&lt;BR /&gt;1000 lines. Most likely will create a performance problem.&lt;BR /&gt;&lt;BR /&gt;***** please remember to rate useful posts&lt;BR /&gt;&lt;BR /&gt;***** please remember to rate useful posts&lt;BR /&gt;</description>
      <pubDate>Tue, 13 Oct 2020 08:00:42 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/re-writing-acl-with-log-keyword/m-p/4165700#M1074665</guid>
      <dc:creator>Mohammed al Baqari</dc:creator>
      <dc:date>2020-10-13T08:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: Re writing ACL with Log keyword</title>
      <link>https://community.cisco.com/t5/network-security/re-writing-acl-with-log-keyword/m-p/4167919#M1074848</link>
      <description>&lt;P&gt;Hi Balaji,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am very new to automation, could you please suggest to me any document or example article.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 03:48:19 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/re-writing-acl-with-log-keyword/m-p/4167919#M1074848</guid>
      <dc:creator>CSCO12053961</dc:creator>
      <dc:date>2020-10-16T03:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Re writing ACL with Log keyword</title>
      <link>https://community.cisco.com/t5/network-security/re-writing-acl-with-log-keyword/m-p/4167923#M1074849</link>
      <description>&lt;P&gt;Hi Baqari,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is your advice is to create a new ACL to only math the specific traffic, rather than logging all?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For CPU we have 64 core CPU firepower appliance in place and the current load is about 5% max, logging all ACL is a requirement for firewall rule analysis tool (AlgoSec), So I have to log all ACL, so unused or less used can be revealed or caught.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 03:56:18 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/re-writing-acl-with-log-keyword/m-p/4167923#M1074849</guid>
      <dc:creator>CSCO12053961</dc:creator>
      <dc:date>2020-10-16T03:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: Re writing ACL with Log keyword</title>
      <link>https://community.cisco.com/t5/network-security/re-writing-acl-with-log-keyword/m-p/4168060#M1074856</link>
      <description>&lt;P&gt;Although I agree with Mohammed that you should be careful when enabling logging on so many rules, especially on the ASA, you could add the log keyword using a simple python script.&amp;nbsp; First pull the ACL configuration from the ASA and save it in a file.&amp;nbsp; Then run the following script to add the log keyword at the end of each entry.&amp;nbsp; Be sure to change the path to where the files are located to match the actual location you have saved them to:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;#Read the original ACL file and add the entries into a list&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;def read_file():&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; with open('D:\\Python\\Network Programability\\Files\\ASA_ACL.txt', 'r') as file_object:&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; file_info_list = []&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; for line in file_object:&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; file_info_list.append(line.strip())&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; return file_info_list&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;#Loop through the newly created list adding the log keyword at the end of the ACL and write to a new file&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;with open('D:\\Python\\Network Programability\\Files\\ASA_ACL_new.txt', 'w') as write_file:&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; file_object = read_file()&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp; for line in file_object:&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp; &amp;nbsp; write_file.write(f"{line} log\n")&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can obviously script the process of adding the lines back to the ASA.&amp;nbsp; However, I prefer to do that part as a manual job as I can then react to any errors or issues that might pop up while adding them.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 08:00:03 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/re-writing-acl-with-log-keyword/m-p/4168060#M1074856</guid>
      <dc:creator>Marius Gunnerud</dc:creator>
      <dc:date>2020-10-16T08:00:03Z</dc:date>
    </item>
  </channel>
</rss>

