- API - failed case analyze:
- Download curl tool and extract the downloaded zip file in FWA installed machine (https://curl.haxx.se/download.html) - (only for Windows machine, curl tool by default bundled in linux machines)
- Go to "AMD64" folder in command prompt (only for Windows machine),
- execute below commands and check the status: (Need to copy sid value)
- curl --insecure -XPOST "https://managementServerIP/web_api/login" --data-binary "{\"user\": \"givenUserName\", \"password\": \"givenPassword\"}" -H "Content-Type: application/json" (Standard setup)
(or)
curl --insecure -XPOST "https://managementServerIP/web_api/login" --data-binary "{\"user\": \"givenUserName\", \"password\": \"givenPassword\",\"domain\": \"givenDomainName\"}}" -H "Content-Type: application/json" (Multi domain setup)
- curl --insecure -XPOST "https://managementServerIP/web_api/show-access-layers"
--data-binary "{\"limit\": \"50\", \"offset\": \"0\",
\"details-level\": \"standard\"}" -H "Content-Type: application/json" -H
"X-chkp-sid: sid-Value"
- Copy access layer names.
- curl --insecure -XPOST "https://managementServerIP/web_api/show-packages" --data-binary "{\"details-level\": \"full\"}" -H "Content-Type: application/json" -H "X-chkp-sid: sid-Value"
- curl --insecure -XPOST "https://managementServerIP/web_api/show-access-rulebase" --data-binary "{\"name\": \"layerName\", \"details-level\": \"full\", \"use-object-dictionary\": \"true\"}" -H "Content-Type: application/json" -H "X-chkp-sid: sid-Value"
- Need to check all layer names.
- curl --insecure -XPOST "https://managementServerIP/web_api/show-unused-objects"
--data-binary "{\"details-level\": \"full\"}" -H "Content-Type:
application/json" -H "X-chkp-sid: sid-Value"
- curl --insecure -XPOST "https://managementServerIP/web_api/show-gateways-and-servers"
--data-binary "{\"details-level\": \"full\"}" -H "Content-Type:
application/json" -H "X-chkp-sid: sid-Value"
- curl --insecure -XPOST "https://managementServerIP/web_api/logout" --data-binary "{}" -H "Content-Type: application/json" -H "X-chkp-sid: sid-Value"
- CLI - failed case analyze:
- Connect management server using putty or ssh tool,
- Then execute below commands:
- mgmt login user givenUserName password givenPassword
- mgmt_cli show access-layers limit 50 offset 0 details-level standard
- Copy access layer names.
- mgmt_cli show access-rulebase name "layerName" details-level full use-object-dictionary true --format json
- Need to check all layer names.
- mgmt_cli show unused-objects details-level full --format json
- mgmt_cli show gateways-and-servers details-level "full" --format json
- mgmt_cli logout --format json
How to configured Device rule for Checkpoint devices:
- Go to "Settings" > "Firewall Server" > "Device Rule" page and Click "Add" button and select the checkpoint device,
- 2ways we can configure device rule for Checkpoint devices (preferable is API option):
- API:
- Need to provide "Management Server URL" (like https://190.10.10.11/)
- Need to provide "Login Name" of "Management Server".
- Need to provide "Password" of "Management Server".
- Multi-Domain cases, need to enable "Domain Name" check box and provide the domain name. (Otherwise leave the domain name field.)
- Device name contains ip address cases, need to provide gateway name in "Gateway Name" field. (Changes released in 124099 build)
- Then
click the "Validate" action, if validation failed cases access given
"Management Server URL" in browser(in FWA installed machine), then try
login using given credentials. if login failed cases report customer to
enable API option in Checkpoint devices.
- If failed cases try below steps:
- Download curl tool and extract the downloaded zip file in FWA installed machine (https://curl.haxx.se/download.html) - (only for Windows machine, curl tool default bundled in linux machines)
- Go to "AMD64" folder in command prompt (only for Windows machine),
- execute below commands and check the status:
- Multi-Domain setup: (managementServerIP="Management server Ipaddress" and givenUserName="Login Name" and givenPassword="Password" and givenDomainName="Domain Name", need to replace the correct values)
- curl --insecure -XPOST "https://managementServerIP/web_api/login" --data-binary "{\"user\": \"givenUserName\", \"password\": \"givenPassword\" , \"domain\": \"givenDomainName\"}" -H "Content-Type: application/json"
- Other setups: (managementServerIP="Management server Ipaddress" and givenUserName="Login Name" and givenPassword="Password", need to replace the correct values)
- curl --insecure -XPOST "https://managementServerIP/web_api/login" --data-binary "{\"user\": \"givenUserName\", \"password\": \"givenPassword\"}" -H "Content-Type: application/json"
- Login successful cases need to execute below API calls: (managementServerIP="Management server Ipaddress" and sessionID=login api access will return a sessionId value.)
- curl --insecure -XPOST "https://managementServerIP/web_api/show-access-layers"
--data-binary "{\"limit\": \"50\", \"offset\": \"0\",
\"details-level\": \"standard\"}" -H "Content-Type: application/json"
-H "X-chkp-sid: sessionID"
- Execute below API call to get rule details: (managementServerIP="Management server Ipaddress", layerName=show-access-layers api call will return a layer name details and sessionID=login api access will return a sessionId value.)
- curl --insecure -XPOST "https://managementServerIP/web_api/show-access-rulebase" --data-binary "{\"name\": \"layerName\", \"details-level\": \"full\", \"use-object-dictionary\": \"true\"}" -H "Content-Type: application/json" -H "X-chkp-sid: sessionID"
- Execute below API call to get unUsed objects list: (managementServerIP="Management server Ipaddress" and sessionID=login api access will return a sessionId value.)
- curl --insecure -XPOST "https://managementServerIP/web_api/show-unused-objects"
--data-binary "{\"details-level\": \"full\"}" -H "Content-Type:
application/json" -H "X-chkp-sid: sessionID"
- Execute below API call to get Interface list: (managementServerIP="Management server Ipaddress" and sessionID=login api access will return a sessionId value.)
- curl --insecure -XPOST "https://managementServerIP/web_api/show-gateways-and-servers"
--data-binary "{\"details-level\": \"full\"}" -H "Content-Type:
application/json" -H "X-chkp-sid: sessionID"
- After that changes need to call logout API: (managementServerIP="Management server Ipaddress" and sessionID=login api access will return a sessionId value.)
- curl --insecure -XPOST "https://managementServerIP/web_api/logout" --data-binary "{}" -H "Content-Type: application/json" -H "X-chkp-sid: sessionID"
- CLI:
- Need to provide below fields:
- "Management Server IP" (Management server ipaddress value like 190.10.10.11)
- "Login Username" (Management server login username)
- "Login Password" (Management server login password)
- Device name contains ip address cases, need to provide gateway name in "Gateway Name" field. (Changes released in 124099 build)
- "Security
Management Administrator Username" (During the checkpoint installation,
we have option to configure separate username for access "Security
Management", if not configured cases ask customer to use "Login
Username" value.)
- "Security Management Administrator Password"
(During the checkpoint installation, we have option to configure
separate password for access "Security Management", if not configured
cases ask customer to use "Login Password" value.)
- "Timeout" (Provide timeout value)
- Multi-Domain cases, Need to enable "Domain Name" check box and provide the domain name. (Otherwise leave the domain name field.)
- Then click the "Validate" action, if validation failed cases try below options:
- Open command prompt/putty,
- then login the "Management Server IP" using given "Login Username" and "Login Password" values,
- then execute below command:
- Multi-Domain
setup: (givenUserName="Security Management Administrator Username" and
givenPassword="Security Management Administrator Password" and
givenDomainName="Domain Name", need to replace the correct values)
- mgmt login user givenUserName password givenPassword domain givenDomainName
- Other
setups: (givenUserName="Security Management Administrator Username" and
givenPassword="Security Management Administrator Password", need to
replace the correct values)
- mgmt login user givenUserName password givenPassword
- If failed cases check the error message.
- Login successful cases need to execute below API commands:
- set clienv rows 0
- mgmt_cli show access-layers limit 50 offset 0 details-level "standard" --format json
- mgmt_cli show access-rulebase name "layerName" details-level "full" use-object-dictionary true --format json (layerName = "show access-layers " command returned value)
- mgmt_cli show unused-objects details-level "full" --format json
- mgmt_cli logout --format json
How to Enable API in Checkpoint devices:
- Using 2ways we can enable API option in Checkpoint devices:
- Manual:
- Open Check Point Smart Console.
- Go to Manage & Settings > Blades > Management API and click Advanced Settings button.
- Enable Automatic Start and choose All IP address option from Access API calls from field.
- Click push button and restart the management server.
- Command Prompt:
- In command prompt login in "Management Server",
- In expert mode execute below commands:
- mgmt_cli -r true --domain MDS set api-settings accepted-api-calls-from "All IP addresses"
- mgmt_cli -r true --domain MDS set api-settings automatic-start true
Security Management Administrator Username/password section in installation:
Postman tool based Troubleshooting steps:
- Need to install "postman" tool in Firewall Analyzer installed machine.
- Then need to execute below login API call in "Postman" tool:
- Request type = Post
- URL = https://managementServerIP/web_api/login (Need to update managementServerIP value)
- Headers:
- Content-Type = application/json
- Body > Need to select "raw" option : (Need to update correct givenUserName and givenPassword values)
{"user": "givenUserName" , "password" : "givenPassword"}
- Then click "Send" and check response.
- If above login API returned "sid" value response case, need to execute below API call:
- Request type = Post
- URL = https://managementServerIP/web_api/show-access-layers (Need to update managementServerIP value)
- Headers:
- Content-Type = application/json
- X-chkp-sid = sid-Value (Login API returnned sid value)
- Body > Need to select "raw" option :
{"limit": "50", "offset": "0", "details-level": "standard"}
- Then click "Send" and check response.
- If 3 step API call return more than 1 access layer cases. need to call below API multiple times using access layer name value:
- Request type = Post
- URL = https://managementServerIP/web_api/show-access-rulebase (Need to update managementServerIP value)
- Headers:
- Content-Type = application/json
- X-chkp-sid = sid-Value (Login API returnned sid value)
- Body > Need to select "raw" option : (Need use 3rd step returned access layer name value in layerName value.)
{"name": "layerName", "details-level": "full", "use-object-dictionary": "true"}
- Then click "Send" and check response.