- Products
- Learn
- Local User Groups
- Partners
- More
Check Point Jump-Start Online Training
Now Available on CheckMates for Beginners!
Welcome to Maestro Masters!
Talk to Masters, Engage with Masters, Be a Maestro Master!
ZTNA Buyer’s Guide
Zero Trust essentials for your most valuable assets
The SMB Cyber Master
Boost your knowledge on Quantum Spark SMB gateways!
Check Point's Cyber Park is Now Open
Let the Games Begin!
As YOU DESERVE THE BEST SECURITY
Upgrade to our latest GA Jumbo
CheckFlix!
All Videos In One Space
To test the ability of my code to deal properly with policy packages with empty installation targets, I'm trying to build such a policy package. It's easy in SmartConsole, but I'm not sure how to do it via the API.
[Expert@TestSC:0]# mgmt_cli -s session.txt add package name "Installed_Nowhere" access true installation-targets "none"
code: "generic_err_object_not_found"
message: "Requested object [none] not found"
[Expert@TestSC:0]# mgmt_cli -s session.txt add package name "Installed_Nowhere" access true installation-targets ""
code: "generic_err_object_not_found"
message: "Requested object [] not found"
[Expert@TestSC:0]# mgmt_cli -s session.txt add package name "Installed_Nowhere" access true installation-targets "[]"
[Expert@TestSC:0]# mgmt_cli -f json -s session.txt show package name "Installed_Nowhere" details-level full | jq '."installation-targets"'
"all"
[Expert@TestSC:0]# mgmt_cli -s session.txt discard
number-of-discarded-changes: 1
message: "OK"
[Expert@TestSC:0]# mgmt_cli -s session.txt add package name "Installed_Nowhere" access true
[Expert@TestSC:0]# mgmt_cli -f json -s session.txt show package name "Installed_Nowhere" details-level full | jq '."installation-targets"'
"all"
[Expert@TestSC:0]# mgmt_cli -s session.txt set package name "Installed_Nowhere" installation-targets.remove "all"
code: "generic_err_object_not_found"
message: "Requested object [all] not found"
Meanwhile, on a real box I have with a policy I built in SmartConsole:
[Expert@StandingLab:0]# mgmt_cli -f json -r true show package name "Installed_Nowhere" details-level full | jq '."installation-targets"'
[]
Is there a special value I can pass to 'add package' to get it to build a package with an empty installation targets list?
Separately, I have tried building it with a single installation target, then removing that target. That causes the property to change to "all" rather than to an empty list. That seems very unlikely to be expected behavior.
If None (notice the caps) doesn’t work, maybe @Omer_Kleinstern knows.
I thought I had tried that, but I had not. Sadly, I get the same result:
[Expert@TestSC:0]# mgmt_cli -s session.txt add package name "Installed_Nowhere" access true installation-targets "None"
code: "generic_err_object_not_found"
message: "Requested object [None] not found"
try this out (but be wary when using generic-object, I suspect you can do this with the REST API interface more easily but can't get at it right now in my lab).
mgmt_cli -r true set generic-object uid <UID for your policy package here> installationTargets
"SPECIFIC_GATEWAYS"
The equivalent setting for the default of all gateways is ALL_INTERNAL_GATEWAYS
That worked. Thanks!
Separately, the properties in 'show generic-object' are camelCase, which is incredibly nice. I don't recall seeing anything about this in the API documentation, but it's possible I've been looking in the wrong places. This could make my life significantly easier.
About CheckMates
Learn Check Point
Advanced Learning
YOU DESERVE THE BEST SECURITY