goat-cloud

goat-cloud

Every cloud resource has an owner, a purpose and a lifetime that anyone can look up.

Developers deploy from their own repositories with no central gate and no ticket. Each night a scan finds what has no owner or has outlived its stated expiry; its owner is warned, and it is removed.

Star on GitHub Try the demo Docs

git clone https://github.com/USAREUR-AF/goat-cloud && cd goat-cloud
pip install boto3 && python3 demo/serve.py

The dashboard on synthetic data at http://localhost:8888. No cloud account, no credentials, no AWS call. Open source · Apache-2.0 · AWS, Azure, Google Cloud.

Expired
ec2:instance
load-gen-1
Project
acme
Environment
dev
ManagedBy
terraform
Lifecycle
temporary
Repository
git.acme.example/acme/load-test-lab
ExpiresAt
3 days before the scan
A replay of the demo scan: the resources, their order and the findings are from demo/data/compliance-report.json, which python3 demo/generate.py writes. The tag is a drawing of the six facts on load-gen-1.
  • 6facts on every resource: project, environment, managing tool, lifecycle, repository, and an expiry when it is not meant to last
  • 8deployment tools take part on equal terms: Terraform, OpenTofu, Pulumi, CloudFormation, Serverless Framework, CDK, SAM, Copilot
  • 1,831tests pass from a fresh clone; none needs a cloud credential
  • 152 / 29resources and findings in one scan of the synthetic demo estate, from one command

The command or source behind each figure is in Try it.

The goat-cloud dashboard overview on synthetic data: 152 resources tracked, 16 high, 9 medium and 2 low severity findings, 14 pending destroys, and the last scan taking 38.2 seconds
A real capture: the dashboard overview, running on this repository's synthetic demo data. Select a capture to open it at full size.

What it is

Four small parts. Three properties.

A contract of tags that each repository applies in its own code. A registry in which each repository records where its infrastructure state lives. A nightly scan that compares what exists with what the repositories claim. Removal that runs only behind a warning, an approval and a deliberate switch.

Engineered

Ownership is written in code

Every repository states, in its own infrastructure code, what it owns and for how long. Nothing is entered in a console or a spreadsheet, and no central team edits a list when a repository joins.

Observable

Anyone can look it up

The scanner reads infrastructure state where it already lives and compares it with the account. Nothing is installed on a host and no deployment pipeline changes.

Regulated

Removal, behind gates

A resource that is unowned or expired does not stay because nobody got to it. Its owner is told, a period passes, and it goes. Removal is the part with the most safeguards.

Status

AWS is built and runs each night. Azure and Google Cloud scan; the rest is designed.

Built means the code is complete and usable today. Written means the document or code exists. Designed means the approach is decided and no code exists. On AWS the contract attaches to each resource; on Azure to the resource group; on Google Cloud to the project.

CapabilityAWSAzureGoogle Cloud
Build standard with a reference rootWritten, in use in productionWritten, reference root applied and destroyed onceWritten, reference root applied and destroyed once
Read-only scan and reportBuilt: nightly scannerBuilt: checked against a live subscriptionBuilt: checked against a live project
Ownership from registered stateBuiltDesignedDesigned
CostBuiltDesignedDesigned
Expiry teardownBuiltDesignedDesigned
Enforcement with approvalBuiltDesignedDesigned
DashboardBuiltDesignedDesigned

The table scrolls sideways. Source: the Cloud support table of the README. Every capability with its mechanism on each cloud: cloud parity. Kubernetes and bare metal are designed, not built.

What you see

Each finding names a resource, an owner and a cost.

Two checks decide what the scan reports

A resource is owned when a registered repository's state contains it. The scanner reads the state each registry entry points to; it never asks a deployment tool what it manages.

Two checks decide what the scanner reports for one resource A registered state claims it No registered state claims it Required tags present and valid Pass. No finding. Drift finding. Tagged, but no repository's state holds it. Required tags missing or invalid Tag finding. Owned, but its tags do not say by whom. Tag and drift findings. Made by hand.

