Create a vulnerability
Creates a vulnerability finding. Findings created through the API always have source set to api, and you can't set it yourself. Use the vulnerabilityId returned in the response, not the one you sent, in later GET and PATCH calls.
- Duplicate IDs: If a finding created through the API already has the same
vulnerabilityId, the request returns409with the error codeconflictand the existing finding doesn't change. This applies even when the existing finding is closed. - Each source is separate: A finding created through the API with the same ID as a finding imported from CSV is a new record, so
api#VUL-1001andimport#VUL-1001can both exist. Scrut doesn't merge findings across sources. - ID matching: Scrut matches IDs without regard to case and stores them in upper case in
vulnerabilityId. For example,cve-2021-44228is treated asCVE-2021-44228and returned asapi%23CVE-2021-44228. - No CVE lookup: Scrut doesn't fill in the title, description, CVSS score or severity from a CVE ID. Only
cveIdis set, in lower case, for examplecve-2021-44228. - Closed on create: You can create a finding that's already closed by sending
"status": "closed". - Lower-case storage: Scrut stores
titleand affected resource names in lower case. The Scrut app shows them in title case. - Changes after create: You can change only
assigneeEmail,reportLinkandcustomFieldsthrough the API. You can't change status, severity, title or affected resources. You can't close an existing finding through the API.
curl -X POST "https://api.scrut.io/v1/vulnerabilities" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 7c9e6679-7425-40de-944b-e07fc1f90ae7" \
-H "Authorization: Bearer YOUR_API_TOKEN (JWT)" \
-d '{
"vulnerabilityId": "VUL-5672",
"title": "public s3 bucket",
"description": "Bucket is world-readable.",
"remediation": "Block public ACLs.",
"stepsToReproduce": "Open the bucket URL.",
"severity": "high",
"status": "open",
"fixAvailable": "no",
"firstSeen": 1704067200000,
"affectedResources": [
{
"name": "s3://bucket",
"type": "s3",
"tags": [
"public",
"prod"
]
}
],
"assigneeEmail": "jordan@example.com"
}'
import requests
import json
url = "https://api.scrut.io/v1/vulnerabilities"
headers = {
"Content-Type": "application/json",
"Idempotency-Key": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"Authorization": "Bearer YOUR_API_TOKEN (JWT)"
}
data = {
"vulnerabilityId": "VUL-5672",
"title": "public s3 bucket",
"description": "Bucket is world-readable.",
"remediation": "Block public ACLs.",
"stepsToReproduce": "Open the bucket URL.",
"severity": "high",
"status": "open",
"fixAvailable": "no",
"firstSeen": 1704067200000,
"affectedResources": [
{
"name": "s3://bucket",
"type": "s3",
"tags": [
"public",
"prod"
]
}
],
"assigneeEmail": "jordan@example.com"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.scrut.io/v1/vulnerabilities", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Idempotency-Key": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"Authorization": "Bearer YOUR_API_TOKEN (JWT)"
},
body: JSON.stringify({
"vulnerabilityId": "VUL-5672",
"title": "public s3 bucket",
"description": "Bucket is world-readable.",
"remediation": "Block public ACLs.",
"stepsToReproduce": "Open the bucket URL.",
"severity": "high",
"status": "open",
"fixAvailable": "no",
"firstSeen": 1704067200000,
"affectedResources": [
{
"name": "s3://bucket",
"type": "s3",
"tags": [
"public",
"prod"
]
}
],
"assigneeEmail": "jordan@example.com"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"vulnerabilityId": "VUL-5672",
"title": "public s3 bucket",
"description": "Bucket is world-readable.",
"remediation": "Block public ACLs.",
"stepsToReproduce": "Open the bucket URL.",
"severity": "high",
"status": "open",
"fixAvailable": "no",
"firstSeen": 1704067200000,
"affectedResources": [
{
"name": "s3://bucket",
"type": "s3",
"tags": [
"public",
"prod"
]
}
],
"assigneeEmail": "jordan@example.com"
}`)
req, err := http.NewRequest("POST", "https://api.scrut.io/v1/vulnerabilities", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Idempotency-Key", "7c9e6679-7425-40de-944b-e07fc1f90ae7")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN (JWT)")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.scrut.io/v1/vulnerabilities')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['Idempotency-Key'] = '7c9e6679-7425-40de-944b-e07fc1f90ae7'
request['Authorization'] = 'Bearer YOUR_API_TOKEN (JWT)'
request.body = '{
"vulnerabilityId": "VUL-5672",
"title": "public s3 bucket",
"description": "Bucket is world-readable.",
"remediation": "Block public ACLs.",
"stepsToReproduce": "Open the bucket URL.",
"severity": "high",
"status": "open",
"fixAvailable": "no",
"firstSeen": 1704067200000,
"affectedResources": [
{
"name": "s3://bucket",
"type": "s3",
"tags": [
"public",
"prod"
]
}
],
"assigneeEmail": "jordan@example.com"
}'
response = http.request(request)
puts response.body
{
"data": {
"vulnerabilityId": "api%23VUL-5672",
"title": "public s3 bucket",
"description": "Bucket is world-readable.",
"status": "open",
"severity": "high",
"source": "api",
"assignees": [
{
"name": "Jordan Kim",
"email": "jordan@example.com",
"isPrimary": true
}
],
"firstSeen": 1704067200000,
"cveId": "",
"remediation": "Block public ACLs.",
"stepsToReproduce": "Open the bucket URL.",
"customFields": []
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "validation_failed",
"message": "Request validation failed.",
"details": [
{
"field": "assigneeEmail",
"message": ""assigneeEmail" must be a valid email"
}
]
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "validation_failed",
"message": "Request validation failed.",
"details": [
{
"message": "assigneeEmail does not match a user in this organization"
}
]
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "unauthorized",
"message": "Missing, malformed, or invalid Bearer token.",
"details": []
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "token_revoked",
"message": "The API credential was revoked.",
"details": []
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "token_stale",
"message": "The access token is stale; obtain a new token.",
"details": []
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "forbidden",
"message": "Insufficient scope.",
"details": []
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "not_found",
"message": "The requested resource was not found.",
"details": []
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "conflict",
"message": "A vulnerability with this vulnerabilityId already exists.",
"details": []
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "idempotency_key_reused",
"message": "Idempotency key was reused with a different request body.",
"details": []
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "idempotency_request_in_progress",
"message": "A request with this idempotency key is already being processed.",
"details": []
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "rate_limit_exceeded",
"message": "Rate limit exceeded.",
"details": [
{
"retryAfterSec": 12
}
]
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "internal_error",
"message": "An unexpected error occurred.",
"details": []
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "upstream_unavailable",
"message": "Upstream service is unavailable.",
"details": [
{
"dependency": "frameworks",
"issue": "Failed to process frameworks."
}
]
},
"meta": {
"requestId": "550e8400-e29b-41d4-a716-446655440000"
}
}
/v1/vulnerabilities
Target server for requests. Edit to use your own host.
Machine access token from POST /oauth/token. Send Authorization: Bearer $SCRUT_ACCESS_TOKEN on every /v1 request.
POST /oauth/token. Send Authorization: Bearer $SCRUT_ACCESS_TOKEN on every /v1 request.The media type of the request body
Client-generated key identifying one logical write. 1–128 characters; letters, numbers, and . _ ~ - only. Reuse the same key and body to retry safely. Reusing a key with a different body returns 409 idempotency_key_reused. Successful 2xx responses are replayed for 24 hours.
A CVE ID, or VUL- followed by exactly four digits, for example VUL-5672. Any other format, such as GHSA-… or VUL-12345, returns 400. Matched without regard to case and stored in upper case. Scrut stores the finding as api#<vulnerabilityId> and returns it URL-encoded, for example api%23VUL-5672. Use the returned value as-is in GET and PATCH paths.
Stored in lower case. The Scrut app shows it in title case.
Send closed to create a finding that's already closed.
Unix epoch milliseconds.
Resources affected by the finding. Each resource needs a name and a type, and can have up to three tags. Scrut stores resource names in lower case.
Email address of a user in your Scrut organization. An invalid email address, or one that doesn't match a user in your organization, returns 400.
Request Preview
Response
Response will appear here after sending the request
Authentication
Bearer token (JWT). Machine access token from POST /oauth/token. Send Authorization: Bearer $SCRUT_ACCESS_TOKEN on every /v1 request.
Headers
Client-generated key identifying one logical write. 1–128 characters; letters, numbers, and . _ ~ - only. Reuse the same key and body to retry safely. Reusing a key with a different body returns 409 idempotency_key_reused. Successful 2xx responses are replayed for 24 hours.
7c9e6679-7425-40de-944b-e07fc1f90ae7Body
A CVE ID, or VUL- followed by exactly four digits, for example VUL-5672. Any other format, such as GHSA-… or VUL-12345, returns 400. Matched without regard to case and stored in upper case. Scrut stores the finding as api#<vulnerabilityId> and returns it URL-encoded, for example api%23VUL-5672. Use the returned value as-is in GET and PATCH paths.
VUL-5672Stored in lower case. The Scrut app shows it in title case.
public s3 bucketBucket is world-readable.Block public ACLs.Open the bucket URL.criticalhighmediumlowSend closed to create a finding that's already closed.
openclosedacknowledgedyesnoResources affected by the finding. Each resource needs a name and a type, and can have up to three tags. Scrut stores resource names in lower case.
Email address of a user in your Scrut organization. An invalid email address, or one that doesn't match a user in your organization, returns 400.
jordan@example.com