ServiceNow — Whitelisting Applications Services and KPIs

Whitelist applications, services, and KPIs for ServiceNow using Keycloak-authenticated API calls.

4 min read Updated SS

Whitelisting happens at three levels as follows:

  • Application

  • Service, and

  • KPIs

    Whitelisting Applications

    API requests must contain the following:

    1. To obtain the Keycloak authentication token, execute this command by replacing the Keycloak IP and port.

      export signature=`curl -s -k -X POST -d “client_id=admin-cli” -d “username=appsoneadmin” -d “password=<password>” -d “grant_type=password” https://<keyclock ip:port/auth/realms/master/protocol/openid-connect/token | jq ‘.access_token’ | cut -d '"' -f 2`

    2. To whitelist the application, execute the below command: curl -k -H “Content-Type: application/json” -H “Authorization:$signature” -X POST -d @<filename.json> https://<controcenter_IP>:<controcenter_Port>/heal- controlcenter/v2.0/api/accounts/<account-id>/whitelist

      1. Before whitelisting the application, ensure the following: Create a sample JSON file containing the names of all applications that need to be whitelisted and then specify the file path in the whitelist command.

        For Example: application.json

        The application JSON file should be as below: [ { “applicationName”:”App-Service-02-DR”, “applicationSuppressionInterval”:25 }, { “applicationName”:”CBC-DC”, “applicationSuppressionInterval”:25 } ]

        Note:

    3. To get the application name from the percona as follows: Navigate to the percona database and select the appsone schema.

      Execute the below command to get all the applications: Select * from a controller where controller_type_id=191

    4. You can add multiple applications separated by a comma.

    5. URL Details as follows: Control Center_IP_Hostname: IP Address or the server’s hostname where HEAL is installed.

      Control Center_Port: Port number of the server where HEAL is running. AccountIdentifier: Identifier of the Account being monitored. An Account Identifier is available in the Manage Accounts Screen of the HEAL Control Center UI.

    6. The above result will be stored in the Percona Database.

      Navigate to the Controller table and verify the values for the below column. Plugin_supr_interval and plugin_Whitelist_status

      Whitelisting Services

      API requests must contain the following:

    7. To obtain the keycloak authentication token, execute the command by replacing the keycloak IP and Port.

      export signature=`curl -s -k -X POST -d “client_id=admin-cli” -d “username=appsoneadmin” -d “password=<password>” -d “grant_type=password” https://<keyclock ip:port/auth/realms/master/protocol/openid- connect/token | jq ‘.access_token’ | cut -d '"' -f 2`

    8. To whitelist the application, execute the command below:

      curl -k -H “Content-Type: application/json” -H “Authorization:$signature” -X POST -d @<filename.json> https://<controlcenter_IP>:<controlcenter_Port>/heal- controlcenter/v2.0/api/accounts/<account- id>/applications/<application-id>/whitelist

      1. Before whitelisting the application, ensure the following: Create a sample JSON file containing the names of all services that need to be whitelisted and then specify the file path in the whitelist command.

        For Example: service.json

        The service JSON file should be as below:

        [ { “serviceName”:”Web-Service-02-DR”, “serviceSuppressionInterval”:12 }, { “serviceName”:”OnlineBanking-Service-DR”, “serviceSuppressionInterval”:12 } ]

        Note: To get the application name from the percona as follows: Navigate to the percona database and select the appsone schema Execute the command below to get all the services: Select * from a controller where controller_type_id=192 You can add multiple services that belong to the application.

    9. URL Details as follows: Control Center_IP_Hostname: IP Address or the Hostname of the server where HEAL is installed.

      Control Center_Port: Port number of the server where HEAL is running. AccountIdentifier: Identifier of the Account being monitored. An Account Identifier is available in the Manage Accounts Screen of HEAL Control Center UI.

      Whitelisting KPIs

      API requests must contain the following:

    10. To obtain the keycloak authentication token, execute the below command by replacing

      keycloak IP and Port.

      export signature=`curl -s -k -X POST -d “client_id=admin-cli” -d “username=appsoneadmin” -d “password=<password>” -d “grant_type=password” https://<keyclock ip:port/auth/realms/master/protocol/ openid- connect/token | jq ‘.access_token’ | cut -d '"' -f 2`

    11. To whitelist the application, execute the command below:

      curl -k -H “Content-Type: application/json” -H “Authorization:$signature” -X POST -d @<filename.json> https://<controlcenter_IP_HostName>: <controlcenter_Port>/heal-controlcenter/v2.0/api/accounts/<account- id>/applications/<application-id>/service/<service-id>/whitelist

      1. Before whitelisting the application, ensure the following: Create a sample JSON file containing the names of all KPIs that need to be whitelisted for the services and applications and then specify the file path in the whitelist command.

        For Example: KPI.json

        The KPI JSON file should be as below: [ “Ping Status”, “Established Status”, “Listen Status”, “Process Running” ]

        Note: Execute the below command to get all the KPIs: select * from mst_kpi_details

    12. URL Details are as follows: Control Center_IP_Hostname: IP Address or the server’s Hostname where HEAL is installed.

      Control Center_Port: Port number of the server where HEAL is running. AccountIdentifier: Identifier of the Account being monitored. An Account Identifier is available in the Manage Accounts Screen of the HEAL Control Center UI. Service-id: Identifier assigned to a specific service within the application in the HEAL Control Center.

      Whitelisted Status

      The below command (input) provides the status of the whitelisted applications, services, and KPIs.

      http://<Enter the HEAL UI IP and port>/heal- controlcenter/v2.0/api/accounts/qa-d681ef13- d690-4917-9f3a-6c79b- 1/whitelist

      For Example:

      Input:

      http://192.0.2.2:8082/heal-controlcenter/v2.0/api/accounts/qa- d681ef13-d690-4917- 9f3a-6c79b-1/whitelist

      Output:

      { “message”: “SUCCESS”, “responseStatus”: “SUCCESS”, “data”: { “whitelistActive”: true, “whiteList”: [ { “applicationName”: “OnlineBanking-DR”, “applicationSuppressionInterval”: 0, “serviceWhitelist”: [ { “serviceName”: “DB-Service-01-DR”, “kpiWhitelist”: [ “CPU Util”, “Memory Util”, “Listen Status”, “Established Status”, “Ping Status” ], “serviceSuppressionInterval”: 0 } ] }, { “applicationName”: “Dot_Net”, “applicationSuppressionInterval”: 0, “serviceWhitelist”: [ { “serviceName”: “DontNet-App-Service”, “kpiWhitelist”: [], “serviceSuppressionInterval”: 5 } ] } ] } }