Compliance ToolsAPICI/CDCompliance ScoreDevOpsAutomation

Using the Compliance Score API in CI/CD Pipelines

Gate deployments on your compliance score with SecureSpect's REST API — block releases when critical findings are open.

SecureSpect Team··7 min read

The Problem: Compliance Drift Between Audits

Most companies audit annually, which means compliance is measured once a year. Between audits, controls drift — access reviews get skipped, a new service launches without MFA, a dependency vulnerability sits open past its SLA. By the time the auditor arrives, the gap is significant.

The Compliance Score API solves this by making your compliance posture a real-time signal that your engineering team can act on continuously.

How the Compliance Score Works

SecureSpect calculates a compliance score (0–100) based on:

  • Percentage of controls passing across all connected integrations
  • Severity weighting (critical failures reduce the score more than medium ones)
  • Control coverage (ungated controls reduce the ceiling)
  • Recency (scores decay slightly for controls not checked in 48+ hours)

A score of 80+ is considered "audit-ready." A score below 60 indicates significant gaps.

API Authentication

The Compliance Score API uses Bearer token authentication. Generate a token in Settings → API Keys → Create API Key.

curl -X GET https://api.securespect.io/v1/compliance-score \

-H "Authorization: Bearer YOUR_API_KEY" \

-H "Content-Type: application/json"

Response:

{

"score": 87,

"status": "pass",

"critical_open": 0,

"high_open": 2,

"last_updated": "2026-10-14T08:23:00Z",

"breakdown": {

"access_control": 92,

"monitoring": 85,

"change_management": 88,

"availability": 100

}

}

GitHub Actions Integration

Gate deployments to production on a minimum compliance score:

name: Compliance Gate

on:

workflow_call:

jobs:

compliance-check:

runs-on: ubuntu-latest

steps:

- name: Check compliance score

run: |

SCORE=$(curl -s \

-H "Authorization: Bearer ${{ secrets.SECURESPECT_API_KEY }}" \

https://api.securespect.io/v1/compliance-score | jq '.score')

echo "Compliance score: $SCORE"

if [ "$SCORE" -lt 80 ]; then

echo "ERROR: Compliance score $SCORE is below threshold of 80"

exit 1

fi

CRITICAL=$(curl -s \

-H "Authorization: Bearer ${{ secrets.SECURESPECT_API_KEY }}" \

https://api.securespect.io/v1/compliance-score | jq '.critical_open')

if [ "$CRITICAL" -gt 0 ]; then

echo "ERROR: $CRITICAL critical findings are open"

exit 1

fi

echo "Compliance gate passed"

Filtering by Category

Get the score for a specific control category:

curl https://api.securespect.io/v1/compliance-score?category=access_control \

-H "Authorization: Bearer YOUR_API_KEY"

Compliance Score in Dashboards

The API also supports integration with monitoring dashboards. SecureSpect publishes a Datadog integration and a Grafana data source plugin for embedding the compliance score in your existing dashboards.

The compliance score metric can be used as an SLO target: "Compliance score stays above 80 for 99% of days."

Automate your SOC 2 evidence collection

Connect your AWS and GitHub environments and start collecting audit-ready evidence today. Free to start.

Start Free →More Articles