The Simplest Way to Make Github and SAML Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

You pair github and saml to control who can read and write code. This setup lets your team log in with one main work account. When someone joins your company, your identity tool grants them code rights. When they leave, you turn off one account and block all code changes. This workflow stops former staff from keeping active keys on their laptops. How github and saml handle sign-in and roles GitHub acts as the service provider that holds your code and build pipelines. Your SAML provider acts

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

You pair github and saml to control who can read and write code. This setup lets your team log in with one main work account.

When someone joins your company, your identity tool grants them code rights. When they leave, you turn off one account and block all code changes. This workflow stops former staff from keeping active keys on their laptops.

How github and saml handle sign-in and roles

GitHub acts as the service provider that holds your code and build pipelines. Your SAML provider acts as the source of truth for user identities. When a developer tries to log in, GitHub sends a request out. The identity tool checks the user and sends back a signed XML note.

That signed note proves who the user is to your code host. It also carries group names that map to specific team roles in GitHub. You can map a group to read roles, write roles, or admin roles. This keeps your role setup in one central place for every team.

Developers still use personal tokens and SSH keys for terminal git commands. With SAML turned on, users must link each key to their SAML identity. Until they authorize a key through single sign-on, GitHub blocks that key. When the central identity ends, those linked keys stop working right away.

Common failure modes and how to scope roles

Many teams turn on single sign-on in a weak test mode first. They forget to force SAML for every member of the code group. This leaves a back door open for users with old passwords. You should enforce SAML across the whole group after testing one admin account.

Shared bot accounts cause another huge security gap in many build setups. Teams create a fake user, skip SAML for it, and share the token. When that token leaks, no log shows which person ran the bad command. Instead, use short-lived app tokens scoped to one repo and one job.

SAML 2.0 + GitHub Actions Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Broad personal tokens also break the safety of your single sign-on setup. Engineers often create tokens with full write rights and no end date. If a bad actor steals that token, they can copy every private repo. Set strict end dates on all keys and limit them to single repos.

Network paths and audit logs also need tight rules between both tools. Limit code pulls and pushes to known office or VPN IP ranges. Send sign-in logs and repo events to a central log store every day. Check those logs for failed sign-in tries and strange token creation events.

How to keep daily git workflows fast and safe

Security rules fail when they make daily coding too slow for developers. If SAML sessions expire every hour, engineers will look for unsafe workarounds. Set session lengths to match a normal work day for your staff. Pair that session rule with a strong device check at sign-in time.

Keep your group mappings clean and simple inside your identity tool. Create clear groups for readers, writers, and owners of each main codebase. Review these groups every quarter to remove people who changed teams. Good hygiene in your identity tool keeps your code host clean and safe.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.

First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

What happens to existing SSH keys when we turn on SAML?

Existing SSH keys and personal tokens stay on the user account at first. Each developer must authorize their existing keys through a quick SAML sign-in flow.

How do we recover access if our identity provider goes down?

Group owners should download and save recovery codes in a safe password vault. Those codes let an admin log in and fix broken SAML settings.

Can bots and build servers use SAML to pull code?

Build servers cannot click through a browser sign-in screen to use SAML. Use dedicated GitHub Apps with scoped permissions for automated build and deploy jobs.

The query runs. The emails stay hidden.