Skip to content

Latest commit

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

SOFE Action

Run FinOps policy evaluations in CI/CD
Cloud mode (live AWS scan) or Terraform mode (pre-deploy plan scan).

Quick Start · Inputs · How It Works · Ecosystem

MarketplaceLicenseCloud + TerraformPRs


Catch cost violations before they reach production. Two modes:

  • Cloud mode: Scan live AWS resources for idle resources, tagging violations, and savings
  • Terraform mode: Scan tfplan.json pre-deploy to catch policy violations before terraform apply
- uses: breakingthecloud/sofe-action@v2with:
api-key: ${{ secrets.SOFE_API_KEY }}fail-on: high

Quick Start — Cloud Mode

- uses: breakingthecloud/sofe-action@v2with:
api-key: ${{ secrets.SOFE_API_KEY }}mode: cloudfail-on: high

Quick Start — Terraform Mode

- run: terraform plan -out=tfplan && terraform show -json tfplan > tfplan.json
- uses: breakingthecloud/sofe-action@v2with:
api-key: ${{ secrets.SOFE_API_KEY }}mode: terraformplan-file: tfplan.jsonfail-on: high

Full Example — Terraform FinOps Gate

name: FinOps Pre-Deploy Gateon: pull_requestjobs:
terraform-scan:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
- name: Terraform Planrun: | cd infra/ terraform init && terraform plan -out=tfplan terraform show -json tfplan > tfplan.json - name: SOFE Pre-Deploy Scanuses: breakingthecloud/sofe-action@v2id: sofewith:
api-key: ${{ secrets.SOFE_API_KEY }}mode: terraformplan-file: infra/tfplan.jsonfail-on: high
- name: Comment findings on PRif: always() && github.event_name == 'pull_request'uses: actions/github-script@v7with:
script: | const findings = '${{ steps.sofe.outputs.findings-count }}'; const resources = '${{ steps.sofe.outputs.resources-scanned }}'; const failed = '${{ steps.sofe.outputs.failed }}'; const icon = failed === 'true' ? '❌' : '✅'; github.rest.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, issue_number: context.issue.number, body: `## ${icon} SOFE Terraform Scan\n| Metric | Value |\n|--------|-------|\n| Resources scanned | ${resources} |\n| Findings | ${findings} |\n| Status | ${failed === 'true' ? 'FAILED (high+ severity)' : 'PASSED'} |` })

Full Example — Cloud Mode

name: FinOps Gateon: [push, pull_request]jobs:
sofe-evaluate:
runs-on: ubuntu-lateststeps:
- uses: breakingthecloud/sofe-action@v2id: sofewith:
api-key: ${{ secrets.SOFE_API_KEY }}mode: cloudfail-on: high
- name: Comment findings on PRif: github.event_name == 'pull_request'uses: actions/github-script@v7with:
script: | github.rest.issues.createComment({ owner: context.repo.owner, repo: context.repo.repo, issue_number: context.issue.number, body: `## SOFE FinOps Report\n- Findings: ${{ steps.sofe.outputs.findings-count }}\n- Resources scanned: ${{ steps.sofe.outputs.resources-scanned }}` })

Inputs

InputDescriptionRequiredDefaultModes
api-keySOFE API key (sk_sofe_xxx)both
modecloud or terraformcloud
plan-filePath to tfplan.json✅ (tf)terraform
fail-onFail if findings ≥ severity(none)both
resource-typesFilter resource typesallcloud
formatOutput: table, json, markdowntableboth
versionCLI version to installlatestcloud

Outputs

OutputDescription
findings-countNumber of findings detected
resources-scannedNumber of resources scanned
failedtrue if fail-on threshold was exceeded

How It Works

Cloud Mode

  1. Installs the SOFE CLI binary
  2. Runs sofe evaluate --cloud with your API key
  3. SOFE evaluates your connected AWS account
  4. Returns findings + optional pipeline failure

Terraform Mode

  1. Reads your tfplan.json file (no CLI install needed)
  2. POSTs it to api.sofe.dev/terraform/scan
  3. Evaluates 6 pre-deploy policies (tags, sizing, encryption, etc.)
  4. Returns findings + optional pipeline failure

Key advantage: Same policies work pre AND post deploy. Write once, enforce everywhere.

Terraform Policy Examples

PolicyWhat it catches
require-cost-tagsResource without owner/env/costcenter tag
no-oversized-stagingLarge instance in non-prod environment
s3-encryption-requiredBucket without SSE configured
no-public-s3Bucket with public access
rds-multi-az-prodProduction RDS without Multi-AZ
naming-conventionResource not following naming standard

Migration from v1

-- uses: breakingthecloud/sofe-action@v1+- uses: breakingthecloud/sofe-action@v2
with:
api-key: ${{ secrets.SOFE_API_KEY }}
+ mode: cloud
fail-on: high

Prerequisites

  • SOFE account at platform.sofe.dev
  • API key (add as SOFE_API_KEY secret in your repo)
  • Cloud mode: AWS account connected in the SOFE platform
  • Terraform mode: terraform show -json output as .json file

Ecosystem

ProjectDescription
sofePython engine (collectors + policies)
sofe-serverREST API server
sofe-cliGo CLI (19 commands, TUI)
platform.sofe.devSaaS dashboard (free tier)
sofe.dev/docsDocumentation

License

Apache 2.0 — see LICENSE.


sofe.dev · Engine · finoptix.dev

Catch cost violations before they reach production.

About

GitHub Action for SOFE — evaluate FinOps policies in CI/CD pipelines.

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors