Skip to main content
Technology|DevOps Engineer / Platform Engineer

CI/CD Security Gate

Check public deployment security before promotion

Check public deployment security before promotion. Use the API workflow below to collect dated findings, review their scope, and decide which follow-up checks your team needs.

Implementation example by the EdgeDNS team · Updated

The Challenge

A successful build can still deploy missing headers, unexpected certificates, or weaker HTTPS configuration.

The Solution

Run header, SSL, HSTS, and security-score checks against a publicly reachable deployment. Define failure criteria from the actual response fields, handle API errors separately from target failures, and account for endpoint caching before using a result to block promotion.

Endpoints Used

Combine these EdgeDNS endpoints to build this solution.

GET
/v1/security/headersAPI reference

Security Headers: Analyze HTTP security headers, score, and compliance

GET
/v1/domain/sslAPI reference

SSL Certificate: Analyze active SSL/TLS certificate details

GET
/v1/score/securityAPI reference

Security Score: Composite security score from 10 weighted factors

GET
/v1/domain/hstsAPI reference

HSTS Preload: Check HSTS policy and preload status

What this workflow helps you do

Define explicit release criteria

Choose the header and certificate findings that matter to your service.

Handle incomplete checks

Retry or require review when an upstream check is unavailable.

Keep deployment evidence

Archive responses with the release identifier.

Code Example

Check public deployment security before promotion

javascript
const headers = { Authorization: 'Bearer YOUR_API_KEY' };
const checks = [
  {
    "path": "/v1/security/headers",
    "params": {
      "url": "https://example.com"
    }
  },
  {
    "path": "/v1/domain/ssl",
    "params": {
      "domain": "example.com"
    }
  },
  {
    "path": "/v1/score/security",
    "params": {
      "domain": "cloudflare.com"
    }
  }
];

// Run sequentially to keep concurrency bounded. API tier restrictions apply.
for (const { path, params } of checks) {
  const url = new URL(path, 'https://api.edgedns.dev');
  url.search = new URLSearchParams(params).toString();
  const response = await fetch(url, { headers });
  const result = await response.json();
  if (!response.ok) {
    throw new Error(`${path}: ${response.status} ${result.error?.message ?? 'Request failed'}`);
  }
  // Keep the response metadata and any partial/unknown findings for review.
  console.log(path, result);
}

Learn More

Explore industry standards and best practices related to this use case.

Ready to build CI/CD Security Gate?

Get started with 200 free API requests per month. No credit card required.

Other Use Cases

CI/CD Security Gate for Domains | EdgeDNS