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

Is there any way to extract ALL service port (eg http tcp 80, https tcp 443) from Smart console

Is there any way to extract ALL service port (eg http tcp 80, https tcp 443) from Smart console or command line ?

Please note that I mean **ALL** and after the extraction, I need to write a python script to convert, say, from http to 80.

0 Kudos
4 Replies
G_W_Albrecht
Legend Legend
Legend

Please explain what you want to achieve - and what you mean with "extract", show used service ports ? "Smart console or command line" looks like you want logs ?

CCSP - CCSE / CCTE / CTPS / CCME / CCSM Elite / SMB Specialist
0 Kudos
martylee
Participant

I am now migrating some check point access rules to Azure NSG.

I export the rules from Smart console GUI (see picture) and the Service port is in the form of Name (http snmp etc), instead of tcp or udp numbers. I need to create a text file from which I can use python to convert, say http, to tcp 80. 

 

0 Kudos
PhoneBoy
Admin
Admin

Instead of taking that approach, use the API to export the relevant Access Policy using the show-access-rulebase endpoint.
There is an option (show-as-ranges true) that will convert the hosts and services to their numerical values.
https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/show-access-rulebase~v1.9%20

0 Kudos
PhoneBoy
Admin
Admin

From SmartConsole itself? Probably not.
It’s definitely possible through the API (meaning also possible from CLI), but it will require multiple calls to obtain all the data.
Two programs that will do this (among other data):

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events