Create a configuration rule directly from a finding (mark-as-original)
curl --request POST \
--url https://{tenant}.earnie.dev/v1/findings/{findingId}/actions/create-rule \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reason": "<string>"
}
'import requests
url = "https://{tenant}.earnie.dev/v1/findings/{findingId}/actions/create-rule"
payload = { "reason": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: '<string>'})
};
fetch('https://{tenant}.earnie.dev/v1/findings/{findingId}/actions/create-rule', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenant}.earnie.dev/v1/findings/{findingId}/actions/create-rule",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenant}.earnie.dev/v1/findings/{findingId}/actions/create-rule"
payload := strings.NewReader("{\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{tenant}.earnie.dev/v1/findings/{findingId}/actions/create-rule")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.earnie.dev/v1/findings/{findingId}/actions/create-rule")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"finding": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"domain_slug": "<string>",
"title": "<string>",
"evidence": {
"kind": "oss-diff",
"local_file": "<string>",
"local_line_start": 123,
"local_line_end": 123,
"oss_file": "<string>",
"oss_line_start": 123,
"oss_line_end": 123,
"purl": "<string>",
"match_percent": 123,
"algorithm": "<string>",
"oss_file_path": "<string>",
"spans": [
{
"local_line_start": 123,
"local_line_end": 123,
"oss_line_start": 123,
"oss_line_end": 123
}
],
"match_type": "file"
},
"produced_by": {
"kind": "user",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"state": "open",
"domain": "oss",
"severity": "critical",
"suppressed": true,
"version": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"purpose": "confidentiality",
"export_signals": [
{
"regime": "<string>",
"regime_version": "<string>",
"vintage": "current",
"test": "<string>",
"state": "met",
"provenance_ref": "<string>"
}
],
"location": {
"purl": "<string>",
"path": "<string>",
"line": 123,
"end_line": 123
},
"producer_kind": "repo",
"producer_ref": "<string>",
"previous_severity": "critical",
"previous_severity_scan_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"severity_change_reason": "rescan_lowered",
"enrichments": {
"component": {
"release_date": "2023-11-07T05:31:56Z",
"latest_release_date": "2023-11-07T05:31:56Z",
"age_days": 1,
"versions_behind": 1,
"status": "<string>"
},
"license": {
"spdx_id": "<string>",
"name": "<string>",
"url": "<string>",
"copyleft": true,
"category": "permissive",
"dual_licensed": true,
"source": "<string>"
},
"vulnerabilities": [
{
"kev": true,
"known_ransomware": true,
"fixed_versions": [
"<string>"
],
"cwe": [
"<string>"
],
"cve_id": "<string>",
"cvss_score": 123,
"cvss_vector": "<string>",
"epss_score": 123,
"epss_percentile": 123,
"severity": "critical",
"source": "<string>",
"published": "2023-11-07T05:31:56Z",
"modified": "2023-11-07T05:31:56Z"
}
],
"geoprovenance": {
"countries": [
"<string>"
],
"locations": [
{
"country": "<string>",
"percentage": 123
}
]
},
"model": {
"derivation": {
"parents": [
"<string>"
],
"is_adapter": true,
"transform_kind": "<string>",
"adapter_type": "<string>",
"evidence_source": "<string>",
"source": "<string>"
},
"datasets": [
"<string>"
],
"bias": [
"<string>"
],
"curation": {
"audit_status": "<string>",
"declared_license": "<string>",
"source": "<string>"
},
"model_card": {
"structured": {
"ethical_considerations": [
"<string>"
],
"authors": [
"<string>"
],
"intended_use": "<string>",
"technical_limitations": "<string>",
"paper_url": "<string>"
},
"source": "<string>"
},
"shards": [
{
"filename": "<string>",
"sha256": "<string>",
"size_bytes": 123
}
],
"name": "<string>",
"author": "<string>",
"architecture": "<string>",
"model_type": "<string>",
"parameter_count": 123,
"quantization": "<string>",
"license": "<string>",
"organization": "<string>",
"source": "<string>",
"considerations": {
"ethical_considerations": [
"<string>"
],
"fairness_assessments": [
"<string>"
],
"environmental_considerations": [
"<string>"
],
"source": "<string>"
},
"modality": "<string>",
"info_code": "<string>",
"info_message": "<string>"
},
"remediation": {
"purl": "<string>",
"version": "<string>",
"coverage": "assessed",
"signals": [
{
"dimension": "vulnerability",
"kind": "<string>",
"effect": "blocking",
"fact": "<string>",
"evidence": [
{
"label": "<string>",
"url": "<string>"
}
]
}
],
"confidence": 0.5,
"confidence_reasons": [
"<string>"
],
"assessed_at": "2023-11-07T05:31:56Z",
"source": {
"provider": "<string>",
"version": "<string>"
},
"priority": "fix_now",
"action": {
"kind": "upgrade",
"upgrade_pain": "none",
"summary": "<string>",
"target_version": "<string>",
"replacement_purl": "<string>"
}
}
},
"resolution_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scan_only": true,
"pending_resolution": {
"reason_slug": "<string>",
"reason_display_name": "<string>",
"justification": "<string>",
"status": "pending_review",
"suppresses": true,
"decided_by": {
"kind": "user",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"decided_at": "2023-11-07T05:31:56Z",
"decided_by_display": "<string>"
}
},
"rule_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}findings
Create a configuration rule directly from a finding (mark-as-original)
Creates a configuration rule for the given finding without going through the pending-review queue. Derives the rule scope from the finding unless an explicit scope override is supplied. Requires findings:write permission.
POST
/
v1
/
findings
/
{findingId}
/
actions
/
create-rule
Create a configuration rule directly from a finding (mark-as-original)
curl --request POST \
--url https://{tenant}.earnie.dev/v1/findings/{findingId}/actions/create-rule \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"reason": "<string>"
}
'import requests
url = "https://{tenant}.earnie.dev/v1/findings/{findingId}/actions/create-rule"
payload = { "reason": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({reason: '<string>'})
};
fetch('https://{tenant}.earnie.dev/v1/findings/{findingId}/actions/create-rule', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenant}.earnie.dev/v1/findings/{findingId}/actions/create-rule",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'reason' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{tenant}.earnie.dev/v1/findings/{findingId}/actions/create-rule"
payload := strings.NewReader("{\n \"reason\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{tenant}.earnie.dev/v1/findings/{findingId}/actions/create-rule")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenant}.earnie.dev/v1/findings/{findingId}/actions/create-rule")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"finding": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"org_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"domain_slug": "<string>",
"title": "<string>",
"evidence": {
"kind": "oss-diff",
"local_file": "<string>",
"local_line_start": 123,
"local_line_end": 123,
"oss_file": "<string>",
"oss_line_start": 123,
"oss_line_end": 123,
"purl": "<string>",
"match_percent": 123,
"algorithm": "<string>",
"oss_file_path": "<string>",
"spans": [
{
"local_line_start": 123,
"local_line_end": 123,
"oss_line_start": 123,
"oss_line_end": 123
}
],
"match_type": "file"
},
"produced_by": {
"kind": "user",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"state": "open",
"domain": "oss",
"severity": "critical",
"suppressed": true,
"version": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"purpose": "confidentiality",
"export_signals": [
{
"regime": "<string>",
"regime_version": "<string>",
"vintage": "current",
"test": "<string>",
"state": "met",
"provenance_ref": "<string>"
}
],
"location": {
"purl": "<string>",
"path": "<string>",
"line": 123,
"end_line": 123
},
"producer_kind": "repo",
"producer_ref": "<string>",
"previous_severity": "critical",
"previous_severity_scan_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"severity_change_reason": "rescan_lowered",
"enrichments": {
"component": {
"release_date": "2023-11-07T05:31:56Z",
"latest_release_date": "2023-11-07T05:31:56Z",
"age_days": 1,
"versions_behind": 1,
"status": "<string>"
},
"license": {
"spdx_id": "<string>",
"name": "<string>",
"url": "<string>",
"copyleft": true,
"category": "permissive",
"dual_licensed": true,
"source": "<string>"
},
"vulnerabilities": [
{
"kev": true,
"known_ransomware": true,
"fixed_versions": [
"<string>"
],
"cwe": [
"<string>"
],
"cve_id": "<string>",
"cvss_score": 123,
"cvss_vector": "<string>",
"epss_score": 123,
"epss_percentile": 123,
"severity": "critical",
"source": "<string>",
"published": "2023-11-07T05:31:56Z",
"modified": "2023-11-07T05:31:56Z"
}
],
"geoprovenance": {
"countries": [
"<string>"
],
"locations": [
{
"country": "<string>",
"percentage": 123
}
]
},
"model": {
"derivation": {
"parents": [
"<string>"
],
"is_adapter": true,
"transform_kind": "<string>",
"adapter_type": "<string>",
"evidence_source": "<string>",
"source": "<string>"
},
"datasets": [
"<string>"
],
"bias": [
"<string>"
],
"curation": {
"audit_status": "<string>",
"declared_license": "<string>",
"source": "<string>"
},
"model_card": {
"structured": {
"ethical_considerations": [
"<string>"
],
"authors": [
"<string>"
],
"intended_use": "<string>",
"technical_limitations": "<string>",
"paper_url": "<string>"
},
"source": "<string>"
},
"shards": [
{
"filename": "<string>",
"sha256": "<string>",
"size_bytes": 123
}
],
"name": "<string>",
"author": "<string>",
"architecture": "<string>",
"model_type": "<string>",
"parameter_count": 123,
"quantization": "<string>",
"license": "<string>",
"organization": "<string>",
"source": "<string>",
"considerations": {
"ethical_considerations": [
"<string>"
],
"fairness_assessments": [
"<string>"
],
"environmental_considerations": [
"<string>"
],
"source": "<string>"
},
"modality": "<string>",
"info_code": "<string>",
"info_message": "<string>"
},
"remediation": {
"purl": "<string>",
"version": "<string>",
"coverage": "assessed",
"signals": [
{
"dimension": "vulnerability",
"kind": "<string>",
"effect": "blocking",
"fact": "<string>",
"evidence": [
{
"label": "<string>",
"url": "<string>"
}
]
}
],
"confidence": 0.5,
"confidence_reasons": [
"<string>"
],
"assessed_at": "2023-11-07T05:31:56Z",
"source": {
"provider": "<string>",
"version": "<string>"
},
"priority": "fix_now",
"action": {
"kind": "upgrade",
"upgrade_pain": "none",
"summary": "<string>",
"target_version": "<string>",
"replacement_purl": "<string>"
}
}
},
"resolution_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"scan_only": true,
"pending_resolution": {
"reason_slug": "<string>",
"reason_display_name": "<string>",
"justification": "<string>",
"status": "pending_review",
"suppresses": true,
"decided_by": {
"kind": "user",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"decided_at": "2023-11-07T05:31:56Z",
"decided_by_display": "<string>"
}
},
"rule_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}{
"code": "<string>",
"message": "<string>"
}Authorizations
An Earnie API key, sent as Authorization: Bearer sk_earnie_.... Create one under Settings > API keys. The key's scopes decide which operations it may call.
Path Parameters
Body
application/json