Retrieve a baseline compliance report
The baseline_compliance
request retrieves the baseline compliance report for a device.
The input will be the active session ID and the device name. The output will be the Baseline Compliance Report in JSON format.
Resource Name:
Request Method: GET
Request URL Parameters:
Element | Type | Description |
---|---|---|
Mandatory |
String |
The name of the device:
|
Response:
Element | Type | Description |
---|---|---|
device
|
String | Name of the device. |
version
|
String | Version of the device. |
policy
|
String | Policy on the device. |
date
|
String | Date of report in YYYY-MM-DD format. |
profile
|
String | Name of baseline profile. |
baseline_compliance_score
|
Integer |
Baseline compliance score. |
passed_requirement_count
|
Integer | Number of successful requirements. |
failed_requirement_count
|
Integer | Number of failed requirements. |
requirements
|
List of BaselineRequirementResult type objects | A list of baseline requirement result objects. |
Request example:
curl -i -H "Accept:application/json" -k -X GET --cookie "PHPSESSID=<session ID>" "https://localhost/afa/api/v1/baseline_compliance?device= <tree name>"
Response example:
{
"device" : "root (62.219.117.1)",
"version" : "Fortinet FortiGate Fortigate-50B v4.0,build0689,140731 (MR3 Patch 18)",
"policy" : "10_132_20_1_root.fortigate",
"date" : "2019-03-14",
"profile" : "FortiGateProfile",
"baseline_compliance_score" : 55,
"passed_requirement_count" : 8,
"failed_requirement_count" : 6,
"requirements" : [ {
"name" : "Device details",
"status" : "UNKNOWN",
"id" : 1,
"tests" : [ {
"command" : "Get System Status",
"criterion" : "Manual Review",
"item" : "System time:\\s(.*)",
"comments" : "Found: Thu Mar 14 12:00:27 2019",
"status" : "UNKNOWN",
"id" : 1
}, {
"command" : "Get System Status",
"criterion" : "Manual Review",
"item" : "IPS-DB:\\s*(.*)",
"comments" : "Found: 3.00295(2013-01-30 19:23)",
"status" : "UNKNOWN",
"id" : 2
}, {
"command" : "Get System Status",
"criterion" : "Manual Review",
"item" : "Serial-Number:\\s*(.*)",
"comments" : "Found: FGT50B3G11605125",
"status" : "UNKNOWN",
"id" : 3
}, {
.
.
}, {
"command" : "Get System Status",
"criterion" : "Manual Review",
"item" : "Virtual domains status:\\s*(.*)",
"comments" : "Found: 9 in NAT mode, 1 in TP mode",
"status" : "UNKNOWN",
"id" : 14
} ]
.
.
}, {
"name" : "Time out Settings",
"status" : "PASSED",
"id" : 17,
"tests" : [ {
"command" : "Global Configuration",
"criterion" : "Required Regexp",
"item" : "set admintimeout\\s(.*)",
"comments" : "Found: 480",
"status" : "PASSED",
"id" : 1
} ]
} ]
}