Hi everyone,
It's a pleasure to be part of this community. CheckMates has been an excellent way to learn from other people's real-world experience, so I wanted to give a little back by sharing a small script that solved a recurring need for our team, hopefully it saves someone else the same digging I had to do.
The need was simple to describe but not so simple to solve cleanly: getting a real-time list of users currently connected via Remote Access/Mobile Access VPN, to be consumed by an internal PHP-based dashboard.
Purpose: Authenticate to the Check Point Management API (SMS) and list users currently connected via Remote Access/Mobile Access VPN, by running "fw tab -t userc_users -f -u" on the gateway/cluster via run-script + show-task.
Requirements:
- PHP with cURL extension enabled
- Management API enabled on the SMS
- User restrict permission profile with "Run One Time Script" enabled (Gateways tab) and "Management API Login" enabled (Management tab)
Please feel free to suggest improvements, point out edge cases I might have missed, or adapt it to your own environment.
Looking forward to your feedback!