Remediation Agent
Internal endpoints for remediation-agent plugins and account-scoped STO base-image approval lookup
List the approved variants of one or more base images across an account (not scoped to org/project). Customers scan base images manually as their own container targets and approve variants via the target variant status update; this lookup does not depend on base image auto-detection (STO_BASE_IMAGE_DETECTION). For each requested target name, returns every variant of the container target with that name whose base image status is approved, newest scan first, de-duplicated. Variant strings are the bare parameters.variant value (for example 3.21), not the STO UI display form (tag: 3.21); tag: and branch: prefixes are stripped. Duplicate request names are collapsed; results follow request order and always contain one entry per distinct name. Does not pick a single upgrade tag.
Harness Account ID
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$STO container test target names to look up (for example alpine). Matched exactly; duplicates are collapsed
["alpine","ubuntu"]OK response.
BadRequest: Bad Request response.
Unauthorized: Unauthorized response.
Forbidden: Forbidden response.
TooManyRequests: Too Many Requests response.
InternalServerError: Internal Server Error response.
POST /gateway/sto/api/v2/remediation-agent/base-image-approval?accountId=abcdef1234567890ghijkl HTTP/1.1
Host: app.harness.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 35
{
"targetNames": [
"alpine",
"ubuntu"
]
}{
"results": [
{
"approvedVariants": [
{
"lastScanned": 1714521600,
"variant": "3.21"
},
{
"lastScanned": 1714521600,
"variant": "3.21"
},
{
"lastScanned": 1714521600,
"variant": "3.21"
}
],
"targetName": "alpine"
},
{
"approvedVariants": [
{
"lastScanned": 1714521600,
"variant": "3.21"
},
{
"lastScanned": 1714521600,
"variant": "3.21"
},
{
"lastScanned": 1714521600,
"variant": "3.21"
}
],
"targetName": "alpine"
}
]
}Diff the validation execution's scan against the original scan's ignore set. Resolves validationScanId from validationExecutionId (account-scoped — validation pipeline may live in a different org/project than the original scan), derives the original scan's ignored occurrences (every occurrence on the original scan minus the in-scope ones for the scoped issue type, same computation as ListOccurrencesInScope), and removes those (matched by fingerprint) from the validation scan. Remaining occurrences are split into existingOccurrences (fingerprint also present in original in-scope) and newOccurrences (introduced on the validation scan).
Harness Account ID
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$Harness Organization ID
example_orgPattern: ^[A-Za-z_][A-Za-z0-9_]*$Harness Project ID
example_projectPattern: ^[A-Za-z_][A-Za-z0-9_]*$Original STO scan id
scan111111111111111111Pattern: ^[a-zA-Z0-9_-]{22}$Validation pipeline execution id
exec111111111111111111Legacy: when true and onlyTruePositiveIssueTypes is empty, apply TP filter to all resolved issueTypes. Prefer onlyTruePositiveIssueTypes for per-type Exclude False Positives.
falseExample: falseWhen true, exclude occurrences whose reachability is 'unreachable' (SAST). Missing/unknown reachability stays in scope.
falseExample: falseMaximum number of occurrences
1000Example: 8379Glob patterns matching target.name on repository targets
["sf0","jak","c74"]Restrict scope to these issue ids (issue.id). Empty = no restriction.
["sfi","ic0","6xb"]Harness personal or service access token
Consequatur asperiores aut consequatur quia consequuntur.OK response.
4106540942799589400existingCount + newCount
68272668346043120005561975453252969000scan222222222222222222Pattern: ^[a-zA-Z0-9_-]{22}$BadRequest: Bad Request response.
Unauthorized: Unauthorized response.
Forbidden: Forbidden response.
TooManyRequests: Too Many Requests response.
InternalServerError: Internal Server Error response.
GET /gateway/sto/api/v2/remediation-agent/diff-occurrences?accountId=abcdef1234567890ghijkl&orgId=example_org&projectId=example_project&scanId=scan111111111111111111&validationExecutionId=exec111111111111111111 HTTP/1.1
Host: app.harness.io
X-Api-Key: YOUR_API_KEY
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"existingCount": 4890454813826552000,
"existingOccurrences": [
{
"issueId": "issue11111111111111111",
"issueTitle": "SQL Injection",
"issueType": "SAST",
"occurrenceDetails": "Et magni odit libero repudiandae.",
"occurrenceInternalId": 2002,
"severityCode": "HIGH"
},
{
"issueId": "issue11111111111111111",
"issueTitle": "SQL Injection",
"issueType": "SAST",
"occurrenceDetails": "Et magni odit libero repudiandae.",
"occurrenceInternalId": 2002,
"severityCode": "HIGH"
},
{
"issueId": "issue11111111111111111",
"issueTitle": "SQL Injection",
"issueType": "SAST",
"occurrenceDetails": "Et magni odit libero repudiandae.",
"occurrenceInternalId": 2002,
"severityCode": "HIGH"
},
{
"issueId": "issue11111111111111111",
"issueTitle": "SQL Injection",
"issueType": "SAST",
"occurrenceDetails": "Et magni odit libero repudiandae.",
"occurrenceInternalId": 2002,
"severityCode": "HIGH"
}
],
"matchedCount": 2798979288219303000,
"newCount": 7750807919324539000,
"newOccurrences": [
{
"issueId": "issue11111111111111111",
"issueTitle": "SQL Injection",
"issueType": "SAST",
"occurrenceDetails": "Et magni odit libero repudiandae.",
"occurrenceInternalId": 2002,
"severityCode": "HIGH"
},
{
"issueId": "issue11111111111111111",
"issueTitle": "SQL Injection",
"issueType": "SAST",
"occurrenceDetails": "Et magni odit libero repudiandae.",
"occurrenceInternalId": 2002,
"severityCode": "HIGH"
},
{
"issueId": "issue11111111111111111",
"issueTitle": "SQL Injection",
"issueType": "SAST",
"occurrenceDetails": "Et magni odit libero repudiandae.",
"occurrenceInternalId": 2002,
"severityCode": "HIGH"
},
{
"issueId": "issue11111111111111111",
"issueTitle": "SQL Injection",
"issueType": "SAST",
"occurrenceDetails": "Et magni odit libero repudiandae.",
"occurrenceInternalId": 2002,
"severityCode": "HIGH"
}
],
"validationScanId": "scan222222222222222222"
}List (issue, occurrence) tuples for the remediation pre-plugin. Scoped to one scan and issue type; optionally filters to TRUE_POSITIVE triage verdicts.
Harness Account ID
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$Harness Organization ID
example_orgPattern: ^[A-Za-z_][A-Za-z0-9_]*$Harness Project ID
example_projectPattern: ^[A-Za-z_][A-Za-z0-9_]*$STO scan id
scan111111111111111111Pattern: ^[a-zA-Z0-9_-]{22}$Optional STO target id
target1111111111111111Pattern: ^[a-zA-Z0-9_-]{22}$Legacy: when true and onlyTruePositiveIssueTypes is empty, apply TP filter to all resolved issueTypes. Prefer onlyTruePositiveIssueTypes for per-type Exclude False Positives.
falseExample: falseWhen true, exclude occurrences whose reachability is 'unreachable' (SAST). Missing/unknown reachability stays in scope.
falseExample: falseMaximum number of occurrences
1000Example: 9809Glob patterns matching target.name on repository targets
["ig4","stc","9ml"]Restrict scope to these issue ids (issue.id). Empty = no restriction.
["mz1","s3e","eur"]OK response.
Occurrence internal IDs excluded from scope because they already have remediation agent augmentation for this target variant
[7973917382933212000,3048718097675218400]Uncapped SUM(issue_scan.num_occurrences) for the scoped issue type on the scan; not limited by the result list cap
3181632451803633000BadRequest: Bad Request response.
Unauthorized: Unauthorized response.
Forbidden: Forbidden response.
TooManyRequests: Too Many Requests response.
InternalServerError: Internal Server Error response.
GET /gateway/sto/api/v2/remediation-agent/occurrences-in-scope?accountId=abcdef1234567890ghijkl&orgId=example_org&projectId=example_project&scanId=scan111111111111111111 HTTP/1.1
Host: app.harness.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"ignoredOccurrenceIds": [
7933169035579455000,
6867027967431410000,
8605073441667216000
],
"originalOccurrenceCount": 4345483215435471000,
"results": [
{
"issueId": "issue11111111111111111",
"issueTitle": "SQL Injection",
"issueType": "SAST",
"occurrenceDetails": "Et magni odit libero repudiandae.",
"occurrenceInternalId": 2002,
"severityCode": "HIGH"
},
{
"issueId": "issue11111111111111111",
"issueTitle": "SQL Injection",
"issueType": "SAST",
"occurrenceDetails": "Et magni odit libero repudiandae.",
"occurrenceInternalId": 2002,
"severityCode": "HIGH"
}
]
}Atomically upsert per-occurrence remediation rows for one agent run. STO Core resolves in-scope occurrences for originalScanId (same query as ListOccurrencesInScope, using the same RemAgentScopeFilters from sto-plugins) and stamps pullRequestMetadata onto each issue_augmentation row. Run-level rollup counts on this payload are stored for audit/UI; the post-plugin ALSO posts the same counts to ssca-manager agentResults for the Agents Executions tab (same split as FP triage).
Harness Account ID
abcdef1234567890ghijklPattern: ^[a-zA-Z0-9_-]{22}$Harness Organization ID
example_orgPattern: ^[A-Za-z_][A-Za-z0-9_]*$Harness Project ID
example_projectPattern: ^[A-Za-z_][A-Za-z0-9_]*$original + new_introduced - remediated
8284459238533817000Glob patterns matching target.name on repository targets
["x40","y27","p8u"]When true, exclude occurrences whose reachability is 'unreachable' (SAST). Missing/unknown reachability stays in scope.
falseExample: falseRestrict scope to these issue ids (issue.id). Empty = no restriction.
["9bp","m4b","4av"]When true, create a summary ticket after persist (still requires project External Tickets settings). Mirrors agent.jiraEnabled / pipeline setting jira_enabled. Default false when unset (older plugins omit → no ticket). Result is written to remediation_agent_summary.notification_metadata.jira {creationEnabled, ticketId, ticketUrl}.
falseExample: trueMaximum number of occurrences
1000Example: 8773us4New findings introduced by the fix branch that were not in the original scope
8958288031106543000Occurrences with verdict REMEDIATED
1688229898222595300Legacy: when true and onlyTruePositiveIssueTypes is empty, apply TP filter to all resolved issueTypes. Prefer onlyTruePositiveIssueTypes for per-type Exclude False Positives.
falseExample: falseIn-scope occurrence count from the pre-plugin (original_occurrence_count)
6654595133128232000STO scan id the agent remediated
scan111111111111111111Pattern: ^[a-zA-Z0-9_-]{22}$o2xRun-level PR stamp (PascalCase keys matching types.PullRequestMetadata): Provider, AccountID, OrgID, ProjectID, RepositoryName, Number, Title, SourceBranch, TargetBranch, Url, CommentUrl, BuildId, CommitsCount, ConnectorRef. ConnectorRef (SCM connector that opened the PR) enables live status refresh. BuildId = TRIGGERING_PIPELINE_BUILD_NUMBER (not parsed from SourceBranch). CommitsCount = fix commits on the PR. Copied onto issue_augmentation.pr_metadata for every in-scope occurrence.
Enim totam recusandae voluptatem.Target id the agent remediated; supplied by the plugin
target1111111111111111Pattern: ^[a-zA-Z0-9_-]{22}$Target name the agent remediated; supplied by the plugin
pv4Target variant name the agent remediated; supplied by the plugin
4xl4878067008882298000Opaque ssca-manager workflow execution id
k81OK response.
remediation_agent_summary.internal_id for this run
6856567302341357000External ticket key/id (e.g. Jira STO-34219) when ticket creation succeeds; omit when not created
STO-34219URL of the summary ticket created for this remediation run, when ticket creation succeeds
https://jira.example.com/browse/STO-123Number of per-occurrence augmentation rows written
429411489281479230BadRequest: Bad Request response.
Unauthorized: Unauthorized response.
Forbidden: Forbidden response.
TooManyRequests: Too Many Requests response.
InternalServerError: Internal Server Error response.
POST /gateway/sto/api/v2/remediation-agent/results/batch?accountId=abcdef1234567890ghijkl&orgId=example_org&projectId=example_project HTTP/1.1
Host: app.harness.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 1008
{
"activeOccurrenceCount": 1905069439744297200,
"excludeRepoPatterns": [
"jfm",
"ben",
"cli"
],
"excludeUnreachable": false,
"issueIds": [
"bro",
"8da",
"3by"
],
"issueTypes": [
"SECRET",
"SAST",
"SCA",
"SAST"
],
"jiraEnabled": false,
"limit": 4742,
"modelName": "vn1",
"newOccurrenceIntroducedCount": 325278836991922200,
"occurrenceRemediatedCount": 5362431424184966000,
"onlyTruePositive": true,
"onlyTruePositiveIssueTypes": [
"SAST",
"SECRET",
"SAST",
"SECRET"
],
"originalOccurrenceCount": 5094687477339663000,
"originalScanId": "scan111111111111111111",
"promptVersion": "n2m",
"pullRequestMetadata": "Quasi et.",
"severityCodes": [
"LOW",
"MEDIUM"
],
"targetId": "target1111111111111111",
"targetName": "bzm",
"targetVariantName": "ny1",
"userScanActiveCount": 1632754644395087400,
"validationMetadata": {
"build": {
"executionId": "2zz",
"orgId": "h2h",
"pipelineId": "qni",
"projectId": "kb5",
"status": "laq"
},
"remediation": {
"executionId": "06w",
"orgId": "a5g",
"pipelineId": "2f9",
"projectId": "qvo",
"scanId": "scan222222222222222222",
"status": "pxs"
}
},
"workflowExecutionId": "7vf"
}{
"summaryId": 7900509402511571000,
"ticketId": "STO-34219",
"ticketUrl": "https://jira.example.com/browse/STO-123",
"written": 5344232660940647000
}Last updated
Was this helpful?