Technology Blog Posts by SAP
cancel
Showing results for 
Search instead for 
Did you mean: 
CyMac
Product and Topic Expert
Product and Topic Expert
1,438

SAP Cloud ALM Configuration and Security AnalyticsSAP Cloud ALM Configuration and Security Analytics

SAP Cloud ALM OData Analytics API for Configuration and Security Analysis is documented in the SAP Business Accelerator Hub and in the official SAP Help documentation.

This API provides access to analytics data of Configuration and Security Analysis use case of SAP Cloud ALM. It exposes the same data than the generic Analytics OData API (DataSet) and the REST Analytics API.

The API support several use cases:

  1. Access the configuration stores and elements 
  2. Retrieve the number and type of historical changes 
  3. Check configuration compliance against security recommendations
  4. Access the full content of a configuration store (items key and value) (*)

(*) The API provides access to the full contents of a configuration store for a single store only. 

In the following we'll show how this analytics OData API can be used with SAP Analytics Cloud by building step by step a simple story. 

We take as example a system of type "SAP NetWeaver AS for ABAP" with id EE1.

CyMac_0-1728997903431.png CyMac_1-1728997918476.png

In order to get the data in SAP Analytics Cloud we need a simple query which selects only the serviceId:

https://{{CALM_URL}}/api/calm-analytics/v1/odata/v4/analytics/ConfigurationItems?$filter=period eq 'C24M' and serviceId eq 'c19e8958-92fa-422b-921b-f9349f2ddfda'

With filter "serviceId eq 'c19e8958-92fa-422b-921b-f9349f2ddfda'" we select the service EE1 of type "SAP NetWeaver AS for ABAP" using its LMS-ID (Landscape Management Service Id). This id can be retrieve from the LMS application of SAP Cloud ALM but also looking at the URL parameters in CSA application (see screenshot below).

With filter "period eq 'C24M'", we select a large period of time of 24 months (including the current month since the period start with character 'C' and not 'L' for LAST). The value of the period to use depends on how far you want to go to build historical charts. If you are not interested by historical values (which are identified with dimension "ElementStatus=OLD"), you can just ignore filter "period" and add the filter "ElementStatus=CURRENT".

CyMac_2-1728998211234.png

Remark about API parameters used by SAP Analytics Cloud

If we call the URL indicated above using an API tool (and the proper OAuth 2.0 credentials / token), we receive all dimensions and measures exposed by the CSA analytics provider:

CyMac_0-1728998452388.png

This includes the dimensions "itemKey" and "itemValue" which are null since we don't access a single configuration store but all the configuration stores of system EE1. When the OData API is called from SAP Analytics Cloud (see after), we generally use the graphical editor to construct the query with the graphical editor. SAP Analytics Cloud adds additional parameters like "$select" which lists the fields (dimensions and measures) that should be returned by the OData API.

SAP Analytics Cloud Connection

There is nothing specific about the SAP Analytics Cloud connection you need to access the CSA OData Analytics API. You can re-use an existing SAP Cloud ALM connection for the generic OData Analytics API or create a new one if you don't have one already.

Of course you need a proper OAuth 2.0 credentials (client id, client secret) with at least the minimum required security scopes:

  • calm-api.analytics.read
  • calm-api.csa.read 
  • calm-api.csa.personal.read
CyMac_0-1729094503127.png

Data Service URL: https://calm-demo.eu10.alm.cloud.sap/api/calm-analytics/v1/odata/v4/analytics/

Token URL: https://calm-demo.authentication.eu10.hana.ondemand.com/oauth/token

CyMac_0-1729000976883.png

SAP Analytics Cloud Model

The SAC model can be created in few clicks with minimum effort.

To create the OData model select the connection to the SAP Cloud ALM tenant we want to access.

CyMac_2-1729002192290.png

We select the Entity "ConfigurationItems".

CyMac_3-1729002225481.png

 

We select all dimensions and measures except "itemKey" and "itemValue" that won't be used since we want to create a model with all the configuration stores of the service EE1.

CyMac_4-1729002248032.png

The three measures are automatically recognized as such.

  
CyMac_5-1729003310573.png

 

CyMac_6-1729003315823.png

 

Dimensions "elementDate" and "elementDateTo" are automatically recognized as Timestamp. In this example, we change the type of  those two dimensions to Date since it is more convenient to use in the story and we don't care about the time resolution.

CyMac_4-1729092885816.png

The API returns two additional control dimensions:

  • period: input semantic period with format [L|C]<number[D|W|M|Y]
  • timeZone: input time zone (by default UTC is used)

SAP Analytics Cloud Story Example

Number of configuration stores

One option to count the number of configuration stores is to count the number of storeIds.

CyMac_0-1729080954763.pngCyMac_1-1729080963828.pngCyMac_0-1729004261596.png

Number of configuration items 

To report on the number of items per configuration store we use dimension "StoreName" and measure "NumItems". To count only the current number of items and not the historical ones, we use filter "ElementStatus=CURRENT".

CyMac_2-1729089673425.png

Compliance

In the example below we check the configuration compliance against the security recommendations. To do so, we select only the current version of the configuration by applying the filter "ElementStatus=CURRENT". We use the measure "NumItems" to count the number of items per compliance status and the dimension "ItemSecRecStatus" to distinguish betwen configuration items COMPLIANT, NON COMPLIANT and the those which are not rated.

CyMac_0-1729089108577.png

 

CyMac_1-1729089116021.png

 

Change history

In this example we display the number of changes per week. To do that we use dimension "ElementDate" together with measure "NumChanges". We can easily construct this historical view since we have converted the type of dimension "ElementDate" from Timestamp to Date (see model construction above).

CyMac_2-1729091498641.png

CyMac_3-1729091512950.png

 

 

 

 

 

1 Comment
anotherbasicguy
Explorer
0 Kudos

Interesting to know that this is available, but why do we customers need to build a visual compliance dashboard each on our own in the first place?

For On-Prem I would understand this with CALM - although customers usually have Config Validation in place anyways - but for Cloud Services like Cloud Identity Services all the information is already there in CALM, can't SAP provide templates to Analytics Cloud or even better implement a visualization solution into CALM itself?

Still thank you for sharing that, I'm sure it'll come in handy for some.