Skip to content
Home
Products
Solutions
Customers Enterprise Community Docs
Support
Live Demo

Building a Bastion Host on OpsAny

This guide explains how to deploy and configure the Bastion Host in the OpsAny operations platform. A bastion host is a security appliance that controls and monitors access to internal network resources. Deploying it in OpsAny improves network security by ensuring only authorized users reach protected resources.

Bastion Host proxy settings

The OpsAny Bastion Host supports proxies, split into Linux proxies and Windows proxies. Linux proxies cover everything except Windows hosts: hosts, MySQL, Redis, and so on.

Linux proxy

The Linux proxy uses an SSH tunnel. Configure the IP address, port, username, and password under 【Bastion Host】 → 【Platform Settings】 → 【Network Proxy】.

Windows proxy

A Windows proxy requires the guacd service on the proxy server.

cd /opt/opsany-paas/install/
./opsany-ce-update.sh guacd 1.5.0

guacd listens on port 4822 by default. Do not forget the firewall rules.

Then add the IP address and port under 【Bastion Host】 → 【Platform Settings】 → 【Network Proxy】 → (Windows).

Scenario

A company has bought new servers and plans to use the Bastion Host to give each role or user connection permissions to server accounts. It also wants to restrict the commands that can be run and the hours during which login is allowed. The company will additionally use the Bastion Host to control access to database logins.

  • Prerequisites

The OpsAny Bastion Host is deployed, and the unified permissions (rbac) platform has created the users who need to sign in to the Bastion Host.

  • Step overview

  • Create a server password credential.

  • Add server resources.
  • Usage scenario: add hosts in the Bastion Host so users can sign in to servers with their accounts, restrict login hours, and block the rm command.
  • Create a MySQL database password credential.
  • Add MySQL database resources.
  • Usage scenario: add a MySQL instance in the Bastion Host and authorize it to a user, so the user can sign in to MySQL through the Bastion Host.

Scenario 1: Add hosts in the Bastion Host so users can sign in with their accounts, with login allowed only 09:00–18:00 Monday to Friday, and the rm command blocked.

1. Create a server password credential.

Under Bastion Host → Credential Management → Password Credentials, add the user's server password credential.

Bastion Host

2. Add server resources.

Under Bastion Host → Resource Management → Host Resources, add the server resource.

Bastion Host

3. Configure the access policy

Under Bastion Host → Permission Policies → Access Policies, add a new access policy.

In the basic information, set the login window to 09:00–18:00 Monday to Friday.

Bastion Host

Configure the associated users

Bastion Host

Add the associated credential

Bastion Host

Verify the login policy

Bastion Host

Sign in

Bastion Host

4. Configure the command policy

Under Bastion Host → Command Policies → Command List, add the rm command. (Choose "command block" as the command type.)

Bastion Host

Under Bastion Host → Command Policies → Policy List, create a new policy.

In the basic information, set the login window to 09:00–18:00 Monday to Friday.

Bastion Host

Configure the associated commands and add rm.

Bastion Host

Configure the associated users

Bastion Host

Configure the associated resource credentials

Bastion Host

Test the command

Bastion Host

5. Create a MySQL database password credential.

Under Bastion Host → Credential Management → Password Credentials, add the user's MySQL database password credential.

Bastion Host

6. Add MySQL database resources.

Under Bastion Host → Resource Management → Databases, add the user's MySQL database resource.

Bastion Host

Scenario 2: Add a MySQL instance in the Bastion Host and authorize it to a user, so the user can sign in to MySQL through the Bastion Host.

1. Configure the access policy

Under Bastion Host → Permission Policies → Access Policies, add a new access policy.

Bastion Host

Configure the associated users

Bastion Host

Configure the associated resource credentials

Bastion Host

2. Verify the login policy

Bastion Host

Test running SQL

Bastion Host

Summary

Following this guide, you can use the OpsAny Bastion Host to control access by role across multiple environments. This helps protect company resources and supports security and compliance.

Document