- Products
- Learn
- Local User Groups
- Partners
- More
Quantum Spark Management Unleashed!
Introducing Check Point Quantum Spark 2500:
Smarter Security, Faster Connectivity, and Simpler MSP Management!
Check Point Named Leader
2025 Gartner® Magic Quadrant™ for Hybrid Mesh Firewall
HTTPS Inspection
Help us to understand your needs better
CheckMates Go:
SharePoint CVEs and More!
Hi,
I am trying to display the content of a large "Access Role"...way too big to copy content entry by entry. I started with the following command to see what it might display. What am I doing wrong?
The command I derived from the "Management API Reference 1.6" was this...
Example command in bash:
mgmt_cli show access-role name "Test1234"
The output is this:
Username: user1
Password:
code: "generic_err_object_not_found"
message: "Requested object [Test1234] not found"
I tested the API as well bash command "api status":
####################################################
API Settings:
---------------------
Accessibility: Require all granted
Automatic Start: Enabled
Processes:
Name State PID More Information
-------------------------------------------------
API Started 5591
CPM Started 9996 Check Point Security Management Server is running and ready
FWM Started 7107
APACHE Started 9017
Port Details:
-------------------
JETTY Internal Port: 50277
APACHE Gaia Port: 443
--------------------------------------------
Overall API Status: Started
--------------------------------------------
API readiness test SUCCESSFUL. The server is up and ready to receive connections
Notes:
------------
To collect troubleshooting data, please run 'api status -s <comment>'
####################################################
Regards
Carsten
Hello again,
I finaly managed to reuse my "mgm_cli" session in order to sucessfully run my "Access Role" query and to find the time to report back here. (only used on MDM/DMS (a specific domain))
Thanks to all that helped me figuring out the commands needed.
What I wanted to achieve:
The Background:
What I needed to do (tested on MDM only):
The commands:
psql_client cpm postgres -c"select objid,name from domainbase_data where dlesession=0 and not deleted;"
mgmt_cli login -d 78sd67ff4-2114-4542-821e-e3ed48f7e102 -u <user> -p <password> > /var/log/tmp/sid.txt.$$<user> = you need to replace this with the account name of the user required to authenticate
mgmt_cli -s /var/log/tmp/sid.txt.$$ show access-roles limit 500 offset 0 --format json | $CPDIR/jq/jq -r .objects[].name > /var/log/tmp/ARs.txtThese are 4 separate commands. You need more if your list of Access Roles is longer than 1500!
mgmt_cli -s /var/log/tmp/sid.txt.$$ show access-roles limit 500 offset 500 --format json | $CPDIR/jq/jq -r .objects[].name >> /var/log/tmp/ARs.txt
mgmt_cli -s /var/log/tmp/sid.txt.$$ show access-roles limit 500 offset 1000 --format json | $CPDIR/jq/jq -r .objects[].name >> /var/log/tmp/ARs.txt
mgmt_cli -s /var/log/tmp/sid.txt.$$ show access-roles limit 500 offset 1500 --format json | $CPDIR/jq/jq -r .objects[].name >> /var/log/tmp/ARs.tx
(for i in $(< /var/log/tmp/ARs.txt) ; do echo \# $i\;$(mgmt_cli -s /var/log/tmp/sid.txt.$$ show access-role name "$i" --format json | $CPDIR/jq/jq -r .users[].name | awk '{print $0 "\r"}' | sed 's/ //g') ; done) > /var/log/tmp/AD-groups.txt
The output is a list like the following, I am able to finalize in Excel to my needs (because I am not that good at text editing with linux). Maybe I'll get some help for that and optimize it, so it does not require so much work in Excel as it does now:
# G_SharedServices;ad_group_G_SharedServices # G_Developer_ALL;ad_group_G_T_LI_Developer ad_group_G_T_CD_Developer ad_group_G_T_DSRF_Developer ad_group_G_T_AOUTO_Developer ad_group_G_T_CC_Developer ...snip... ad_group_G_JKSD_Dev_Tst ad_group_G_RCRM_Developer ad_group_G_CDE_BSC_Fortz_Developer ad_group_G_SME_Dev_Tst ad_group_G_POP_DevTest ad_group_G_OCC_CS_Developer # G_MaltedBausda;ad_group_G_MaltedBausda # G_MaltedBausda_QA;ad_group_G_MaltedBausda_QA
This is something I can work with easily enough for now. Feel free to improve the output especially in the 4th command. Or the number of commands needed in 3rd step overcomming the limit of 500 entries being output at once.
I hope this helps other people in dire need 😉
Best regards
Carsten
PS.: Some "invalid HTML has been removed", I checked but could not find the location of the "removal" and also did not see the commands being broken. Let me know if you find an error, so I can fix it.
Just to clarify:
I was looking for an existing AR Object!
I then created a new and simple one "Test1234" with one user (me), which I also did not find using this command.
Meanwhile...I tried something else (looking for a a normal group) with the same result as above:
mgmt_cli show group name "<GroupName>"
Username: user1
Password:
code: "generic_err_object_not_found"
message: "Requested object [<GroupName>] not found"
...and also...
mdsenv <Domainname>
clish
mgmt login
Enter password:
mgmt show group name "<GroupName>"
MGMT9000 code: "generic_err_object_not_found"
message: "Requested object [<GroupName>] not found"
...this works, so I must be doint something right:
mgmt show login-message
type: "login-message"
domain:
uid: "a7dcedsa-afed-4ef8-bf6e-fedfedfedfed"
name: "System Data"
domain-type: "mds"
show-message: false
warning: true
message: "This system is for authorized use only"
header: "Warning"
This is a MDM R80.30, by the way.
Hi PhoneBoy,
thanks for your interest in this.
I issued the commands as shown.
I tried two methods:
- 'mgmt_cli' (being asked for credentials every single time)
- 'clish ; mgmt login ; mgmt show access-role name “<AR_Object_Name>"' (being asked for creds only once)
But as of now I am communicating with Rami Dayan from TAC in a ticket. He just mentioned this parameter as well. So he suggested to try this (results shown as well):
# mdsenv <Domain_Name>
(tried on domain level, which might be useless, but anyway, just in case)
(also tried with "mdsenv" on MDS level)
# mgmt_cli show access-role name “<AR_Object_Name>” -d <Domain_Name>
Username: <user_name>
Password:
code: "generic_error"
message: "Runtime error: Domain '<Domain_Name>' not found!"
I might need to run another debug for him.
Thanks a lot.
Carsten
mgmt_cli is an API client, which means you have to work with it almost exactly as if you were coding against the API.
That means, in general, you:
The traditional "mdsenv" is irrelevant in this context.
You need to do something like the following:
mgmt_cli login domain "mydomain" > sid.txt
mgmt_cli -s sid.txt show access-role name "Access Role"
mgmt_cli -s sid.txt logout
Or, if you're on the MDS itself, you can simplify this a little:
mgmt_cli -r true --domain "mydomain" show access-role name "Access Role"
The "-r true" is somewhat like using the -local flag with dbedit in the sense you don't need to provide credentials and it only works on the management server itself.
However, it should only be used if you're doing 1-2 commands as it simulates the entire API flow (login/action/publish/logout).
If you are doing a lot of commands against the API, it will be much more efficient to create (and reuse) a proper session.
Interesting, this is good to know. Thanks.
Did I somehow overlook your "how to bing with" with examples (incl. MDS) in the documentation? 😳
This is my first time meddling arround with the mgmt_cli, as the GUI does not help in my case. I am interested in showing stuff for now.
- variant 1: "mgmt_cli <what_ever>" (single command)
and
- variant 2: "clish ; mgmt login ; mgmt <what_ever> ; mgmt logout" (multiple commands within one sessions)
...is to leave away "_cli" when connected via the 2nd variant, correct? Or are there additional implications?
Unfortunately I don't see that I am in a "mgmt" session in the cli.
Have to admit, I've never seen variant 2 used before this post.
In this case, the session is being handled by clish.
Which, in the context of clish, makes sense.
You still need to pass a domain as part of the login process, which I assume you'd do by something like:
mgmt login user aa password aaaa domain mydomain
Variant 1 only works for very specific commands (e.g. login) or in conjunction with -r true.
(Note that -r true does not appear to work in clish)
And yes, you could do something like mgmt_cli -r true login to create a reusable session.
However, that does not work in clish, only expert mode.
Regardless, in an MDS context, you have to indicate the domain to ensure your session is associated with the correct domain.
Note that a given session can only be associated with one domain.
If you need to do something on a different domain, that requires creating a new session against that domain.
Session tokens time out after 15 minutes of inactivity.
You can always create a new one and/or take over/kill previous sessions in SmartConsole and via the API.
mgmt_cli login domain "mydomain" > sid.txt
doesn't work, I have to provide credentials, which I don't see being prompted. The output: "Username: " is being written into the sid.txt
Hello again,
I finaly managed to reuse my "mgm_cli" session in order to sucessfully run my "Access Role" query and to find the time to report back here. (only used on MDM/DMS (a specific domain))
Thanks to all that helped me figuring out the commands needed.
What I wanted to achieve:
The Background:
What I needed to do (tested on MDM only):
The commands:
psql_client cpm postgres -c"select objid,name from domainbase_data where dlesession=0 and not deleted;"
mgmt_cli login -d 78sd67ff4-2114-4542-821e-e3ed48f7e102 -u <user> -p <password> > /var/log/tmp/sid.txt.$$<user> = you need to replace this with the account name of the user required to authenticate
mgmt_cli -s /var/log/tmp/sid.txt.$$ show access-roles limit 500 offset 0 --format json | $CPDIR/jq/jq -r .objects[].name > /var/log/tmp/ARs.txtThese are 4 separate commands. You need more if your list of Access Roles is longer than 1500!
mgmt_cli -s /var/log/tmp/sid.txt.$$ show access-roles limit 500 offset 500 --format json | $CPDIR/jq/jq -r .objects[].name >> /var/log/tmp/ARs.txt
mgmt_cli -s /var/log/tmp/sid.txt.$$ show access-roles limit 500 offset 1000 --format json | $CPDIR/jq/jq -r .objects[].name >> /var/log/tmp/ARs.txt
mgmt_cli -s /var/log/tmp/sid.txt.$$ show access-roles limit 500 offset 1500 --format json | $CPDIR/jq/jq -r .objects[].name >> /var/log/tmp/ARs.tx
(for i in $(< /var/log/tmp/ARs.txt) ; do echo \# $i\;$(mgmt_cli -s /var/log/tmp/sid.txt.$$ show access-role name "$i" --format json | $CPDIR/jq/jq -r .users[].name | awk '{print $0 "\r"}' | sed 's/ //g') ; done) > /var/log/tmp/AD-groups.txt
The output is a list like the following, I am able to finalize in Excel to my needs (because I am not that good at text editing with linux). Maybe I'll get some help for that and optimize it, so it does not require so much work in Excel as it does now:
# G_SharedServices;ad_group_G_SharedServices # G_Developer_ALL;ad_group_G_T_LI_Developer ad_group_G_T_CD_Developer ad_group_G_T_DSRF_Developer ad_group_G_T_AOUTO_Developer ad_group_G_T_CC_Developer ...snip... ad_group_G_JKSD_Dev_Tst ad_group_G_RCRM_Developer ad_group_G_CDE_BSC_Fortz_Developer ad_group_G_SME_Dev_Tst ad_group_G_POP_DevTest ad_group_G_OCC_CS_Developer # G_MaltedBausda;ad_group_G_MaltedBausda # G_MaltedBausda_QA;ad_group_G_MaltedBausda_QA
This is something I can work with easily enough for now. Feel free to improve the output especially in the 4th command. Or the number of commands needed in 3rd step overcomming the limit of 500 entries being output at once.
I hope this helps other people in dire need 😉
Best regards
Carsten
PS.: Some "invalid HTML has been removed", I checked but could not find the location of the "removal" and also did not see the commands being broken. Let me know if you find an error, so I can fix it.
Leaderboard
Epsum factorial non deposit quid pro quo hic escorol.
User | Count |
---|---|
7 | |
6 | |
3 | |
2 | |
2 | |
2 | |
1 | |
1 |
Wed 03 Sep 2025 @ 11:00 AM (SGT)
Deep Dive APAC: Troubleshooting 101 for Quantum Security GatewaysThu 04 Sep 2025 @ 10:00 AM (CEST)
CheckMates Live BeLux: External Risk Management for DummiesWed 10 Sep 2025 @ 11:00 AM (CEST)
Effortless Web Application & API Security with AI-Powered WAF, an intro to CloudGuard WAFWed 10 Sep 2025 @ 11:00 AM (EDT)
Quantum Spark Management Unleashed: Hands-On TechTalk for MSPs Managing SMB NetworksWed 03 Sep 2025 @ 11:00 AM (SGT)
Deep Dive APAC: Troubleshooting 101 for Quantum Security GatewaysThu 04 Sep 2025 @ 10:00 AM (CEST)
CheckMates Live BeLux: External Risk Management for DummiesWed 10 Sep 2025 @ 11:00 AM (EDT)
Quantum Spark Management Unleashed: Hands-On TechTalk for MSPs Managing SMB NetworksAbout CheckMates
Learn Check Point
Advanced Learning
YOU DESERVE THE BEST SECURITY