SAP Reports APIs
CCKM provides options to generate key visibility reports based on key-related activities between CCKM and SAP groups and rotation schedules. SAP reports are categorized as:
-
Key Activity Report: Inspect individual SAP key histories by operations, for example, when they were refreshed, rotated, edited, or deleted. Also, use this report to compare key activities between CCKM and SAP group.
-
Key Rotation Report: Track keys that are scheduled for rotation.
Use the SAP reports APIs to:
-
Generate a report
-
View the list of existing reports
-
View details of a particular report
-
Delete a report from CCKM
-
View the content of a generated report
-
Download the content of a report in CSV
Generating a SAP Cloud Report
Use the post /v1/cckm/sap/reports
API to generate a report. This API starts the report generation. The report content can be verified by running the get /v1/cckm/sap/reports/{id}/contents
API. Refer to Viewing Content of Generated SAP Cloud Reports.
Syntax
curl -k '<IP>/api/v1/cckm/sap/reports' -H 'Authorization: Bearer AUTHTOKEN' -H 'Content-Type: application/json' --data-binary $'{\n "name": "<report name>",\n "start_time": "<start time>",\n "end_time": "<end time>",\n "report_type": "<report type>",\n "sap_params": [<SAP parameters>]\n}' --compressed
Request Parameters
Parameter | Type | Description |
---|---|---|
AUTHTOKEN | string | Authorization token. |
name | string | Name for the report. |
report_type | string | Type of the report. The supported types are key-report and key-rotation . |
sap_params | JSON | SAP parameter. Refer to SAP Parameter for details. |
start_time | string | Start time from when the report is to be generated. Default start time is end_time-24hrs. |
end_time | string | End time for the report. Default end time is the time when the call is initiated. |
Note
If end_time
and start_time
are not specified, a report for the last 24 hours is generated.
SAP Parameter
Parameter | Type | Description |
---|---|---|
group | string | Resource ID of the SAP group on the CipherTrust Manager. |
Example Request
curl -k 'https://127.0.0.1/api/v1/cckm/sap/reports' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiI4NDQ3NTdmMS1hMWNmLTRhMzEtYWZiNC0zNTdhNGM3NmVkYjciLCJzdWIiOiJsb2NhbHwxNjEyYjYyYy1mYWFiLTQ1NzQtYWQ4Ny00ZTBmMDRlNWZlMzUiLCJpc3MiOiJreWxvIiwiYWNjIjoia3lsbyIsInByZWZlcnJlZF91c2VybmFtZSI6ImFkbWluIiwiY3VzdCI6eyJkb21haW5faWQiOiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiLCJncm91cHMiOlsiYWRtaW4iXSwic2lkIjoiOTYyNDEwNzktOGU1Ni00MGM5LWJhMmMtN2Y0MjZhMWZhZjQwIiwiem9uZV9pZCI6IjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMCJ9LCJqd3RpZCI6ImMxNjRhNGNjLTI5YmYtNDlkNy1iODlmLTdlZGVjNmZkOTAwNiIsImlhdCI6MTYzNjM0OTkzMSwiZXhwIjoxNjM2MzUwMjMxfQ.GfqrxEWAttYDfCrn8xuDQMOYnCENcq1aOxi8ZLhe7qY' -H 'Content-Type: application/json' --data-binary $'{\n "start_time": "2021-11-06T06:37:07Z",\n "end_time": "2021-11-06T08:37:07Z",\n "name": "ab-report",\n "report_type": "key-report",\n "sap_params": [\n {\n "group": "e58ebcd1-e182-4114-8151-5767904aa3fb"\n }\n ]\n}' --compressed
Example Response
{
"id": "346a7b56-bd32-4c08-a716-13b926f5ca2b",
"uri": "kylo:kylo:cckm:sap-reports:346a7b56-bd32-4c08-a716-13b926f5ca2b",
"account": "kylo:kylo:admin:accounts:kylo",
"createdAt": "2021-11-08T05:41:15.37029022Z",
"updatedAt": "2021-11-08T05:41:15.380663706Z",
"overall_status": "in_progress",
"detailed_status": {
"e58ebcd1-e182-4114-8151-5767904aa3fb": "in_progress"
},
"abort": false,
"report_type": "key-report",
"groups": [
"e58ebcd1-e182-4114-8151-5767904aa3fb"
],
"start_time": "2021-11-06T06:37:07Z",
"end_time": "2021-11-06T08:37:07Z",
"name": "ab-report"
}
The output shows that the "overall_status"
of the report is "in_progress"
. Wait until the status becomes Completed
. To check the status, run the get /v1/cckm/sap/reports
(refer to Viewing List of Existing SAP Cloud Reports) or get /v1/cckm/sap/reports/{id}
API (refer to Viewing Details of a Particular SAP Cloud Report).
Response Codes
Response Code | Description |
---|---|
2xx | Success |
4xx | Client errors |
5xx | Server errors |
Refer to HTTP status codes for details.
Viewing List of Existing SAP Cloud Reports
Use the get /v1/cckm/sap/reports
API to view the list of updated reports. The results can be filtered using the request query parameters.
Syntax
curl -k '<IP>/api/v1/cckm/sap/reports?skip=0&limit=10&sort=updatedAt' -H 'Authorization: Bearer AUTHTOKEN' --compressed
Request Parameter
Parameter | Type | Description |
---|---|---|
AUTHTOKEN | string | Authorization token. |
Request Query Parameters
Parameter | Type | Description |
---|---|---|
id | string | Internal ID of the SAP cloud report. |
overall_status | string | Overall status of the SAP cloud report. The status can be: • completed • in progress • failed |
name | string | Name of the SAP cloud report. |
report_type | string | Type of the SAP cloud report. The supported types are key-report and key-rotation . |
skip | integer | Number of records to skip. For example, if "skip":5 is specified, the first five records will not be displayed in the output. |
limit | integer | Numbers of records to display. For example, if "limit":10 is specified, then the next 10 records (after skipping the number of records specified in the skip parameter) will be displayed in the output. |
sort | string | Comma-delimited list of properties to sort the results. |
Example Request
curl -k 'https://127.0.0.1/api/v1/cckm/sap/reports?skip=0&limit=10&sort=updatedAt' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiI4NDQ3NTdmMS1hMWNmLTRhMzEtYWZiNC0zNTdhNGM3NmVkYjciLCJzdWIiOiJsb2NhbHwxNjEyYjYyYy1mYWFiLTQ1NzQtYWQ4Ny00ZTBmMDRlNWZlMzUiLCJpc3MiOiJreWxvIiwiYWNjIjoia3lsbyIsInByZWZlcnJlZF91c2VybmFtZSI6ImFkbWluIiwiY3VzdCI6eyJkb21haW5faWQiOiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiLCJncm91cHMiOlsiYWRtaW4iXSwic2lkIjoiOTYyNDEwNzktOGU1Ni00MGM5LWJhMmMtN2Y0MjZhMWZhZjQwIiwiem9uZV9pZCI6IjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMCJ9LCJqd3RpZCI6ImMxNjRhNGNjLTI5YmYtNDlkNy1iODlmLTdlZGVjNmZkOTAwNiIsImlhdCI6MTYzNjM0OTkzMSwiZXhwIjoxNjM2MzUwMjMxfQ.GfqrxEWAttYDfCrn8xuDQMOYnCENcq1aOxi8ZLhe7qY' --compressed
Example Response
{
"skip": 0,
"limit": 10,
"total": 1,
"resources": [
{
"id": "346a7b56-bd32-4c08-a716-13b926f5ca2b",
"uri": "kylo:kylo:cckm:sap-reports:346a7b56-bd32-4c08-a716-13b926f5ca2b",
"account": "kylo:kylo:admin:accounts:kylo",
"createdAt": "2021-11-08T05:41:15.37029Z",
"updatedAt": "2021-11-08T05:41:18.391617Z",
"completed_at": "2021-11-08T05:41:18.391474Z",
"overall_status": "completed",
"detailed_status": {
"e58ebcd1-e182-4114-8151-5767904aa3fb": "completed"
},
"abort": false,
"report_type": "key-report",
"groups": [
"e58ebcd1-e182-4114-8151-5767904aa3fb"
],
"start_time": "2021-11-06T06:37:07Z",
"end_time": "2021-11-06T08:37:07Z",
"name": "ab-report"
}
]
}
The output shows two SAP cloud reports with their details.
Response Codes
Response Code | Description |
---|---|
2xx | Success |
4xx | Client errors |
5xx | Server errors |
Refer to HTTP status codes for details.
Viewing Details of a Particular SAP Cloud Report
Use the get /v1/cckm/sap/reports/{id}
API to view the details of a SAP cloud report.
Syntax
curl -k '<IP>/api/v1/cckm/sap/reports/{id}' -H 'Authorization: Bearer AUTHTOKEN' --compressed
Here, {id}
represents the resource ID of the SAP cloud report on the CipherTrust Manager.
Request Parameters
Parameter | Type | Description |
---|---|---|
AUTHTOKEN | string | Authorization token. |
Example Request
curl -k 'https://127.0.0.1/api/v1/cckm/sap/reports/346a7b56-bd32-4c08-a716-13b926f5ca2b' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiI4NDQ3NTdmMS1hMWNmLTRhMzEtYWZiNC0zNTdhNGM3NmVkYjciLCJzdWIiOiJsb2NhbHwxNjEyYjYyYy1mYWFiLTQ1NzQtYWQ4Ny00ZTBmMDRlNWZlMzUiLCJpc3MiOiJreWxvIiwiYWNjIjoia3lsbyIsInByZWZlcnJlZF91c2VybmFtZSI6ImFkbWluIiwiY3VzdCI6eyJkb21haW5faWQiOiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiLCJncm91cHMiOlsiYWRtaW4iXSwic2lkIjoiOTYyNDEwNzktOGU1Ni00MGM5LWJhMmMtN2Y0MjZhMWZhZjQwIiwiem9uZV9pZCI6IjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMCJ9LCJqd3RpZCI6ImMxNjRhNGNjLTI5YmYtNDlkNy1iODlmLTdlZGVjNmZkOTAwNiIsImlhdCI6MTYzNjM0OTkzMSwiZXhwIjoxNjM2MzUwMjMxfQ.GfqrxEWAttYDfCrn8xuDQMOYnCENcq1aOxi8ZLhe7qY' --compressed
Example Response
{
"id": "346a7b56-bd32-4c08-a716-13b926f5ca2b",
"uri": "kylo:kylo:cckm:sap-reports:346a7b56-bd32-4c08-a716-13b926f5ca2b",
"account": "kylo:kylo:admin:accounts:kylo",
"createdAt": "2021-11-08T05:41:15.37029Z",
"updatedAt": "2021-11-08T05:41:18.391617Z",
"completed_at": "2021-11-08T05:41:18.391474Z",
"overall_status": "completed",
"detailed_status": {
"e58ebcd1-e182-4114-8151-5767904aa3fb": "completed"
},
"abort": false,
"report_type": "key-report",
"groups": [
"e58ebcd1-e182-4114-8151-5767904aa3fb"
],
"start_time": "2021-11-06T06:37:07Z",
"end_time": "2021-11-06T08:37:07Z",
"name": "ab-report"
}
The output shows the details of a SAP cloud report with the specified resource ID.
Response Codes
Response Code | Description |
---|---|
2xx | Success |
4xx | Client errors |
5xx | Server errors |
Refer to HTTP status codes for details.
Viewing Content of Generated SAP Cloud Reports
Use the get /v1/cckm/sap/reports/{id}/contents
API to view the content of a SAP cloud report on console. Use the request query parameters to filter the content of the report.
Syntax
curl -k '<IP>/api/v1/cckm/sap/reports/{id}/contents?skip=0&limit=10&sort=updatedAt' -H 'Authorization: Bearer AUTHTOKEN' --compressed
Here, {id}
represents the resource ID of the SAP cloud report on the CipherTrust Manager.
Request Parameter
Parameter | Type | Description |
---|---|---|
AUTHTOKEN | string | Authorization token. |
Request Query Parameters
Parameter | Type | Description |
---|---|---|
key_name | string | Name of the SAP key. |
sap_key_id | string | ID of the SAP key. |
group_id | string | Resource ID of the SAP group. |
key_activity | string | Activity performed on the key. |
origin | string | Origin of the key. |
user_name | string | Name of the CCKM user who performed the operation. |
skip | integer | Number of records to skip. For example, if "skip":5 is specified, the first five records will not be displayed in the output. |
limit | integer | Numbers of records to display. For example, if "limit":10 is specified, then the next 10 records (after skipping the number of records specified in the skip parameter) will be displayed in the output. |
sort | string | Comma-delimited list of properties to sort the results. |
Example Request
curl -k 'https://127.0.0.1/api/v1/cckm/sap/reports/346a7b56-bd32-4c08-a716-13b926f5ca2b/contents?skip=0&limit=10&sort=updatedAt' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiI4NDQ3NTdmMS1hMWNmLTRhMzEtYWZiNC0zNTdhNGM3NmVkYjciLCJzdWIiOiJsb2NhbHwxNjEyYjYyYy1mYWFiLTQ1NzQtYWQ4Ny00ZTBmMDRlNWZlMzUiLCJpc3MiOiJreWxvIiwiYWNjIjoia3lsbyIsInByZWZlcnJlZF91c2VybmFtZSI6ImFkbWluIiwiY3VzdCI6eyJkb21haW5faWQiOiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiLCJncm91cHMiOlsiYWRtaW4iXSwic2lkIjoiOTYyNDEwNzktOGU1Ni00MGM5LWJhMmMtN2Y0MjZhMWZhZjQwIiwiem9uZV9pZCI6IjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMCJ9LCJqd3RpZCI6ImMxNjRhNGNjLTI5YmYtNDlkNy1iODlmLTdlZGVjNmZkOTAwNiIsImlhdCI6MTYzNjM0OTkzMSwiZXhwIjoxNjM2MzUwMjMxfQ.GfqrxEWAttYDfCrn8xuDQMOYnCENcq1aOxi8ZLhe7qY' --compressed
Example Response
{
"skip": 0,
"limit": 1,
"total": 1,
"resources": [
{
"id": "346a7b56-bd32-4c08-a716-13b926f5ca2b",
"uri": "kylo:kylo:cckm:sap-reports:346a7b56-bd32-4c08-a716-13b926f5ca2b",
"account": "kylo:kylo:admin:accounts:kylo",
"createdAt": "2021-11-08T05:41:15.37029Z",
"updatedAt": "2021-11-08T05:41:18.391617Z",
"key_name": "key_name",
"sap_key_id": "1cf5acb7-0ed9-44dc-8e5f-e6c88bf17dc2",
"group_id": "2a3c9b29-5088-499f-871f-c2a19dad0e6c",
"key_activity": "CREATE",
"event_time": "2021-10-27T06:51:23Z",
"user_name": "user@sap.com"
}
]
}
Response Codes
Response Code | Description |
---|---|
2xx | Success |
4xx | Client errors |
5xx | Server errors |
Refer to HTTP status codes for details.
Downloading Content of SAP Cloud Reports in CSV
Use the get /v1/cckm/sap/reports/{id}/download
API to download the comma-separated SAP cloud report. The report is downloaded as a CSV file named as <report-name>-<report-type>.csv
, for example, sap-report-key-report.csv
.
Syntax
curl -k '<IP>/api/v1/cckm/sap/reports/{id}/download' -H 'Authorization: Bearer AUTHTOKEN' --compressed
Here, {id}
represents the resource ID of the SAP cloud report on the CipherTrust Manager.
Request Parameter
Parameter | Type | Description |
---|---|---|
AUTHTOKEN | string | Authorization token. |
Example Request
curl -k 'https://127.0.0.1/api/v1/cckm/sap/reports/346a7b56-bd32-4c08-a716-13b926f5ca2b/download' -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiI4NDQ3NTdmMS1hMWNmLTRhMzEtYWZiNC0zNTdhNGM3NmVkYjciLCJzdWIiOiJsb2NhbHwxNjEyYjYyYy1mYWFiLTQ1NzQtYWQ4Ny00ZTBmMDRlNWZlMzUiLCJpc3MiOiJreWxvIiwiYWNjIjoia3lsbyIsInByZWZlcnJlZF91c2VybmFtZSI6ImFkbWluIiwiY3VzdCI6eyJkb21haW5faWQiOiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiLCJncm91cHMiOlsiYWRtaW4iXSwic2lkIjoiOTYyNDEwNzktOGU1Ni00MGM5LWJhMmMtN2Y0MjZhMWZhZjQwIiwiem9uZV9pZCI6IjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMCJ9LCJqd3RpZCI6ImMxNjRhNGNjLTI5YmYtNDlkNy1iODlmLTdlZGVjNmZkOTAwNiIsImlhdCI6MTYzNjM0OTkzMSwiZXhwIjoxNjM2MzUwMjMxfQ.GfqrxEWAttYDfCrn8xuDQMOYnCENcq1aOxi8ZLhe7qY' --compressed
The report is downloaded as a CSV file named as <report-name>-<report-type>.csv
, for example, sap-report-key-report.csv
.
Response Codes
Response Code | Description |
---|---|
2xx | Success |
4xx | Client errors |
5xx | Server errors |
Refer to HTTP status codes for details.
Deleting a Report from CCKM
Use the delete /v1/cckm/sap/reports/{id}
API to delete a SAP cloud report from CCKM.
Syntax
curl -k '<IP>/api/v1/cckm/sap/reports/{id}' -X DELETE -H 'Authorization: Bearer AUTHTOKEN' --compressed
Here, {id}
represents the resource ID of the SAP cloud report on the CipherTrust Manager.
Request Parameter
Parameter | Type | Description |
---|---|---|
AUTHTOKEN | string | Authorization token. |
Example Request
curl -k 'https://127.0.0.1/api/v1/cckm/sap/reports/346a7b56-bd32-4c08-a716-13b926f5ca2b' -X DELETE -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiI4NDQ3NTdmMS1hMWNmLTRhMzEtYWZiNC0zNTdhNGM3NmVkYjciLCJzdWIiOiJsb2NhbHwxNjEyYjYyYy1mYWFiLTQ1NzQtYWQ4Ny00ZTBmMDRlNWZlMzUiLCJpc3MiOiJreWxvIiwiYWNjIjoia3lsbyIsInByZWZlcnJlZF91c2VybmFtZSI6ImFkbWluIiwiY3VzdCI6eyJkb21haW5faWQiOiIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMDAwMDAiLCJncm91cHMiOlsiYWRtaW4iXSwic2lkIjoiOTYyNDEwNzktOGU1Ni00MGM5LWJhMmMtN2Y0MjZhMWZhZjQwIiwiem9uZV9pZCI6IjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMCJ9LCJqd3RpZCI6ImMxNjRhNGNjLTI5YmYtNDlkNy1iODlmLTdlZGVjNmZkOTAwNiIsImlhdCI6MTYzNjM0OTkzMSwiZXhwIjoxNjM2MzUwMjMxfQ.GfqrxEWAttYDfCrn8xuDQMOYnCENcq1aOxi8ZLhe7qY' --compressed
Example Response
{
"status": 204
}
The output shows that the report with the specified resource ID is deleted from CCKM.
Response Codes
Response Code | Description |
---|---|
2xx | Success |
4xx | Client errors |
5xx | Server errors |
Refer to HTTP status codes for details.