In general communication with the RIPS API has to be initiated by the client. There are some cases where this architecture is not desirable. For example, the client does not know when a scan finishes, so it has to ask the API regularly about the state of the scan until it is finished. As a solution callbacks were introduced in RIPS API 2.8. A callback is a HTTP URL that is called by the API on certain events, for example when a scan is finished.
Callbacks are JSON-encoded HTTP POST requests. A callback consists of 3 sections:
Action is a string that specifies the cause of the callback.
Item is an associative array that represents the state of the object that caused the callback to happen.
Class is a string that specifies the class name of the object in item.
For security reasons a callback URL has to fulfill the following criteria, otherwise it is ignored.
|Redirects||Does not follow redirects|
This first layer of protection is not sufficient to completely prevent Server-Side Request Forgery. Thus, the SaaS version of RIPS sends all requests through the proxy server proxy.ripstech.com (126.96.36.199).
Callbacks can be bound to users, applications, and scans. Callbacks for applications automatically apply to all scans of that application as well. It is necessary to specify the events that trigger the callback through the parameter "reports". Possible values are "UPDATE_USER", "DELETE_USER", "CREATE_SCAN", "UPDATE_SCAN", "FINISH_SCAN", "CREATE_COMMENT", "CREATE_REVIEW", and "DELETE_COMMENT". More information about the input and output can be found in the API specification.
When designing a callback system make sure to consider that the callbacks are visible to all users of your organization with the role "chief".
You can use https://webhook.site/ to easily test the callback feature.