Home / Security tooling

scp-guardrails

Build AWS service control policies from a short spec and lint them for lockouts and statements that deny nothing.

Python · MIT · latest v0.3.0

What it is

scp-guardrails builds AWS Organizations service control policies from a short spec (region allowlist, protected roles, deny leaving the org, deny disabling CloudTrail and GuardDuty, deny root, require IMDSv2, deny public S3 ACLs, spend denies) under the SCP size limit, lints existing SCPs for the mistakes that lock you out or do nothing, and runs as a GitHub Action.

For cloud and platform engineers who run multi-account AWS organizations, and for whoever reviews SCP changes. Quick start (Python 3.11 or newer; the second line fetches the example spec):

pipx install git+https://github.com/basitalisandhu/scp-guardrails
curl -fsSLO https://raw.githubusercontent.com/basitalisandhu/scp-guardrails/main/examples/spec.yaml
scp-guardrails build --spec spec.yaml --out scps && scp-guardrails lint scps/

Output of those commands, as run on 2026-10-20:

scp-01.json: 4138/10240 chars, guardrails: allowed_regions, deny_disable_security_services, deny_iam_users_outside, deny_leave_organization, deny_public_s3_acls, deny_root_user, require_imdsv2
  statements: DenyLeaveOrganization, DenyRootUser, ProtectCloudTrail, ProtectGuardDuty, ProtectSecurityHub, ProtectConfig, DenyOutsideAllowedRegions, DenyIamUsersOutsideIdentityAccount, RequireImdsv2OnLaunch, DenyImdsOptionChanges, DenyImdsv1RoleCredentials, DenyPublicS3CannedAcls, ProtectAccountPublicAccessBlock
wrote 1 document(s), manifest.json and SUMMARY.md to scps
Review every document and test it on a non-production OU before attaching it.
skipped scps/manifest.json: not an SCP document (no Statement)
scps/scp-01.json: 4138/10240 chars, 0 finding(s)
1 file(s), 0 finding(s): 0 high, 0 medium, 0 low.

Install

pip install scp-guardrails                                                              # once published to PyPI
pipx install git+https://github.com/basitalisandhu/scp-guardrails                        # the scp-guardrails command, isolated
uvx --from git+https://github.com/basitalisandhu/scp-guardrails scp-guardrails --help   # run without installing

From the README; see the full README for every option.

Releases

More in Security tooling

All tools

Topics: aws, aws-organizations, aws-security, cli, cloud-security, devsecops, github-actions, guardrails, hacktoberfest, iam, landing-zone, linter, policy-as-code, python, sarif, scp, security-tools, service-control-policies