Skip to main content

SOFE API Server — FinOps Policies as Code REST API

Project description

🟢 SOFE Server — FinOps Policy Engine API

REST API server for the SOFE (Stairway Open FinOps Engine). Wraps the SOFE Python engine in a FastAPI application, enabling HTTP-based evaluations.

Quick Start

pip install sofe sofe-server
sofe-server
# → http://localhost:8080

Or use the Go CLI:

sofe serve    # starts sofe-server in background
sofe evaluate # calls localhost:8080/evaluate

Endpoints

Method Path Description
GET /health Health check
POST /evaluate Evaluate AWS account against policies
POST /validate Validate a BYaML YAML file
GET /policies List all loaded policies
GET /collectors List available collectors
GET /metrics List metrics per collector
POST /connect/test Test STS AssumeRole connection

Usage

Evaluate your AWS account

curl -X POST http://localhost:8080/evaluate \
  -H "Content-Type: application/json" \
  -d '{"aws_profile": "default"}'

With cross-account role

curl -X POST http://localhost:8080/evaluate \
  -H "Content-Type: application/json" \
  -d '{
    "role_arn": "arn:aws:iam::123456789012:role/SOFEReadOnlyRole",
    "external_id": "sofe-abc123"
  }'

List policies

curl http://localhost:8080/policies

Docker

docker run -p 8080:8080 -v ~/.aws:/root/.aws:ro \
  ghcr.io/breakingthecloud/sofe-community:latest

Architecture

sofe-server (this repo)
    │
    │ imports
    ▼
sofe/ (engine — pip install sofe)
    │
    │ boto3
    ▼
Your AWS Account (read-only)

sofe-server is a thin wrapper — all logic lives in the sofe engine.

Requirements

  • Python 3.11+
  • sofe >= 0.2.0 (engine)
  • AWS credentials (profile or role)

Development

git clone https://github.com/breakingthecloud/sofe-server.git
cd sofe-server
uv venv && source .venv/bin/activate
uv pip install -e ".[dev]" -e ../sofe/
uvicorn sofe_server.app:app --reload --port 8080

Related Projects

Project Description
sofe Python engine (collectors + policies)
sofe-cli Go CLI (19 commands, TUI)
sofe-action GitHub Action for CI/CD
platform.sofe.dev SaaS dashboard (free tier)
sofe.dev/docs Documentation (26 pages)

License

Apache 2.0 — see LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sofe_server-0.1.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sofe_server-0.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file sofe_server-0.1.0.tar.gz.

File metadata

  • Download URL: sofe_server-0.1.0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for sofe_server-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a674823890062d1f11c63b471f77282fa5fbf39d13bcebf3a5e4f47d50e40c60
MD5 a72785bc9764691913a4805a8a84b092
BLAKE2b-256 c630ea56c208705df89dcd1049b6e2c863d576abb7f90faca3278d712e33c023

See more details on using hashes here.

File details

Details for the file sofe_server-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sofe_server-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for sofe_server-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 59074b7aca0c632dee910c715dae3f887465a9d9f8add802038f73762c0fd9ed
MD5 c9d4633049a3870ad45dca64dbaf1027
BLAKE2b-256 84737bf66240a6eee21dfa1e90a6ef8c4423c746ec441992a98f5a3f7adb7d5e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page