SSH Push接続メソッド
SSH Push (ssh-push) is used in environments where Salt clients cannot reach the SUSE Multi-Linux Manager Server directly. In this environment, clients are located in a firewall-protected zone called a DMZ. No system within the DMZ is authorized to open a connection to the internal network where the SUSE Multi-Linux Manager Server is located.
SSH Pushは、SUSE Multi-Linux Managerからクライアントにのみトンネルを開きますが、リバースチャンネルは直接接続されます。 このようなシナリオは、どこでも機能するわけではありません。 そのため、接続メソッドとしてSSH Push (トンネル使用)も利用できます。 これにより、リバーストンネルも開くため、クライアントからサーバへの接続をブロックする可能性のあるすべてのファイアウォールを介して通信することができます。
SSH Pushは、デーモンエージェントをクライアントにインストールできない場合にも使用されます。
|
The SSH Push method has serious limitations. It does not scale well, and consumes more Server resources and network bandwidth than the plain Salt method ( |
サーバは、SSH Pushを使用して、定期的にクライアントに接続し、チェックインし、スケジュールされたアクションおよびイベントを実行します。
|
プロビジョニングモデルを使用したシステムの再インストールは、SSH Pushで管理されているクライアントでは現在サポートされていません。 |
This image demonstrates the SSH Push process path. All items left of the Taskomatic block represent processes running on the SUSE Multi-Linux Manager client.
To use SSH Push, you must have the SSH daemon running on the client, and reachable by the salt-api daemon running on the SUSE Multi-Linux Manager Server. Additionally, the required Python version will be deployed with the Salt Bundle on the client system.
次の登録手順を開始する前に、SSH Push接続メソッドが設定された状態でアクティベーションキーを定義します。このメソッドでは、HTTPSでのサーバとの直接接続が存在する必要があります。
Web UIまたはAPIを使用して、これらのクライアントをSUSE Multi-Linux Managerサーバに登録する必要があります。次のプロシージャまたは例を参照してください。
-
SUSE Multi-Linux ManagerのWeb UIで、に移動し、該当するフィールドに入力します。
-
SSH Push接続メソッドが設定された状態でアクティベーションキーを選択します。アクティベーションキーの詳細については、アクティベーションキーを参照してください。
-
Check the
Manage system completely via SSHcheckbox. -
ブートストラップをクリックして、登録を開始します。
-
に移動して、システムが正しく登録されたことを確認します。
You can use the API to manage which contact method to use. This example Python code sets the contact method to ssh-push.
有効な値は次のとおりです。
-
default(pull) -
ssh-push -
ssh-push-tunnel
client = xmlrpclib.Server(MLM_HOST + "/rpc/api", verbose=0)
key = client.auth.login(MLM_LOGIN, MLM_PASSWORD)
client.system.setDetails(key, 1000012345, {'contact_method' : 'ssh-push'})
1. 使用可能なパラメータ
SSH Pushを設定している場合、ホスト、アクティベーションキー、パスワードなど、システムを登録するときに使用するパラメータを変更できます。このパスワードはブートストラップでのみ使用し、どこにも保存されません。今後のSSHセッションではすべて、キー/証明書のペアで認可されます。これらのパラメータはで設定されます。
rootとしてではなく非特権ユーザとしてシステムにアクセスするためのsudoユーザなど、システム全体で使用される永続パラメータを設定することもできます。
|
Use |
-
Ensure you have the latest
spacewalk-taskomaticandspacewalk-certs-toolspackages installed on the SUSE Multi-Linux Manager Server. -
それぞれのクライアントシステムで、適切な非特権ユーザを作成します。
-
On each client system, edit the
sudoersfile:sudo visudo
-
Grant
sudoaccess to the user by adding this line at the end of thesudoersfile. Replace<user>with the name of the user that is bootstrapping the client in the Web UI:<user> ALL=NOPASSWD: /usr/bin/python3, /var/tmp/venv-salt-minion/bin/python
This procedure grants root access without requiring a password, which is required for registering the client. When the client is successfully installed it runs with root privileges, so the access is no longer required. We recommend that you remove the line from the
sudoersfile after the client has been successfully installed. -
Inside the SUSE Multi-Linux Manager Server container, edit the
/etc/rhn/rhn.confconfiguration file, and add or amend this line to include the unprivileged username:ssh_push_sudo_user = <user>
-
After changing this configuration parameter you must restart services such as
salt-secrets-config.service,tomcat.service, andtaskomatic.service. 必要なサービスすべてを対象とするには、SUSE Multi-Linux Managerサーバをrootとして再起動することをお勧めします。コンテナの外部、コンテナホストから、次のように入力します。mgradm restart
2. アクションの実行
The SSH Push feature uses taskomatic to execute scheduled actions using salt-ssh. The taskomatic job periodically checks for scheduled actions and executes them. The SSH Push feature executes a complete salt-ssh call based on the scheduled action.
By default, twenty Salt SSH actions can be executed at a time. You can increase the number of actions that can be executed in parallel, by adding these lines to your configuration file, and adjusting the value of parallel_threads upwards. We recommend you keep the number of parallel actions low, to avoid problems:
taskomatic.sshminion_action_executor.parallel_threads = <number> org.quartz.threadPool.threadCount = <value of parallel_threads + 20>
1つのクライアントで同時実行できるアクションの個数とtaskomaticで使用されるワーカスレッドの合計数が調整されます。 複数のクライアントでアクションを実行する必要がある場合、アクションは常に各クライアントで順次実行されます。
If the clients are connected through a proxy, you need to adjust the MaxSessions settings on the proxy. In this case, set the number of parallel connections to be three times the total number of clients.
3. 今後の機能
SSH Pushでサポートされていない機能があります。これらの機能はSalt SSHクライアント上では動作しません。
-
OpenSCAPの監査
-
ビーコン。次の結果になります。
-
Installing a package on a system using
zypperdoes not invoke the package refresh. -
仮想ホストシステムがSalt SSHベースの場合、仮想ホスト関数(たとえば、ゲストへのホスト)が動作しません。
-
詳細情報:
-
Salt SSH全般については、Salt SSH and https://docs.saltproject.io/en/latest/topics/ssh/を参照してください。
-
SSHキーのローテーションについては、specialized-guides:salt/salt-ssh.adoc#salt.ssh.key_rotationを参照してください。