Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Alex_Sykes
Participant

Bash API script help

Hi CheckMates,

I’m after some API help if you’re able to, please? I want to start using the CP API functionality to speed up the basic day to day firewall work and I’ve been reading the documentation available. However, I’m unsure how to go from the basic commands (see below) to using a bash script.

Typing API commands from the SmartConsole GUI:

add host name myHost ip-address 192.0.2.100

Using the "mgmt_cli" tool:

# mgmt_cli add host name host1 ip-address 192.0.2.100

The above is all very self-explanatory, but how do I go from that to using a script?

I've found these very useful scripts, but where do I start? Where do these need to be located and how do they get run?

https://community.checkpoint.com/docs/DOC-1967
https://community.checkpoint.com/docs/DOC-1965
https://community.checkpoint.com/docs/DOC-1966

I'm clearly a newbie to this so any help would be appreciated.

Many thanks
Alex

 

0 Kudos
3 Replies
Nüüül
Advisor

Hi

 

you can check if you can extract some of the commands there:

https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/Basic-script-for-importing-IP-Add... or github: https://github.com/leinadred/IPaddressFeed2CheckPointAPI

 

Had similar problems at the beginning... 🙂

What exactly do you want to accomplish with your script?

 

Cheers,

 

Daniel

0 Kudos
fllangari
Explorer
Explorer

Hello there

Is it possible, do you have a script to export which groups a user belongs to?

Thanks for your help.

Greetings

0 Kudos
Nüüül
Advisor

Hi,

 

no - would need to write that - but depending on your needs should not be that big problem. Have a look at the check Point API Sdk on gihtub. They did a very good work there... including some examples for a good start

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events