- Products
- Learn
- Local User Groups
- Partners
- More
MVP 2026: Submissions
Are Now Open!
What's New in R82.10?
Watch NowOverlap in Security Validation
Help us to understand your needs better
CheckMates Go:
Maestro Madness
Hi there,
Making use of cpapi, I can write some python scripts to add access rules from an excel file into a check point firewall R80.40
This is the youtube link that I demo the process.
https://www.youtube.com/watch?v=8D4XJ3Bwtrk
One of the limitations of the python scripts is that I can only add a single source IP address, a single destination address and a single port for a given row (or a given single rule number).
But in my work environment, a single rule number most likely contains multiple source IP addresses, multiple destination addresses and multiple ports, such as the sample excel that I upload in this post (ADD_RULES_real_world.xlsx).
It would be great if you could shed some light.
(You can see or download my source code from the youtube link as the file .py is not supported here.)
Thank you.
Marty
I'm not able to download the code. From the video, it looks like when you're creating the objects, you set obj_src and obj_dst to be equal to a given name, rather than appending the name to a list. Thus, when you use obj_src and obj_dst later to make the API call to create the rule, they only contain one thing each.
I'm not able to download the code. From the video, it looks like when you're creating the objects, you set obj_src and obj_dst to be equal to a given name, rather than appending the name to a list. Thus, when you use obj_src and obj_dst later to make the API call to create the rule, they only contain one thing each.
Hi Bob,
Thank you for giving me some directions. Will try to work on it about using list.
Already fixed the link on youtube and the source code is zipped here.
Hi Bob, _Val_ and everyone,
Thanks Bob for providing me a direction on using list. It works like a charm. Another questions are:
1. how to add groups (grouping of different subnets), what is the parameters or keyword I should use in the python script ?
2. how to add port range eg: tcp port 1000-200 ? Again I don't know the parameter of keywords.
Zip and share python code here please.
You may download the source code as below link:
Thanks great demo.
just a question, when I run the script a second time, does it create the objects like host ... again ?
Leaderboard
Epsum factorial non deposit quid pro quo hic escorol.
| User | Count |
|---|---|
| 4 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
Tue 16 Dec 2025 @ 05:00 PM (CET)
Under the Hood: CloudGuard Network Security for Oracle Cloud - Config and Autoscaling!Thu 18 Dec 2025 @ 10:00 AM (CET)
Cloud Architect Series - Building a Hybrid Mesh Security Strategy across cloudsTue 16 Dec 2025 @ 05:00 PM (CET)
Under the Hood: CloudGuard Network Security for Oracle Cloud - Config and Autoscaling!Thu 18 Dec 2025 @ 10:00 AM (CET)
Cloud Architect Series - Building a Hybrid Mesh Security Strategy across cloudsAbout CheckMates
Learn Check Point
Advanced Learning
YOU DESERVE THE BEST SECURITY