Creating a SAML app in Yandex Identity Hub for integration with OpenVPN Access Server
Note
This feature is at the Preview stage.
For your organization's users to be able to authenticate in OpenVPN Access Server via SAML
OpenVPN Access Server is built on and compatible with the OpenVPN open-source version
SAML apps can be managed by users with the organization-manager.samlApplications.admin role or higher.
To grant access to OpenVPN Access Server to the users of your organization:
- Get OpenVPN Access Server ready.
- Create an app in Identity Hub.
- Set up the integration.
- Make sure the application works correctly.
Get OpenVPN Access Server ready
You can use an OpenVPN Access Server installation of your own, an SaaS version, or create a VM with OpenVPN Access Server in Yandex Cloud.
Creating a VM with OpenVPN Access Server in Yandex Cloud
-
In the management console
, select the folder where you want to create your VM. -
In the list of services, select Compute Cloud.
-
In the left-hand panel, select
Virtual machines. -
Click Create virtual machine.
-
Under Boot disk image, specify
OpenVPN Access Serverin the Product search field and select the OpenVPN Access Server image. -
Under Location, select the availability zone.
-
Under Access, select SSH key and specify the VM access credentials:
- In the Login field, enter the username:
yc-user. -
In the SSH key field, select the SSH key saved in your organization user profile.
If there are no SSH keys in your profile or you want to add a new key:
-
Click Add key.
-
Enter a name for the SSH key.
-
Select one of the following:
-
Enter manually: Paste the contents of the public SSH key. You need to create an SSH key pair on your own. -
Load from file: Upload the public part of the SSH key. You need to create an SSH key pair on your own. -
Generate key: Automatically create an SSH key pair.When adding a new SSH key, an archive containing the key pair will be created and downloaded. In Linux or macOS-based operating systems, unpack the archive to the
/home/<user_name>/.sshdirectory. In Windows, unpack the archive to theC:\Users\<user_name>/.sshdirectory. You do not need additionally enter the public key in the management console.
-
-
Click Add.
The system will add the SSH key to your organization user profile. If the organization has disabled the ability for users to add SSH keys to their profiles, the added public SSH key will only be saved in the user profile inside the newly created resource.
-
- In the Login field, enter the username:
-
Under General information, specify the VM name:
vpn-server. -
Click Create VM.
-
This will open a window with the licensing model: BYOL (Bring Your Own License).
-
Click Create.
Get the administrator password
The openvpn user with administrator privileges was created on the OpenVPN server in advance. The password is generated automatically when you create a VM.
Get the password in the serial port output or the serial console. The password will display in the following string:
To log in, please use the `openvpn` account with the <password> password.
Where <password> is the openvpn user password.
Log in to the admin panel using the openvpn username and the obtained password.
If you do not get the password after launching the VPN server for the first time, you need to re-create the VM running OpenVPN Access Server. The password will not display when reboot.
Create an app in Identity Hub
- Log in to Yandex Identity Hub
. - In the left-hand panel, select
Apps. - In the top-right corner, click
Create application and in the window that opens:-
Select the SAML (Security Assertion Markup Language) single sign-on method.
-
In the Name field, specify a name for your new app:
ovpn-app. -
Optionally, in the Description field, enter a description for the new app.
-
Optionally, add labels:
- Click Add label.
- Enter a label in
key: valueformat. - Press Enter.
-
Click Create application.
-
- Save the Metadata URL value until the next step.
Set up the integration
Configure authentication on the OpenVPN Access Server side
Note
By default, the server has a self-signed certificate. If you need to replace this certificate, follow the steps here
Add SAML authentication on the OpenVPN server:
- In your browser, open the OpenVPN Access Server admin interface. Its default address is
https://<server_address>:943/admin. - Enter the OpenVPN Access Server admin username and password.
- Click Agree. This will open the OpenVPN Admin Web UI home page.
- Expand the Authentication tab and open SAML.
- Set the Enable SAML authentication checkbox to Yes.
- Expand the Configure Identity Provider (IdP) Automatically via Metadata section.
- In the IdP Metadata URL field, enter the metadata file address you copied earlier.
- Click Get.
- Click Save settings.
- Copy the
SP IdentityandSP ACSvalues on this page.These URLs depend on the hostname setting your current setting of '<server_address>'. SP Identity: https://<server_address>/saml/metadata SP ACS: https://<server_address>/saml/acs - Expand the Authentication tab and open Settings.
- Under Default Authentication System, select SAML.
- Click Save settings.
- Click Update running server.
Set up the SAML application in Yandex Identity Hub
Set up service provider endpoints
- Log in to Yandex Identity Hub
. - In the left-hand panel, select
Apps and then, the SAML app. - At the top right, click
Edit and in the window that opens:- In the **SP EntityID ** field, paste the
SP Identityaddress you copied earlier. - In the ACS URL field, paste the
SP ACSaddress you copied earlier. - Click Save.
- In the **SP EntityID ** field, paste the
Add a user
For the users of your organization to be able to authenticate in OpenVPN Access Server with Identity Hub's SAML app, you need to explicitly add these users and/or user groups to the SAML application.
Note
Users and groups added to a SAML application can be managed by a user with the organization-manager.samlApplications.userAdmin role or higher.
-
Add users to the application:
Cloud Center UI- Log in to Yandex Identity Hub
. - In the left-hand panel, select
Apps and select the required app. - Navigate to the Users and groups tab.
- Click
Add users. - In the window that opens, select the required user or user group.
- Click Add.
- Log in to Yandex Identity Hub
Make sure your application works correctly
To make sure your SAML app and OpenVPN Access Server integration work correctly, authenticate to OpenVPN Access Server as one of the users you added to the app. Proceed as follows:
- In your browser, go to the OpenVPN Access Server client interface. Its default address is
https://<server_address>:943/. - On the authentication page, click Sign In With SAML.
- On the Yandex Cloud authentication page, enter the user email address and password. The user or group they belong to must be added to the application.
- Make sure you have successfully authenticated to OpenVPN Access Server.