Require a second factor for administrative changes
Step-up makes an administrative role apply only to a sign-in that
proved a second factor. A role binding carries a step-up condition,
and the binding admits a person only when the acr claim of their token
is a multi-factor level. A person who signed in with a password alone
keeps their account and their own devices, and is asked to sign in again
with a second factor at the moment they administer something.
This page covers the bindings in a tenant’s administration audience: which of them must carry the condition, how each tool asks for the second factor, and how an administrator sets one up.
Before you begin
Section titled “Before you begin”- Home administration turned on for the tenant. Turning it on creates the administration audience and its step-up condition. See Let your directory administer your tenant.
- Identity server 1.97.0 or later for the write-time rule on Guard’s administrative roles.
- Guard control plane 0.32.0 or later and console 0.55.0 or later for the changes that ask for a second factor when you make them.
awctl0.45.1 or later forawctl auth login --acr-values.- Terraform provider 0.36.0 or later for
step_up_condition_idonauthwise_tenant_home_administration. - A second factor available in the realm your administrators sign in to. See Set up a second factor.
How step-up works
Section titled “How step-up works”The administration audience of a tenant holds one step-up condition, named
administration.stepUp. It admits a token whose acr claim is one of
these values:
urn:authwise:acr:2phrphrh
A binding that carries the condition grants its role only to such a token. For a token below that level, the binding doesn’t apply, and the call is refused as if the person held no role.
The acr claim is the sign-in’s own. A request can’t claim a higher level
than the sign-in proved.
Guard adds a second check on a short list of changes. Those changes refuse a person’s sign-in that has no second factor, whatever the binding says. For the list, see Changes that need a second factor.
Which bindings carry the condition
Section titled “Which bindings carry the condition”In a tenant’s administration audience, the identity server checks every
binding of a Guard administrative role when the binding is created or
changed. The check applies to every writer: the console, awctl,
Terraform, and Guard’s own API.
| Role | Where you bind it | A user or a group | A service account |
|---|---|---|---|
guardcontrol.tenantAdmin | The tenant only: guardcontrol.tenant/TENANT_ID | Must carry the tenant’s step-up condition | No condition |
guardcontrol.networkAdmin | One network only: guardcontrol.network/NETWORK_ID | Must carry the tenant’s step-up condition | No condition |
guardcontrol.viewer | The tenant or one network | No condition, or the tenant’s step-up condition | No condition |
A binding that doesn’t fit is refused with INVALID_ARGUMENT, and the
message names the anchor or the condition to use. A binding of
guardcontrol.tenantAdmin or guardcontrol.networkAdmin to a person is
also refused while the tenant has no step-up condition.
The rule is checked only when a binding is written. A binding that was written before the rule keeps working until you save it again.
The roles administration.admin, administration.identity, and
administration.viewer take no condition or the same step-up condition.
See
Require multi-factor sign-in.
Grant a Guard administrative role
Section titled “Grant a Guard administrative role”In the console
Section titled “In the console”To grant a role from Guard’s own page, follow these steps:
- In the console, go to Guard’s People page.
- Under Roles, find Grant a role.
- Select the role: Tenant administrator, Network administrator, or Viewer.
- For a network administrator, select the network in Network. For a viewer, select The whole tenant or a network in Where.
- Select a person or a group.
- Click Grant, followed by the role’s name, for example Grant Tenant administrator.
Guard writes the binding with its anchor and, for an administrator, the step-up condition.
The Grant access dialog on the tenant’s Access page applies the same rule in its Condition field:
| Binding | What Condition offers |
|---|---|
| A person as tenant administrator or network administrator | Step-up (second factor), fixed |
| A person as viewer | No condition or Step-up (second factor) |
| A service account | No condition |
If the tenant has no step-up condition, the field says so and the role can’t be granted to a person. Turn home administration on again for the tenant, and then grant the role.
With awctl
Section titled “With awctl”awctl guard people grant-role --role tenantAdmin \ --subject-type group --subject-id GROUP_ID --tenant-id TENANT_IDawctl guard people grant-role --role networkAdmin --network-id NETWORK_ID \ --subject-type user --subject-id USER_ID --tenant-id TENANT_IDawctl guard people list-role-grants --tenant-id TENANT_IDReplace GROUP_ID with the group’s ID (g-…), USER_ID with the user’s
ID (u-…), TENANT_ID with the tenant, and NETWORK_ID with the
network’s ID or short name.
--role takes tenantAdmin, networkAdmin, viewer, or the full
guardcontrol.… name. tenantAdmin and networkAdmin carry the
administration audience’s step-up condition. A role at the wrong kind of
target is refused before anything is written.
With Terraform
Section titled “With Terraform”The step-up condition’s ID is the step_up_condition_id attribute of
authwise_tenant_home_administration. Pass it as the condition_id of
the authwise_access_binding:
resource "authwise_access_binding" "guard_admin" { issuer_id = authwise_tenant_home_administration.this.issuer_id audience_id = authwise_tenant_home_administration.this.audience_id subject_type = "user" subject_id = "USER_ID" role_name = "guardcontrol.tenantAdmin" resource_type = "guardcontrol.tenant" resource_id = authwise_tenant_home_administration.this.tenant_id condition_id = authwise_tenant_home_administration.this.step_up_condition_id}Replace USER_ID with the user’s ID (u-…).
For guardcontrol.networkAdmin, set resource_type to
guardcontrol.network and resource_id to the network’s ID (n-…).
guardcontrol.viewer takes either anchor, with or without condition_id.
step_up_condition_id is null for a tenant that has no step-up condition.
The identity server then refuses the binding and says how to create the
condition.
For a service account, set subject_type = "client" and leave
condition_id out.
Sign in with a second factor in the console
Section titled “Sign in with a second factor in the console”The console asks for the second factor only when you need it.
When you open Guard’s administration with a role that carries the step-up condition, and your sign-in has no second factor, the page shows Sign in again with a second factor in place of the administrative view. Click Sign in again. After the sign-in, the console returns you to the same page.
When you make one of the changes that need a second factor, the console asks before it sends the change:
- Start the change, for example revoking a trusted issuer. The console opens the Sign in again with a second factor dialog.
- Click Sign in again, and complete your second factor at your sign-in page.
- Back in the console, the same dialog or form opens again with what you entered. Confirm the change once more. Nothing runs by itself after the sign-in.
If you have no second factor yet, click Set up a second factor in the dialog. It opens your account page.
If the sign-in can’t prove a second factor, the console returns you to the page with the message Your organization couldn’t verify a second factor for this sign-in. If you have none set up, ask its administrator how to add one.
Sign in with a second factor in awctl
Section titled “Sign in with a second factor in awctl”When a change needs a stepped-up sign-in, awctl stops with
STEP_UP_REQUIRED and prints the sign-in to run:
awctl auth login --acr-values "urn:authwise:acr:2 phr phrh"Complete your second factor in the browser, and then run the original
command again. If you normally sign in with --issuer and --client-id,
add the same two flags.
The login checks the result. If the token’s acr isn’t one of the values
you asked for, the command fails with signed in, but not stepped up and
names the acr it received. Check that your account has a second factor,
and run the login again.
Reading never needs a stepped-up sign-in.
Set up a second factor
Section titled “Set up a second factor”To add a second factor to your own account, follow these steps:
- Go to your account page at
ISSUER_URL/account/, whereISSUER_URLis the address of the issuer you sign in at, for examplehttps://login.example.com/account/. - Open Two-step verification.
- Under Add a method, select a method and complete the setup.
If the page offers no method, the realm has no factor turned on. An administrator of the realm adds one:
- In the console, go to Realms and open the realm.
- Open the Factors tab.
- Click Add factor, and complete the form.
Service accounts
Section titled “Service accounts”A service account signs in with client credentials, and its token has no
acr. For that reason:
- A service account’s binding carries no condition. The identity server refuses a Guard administrative binding to a client that names one.
- A service account is never refused with
STEP_UP_REQUIRED.
Run Terraform and other automation with a service account. When Terraform
runs on a person’s awctl auth login sign-in that isn’t stepped up, the
changes that need a second factor fail at apply with PERMISSION_DENIED
and the reason STEP_UP_REQUIRED.
See Service accounts.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Cause and fix |
|---|---|
INVALID_ARGUMENT: a person bound … must carry the administration audience's step-up condition … | The binding of guardcontrol.tenantAdmin or guardcontrol.networkAdmin to a user or a group has no condition, or a different one. Set the condition the message names. |
INVALID_ARGUMENT: a person bound … must carry this tenant's step-up condition, and the tenant has none | The tenant has no step-up condition. Enable home administration again to create it, and then write the binding. |
INVALID_ARGUMENT: a client bound … carries no condition | The binding of a service account names a condition. Remove the condition. |
INVALID_ARGUMENT: … is bound at …, not at … | The role is at the wrong anchor. Bind guardcontrol.tenantAdmin at the tenant and guardcontrol.networkAdmin at one network. |
awctl stops with STEP_UP_REQUIRED | The change needs a stepped-up sign-in. Run the awctl auth login --acr-values command that the message prints, and then repeat the command. |
awctl auth login --acr-values fails with signed in, but not stepped up | The issuer didn’t ask for a second factor. Set up a second factor on your account, and run the login again. |
| The console shows Sign in again with a second factor every time you open Guard’s administration | Your role carries the step-up condition and your sign-in has no second factor. Click Sign in again. If you have no second factor, set one up first. |
A Terraform apply fails with STEP_UP_REQUIRED | Terraform is running on a person’s sign-in. Run it with a service account. |
What’s next
Section titled “What’s next”- Let your directory administer your tenant to create the administration audience and its step-up condition.
- Let machines join with a trusted issuer for the Guard changes that ask for a second factor.
- Service accounts for automation.