Authorization
Identity provider
H2O AI Hybrid Cloud (H2OAIC) utilizes a compatible OpenID Connect (OIDC) provider, such as Keycloak, to authenticate and authorize users in both the App Store and Wave apps. This allows for easy integration and federation with other services like SAML and LDAP.
User roles
The actions a user may perform within the H2O AI Hybrid Cloud depends on the user's role, as documented in the Authorization section of the user guide.
The user's role is based on the OIDC access token claims returned by the identity provider.
This is configurable via RoleClaim, AdminRoleName, and FullAccessRoleName in
App Store configuration.
App Store server OIDC configuration
The following chart describes the various configuration options which may be either set within
the [OIDC] section of the server configuration ConfigMap TOML, or set via environment variables.
The environment variable names in the table below need to be prefixed with H2O_CLOUD_OIDC_:
| TOML Key / Environment variable | Description | Default |
|---|---|---|
ClientID CLIENT_ID | Confidential client ID for authenticating browser requests | (empty) |
ClientSecret CLIENT_SECRET | Confidential client secret for authenticating browser requests | (empty) |
CLIClientID CLI_CLIENT_ID | Public client ID for authenticating CLI requests | (empty) |
WaveClientID WAVE_CLIENT_ID | Confidential client ID used by Apps to authenticate users. If empty, OIDC authentication is disabled for apps. | (empty) |
WaveClientSecret WAVE_CLIENT_SECRET | Confidential client secret used by Apps to authenticate users. If empty, OIDC authentication is disabled for apps. | (empty) |
WaveRedirectPath WAVE_REDIRECT_PATH | Callback address for the OIDC provider to redirect the user after app authentications | /_auth/callback |
RedirectURL REDIRECT_URL | Callback address for the OIDC provider to redirect the user to after authentication | http://localhost:8889/oauth2/callback |
ProviderURL PROVIDER_URL | URL of OIDC provider | http://localhost:8080/auth/realms/master |
EndSessionURL END_SESSION_URL | URL to redirect the user to terminate their OIDC session | http://localhost:8080/auth/realms/master/protocol/openid-connect/logout |
RoleClaim ROLE_CLAIM | Access token claim containing the user's roles | realm_access.roles |
AdminRoleName ADMIN_ROLE_NAME | Role name assigned to administrators within the OIDC provider | admin |
FullAccessRoleName FULL_ACCESS_ROLE_NAME | Role assigned to users with "full access". If empty, all users have full access. | (empty) |
Scopes SCOPES | OIDC scopes to be granted | (empty) |
CLI authentication
All users have access to use the CLI, however, what they can do depends on the category of the user. An offline Open ID Connect (OIDC) refresh token,
generated by the user by visiting /auth/get-token, is used to generate access tokens to authenticate each request from the CLI to the
App Store server. The CLI stores the refresh token, in addition to its other configuration, on the user's machine at ~/.h2oai/h2o-cli-config.toml.
To configure the CLI, users will need four pieces of information:
- The address of the server that the CLI will connect to
- The OpenID Connect (OIDC) provider URL to obtain access tokens
- The public OpenID Client ID designated for CLI access
- A refresh token, generated by the user by visiting
/auth/get-tokenwhile logged in to the AI App Store web interface
Workspaces
AuthZ is the H2O AI Cloud authorization service that manages workspaces, roles, and role bindings. When AuthZ is enabled for your deployment, the App Store adds a workspace check for app instances on top of the App Store rules described in this guide. A request is allowed only if both the workspace check and the App Store rules allow it. See the Workspaces section in the user guide for how this looks to users.
-
Only app instances belong to a workspace. Apps, tags, secrets, and aliases are global to the App Store.
-
Instances started through the API without a workspace are placed in the
appstoreworkspace (workspaces/appstore, shown as "Appstore Workspace" in the workspace switcher). In the UI, instances are placed in the workspace selected in the switcher, which defaults to the user's Personal Workspace. -
The App Store registers two AuthZ actions that a role can grant on a workspace:
Action Required for actions/appstore/instances/READListing and viewing instances, and opening an instance's UI through the App Store router actions/appstore/instances/WRITERunning an app in the workspace, and updating, suspending, or terminating instances -
Grant these actions through roles and role bindings on the workspace. See Identity and Access Management.
-
To let every user run and view instances in the
appstoreworkspace, add an AuthZ policy that grants all users (users/*) both actions on the resource//workspaceserver/workspaces/appstore. -
Public instances are allowed by default. While they are allowed, anyone with the URL can open a
PUBLICinstance's UI. This skips both the workspace check and sign-in. Public instances can be disabled for your deployment. -
Workspace checks don't apply to the admin pages or the
h2o adminCLI. See Administrators.
When AuthZ is disabled, workspace checks are skipped and every instance belongs to the appstore workspace.
Visitors
Visitors are users without "full access". They have limited permissions within the platform, and tags are used to give them access to specific apps based on their OIDC roles.
Visitors exist only when a full-access role is configured for your deployment. Users with that OIDC role have full access, and all other users are visitors. If no full-access role is configured, all users have full access.
Each tag can have visitor roles and admin roles, set with the --visitor-roles and --admin-roles options of
h2o tag update. See Updating tags in the CLI documentation.
- Users with one of a tag's admin roles can assign that tag to apps or remove it.
- Visitors with one of a tag's visitor roles can see the
ALL_USERSapps that the tag is assigned to. They can run taggedALL_USERSandPUBLICapps that use theON_DEMANDinstance lifecycle. If a tag has no visitor roles, no visitors get access through it.- Example: Visitor
UAhas roleRA, visitorUBhas roleRB, tagTAhas visitor rolesRA, RC, tagTBhas visitor rolesRB, appA1has no tags, appA2has tagTA, appA3has tagsTA, TBbut isPRIVATE. In this case, userUAcan see and run appA2, whileUBcan't see or run any apps.
- Example: Visitor
- Visitors can also see
PUBLICapps without a tag, but they still need a matching tag to run them. - Visitors see their own instances. They can also see
ALL_USERSandPUBLICinstances ofMANAGEDandEXTERNALapps that are visible to them through a tag. This is how visitors use shared managed instances. - Visitors can't see app or instance logs, not even for their own instances.
- Visitors can't import apps into the platform.
- Visitors can't see tags, tag assignments, or secrets.
- By default, each visitor can have up to 5 instances, and each instance is suspended automatically one week after it starts. These limits can be changed for your deployment.
Workspace checks apply to visitors in the same way as to other users.
Administrators
Users who log in with the administrator OIDC role configured for your deployment are granted administrator access to the
AI App Store. Administrators can use the admin pages within the App Store and the admin subcommand of the CLI.
Within the App Store, the admin Apps page lists every app imported into the App Store, regardless of its visibility, and lets administrators delete specific versions of apps. The admin App Instances page lists every running instance known to H2O AI Cloud, and lets administrators terminate specific instances of apps.
Administrators work across all workspaces: the admin pages and the h2o admin CLI aren't subject to workspace checks.
The admin API doesn't give access to an app's UI, so administrators can't open the UI of another user's PRIVATE instance.
Administrators also can't act on behalf of another user, for example to import or run an app as them.
The h2o admin command in the CLI provides administrators with several commands, such as:
h2o admin app <get|list|delete>- Manage apps owned by all usersh2o admin instance <get|list|status|terminate>- Manage and inspect running app instances for all usersh2o admin secret <create|delete|get|list|update>- Manage application secrets including global secretsh2o admin tag <assign|create|delete|get|list|remove|update>- Manage application tagsh2o admin iam <delete|export|get|import|list>- Manage IAM policies
Identity and Access Management (IAM) policies
Note: IAM policies are currently in beta and aren't enabled by default.
See the Identity and Access Management guide for how to manage IAM policies, roles, and role bindings from the admin UI, including the Roles screen for managing roles and the permissions they grant.
Exceptions to normal authorization rules can be granted by leveraging IAM policies, which can be authored in JSON and imported or exported from the platform by using the admin iam CLI subcommand.
IAM policies apply to one or more resources and contain one or more statements. The policy resource limits the scope of the statements being evaluated. Statements may have the effect of either allowing or denying the request. If any one statement in any policy denies the action, then the entire request is denied.
The following is a sample IAM policy that grants users with the OIDC role SUPPORT the ability to list and view logs for all instances regardless of instance owner and visibility setting:
{
"resources": ["*"],
"statements": [
{
"subjects": ["role:SUPPORT"],
"actions": ["instance:view_log", "instance:read"],
"attributes": [],
"effect": "allow"
}
]
}
Wave application instance access controls
The App Store server enforces access restrictions on which users can access running applications. Each request is checked against the instance's workspace and its visibility. See the App instances section in the user guide for details.
Wave application user authentication
Wave applications can run as both single user instances and as multi-user instances. Multi-user instances requires users to
first authenticate with a supported OpenID Connect (OIDC) provider. The OIDC session created with the Wave application is
independent to the App Store user session (including the relevant OIDC client settings and tokens).
The App Store provides an opt-in mechanism to pass OpenID Connect (OIDC) endpoint,
client, and client secret to Wave applications upon start up.
The WaveClientID and WaveClientSecret values in the App Store configuration
must be set to enable OIDC integration.
See Wave's documentation for more.
- Submit and view feedback for this page
- Send feedback about AI App Store to cloud-feedback@h2o.ai