Define SAST Scan Settings - POST /sast/scanSettings (v8.7.0 and up)

Define the SAST scan settings according to a project (preset and engine configuration).

Usage

  1. GET /projects and get details of all visible projects
  2. GET /sast/presets and get details of all presets
  3. GET /sast/engineConfigurations and get engine configurations list
  4. POST /sast/scanSettings and define the SAST scan preset and configuration settings

URL

http://localhost/cxrestapi/sast/scanSettings

Method:

POST

Media Type (header):

Authorization: Bearer <access token value>
Content-Type: application/json;v=1.0/1.1
cxOrigin: {request_origin}

Parameters

Required:

scanSettings=[body] – Scan settings:
projectId=[integer] – Unique Id of the project
presetId=[integer] – Unique Id of the preset
engineConfigurationId=[integer] – Unique Id of the engine configuration

Optional:

postScanActionId=[integer] – Unique Id of the post scan action
emailNotifications=[body] – Email notification details:
beforescan=[string] – Specifies the email to send the pre-scan message
failedScans=[string] – Specifies the email to send the scan failure message
afterScans=[string] – Specifies the email to send the post-scan message

Curl Sample:

curl -X POST --header 'Content-Type: application/json;v=1.0' --header 'Accept: application/json' --header 'Authorization: Bearer <access token> -d '{ \
   "projectId": 1, \
   "presetId": 1, \
   "engineConfigurationId": 1, \
   "postScanActionId": 1, \
   "emailNotifications": { \
     "failedScan": [ \
       "admin@cx.com" \
     ], \
     "beforeScan": [ \
       "admin@cx.com" \
     ], \      "afterScan": [ \
|       "admin@cx.com" \
     ] \
   } \
 }' 'http://localhost/cxrestapi/sast/scanSettings'

Sample Response:

{
  "id": 2,
  "link": {
    "rel": "self",
    "uri": "/sast/scanSettings/2"
  }
}

Success Response:

Code: 200 OK

Error Response:

Code: 400 Bad Request

Notes:

Defines the SAST scan settings according to a project. If the request fails, it returns an error response. Defines project scan settings regardless of whether the scan has been created.