Organization security policies: require SSO, two-step verification and an IP allowlist

Setting up single sign-on is the first half of the job. The second half is making sure nobody keeps using a password, that a stolen laptop's session doesn't last for months, and that an API token leaked on a public CI log can't be used from the other side of the world. That's what organization security policies are for.

The rules

RulePlanApplies to
Require single sign-onTeam, Enterprisesigned-in people, except organization admins
Require two-step verificationEnterprisesigned-in people, admins included
Session limit (1 hour to 90 days)Enterprisesigned-in people
Idle timeout (15 minutes to 30 days)Enterprisesigned-in people
IP allowlist (up to 100 addresses or CIDR ranges, IPv4 and IPv6)Enterprisepeople, personal API tokens, organization API tokens

Require single sign-on

A session that didn't come through your organization's identity provider is signed out with "Your organization requires single sign-on. Sign in again with SSO." The rule can only be turned on while an SSO connection is enabled.

Admins are exempt on purpose: they keep their password as a way back in if the identity provider breaks. Make sure those admins have two-step verification.

Guests from other companies can't use your identity provider. For a guest whose email isn't on one of your verified domains, the rule asks for two-step verification instead. See guest access for contractors.

Require two-step verification

A session without a second factor can only reach the setup screens until the person sets up an authenticator app. An SSO session counts as verified, since your identity provider owns the second step. The admin who turns the rule on must have two-step verification (or SSO) in their own session, so nobody locks themselves out by accident.

Session limit and idle timeout

  • Session limit: a session older than the limit must sign in again, however active it is. Eight or twelve hours is common for "a working day".
  • Idle timeout: a session with no activity for longer than the timeout is signed out. It's tracked to about a minute.

Both apply to people in the app. API tokens are not sessions and aren't affected.

IP allowlist

Calls from addresses outside the list are refused, for people and for both kinds of API tokens. That makes a leaked token useless outside your network. Typical entries: your office ranges, your VPN's egress addresses and your CI runners' addresses.

To prevent the obvious mistake, an admin can't save a list that leaves out their own current address.

What happens on save

Servers pick up the new policy within seconds. Sessions that break a new rule are refused on their next call. To make everyone sign in again right away (after turning on SSO, say), the card offers Sign everyone else out, and Members' sessions in Settings lists sessions individually. See sessions and devices.

Turning a rule on doesn't revoke personal API tokens made earlier; revoke them in Settings ▸ API tokens if that matters for you.

A refused call carries a clear reason (sso_required, mfa_required, session_expired, session_idle, ip_not_allowed), so the apps can tell people what to do instead of showing a generic error.

Audit

Every change is in the audit log with the policy before and after. The Security policies compliance report lists the current rules and the SSO and two-step verification report lists who meets them. See compliance reports.

If the plan lapses

A rule the plan no longer includes stays stored but isn't enforced, so a lapsed plan never locks anyone out. It can be switched off, not turned on or changed.