Skip to main content

APIs

Prerequisites

Log in to the RapidFort platform and create a service account.

Set the RapidFort service account information as environment variables.

Replace RF_ACCESS_ID and RF_SECRET_ACCESS_KEY with your service account information.

For on-premises deployments, replace RF_ROOT_URL with your platform hostname (e.g. https://rapidfort.example.com).

export RF_ACCESS_ID="RF1234567890abcdedfh"
export RF_SECRET_ACCESS_KEY="1234567890abcdefgh1234567890ijklmnopq123"
export RF_ROOT_URL="https://us01.rapidfort.com"

Reports Summary API

The rfcat reports summary API returns a summary of compliance results for each workload.

Request

Request a RapidFort access token using the following command:

AUTH_TOKEN=$(curl $RF_ROOT_URL/api/v1/access-token -u "$RF_ACCESS_ID:$RF_SECRET_ACCESS_KEY" | jq -r .access_token)

Construct the authorization header for the API request:

HEADER="Authorization: Bearer $AUTH_TOKEN"

Find the ID of the project for which you would like to request the summary (e.g. 123).

export PROJECT_ID=123

Construct the reports URL with the project_id:

URL="$RF_ROOT_URL/api/v1/workflow/reports/summary-by-image-name?project_id=$PROJECT_ID"

Make the API request:

curl -X GET -H "${HEADER}" "${URL}"

Request Summary

AUTH_TOKEN=$(curl $RF_ROOT_URL/api/v1/access-token -u "$RF_ACCESS_ID:$RF_SECRET_ACCESS_KEY" | jq -r .access_token)
curl -X GET -H "Authorization: Bearer $AUTH_TOKEN" "$RF_ROOT_URL/api/v1/workflow/reports/summary-by-image-name?project_id=$PROJECT_ID"

Response

Response JSON

{
"hostname:macaddress": {
"benchmarks": [
{
"profile_info": {
"profile_id": "xccdf_org.ssgproject.content_profile_anssi_bp28_enhanced",
"title": "ANSSI-BP-028 (enhanced)",
"description": "This profile contains configurations that align to ANSSI-BP-028 v2.0 at the enhanced hardening level.\n\nANSSI is the French National Information Security Agency, and stands for Agence nationale de la s�curit� des syst�mes d'information.\nANSSI-BP-028 is a configuration recommendation for GNU/Linux systems.\n\nA copy of the ANSSI-BP-028 can be found at the ANSSI website:\nhttps://www.ssi.gouv.fr/administration/guide/recommandations-de-securite-relatives-a-un-systeme-gnulinux/\n\nAn English version of the ANSSI-BP-028 can also be found at the ANSSI website:\nhttps://cyber.gouv.fr/publications/configuration-recommendations-gnulinux-system"
},
"results_summary": {
"pass": 64,
"fail": 31,
"not_applicable": 232,
"not_selected": 0,
"not_checked": 1,
"informational": 0
},
"score": 77.46,
"updated": 1731453853
}
]
},
"hostname:macaddress": {
"benchmarks": [
{
"profile_info": {
"profile_id": "xccdf_org.ssgproject.content_profile_standard",
"title": "Standard System Security Profile for Ubuntu 20.04",
"description": "This profile contains rules to ensure standard security baseline of an Ubuntu 20.04 system. Regardless of your system's workload all of these checks should pass."
},
"results_summary": {
"pass": 18,
"fail": 0,
"not_applicable": 26,
"not_selected": 0,
"not_checked": 1,
"informational": 0
},
"score": 100,
"updated": 1731454721
},
{
"profile_info": {
"profile_id": "xccdf_org.ssgproject.content_profile_cis_level1_server",
"title": "CIS Ubuntu 20.04 Level 1 Server Benchmark",
"description": "This baseline aligns to the Center for Internet Security\nUbuntu 20.04 LTS Benchmark, v1.0.0, released 07-21-2020."
},
"results_summary": {
"pass": 82,
"fail": 21,
"not_applicable": 157,
"not_selected": 0,
"not_checked": 0,
"informational": 0
},
"score": 88.47,
"updated": 1731453782
}
]
},
"hostname:macaddress": {
"benchmarks": [
{
"profile_info": {
"profile_id": "xccdf_org.ssgproject.content_profile_cis_level1_server",
"title": "CIS Ubuntu 22.04 Level 1 Server Benchmark",
"description": "This baseline aligns to the Center for Internet Security\nUbuntu 22.04 LTS Benchmark, v1.0.0, released 08-30-2022."
},
"results_summary": {
"pass": 87,
"fail": 23,
"not_applicable": 183,
"not_selected": 0,
"not_checked": 0,
"informational": 0
},
"score": 88.88,
"updated": 1731448893
}
]
}
}

Response JSON Fields

Field NameData TypeDescription
profile_infoObjectProfile information object
profile_idStringUnique identifier of the profile (e.g. xccdf_org.ssgproject.content_profile_stig)
descriptionStringDetailed description of the profile and its purpose, which includes improving the security of DoD information systems (not available for CIS benchmarks)
titleStringTitle of the security profile (e.g. Canonical Ubuntu 20.04 LTS Security Technical Implementation Guide (STIG) V1R9)
results_summaryObjectResults information object
passintegerNumber of checks that passed
failintegerNumber of checks that failed
not_applicableintegerNumber of checks marked as not applicable
not_selectedintegerNumber of checks not selected
not_checkedintegerNumber of checks not checked
informationalintegerNumber of checks marked as informational
scorefloatThe overall score based on the evaluation results
updatedintegerThe epoch when the results were generated