Open tpurschke opened 1 year ago
Tested with Fortinet Manager v7.2.3 and FortiOS 7.2 and 7.0
trigger hit count generation:
{
"method": "get",
"params": [
{
"data": {
"adom": "myAdomName",
"pkg": "myPolicyPackage"
},
"url": "sys/hitcount"
}
],
"session": 1,
"verbose": 1,
"id": 1
}
returns task id
{
"result": [
{
"data": {
"task": 8565
},
"status": {
"code": 0,
"message": "OK"
},
"url": "sys/hitcount"
}
],
"id": 1
}
Now (wait for 1-x min depending on the size of the policies) we can get the task results .
{
"method": "get",
"params": [
{
"data": {
"taskid": 8565
},
"url": "sys/task/result"
}
],
"session": 1,
"verbose": 1,
"id": 1
}
returns (adom und pkg info need to be added, as the policy IDs are not unique)
{
"result": [
{
"adom": "bla",
"pkg": "blu",
"data": {
"firewall policy": [
{
"byte": 123,
"dstintf": "Interface A",
"first_hit": 123,
"first_session": 123,
"hitcount": 123,
"last_hit": 123,
"last_session": 123,
"name": "abc",
"pkts": 123,
"policyid": 123,
"sesscount": 123,
"srcintf": "Inerface B"
},…
see https://github.com/CactuseSecurity/FWO_private/blob/main/dev-infos/fortimanager_hitcount.md
After this task is completed we ask for result:
This result contains rules ids and correct hitcounts values.