Check Point Firewalls
Check Point Firewalls
Firewalls
Products & Firewall from https://checkpoint.com
Design
Operation
After policy install: UDP packet that belongs to an old session drops
IPS Troubleshooting
VPN Troubleshooting
Link
Thank you Heiko Ankenbrand for creating such a valuable overview:
https://www.ankenbrand24.de/index.php/articles/check-point-articel/arcitecture/r80-
communication-ports/
Overview
http://www.ankenbrand24.de/wp-content/uploads/2019/03/ports.png
Image not found or type unknown
Download
https://www.ankenbrand24.de/wp-content/uploads/2019/12/Ports_1.5a.pdf
Design
Alerts /var/log/send_alert.*
CPD $CPDIR/log/cpd.elg
Distribution /var/log/dist_mode.log*
FWD $FWDIR/log/fwd.elg
FWK $FWDIR/log/fwk.elg.*
/var/log/auditlog*
Gaia ClishClosed
Image notauditing
found or type unknown
/var/log/ftw_install.log
GaiaClosed
Image notFirst
found or type
Time unknown Wizard
Configuration
General /var/log/messages*
/var/log/image_clone.log.dbg*
SMOClosed
Image notImage
found or type unknown
Cloning
Installation /var/log/start_mbs.log
Installation - OS /var/log/anaconda.log
Policy $FWDIR/log/cpha_policy.log.*
Pull Configuration
VPND $FWDIR/log/vpnd.elg*
Operation
Operation
FW Monitor (https://www.roesen.org/files/fw_monitor.pdf)
point-articel/cheat-sheets/r80-cheat-sheet-fw-monitor/)
articel/cheat-sheets/r80-cheat-sheet-clusterxl/)
CLISH Commands
To start a transaction in CLISH use start transaction.
Commands - commit, or rollback to be used to end the transaction mode. All changes
made using commands in transaction mode are applied at once or none of the changes are
applied based on the way transaction mode is terminated.
Show Commands
save config save the current configuration
show arp static all displays all the static arp entry
show backup status show the status of a backup or restore operation being
performed
show backup logs show the logs of the recent backups/restores performed
show users show configured users and their homedir, uid/gid and shell
show version all shows version related to os edition, kernel version, product
version etc
Set Commands
add allowed-client host any-host / add allowed- add any host to the allowed clients list/ add allowed client
client host <ip address> by ipv4 address
add backup scp ip value path value username value adds backup to scp server
set cluster member admin {down | up} initiating manual cluster failover
set expert-password set or change password for entering into expert mode
set edition default <value> set the default edition to 32-bit or 64-bit
set ntp server primary x.x.x.x version <1/2/3/4> sets primary ntp server
set ntp server secondary x.x.x.x version <1/2/3/4> sets secondary ntp server
set snmp agent on/off sets the snmp agent daemon on/off
set snmp traps receiver <ip address> version v1 specifies trap receiver
community value
set static-route x.x.x.x/xx nexthop gateway address adds specific static route
x.x.x.x on comment static route
set static-route x.x.x.x/xx comment "{comment}"
set web session-timeout <value> sets web configuration session time-out in minutes
set web ssl-port <value> sets the web ssl-port for the system
Generic Commands
The commands below have to be used in expert mode and NOT in clish.
More information:
How to reset SIC
System
Manage the GUI clients that can use MGMT cp_conf client get # Get the GUI
SmartConsoles to connect to the clients list
Security Management Server cp_conf client add <GUI client> #
Add one GUI Client
cp_conf client del < GUI client 1>
< GUI client 2>... # Delete GUI
Clients
cp_conf client createlist < GUI
client 1> < GUI client 2>... #
Create new list.
/sbin/grub-md5-crypt
cprid_util -server
<IP_of_Gateway> -verbose
cprid_util -server
<IP_of_Gateway> -verbose
<Password_Hash_from_Step_ab
hash
cprid_util -server
<IP_of_Gateway> -verbose
'set expert-password-hash
<Password_Hash_from_Step_ab
Logging-and-Reporting/R80-xx-
equivalent-of-CPLogInvestigator-for-
Log-Volume-and/td-p/46792
VPN Commands
The commands below have to be used in expert mode and NOT in clish.
In R80+:
See also: Logging and Monitoring R80.10 (Part of Check Point Infinity)
Action Use on Command
VPN IKE Debugging (P1 and P2 GW vpn debug ikeon (enable IKE debug)
Communication) vpn debug ikeoff (disable IKE
The resulting $FWDIR/log/ike.elg debug)
and/or $FWDIR/log/ikev2.xml can
be used in the "IKEView" Utility from
Check Point, see here: sk30994
VSX specific
The commands below have to be used in expert mode and NOT in clish
Example:
# vsx stat -v -l
VSID: 0
VRID: 0
Name: fwvsx01
10:30:11
Connections number: 66
VSID: 1
VRID: 1
Name: fw01p
11:30:39
View state tables for virtual system VSX vsenv <id>; fw tab -t <table>
<id>.
View traffic for virtual system with ID VSX fw monitor -v <id> -e 'accept;'
<id>.
Attention: with fw monitor use -v
instead of -vs.
View HA state of all configured Virtual VSX cphaprob state
Systems.
View HA state for Virtual System ID VSX cphaprob -vs <id> state
<id>.
The mgmt_cli tool is installed as part of Gaia on all R80 gateways and can be used in scripts
running in expert mode.
The mgmt_cli.exe tool is installed as part of the R80 SmartConsole installation (typically under
C:\Program Files (x86)\CheckPoint\SmartConsole\R80\PROGRAM\) and can be copied to run on any
Windows machine.
On Windows you cannot login with a certificate since the mgmt_cli_login is missing, you need to
login with user/password or use the mgmt_cli tool on the management server.
To use the actual ssh login with mgmt_cli use the undocumented feature
mgmt_cli -r true
Show api-settings
Check if clients are allowed to connect to the api and check all the api-settings.
...
...
API Status
To confirm that the API is usable and available remotely, run the api status command. If
Accessibility shows “Require all granted” it means that any system can access the API (on R80 this
will show “Allow all”).
[Expert@awsmgmt:0]# api status
API Settings:
---------------------
Processes:
-------------------------------------------------
CPM Started 14350 Check Point Security Management Server is running and ready
Port Details:
-------------------
--------------------------------------------
--------------------------------------------
API readiness test SUCCESSFUL. The server is up and ready to receive connections
Notes:
------------
logging in
First create a session into a file and reuse it:
mgmt_cli login user admin > id.txt
mgmt_cli -s id.txt show objects filter "192.168.1.1" ip-only true --format json | jq '.objects[] | {name: .name, subnet:
.subnet4, mask: ."mask-length4"}'
Output:
"Layer1"
"Layer2"
...
mgmt_cli run-script script-name "ifconfig" script "ifconfig" targets.1 "corporate-gateway" -s id.txt --format json
Output:
} ],
"from" : 1,
"to" : 260,
"total" : 260
Links
http://sicuriconnoi.blogspot.com/2017/11/top-checkpoint-cli-commands.html
e/Content/Topics-CLIG/FWG/stattest.htm
Operation
Export/Import Policy
Package
Check Point ExportImportPolicyPackage tool enables you to export a policy package from a
Management database to a .tar.gz file, which can then be imported into any other Management
database. The tool is supported for version R80.10 and above.
This tool can be used for backups, database transfers, testing, and more.
Link: https://github.com/CheckPointSW/ExportImportPolicyPackage
Operation
Generic Queries
Research SmartLog Query
Security Management Log Server : when logs were not "were not sent to log server"
able to be sent to it
Any TCP state errors listed in sk101221 tcp (fin OR syn) NOT "both fin" NOT "established"
In the query field, type "tcp state" (without quotes) or any
relevant text (e.g., "syn_sent", "both fin")
Threat Extraction show last activity blade:"Threat Extraction" AND "Content Removal"
OR "Conversion to PDF"
Threat Emulation show found threats blade:"Threat Emulation" AND severity:Critical NOT
type:Correlated
Errors Authenticating Users "Could not obtain user object" "IKE failure"
Operation
The following guide is showing some of the most used SNMP OID for monitoring generic HW
Appliances and VSX Clusters.
http://oidref.com/1.3.6.1.4.1.2620
Activate SNMP
To enable SNMP on a Check Point FW checkout the sk90860
SNMP OIDs
https://somoit.net/wp-content/uploads/2019/05/checkpoint-useful-snmp-oids-to-monitor-1.png
Image not found or type unknown
OIDs: CPU
Monitor each of the CPUs
OIDs: Memory
Counters
RAM - Real Total memTotalReal64 .1.3.6.1.4.1.2620.1.6.7.4.3
Traps
Swap memory utilization alert chkpntSwapMemoryTrap .1.3.6.1.4.1.2620.1.2000.4.1
Links
Thank you for this BLOG entry somoit.net:
https://somoit.net/checkpoint-fw/useful-snmp-oids-monitor-vsx
Operation
URL Reputation – for a domain/URL returns the classification and risk in accessing the
resource
File Reputation – for a file digest (md5/sha1/sha256/sha512) returns the risk in
downloading the file without the need to scan it
IP Reputation - for an IP address returns it’s classification and risk in accessing a resource
hosted on it
Mail Security – upload an email for scanning against malware and phishing attacks, based
on award winning Sandblast engines
All APIs are RESTful, simple to use and can be integrated as part of a SOAR application, home-made
application and more!
Detailed API instructions including samples in Java/Python can now be found in the GitHub
repository.
commands-on-all-gateways-simultaneously/m-p/50883
Operation
image-1604935138774.png
Image not found or type unknown
image-1604935159991.png
Image not found or type unknown
image-1604935178173.png
Image not found or type unknown
monitoring/blog/2018/04/04/threat-prevention-cyber-attacks-dashboard
Operation
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=
&solutionid=sk120476
How to configure Rate Limiting rules for DoS Mitigation (R80.20 and
newer)
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=
&solutionid=sk112454
Mitigation
How to configure Security Gateway to detect and prevent port scan
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=
&solutionid=sk110873&partition=Advanced&product=Security
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=
&solutionid=sk112061
Best practice
Set "Host Scan" and "Sweep Scan" in IPS Policy to "User Alert 1".
In Global Settings on Smartcenter at "User Alert 1" 120 seconds blocking of source ip run
via script
https://supportcenter.checkpoint.com/supportcenter/portal?action=portlets.SearchResultMainActio
n&eventSubmit_doGoviewsolutiondetails=&solutionid=sk102995
Script solution
https://github.com/WadesWeaponShed/Global-IP-Search-MDS
https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/MDS-Global-search-
across-CMAs-by-IP/m-p/75906
https://community.checkpoint.com/t5/API-CLI-Discussion-and-Samples/Search-multiple-
CMA/m-p/35237
The Script
#!/bin/sh
JQ=${CPDIR}/jq/jq
OBJECT_NAME=$1
DOMAINS_FILE="domains.json"
PACKAGES_FILE="packages.json"
PACKAGE_FILE="package.json"
mgmt_cli -r true -d MDS show domains limit 500 --format json > $DOMAINS_FILE
if [ $? -eq 1 ]; then
exit 1
fi
FOUND=0
OBJECT_UID=""
do
mgmt_cli -r true -d "$DOMAIN" show objects offset 0 limit 1 in.1 name in.2 "$OBJECT_NAME" --format json >
$OBJECT_NAME.json
if [ $? -ne 1 ]; then
FOUND=1
break
fi
fi
done
exit 1
fi
echo 'Searching for object '"$OBJECT_NAME"' usages in all policy packages in all domains...'
do
mgmt_cli -r true -d "$DOMAIN" show packages limit 500 --format json > $PACKAGES_FILE
if [ $? -ne 1 ]; then
do
mgmt_cli -r true -d "$DOMAIN" show-package name $PACKAGE --format json > $PACKAGE_FILE
if [ $? -ne 1 ]; then
do
mgmt_cli -r true -d "$DOMAIN" show access-rulebase package "$PACKAGE" name "$LAYER" offset 0 limit 1
if [ $? -ne 1 ]; then
break
fi
fi
done
fi
done
fi
done
echo 'Done!'
Operation
Available since R80 but not enabled per default. In R80.10 it is enabled per default and you can
access it with your SmartConsole Credentials.
image-1604935250608.png
Image not found or type unknown
logs-from-web
Operation
Check Managing partition sizes via LVM manager on Gaia OS (sk95566) for more information.
Screenshot:
https://sc1.checkpoint.com/sc//SolutionsStatics/sk92303/R801905210741.30-gaia.png
Image not found or type unknown
Check this Link: How to configure partition sizes during Gaia installation (sk92303)
Operation
SmartConsole.exe -p SmartConsole.LoginParams
<RemoteLaunchParemeters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Username>admin</Username>
<Password>password</Password>
<ServerIP>1.2.3.4</ServerIP>
<DomainName>LocationDomain</DomainName>
<ReadOnly>False</ReadOnly>
<CloudDemoMode>False</CloudDemoMode>
</RemoteLaunchParemeters>
Link: https://community.checkpoint.com/thread/6432-command-line-arguments-to-r8010-
smartconsoleexe
Operation
Perfect to use in documentations, just use the rule-UID or sometimes I also use the
<FW_RuleName: FW_RuleName> Tag for documentation.
Operation
SmartConsole: Clear
disconnected sessions
Howto clear disconnected sessions
If several SmartConsole disconnected (stale) sessions that cannot be discarded, see this here:
https://community.checkpoint.com/t5/General-Management-Topics/clear-disconnected-sessions/td-
p/33027
Postgresql Queries
View
applicationname,objid,creator,state,numberoflocks,numberofoperations,creationtime,lastmodifytime
from worksession
or numberofoperations != '0');"
Clear
Username: admin
Password:
number-of-discarded-changes: 2
message: "OK"
Operation
Syntax
Shell Command
Example
[Expert@Member1:0]# cphaprob state
... ...
[Expert@Member1:0]#
This command does not survive reboot. To make the change permanent, please run 'set cluster member admin
down/up permanent' in clish or add '-p' at the end of the command in expert mode
[Expert@Member1:0]#
Failover counter: 2
[Expert@Member1:0]#
[Expert@Member1:0]# clusterXL_admin up
This command does not survive reboot. To make the change permanent, please run 'set cluster member admin
down/up permanent' in clish or add '-p' at the end of the command in expert mode
[Expert@Member1:0]#
[Expert@Member1:0]# cphaprob state
Reason for state change: There is already an ACTIVE member in the cluster (member 2)
Failover counter: 2
[Expert@Member1:0]#
Operation
image.png
Image not found or type unknown
Migration
To migrate these queries to a new user account on the same management server or to another
smartview tracker you need to know where this data is stored.
$SMARTLOGDIR/data/users_settings/<username>/Bookmarks_Custom.xml
The file Bookmarks_Custom.xml can just be copied to the location of the new user.
After a restart of the smartconsole the favorite queries are visible again.
Links
More info also here in sk39268
Operation
Example
Basic Log Export to another syslog Server
cp_log_export add name SyslogToSplunk target-server <ip|hostname> target-port <port> protocol tcp format
splunk
name: SyslogToSplunk
enabled: true
target-server: 1.2.3.4
target-port: 8514
protocol: tcp
format: splunk
read-mode: semi-unified
export-attachment-ids: false
export-link: false
export-attachment-link: false
time-in-milli: false
encrypted: true
cp_log_export restart
Link
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=
&solutionid=sk122323
Troubleshooting
Troubleshooting
image-1604935352454.png
Image not found or type unknown
Troubleshooting
In the RADIUS service object "NEW-RADIUS" set "Keep connections open after the policy has been
installed" but this does not help.
connection-drop-when-Policy-Push
Workaround
Disable the RADIUS server for 2 minutes and the Connections do work again.
Solution
Solution is described here:
Dropped UDP Server to Client packets refresh the connection timeout (sk121933)
Fixed in Hotfix for current installed release or future Jumbo Hotfix from CP.
Troubleshooting
For a temporary access to the sftp feature you need to change the shell of the admin or other user
which is used for the filetransfer with sftp.
Shell changed.
Shell changed.
Troubleshooting
https://community.checkpoint.com/videos/5977-the-cpview-utility
https://www.youtube.com/embed/OjsvuT2YxKs
# cpview history on
Check the history data (use <+> or <-> to scroll the time)
# cpview -t
Go to a specific date/time
# cpview -t Wed Nov 7 11:17:00 CET 2018
Troubleshooting
IPS Troubleshooting
IPS Profile and Detect Mode
When you run the IPS recommended profile, most of the critical and high signatures are in inactive
or detect mode.
But still there could be a high cpu performance impact even when you're only in detect mode.
In prevent mode you kill the connection and you are done.
In detect mode you have to keep the connection open and keep spending CPU cycles on
tracking that traffic.
vs-fwaccel-dos
Cause
The user has configured too many policy layers in the rulebase (a layer is either an Ordered layer
or an Inline Layer).
The Security Gateway has a limitation of 251 layers (in total there are 256, while 5 are
reserved).
Solution
Verify that the number of layers is not exceeding 251.
Troubleshooting
Show Access Layers
mgmt_cli show access-layers limit 500 -s id.txt --format json | jq '."access-layers"[].name'
Output:
.
} ],
"from" : 1,
"to" : 260,
"total" : 260
Most vendor’s firewalls have a SQL ALG that handles SQL*Net traffic.
They listen on TCP port 1521.
In Checkpoint firewalls, there are two ALGs for SQL*Net: “sqlnet1” and “sqlnet2.”
sqlnet1 should be used for non-redirected sessions and sqlnet2 should be used for
redirected sessions.
The implication is that non-redirected sessions evaluated against sqlnet2 could negatively
impact the CPU of the firewall.
Troubleshooting
# ifconfig -a | grep encap | awk '{print $1}' | grep -v lo | grep -v bond | grep -v ":" \
| awk '{print $5 " "$7 "\t " $9 "\t" $3}' | grep -v "Unknown" | grep -v "\."
VPN Troubleshooting
VPN Problems
Links & Infos
IKEv2
Internet Key Exchange Protocol Version 2 (IKEv2)
https://tools.ietf.org/html/rfc5996
IKEv2-IPsec-VPN/m-p/14786
&solutionid=sk149892
IKEv2 negotiation for Site-to-Site VPN tunnel with 3rd party peer fails if IKEv2 SA payload contains
more than 8 proposals
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=
&solutionid=sk112139
When Check Point peer is initiator of IKEv2 negotiation, FQDN not being sent
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=
&solutionid=sk108817
Debugging IKEv2 on Check Point
Link
What is the IKEView Utility ?
https://support.checkpoint.com/results/sk/sk30994
Debugging Description
Use Ike debug to validate and understand how both devices are negotiating the
parameters
fwaccel off
Get the file $FWDIR/log/legacy_ikev2.xmll and check the proposal for both side.
Read the file $FWDIR/log/vpnd.elg and try to find any inconsistencies.
IKE is the same for all players, the problem is configuration. Many times, the devices try to
send parameters differently of what you expect they do.
Check Point firewalls try to summarize the networks inside the encryption domain, this is
called supernetting.
It will try to summarize at maximum possible and will send that summarization in place of
original one.
If you have two subnets /24 it will try to send a /23.
Route based VPN is more flexible than domain based and you can have both configured.
Use it if you can.
There's a new version for ikeview.exe capable to read $FWDIR/log/ikev2.xmll. (
https://support.checkpoint.com/results/sk/sk30994)
Check on support center and if possible use its the best tool to troubleshoot VPN problems
on Check Point side.
Disable debug after all
fwaccel on
Threat Extraction
Troubleshooting
Introduction
The following is a collection of troubleshooting I need to do with Check Point Threat Extraction
R80.10.
I used the Technical Reference Guide (ATRG) here: sk114807
3. The scrubd process handles the file and sends it to the scrub_cp_file_convertd process
with the relevant details (according to the policy).
4. scrub_cp_file_convertd process
1. Converts the file / extracts potentialy malicious content from it.
2. Returns a Safe copy of the file to scrubd.
5. The scrubd process returns the Safe copy to the in.emaild.mta daemon
Note: For environments with MTA bundle R80.10 jhf or R80.20, in.emaild.mta is replaced with
mtad daemon
Symptoms
"This notification page has expired. You can safely close the page or" error in
UserCheck page when a user tries to download the original attachment 7 days after
receiving the original e-mail, although the Threat Extraction is configured to keep the
original attachments for more than 7 days.
image-1614413932202.png
Image not found or type unknown
Solution
For more information about the sk106249 you need to login to CP support portal. There you will
need to check more files if you have set the "Delete stored original files older than" to 30+ days.
These files ave been patched if you have installed the latest R80.10 Jumbo hotfixes.
Persistence of UserCheck incidents is not preserved when quarantine time is very high
sk122099
https://checkpoint.engineer/
https://checkpointengineer.com/
Architecture
Ports Used for Communication by Various Check Point Modules
Operating
Domain Objects (FQDN) - deep dive
https://community.checkpoint.com/docs/DOC-3476-domain-objects-fqdn-an-
unofficial-atrg
GAIA REST-API
https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviews
olutiondetails=&solutionid=sk143612
Troubleshooting
Connectivity issues after policy install (sk103598)
Tools
Diagnosticsview - CPInfo Viewer
CLI
Top Check Point CLI commands
https://community.checkpoint.com/thread/5319-my-top-3-check-point-cli-commands
https://www.51sec.org/2015/10/advanced-checkpoint-gaia-cli-commands-tips-and-
tricks/
Common Check Point Commands (ccc) - Bash Script with all useful commands about
check point
https://community.checkpoint.com/docs/DOC-2214-common-check-point-commands-
ccc
fw ctl zdebug commands
https://community.checkpoint.com/docs/DOC-2982-fw-ctl-zdebug-helpful-command-
combinations
fw monitor cheat sheet
http://www.roesen.org/files/fw_monitor.pdf
https://community.checkpoint.com/docs/DOC-3475-r8020-update-cheat-sheet-fw-
monitor
Certification
CCSM Certification R80 Overview
IPS
IPS Protections in Detect (Staging)