From the concepts document. A diagram, not a capture. The figure scrolls sideways.

Findings

One finding is one problem with one resource, in one of four categories: tags, unclaimed resources, lifecycle and schedule. Each carries the resource, its state, its tags, its age, its estimated monthly cost and a recommendation.

The findings view on synthetic data: 27 non-compliant resources in a table with severity, type, name, enforcement state, region, contact, issue, monthly cost and age

A real capture, synthetic data.

Repositories

A repository joins by writing its own registry entry: its URL, its tool, where its state lives. No central list is edited. The view shows each repository's resources, findings and compliance rate.

The repositories view on synthetic data: seven registered repositories with tool, resource count, findings, compliance rate and lifecycle

A real capture, synthetic data: seven repositories using Terraform, the Serverless Framework, Pulumi and CDK.

Cost

A monthly estimate per resource, the total cost of everything with a finding, billed spend per service, and budget alerts at 50, 80, 100 and 120 percent of a limit.

The cost view on synthetic data: billed spend, estimated spend per resource, and the share that is compliant, non-compliant and unattributed

A real capture, synthetic data.

Deletion is off until an administrator turns it on

The function that warns owners has no delete permission. The executor is a second function with its own role, and it exists only while it is armed. Dry run is the default. Protected types, protected environments, a Protected tag and a protected list each stop a deletion.

A resource is deleted only after a warning, an approval and a deliberate arming 1 Scan HIGH finding 2 Warn owner told, 24 hours 3 Approve an administrator 4 Arm executor created 5 Delete approved only 6 Disarm executor removed

From the concepts document. A diagram, not a capture. The figure scrolls sideways.

Try it

The demo needs no account. A first report from AWS takes one Terraform root.

On your machine

The demo generates an invented estate and serves the dashboard against it. It needs Python 3.11 or newer and boto3, which the dashboard code imports.

Real output. Two of the 29 are notices of an expiry within 14 days, which the dashboard leaves out of its count of 27. The output scrolls sideways.

In your AWS account

The quick start creates one Terraform root that tags its own resources, registers itself and deploys the scanner, runs one scan and downloads the report. It deletes nothing. The quick start allows about 20 minutes and states a cost under 1 USD a month at that size.

module "compliance" {
  source = "git::https://github.com/USAREUR-AF/goat-cloud.git//modules/aws/compliance-tags?ref=v0.1.0"

  project         = "acme"
  environment     = "dev"
  repository_url  = "https://github.com/acme/example-repo"
  lifecycle_value = "persistent"
}

The tag module, from the onboarding guide. Quick start on AWS · Bring a repository under the contract

WhatNumberHow to check it
Facts in the contract6The contract table in concepts; the expiry is required when the lifecycle is temporary or experiment
Deployment tools on equal terms8The README, under "Engineered"
Tests, with no cloud credential1,831 passed, 4 skippedpip install -r requirements-dev.txt && pytest, run on a fresh clone of main
Demo scan152 resources, 29 findingspython3 demo/generate.py
Finding categories4The findings table in concepts
Wait between a warning and any deletion24 hoursgrace_period_hours, default 24, in the enforcement module

Measured on goat-cloud main at commit 43267b6.

Scope

One question: whose is this, and should it exist?

goat-cloud governs what shares one account, subscription or project. It has one contract and no rule language. It detects after creation; it does not refuse an untagged resource at creation, detect cost anomalies, optimize rates, or compare a claimed resource with its definition. The README names the tool to use for each of those.

Read

Concepts: the contract, the registry, findings, gates and cost. Turn on deletion safely.

Change it

CONTRIBUTING is the whole process. Every CI check is a command you can run locally.

Add a cloud

Scan an Azure subscription or a Google Cloud project with python -m goatcloud scan.

Report a vulnerability

Privately, as described in SECURITY. Not in a public issue.