<?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 From Bash script to Web Services API in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/From-Bash-script-to-Web-Services-API/m-p/81152#M4685</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;This question might have been asked and answered in different ways, but I still cannot get what I need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have a script that ssh to a server to run 'fw sam' commands to block IPs.&lt;/P&gt;&lt;P&gt;The scripts looks like this:&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;		&lt;SPAN&gt;spawn ssh -o "StrictHostKeyChecking no" $USERNAME@$FIREWALL
   		expect "*assword: "
		send "$PASSWORD\r"
   		expect $multiPrompt
   		send "mdsenv PROD_FW\r"
   		expect $multiPrompt
   		send "fw sam -t $TIME -e name=\"NOT_IN Block\" -e comment=\"$FLAG\" -J src $ATTACKER\r"
		exit
		exit
		&lt;/SPAN&gt;
	&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;What I would like to know is if it is possible to convert that script to Web Services API calls&lt;BR /&gt;with something like web_api/login, web_api/sam_command, web_api/logout or something similar.&lt;/P&gt;&lt;P&gt;The other answers for /put-file and /run-script dont tell me much if it will work the same as the above code.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Tue, 07 Apr 2020 15:20:00 GMT</pubDate>
    <dc:creator>Jorge_Cardona</dc:creator>
    <dc:date>2020-04-07T15:20:00Z</dc:date>
    <item>
      <title>From Bash script to Web Services API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/From-Bash-script-to-Web-Services-API/m-p/81152#M4685</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;This question might have been asked and answered in different ways, but I still cannot get what I need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have a script that ssh to a server to run 'fw sam' commands to block IPs.&lt;/P&gt;&lt;P&gt;The scripts looks like this:&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;		&lt;SPAN&gt;spawn ssh -o "StrictHostKeyChecking no" $USERNAME@$FIREWALL
   		expect "*assword: "
		send "$PASSWORD\r"
   		expect $multiPrompt
   		send "mdsenv PROD_FW\r"
   		expect $multiPrompt
   		send "fw sam -t $TIME -e name=\"NOT_IN Block\" -e comment=\"$FLAG\" -J src $ATTACKER\r"
		exit
		exit
		&lt;/SPAN&gt;
	&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;What I would like to know is if it is possible to convert that script to Web Services API calls&lt;BR /&gt;with something like web_api/login, web_api/sam_command, web_api/logout or something similar.&lt;/P&gt;&lt;P&gt;The other answers for /put-file and /run-script dont tell me much if it will work the same as the above code.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 15:20:00 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/From-Bash-script-to-Web-Services-API/m-p/81152#M4685</guid>
      <dc:creator>Jorge_Cardona</dc:creator>
      <dc:date>2020-04-07T15:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: From Bash script to Web Services API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/From-Bash-script-to-Web-Services-API/m-p/81154#M4686</link>
      <description>&lt;P&gt;This has been &lt;A href="https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/How-run-fw-sam-command-through-management-web-service-api/td-p/5101" target="_self"&gt;answered before&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Also see &lt;A href="https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/Block-IP-With-SAM-rules/td-p/34236" target="_self"&gt;here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2020 15:43:27 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/From-Bash-script-to-Web-Services-API/m-p/81154#M4686</guid>
      <dc:creator>Danny</dc:creator>
      <dc:date>2020-04-07T15:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: From Bash script to Web Services API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/From-Bash-script-to-Web-Services-API/m-p/81357#M4701</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/687"&gt;@Danny&lt;/a&gt;&amp;nbsp; Thanks for your reply.&lt;/P&gt;&lt;P&gt;One quick question.. What kind of access does a user needs in order to run the commands?&lt;/P&gt;&lt;P&gt;I tried simple 'ls -la /' and I get a permission error.&lt;/P&gt;&lt;P&gt;To run 'fw sam...' what kind of access would be it? Is it a the server level, or at the Smart Console level?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks...&lt;/P&gt;</description>
      <pubDate>Wed, 08 Apr 2020 18:27:12 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/From-Bash-script-to-Web-Services-API/m-p/81357#M4701</guid>
      <dc:creator>Jorge_Cardona</dc:creator>
      <dc:date>2020-04-08T18:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: From Bash script to Web Services API</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/From-Bash-script-to-Web-Services-API/m-p/81400#M4705</link>
      <description>&lt;P&gt;I just ran a test and I got this message&lt;BR /&gt;"message": "To run a script on a Domain Server, you must have an admin role with Multi-Domain provisioning permissions.",&lt;/P&gt;&lt;P&gt;Will post another update once I get that kind of access..&lt;/P&gt;</description>
      <pubDate>Thu, 09 Apr 2020 05:05:06 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/From-Bash-script-to-Web-Services-API/m-p/81400#M4705</guid>
      <dc:creator>Jorge_Cardona</dc:creator>
      <dc:date>2020-04-09T05:05:06Z</dc:date>
    </item>
  </channel>
</rss>

