Skip to content

0020: Access policy: named allowlist, MFA, short session ​

Context ​

ADR 0012 put Cloudflare Access with Managed OAuth in front of /mcp, with a policy allowing rob.duncan@getmy.group only. The Product Owner's auth definition of done (2026-09-29) asks for a named allowlist, MFA and a short session, written up as an ADR before any Cloudflare change. The app side is done in PR #44: it verifies the Access token (signature, issuer, audience, expiry), takes identity only from it, and refuses with 403, logged, anyone who is not a principal in the database, so a mistake in the Access policy still does not let a stranger in.

Decision ​

Two gates, each enough on its own to refuse a stranger:

  1. Cloudflare Access, application GetMy Books MCP:
    • Named allowlist. One Allow policy listing people by exact email address. No domain, group or "everyone" rules. Today that is fraser.duncan@feaw.co.uk and rob.duncan@feaw.co.uk, the addresses the app knows them by. Adding a person means amending this ADR, the policy and src/platform/migrations/0005-access-grants.sql together.
    • Entra only. The policy requires the login method to be the getmy.group Entra provider, so no other identity provider (such as one-time PIN) can satisfy it.
    • MFA required in the Access policy itself. The policy requires the authentication method mfa, which Access checks from the identity provider's amr claim. Entra ID (tenant getmy.group) must require MFA for the getmy-books-cloudflare-access app registration, through a Conditional Access policy or security defaults, so the claim is present.
    • Short session. Application session duration of 8 hours: one working day, after which Access asks for a fresh sign-in (and MFA). Shorter would make the Claude connector ask several times a day.
  2. The app: a signed-in person must also exist as a principal with an entity_access grant for the organisation, enforced by row-level security in Postgres (PR #44).

Applied on 2026-09-29 ​

Approved by the Product Owner on 2026-09-29, with Fraser added and an 8-hour session, and MFA required in the Access policy, not only in Entra.

Final policy on the Access application GetMy Books MCP (mcp.getmy.group, team feaw), the only policy on it:

SettingValue
NameNamed people, Entra with MFA
DecisionAllow
Includeemail fraser.duncan@feaw.co.uk; email rob.duncan@feaw.co.uk
Requirelogin method: the "GetMy (getmy.group)" Entra provider; authentication method: mfa
Excludenone
Application session8h
Identity providers allowed"GetMy (getmy.group)" only

Before this change the one policy, "Owner only", allowed rob.duncan@getmy.group with no require rules, and the session was 24h. The application's OAuth settings (dynamic client registration, Claude's callbacks) were not changed.

How it was applied: through the Cloudflare API, with a short-lived token the Product Owner created for this change only, scoped to Access Apps and Policies edit and Identity Providers read on the FEAW account. The Product Owner deleted it afterwards.

Entra fix: the first sign-in failed with "Failed to fetch user/group information from the identity provider": the app registration getmy-books-cloudflare-access had no API permissions. The Product Owner added the Microsoft Graph delegated permissions openid, email, profile, offline_access, User.Read, Directory.Read.All and GroupMember.Read.All, and granted admin consent for GetMy.

Test: on 2026-09-29 at 10:11 UTC, fraser.duncan@feaw.co.uk signed in through Access with Entra and MFA and reached the origin, which answered Error 1033 (tunnel down, expected while the app is not deployed). Ray ID a42a34223d5577c8. So Entra passes the amr claim and the MFA rule stays.

Still to do: Rob can sign in only once rob.duncan@feaw.co.uk is added as a guest in the getmy.group Entra tenant. His old sign-in, rob.duncan@getmy.group, is no longer on the allowlist.

Consequences ​

  • A person needs both a place on the Access allowlist and a principal row. A gap in either one refuses them.
  • Onboarding WealthTechPros or anyone else means an Access policy change, a principal row and an entity_access grant, recorded here.
  • Not in scope here: checking the amr claim in the app as well. Access enforces it at the edge, and the app already rejects any token Access did not sign.
  • The app knows each person by their feaw.co.uk address, so the Access identity and the app principal are the same email (option (a), chosen 2026-09-29), and the audit log names one identity per person.