openapi: 3.1.0 info: title: InsightAppSec Accounts Policy Override API description: '
Welcome to the reference documentation for the public APIs available for InsightAppSec.
Here are a few resources to help you learn how to start using our APIs:
After you''ve got the basics down, you can use this API guide to find examples of requests and responses.
This API uses the platform role of a user''s API key to inherit a set of permissions.
Notes:
| Role | Permissions | |
|---|---|---|
| Product Admin | Manage AppsRead Attack TemplatesManage TargetsManage Scan ConfigsManage ScansManage VulnerabilitiesAdminister Vulnerability CommentsManage EnginesManage Engine GroupsManage SchedulesManage BlackoutsManage Global BlackoutsManage FilesManage TagsManage PDF Report | |
| Read Write | Manage AppsRead Attack TemplatesRead TargetsManage Scan ConfigsManage ScansManage VulnerabilitiesManage Vulnerability CommentsRead EnginesRead Engine GroupsManage SchedulesManage BlackoutsManage FilesManage TagsManage PDF Report | |
| Read Only | Read AppsRead Attack TemplatesRead TargetsRead Scan ConfigsRead ScansRead VulnerabilitiesRead Vulnerability CommentsRead EnginesRead Engine GroupsRead SchedulesRead BlackoutsRead FilesRead TagsRead PDF Report |
| Parameter | Description | Example |
|---|---|---|
index | The 0-based index of the page of data desired (default: 0) | ?index=2 |
size | The size of the page of data desired (min: 1, max: 1000, default: 50) | ?size=10 |
sort | The sort terms and (optional) directions for the desired ordering of data (default: specific to each resource) | ?sort=scan.submit_time,DESC,scan.status |
page-token | The page token, used as an alternative to | ?page-token=NDM0NTk0NTIyOjo6X1M6OjpiYW5hbmFz |
When intending to page beyond the 10,000th result, or as an alternative to using the index query parameter, the page-token option may be used instead. After retrieving the first page, the page_token will be present in the metadata section of the response.
For example, with size=99, index=0 to index=99 may be used. To load the next page, use the page_token value used in the response e.g. ?page-token=NDM0NTk0NTIyO
As is generally the accepted practice with REST-ful APIs, creating a resource can be performed by sending an appropriately formatted POST request. Any ID provided for a new resource in a POST request body will simply be ignored (and a new one generated internally and returned as part of the resource in subsequent GET requests), and POST requests to URLs following a format similar to .../resource/ are unsupported and should respond with 415 Method Not Allowed. All requests which successfully create a resource and respond with 201 Created will contain a Location header the value of which is an absolute URI for the resource (the ID of which can be determined as the last section of the path in the given URI). For example:Location: https://us.api.insight.rapid7.com/ias/v1/scans/12345678-1234-5678-90AB-1234567890AB
The value of date and date-time type properties are fixed to the common ISO-8601 format. Unless otherwise specified, all date or date-time data in response bodies are expressed in UTC, and it is also expected that data provided in request bodies are also expressed in UTC.
The first_start and first_end properties of both Blackouts and Schedules, and the last_start property of Blackouts may be specified with a timezone. If the timezone is not specified, it is assumed to be UTC. For example:2019-08-12T14:00:00.000000Z[Asia/Tokyo]
It is also possible to specify the timezone as an offset of either GMT or UTC. For example:2019-09-04T15:00:00.000000Z[GMT+03:00]
| Value | Format | Notes |
|---|---|---|
| Date | YYYY-MM-DD | Defaults to 12 am UTC (if used for a date & time) |
| Date & time only | YYYY-MM-DD''T''hh:mm:ss[.nnn] | Defaults to UTC |
| Date & time in UTC | YYYY-MM-DD''T''hh:mm:ss[.nnn]Z | |
| Date & time with specific timezone | YYYY-MM-DD''T''hh:mm:ss[.nnn]Z[TimeZoneId] |
One characteristic of a powerful API is support for complex search and filtering of resources using a flexible query language. It is entirely possible to provide basic search and filtering functionality on standard GET resource collection operations using HTTP query parameters, but this becomes restrictive when attempting to encode boolean logic. Other solutions are also possible but come with equally restrictive compromises. The most effective way to facilitate this complex search and filtering is to provide it as a top-level API with a robust Domain-Specific Language (DSL).
For simple data retrieval that supports paging and sorting functionality, use the traditional resource-specific GET collection operations; for more complex data retrieval that supports a user-crafted query DSL, use the global Search operation.
Any response from the API with an HTTP Status Code in the 4xx or 5xx range indicates an error. If in the 4xx range it indicates a client-side error, where in the 5xx range it indicates a server-side error. All responses indicating an error should be JSON formatted, and contain both a "status" and a "message" property indicating the cause of the error, a "r7-correlation-id" header should also always be returned in the format of a UUID, which uniquely identifies the HTTP exchange that took place and caused the error (this header is present on every request). On some occasions, an "error_code" property will be included in the response body, which can provide the support team further context into the cause of the error in cases where the message is not explicitly clear.
When contacting support about error responses received from the API, please attempt to include, at minimum:
Specifically, when a response with an HTTP Status Code of 422 is returned, this indicates a validation error, almost always received in a response from a non-idempotent request (normally PUT, POST or DELETE). In this case, there should be an additional "errors" property included in the JSON response body that should describe the cause of the validation exception; this will almost always require a modification to the request body to resolve.
' version: v1 servers: - url: https://[region].api.insight.rapid7.com/ias/v1 tags: - name: Policy Override description: Policy Override Resource Controller paths: /api/3/assets/{id}/policy_overrides: get: tags: - Policy Override summary: Asset Policy Overrides description: Retrieves policy overrides defined on policy rules for the specified asset. operationId: getAssetPolicyOverrides schemes: [] consumes: - application/json produces: - application/json;charset=UTF-8 parameters: - name: id in: path description: The identifier of the asset. required: true type: integer format: int64 responses: '200': description: OK schema: $ref: '#/definitions/Resources«PolicyOverride»' examples: {} headers: {} '401': description: Unauthorized schema: $ref: '#/definitions/UnauthorizedError' examples: {} headers: {} '404': description: Not Found schema: $ref: '#/definitions/NotFoundError' examples: {} headers: {} '500': description: Internal Server Error schema: $ref: '#/definitions/InternalServerError' examples: {} headers: {} '503': description: Service Unavailable schema: $ref: '#/definitions/ServiceUnavailableError' examples: {} headers: {} security: [] /api/3/policy_overrides: get: tags: - Policy Override summary: Policy Overrides description: Retrieves policy overrides defined on policy rules. operationId: getPolicyOverrides schemes: [] consumes: - application/json produces: - application/json;charset=UTF-8 parameters: - name: page in: query description: The index of the page (zero-based) to retrieve. required: false type: integer default: 0 format: int32 - name: size in: query description: The number of records per page to retrieve. required: false type: integer default: 10 format: int32 - name: sort in: query description: 'The criteria to sort the records by, in the format: `property[,ASC|DESC]`. The default sort order is ascending. Multiple sort criteria can be specified using multiple sort query parameters.' required: false type: array items: type: string collectionFormat: multi responses: '200': description: OK schema: $ref: '#/definitions/PageOf«PolicyOverride»' examples: {} headers: {} '401': description: Unauthorized schema: $ref: '#/definitions/UnauthorizedError' examples: {} headers: {} '404': description: Not Found schema: $ref: '#/definitions/NotFoundError' examples: {} headers: {} '500': description: Internal Server Error schema: $ref: '#/definitions/InternalServerError' examples: {} headers: {} '503': description: Service Unavailable schema: $ref: '#/definitions/ServiceUnavailableError' examples: {} headers: {} security: [] post: tags: - Policy Override summary: Policy Overrides description: Submit a policy override. The policy override can be submitted or it can be submitted and approved in a single request. operationId: createPolicyOverride schemes: [] consumes: - application/json produces: - application/json;charset=UTF-8 parameters: - in: body name: policyOverride description: The specification of a policy override. Allows users to override the compliance result of a policy rule. required: false schema: $ref: '#/definitions/PolicyOverride' responses: '200': description: OK schema: $ref: '#/definitions/CreatedReference«PolicyOverrideID,Link»' examples: {} headers: {} '400': description: Bad Request schema: $ref: '#/definitions/BadRequestError' examples: {} headers: {} '401': description: Unauthorized schema: $ref: '#/definitions/UnauthorizedError' examples: {} headers: {} '500': description: Internal Server Error schema: $ref: '#/definitions/InternalServerError' examples: {} headers: {} '503': description: Service Unavailable schema: $ref: '#/definitions/ServiceUnavailableError' examples: {} headers: {} security: [] /api/3/policy_overrides/{id}: get: tags: - Policy Override summary: Policy Override description: Retrieve the specified policy override. operationId: getPolicyOverride schemes: [] consumes: - application/json produces: - application/json;charset=UTF-8 parameters: - name: id in: path description: The identifier of the policy override. required: true type: integer format: int64 responses: '200': description: OK schema: $ref: '#/definitions/PolicyOverride' examples: {} headers: {} '401': description: Unauthorized schema: $ref: '#/definitions/UnauthorizedError' examples: {} headers: {} '404': description: Not Found schema: $ref: '#/definitions/NotFoundError' examples: {} headers: {} '500': description: Internal Server Error schema: $ref: '#/definitions/InternalServerError' examples: {} headers: {} '503': description: Service Unavailable schema: $ref: '#/definitions/ServiceUnavailableError' examples: {} headers: {} security: [] delete: tags: - Policy Override summary: Policy Override description: Removes a policy override created for a policy rule. operationId: deletePolicyOverride schemes: [] consumes: - application/json produces: - application/json;charset=UTF-8 parameters: - name: id in: path description: The identifier of the policy override. required: true type: integer format: int64 responses: '200': description: OK schema: $ref: '#/definitions/Links' examples: {} headers: {} '401': description: Unauthorized schema: $ref: '#/definitions/UnauthorizedError' examples: {} headers: {} '404': description: Not Found schema: $ref: '#/definitions/NotFoundError' examples: {} headers: {} '500': description: Internal Server Error schema: $ref: '#/definitions/InternalServerError' examples: {} headers: {} '503': description: Service Unavailable schema: $ref: '#/definitions/ServiceUnavailableError' examples: {} headers: {} security: [] /api/3/policy_overrides/{id}/expires: get: tags: - Policy Override summary: Policy Override Expiration description: Get the expiration date for a policy override. operationId: getPolicyOverrideExpiration schemes: [] consumes: - application/json produces: - application/json;charset=UTF-8 parameters: - name: id in: path description: The identifier of the policy override. required: true type: integer format: int64 responses: '200': description: OK schema: type: string examples: {} headers: {} '401': description: Unauthorized schema: $ref: '#/definitions/UnauthorizedError' examples: {} headers: {} '404': description: Not Found schema: $ref: '#/definitions/NotFoundError' examples: {} headers: {} '500': description: Internal Server Error schema: $ref: '#/definitions/InternalServerError' examples: {} headers: {} '503': description: Service Unavailable schema: $ref: '#/definitions/ServiceUnavailableError' examples: {} headers: {} security: [] put: tags: - Policy Override summary: Policy Override Expiration description: Set the expiration date for a policy override. This must be a valid date in the future. operationId: setPolicyOverrideExpiration schemes: [] consumes: - application/json produces: - application/json;charset=UTF-8 parameters: - name: id in: path description: The identifier of the policy override. required: true type: integer format: int64 - in: body name: expiration description: The date the policy override is set to expire. Date is represented in ISO 8601 format. required: false schema: type: string responses: '200': description: OK schema: $ref: '#/definitions/Links' examples: {} headers: {} '400': description: Bad Request schema: $ref: '#/definitions/BadRequestError' examples: {} headers: {} '401': description: Unauthorized schema: $ref: '#/definitions/UnauthorizedError' examples: {} headers: {} '404': description: Not Found schema: $ref: '#/definitions/NotFoundError' examples: {} headers: {} '500': description: Internal Server Error schema: $ref: '#/definitions/InternalServerError' examples: {} headers: {} '503': description: Service Unavailable schema: $ref: '#/definitions/ServiceUnavailableError' examples: {} headers: {} security: [] /api/3/policy_overrides/{id}/{status}: post: tags: - Policy Override summary: Policy Override Status description: 'Update the status of the specified policy override. The status can be one of the following: `"recall"`, `"approve"`, or `"reject"`.' operationId: setPolicyOverrideStatus schemes: [] consumes: - application/json produces: - application/json;charset=UTF-8 parameters: - name: id in: path description: The identifier of the policy override. required: true type: integer format: int64 - name: status in: path description: Policy Override Status required: true type: string enum: - recall - approve - reject - in: body name: comment description: A comment describing the change of the policy override status. required: false schema: type: string responses: '200': description: OK examples: {} headers: {} '400': description: Bad Request schema: $ref: '#/definitions/BadRequestError' examples: {} headers: {} '401': description: Unauthorized schema: $ref: '#/definitions/UnauthorizedError' examples: {} headers: {} '500': description: Internal Server Error schema: $ref: '#/definitions/InternalServerError' examples: {} headers: {} '503': description: Service Unavailable schema: $ref: '#/definitions/ServiceUnavailableError' examples: {} headers: {} security: [] definitions: Link: type: object properties: href: type: string example: https://hostname:3780/api/3/... description: 'A hypertext reference, which is either a URI (see RFC 3986) or URI template (see RFC 6570). ' rel: type: string example: self description: The link relation type. This value is one from the Link Relation Type Registry or is the type of resource being linked to. description: '' BadRequestError: type: object required: - status properties: links: type: array description: Hypermedia links to corresponding or related resources. items: $ref: '#/definitions/Link' message: type: string example: An error has occurred. description: The messages indicating the cause or reason for failure. status: type: string example: '400' description: The HTTP status code for the error (same as in the HTTP response). enum: - '400' description: '' UnauthorizedError: type: object required: - status properties: links: type: array description: Hypermedia links to corresponding or related resources. items: $ref: '#/definitions/Link' message: type: string example: An error has occurred. description: The messages indicating the cause or reason for failure. status: type: string example: '401' description: The HTTP status code for the error (same as in the HTTP response). enum: - '401' description: '' CreatedReference«PolicyOverrideID,Link»: type: object properties: id: type: integer format: int64 example: 1 description: The identifier of the resource created. links: type: array description: Hypermedia links to corresponding or related resources. items: $ref: '#/definitions/Link' description: '' PolicyOverrideReviewer: type: object properties: comment: type: string example: '' description: A comment from the reviewer detailing the review. Cannot exceed 1024 characters. readOnly: true date: type: string example: '' description: The date the review took place. readOnly: true links: type: array items: $ref: '#/definitions/Link' name: type: string example: '' description: The identifier of the user that reviewed the policy override. readOnly: true user: type: integer format: int32 example: '' description: The login name of the user that reviewed the policy override. readOnly: true description: '' PolicyOverrideScope: type: object required: - newResult - rule - type properties: asset: type: integer format: int64 example: '' description: The identifier of the asset whose compliance results are to be overridden. Property is required if the property `scope` is set to either `"specific-asset"` or `"specific-asset-until-next-scan"`. links: type: array items: $ref: '#/definitions/Link' newResult: type: string example: '' description: The new policy rule result after the override is applied. enum: - pass - fail - not-applicable - fixed originalResult: type: string example: '' description: The original policy rule result before the override was applied. This property only applies to overrides with a scope of either `"specific-asset"` or `"specific-asset-until-next-scan"`. readOnly: true enum: - pass - fail - error - unknown - not-applicable - not-checked - not-selected - informational - fixed rule: type: integer format: int64 example: '' description: The identifier of the policy rule whose compliance results are to be overridden. type: type: string example: '' description: "The scope of assets affected by the policy override. Can be one of the following values: \n| Value | Description | \n| ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | \n| `\"all-assets\"` | Overrides the compliance result of all assets evaluated with the specified policy rule. | \n| `\"specific-asset\"` | Overrides the compliance result of a single asset evaluated with the specified policy rule. | \n| `\"specific-asset-until-next-scan\"` | Overrides the compliance result of a single asset evaluated with the specified policy rule until the next time asset is evaluated against that policy rule. | \n" description: '' Links: type: object properties: links: type: array description: Hypermedia links to corresponding or related resources. items: $ref: '#/definitions/Link' description: '' ServiceUnavailableError: type: object required: - status properties: links: type: array description: Hypermedia links to corresponding or related resources. items: $ref: '#/definitions/Link' message: type: string example: An error has occurred. description: The messages indicating the cause or reason for failure. status: type: string example: '503' description: The HTTP status code for the error (same as in the HTTP response). enum: - '503' description: '' PolicyOverrideSubmitter: type: object required: - comment properties: comment: type: string example: '' description: A comment from the submitter as to why the policy override was submitted. Cannot exceed 1024 characters. date: type: string example: '' description: The date the policy override was submitted. readOnly: true links: type: array items: $ref: '#/definitions/Link' name: type: string example: '' description: The login name of the user that submitted the policy override. readOnly: true user: type: integer format: int32 example: '' description: The identifier of the user that submitted the policy override. readOnly: true description: '' PageOf«PolicyOverride»: type: object properties: links: type: array description: Hypermedia links to corresponding or related resources. items: $ref: '#/definitions/Link' page: example: '' description: The details of pagination indicating which page was returned, and how the remaining pages can be retrieved. $ref: '#/definitions/PageInfo' resources: type: array description: The page of resources returned. items: $ref: '#/definitions/PolicyOverride' description: '' PageInfo: type: object properties: number: type: integer format: int64 example: 6 description: The index (zero-based) of the current page returned. size: type: integer format: int64 example: 10 description: The maximum size of the page returned. totalPages: type: integer format: int64 example: 13 description: The total number of pages available. totalResources: type: integer format: int64 example: 123 description: The total number of resources available across all pages. description: '' NotFoundError: type: object required: - status properties: links: type: array description: Hypermedia links to corresponding or related resources. items: $ref: '#/definitions/Link' message: type: string example: An error has occurred. description: The messages indicating the cause or reason for failure. status: type: string example: '404' description: The HTTP status code for the error (same as in the HTTP response). enum: - '404' description: '' Resources«PolicyOverride»: type: object properties: links: type: array description: Hypermedia links to corresponding or related resources. items: $ref: '#/definitions/Link' resources: type: array description: The resources returned. items: $ref: '#/definitions/PolicyOverride' description: '' PolicyOverride: type: object required: - scope - state - submit properties: expires: type: string example: '' description: The date the policy override is set to expire. Date is represented in ISO 8601 format. id: type: integer format: int64 example: '' description: The identifier of the policy override. readOnly: true links: type: array items: $ref: '#/definitions/Link' review: example: '' description: Details regarding the review and/or approval of the policy override. readOnly: true $ref: '#/definitions/PolicyOverrideReviewer' scope: example: '' description: The scope of the policy override. Indicates which assets' policy compliance results are to be affected by the override. $ref: '#/definitions/PolicyOverrideScope' state: type: string example: '' description: "The state of the policy override. Can be one of the following values: \n| Value | Description | Affects Compliance Results | \n| ---------------- | ----------------------------------------------------------------------------------- |:--------------------------:| \n| `\"deleted\"` | The policy override has been deleted. | | \n| `\"expired\"` | The policy override had an expiration date and it has expired. | | \n| `\"approved\"` | The policy override was submitted and approved. | ✓ | \n| `\"rejected\"` | The policy override was rejected by the reviewer. | | \n| `\"under-review\"` | The policy override was submitted but not yet approved or rejected by the reviewer. | | \n" submit: example: '' description: Details regarding the submission of the policy override. $ref: '#/definitions/PolicyOverrideSubmitter' description: '' InternalServerError: type: object required: - status properties: links: type: array description: Hypermedia links to corresponding or related resources. items: $ref: '#/definitions/Link' message: type: string example: An error has occurred. description: The messages indicating the cause or reason for failure. status: type: string example: '500' description: The HTTP status code for the error (same as in the HTTP response). enum: - '500' description: ''