-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1106 from uc-cdis/feat/DCF-1446-mfa-arborist-poli…
…cy-assignment feat(DCF-1446): Assign MFA policy on login
- Loading branch information
Showing
29 changed files
with
562 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Fence Multifactor Authentication Guide | ||
|
||
Fence is capable of using token claims from IdPs to identify when multifactor authentication (MFA) was used during the authentication process. | ||
|
||
## File Level Enforcement | ||
To restrict access to files to user who've authenticated with MFA, the following resource *MUST* be present in the indexd record's `authz`: | ||
`/multifactor_auth` | ||
|
||
And the following configs must be updated: | ||
- fence-config.yaml | ||
- user.yaml | ||
|
||
### fence-config.yaml changes | ||
|
||
MFA claim checking is configured on a per-IdP basis. For a given IdP, define the name of the claim in the id_token and is possible values that indicate MFA. If the id_token claim value matches at least one value in the configured multifactor_auth_claim_info.values, then "/multifactor_auth" resource will be assigned to the user. | ||
|
||
For example, Okta may issue the following id_token when MFA is used: | ||
``` | ||
{ | ||
"amr": ["otp", "pwd"], | ||
"aud": "6joRGIzNCaJfdCPzRjlh", | ||
"auth_time": 1311280970, | ||
"exp": 1311280970, | ||
"iat": 1311280970, | ||
"idp": "00ok1u7AsAkrwdZL3z0g3", | ||
"iss": "https://$" | ||
"jti": "Tlenfse93dgkaksginv", | ||
"sub": "00uk1u7AsAk6dZL3z0g3", | ||
"ver": 1 | ||
} | ||
``` | ||
|
||
And fence-config.yaml is configured as follows: | ||
``` | ||
OPENID_CONNECT: | ||
okta: | ||
client_id: 'redacted' | ||
client_secret: 'redacted' | ||
multifactor_auth_claim_info: | ||
claim: 'amr' | ||
values: [ "mfa", "otp", "sms" ] | ||
``` | ||
|
||
Then fence will assign the "/multifactor_auth" resource to the user in Arborist. | ||
|
||
### user.yaml changes | ||
The `mfa_policy` policy and `multifactor_auth` resource must be added to user.yaml so the appropriate policy and resource are created in arborist when usersync runs. | ||
|
||
NOTE: The role_ids provided here are an example and should be changed to the appropriate arborist roles for the commons. | ||
|
||
Add the following to the `resources` section: | ||
```yaml | ||
- name: multifactor_auth | ||
``` | ||
Add the following the `policies` section: | ||
```yaml | ||
- id: mfa_policy | ||
role_ids: | ||
- read-storage | ||
- read | ||
resource_paths: | ||
- /multifactor_auth | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,6 +111,9 @@ OPENID_CONNECT: | |
user_id_field: '' # optional (default "sub"); claims field to get the user_id from | ||
email_field: '' # optional (default "email"); claims field to get the user email from | ||
scope: '' # optional (default "openid") | ||
multifactor_auth_claim_info: # optional, include if you're using arborist to enforce mfa on a per-file level | ||
claim: '' # claims field that indicates mfa, either the acr or acm claim. | ||
values: [ "" ] # possible values that indicate mfa was used. At least one value configured here is required to be in the token | ||
# These Google values must be obtained from Google's Cloud Console | ||
# Follow: https://developers.google.com/identity/protocols/OpenIDConnect | ||
# | ||
|
@@ -181,6 +184,9 @@ OPENID_CONNECT: | |
client_secret: '' | ||
redirect_url: '{{BASE_URL}}/login/ras/callback' | ||
scope: 'openid email profile ga4gh_passport_v1' | ||
# multifactor_auth_claim_info: | ||
# claim: 'acr' | ||
# values: [ 'https://stsstg.nih.gov/assurance/aal/2' ] | ||
# if mock is true, will fake a successful login response for login | ||
# WARNING: DO NOT ENABLE IN PRODUCTION (for testing purposes only) | ||
mock: false | ||
|
@@ -207,6 +213,9 @@ OPENID_CONNECT: | |
# WARNING: DO NOT ENABLE IN PRODUCTION (for testing purposes only) | ||
mock: false | ||
mock_default_user: '[email protected]' | ||
# multifactor_auth_claim_info: | ||
# claim: 'amr' | ||
# values: [ "mfa", "otp", "rsa", "ngcmfa", "wiaormfa" ] | ||
# For information on configuring an Okta tenant as an OIDC IdP refer to Okta documentation at: | ||
# https://developer.okta.com/docs/reference/api/oidc/#2-okta-as-the-identity-platform-for-your-app-or-api | ||
okta: | ||
|
@@ -215,6 +224,9 @@ OPENID_CONNECT: | |
client_secret: '' | ||
redirect_url: '{{BASE_URL}}/login/okta/login/' | ||
scope: 'openid email' | ||
# multifactor_auth_claim_info: | ||
# claim: 'amr' | ||
# values: [ "mfa", "otp", "sms" ] | ||
cognito: | ||
# You must create a user pool in order to have a discovery url | ||
discovery_url: 'https://cognito-idp.{REGION}.amazonaws.com/{USER-POOL-ID}/.well-known/openid-configuration' | ||
|
@@ -241,6 +253,9 @@ OPENID_CONNECT: | |
# WARNING: DO NOT ENABLE IN PRODUCTION (for testing purposes only) | ||
mock: false | ||
mock_default_user: 'http://cilogon.org/serverT/users/64703' | ||
# multifactor_auth_claim_info: | ||
# claim: 'acr' | ||
# values: [ "https://refeds.org/profile/mfa" ] | ||
synapse: | ||
discovery_url: '' | ||
client_id: '' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.