AWS Systems Manager を使用してデバイス保護をデプロイする
Deploy Aikido Device Protection to Windows and Linux machines managed by AWS Systems Manager with a State Manager association that runs the install command.
Use AWS Systems Manager (SSM) State Manager to install Aikido Device Protection on your Windows and Linux managed nodes. An association runs the install command on every node with a given tag, including nodes you tag later.
Prerequisites
- Managed nodes. Each node runs SSM Agent and has permissions, either through an instance profile with the
AmazonSSMManagedInstanceCorepolicy or through Default Host Management Configuration (needs IMDSv2 and SSM Agent 3.2.582.0 or later). Machines that aren't EC2 instances need a hybrid activation. - Permissions to create State Manager associations and to run commands with Run Command.
- The install command for each operating system and user group you roll out to. You copy it from the Aikido app in the first step.
- A tag on the target nodes. Use the key
AikidoDeviceProtectionwith one value per operating system, user group, and Linux flavor, for examplewindows-developers,linux-developers, andlinux-servers. A node carries one value only. - A supported operating system. For Linux distributions, see Supported ecosystems.
How it works
A State Manager association runs a script on every targeted node once when you create it, and then on a schedule. The script starts with a guard, so a node that already has the agent exits immediately. A node that gets the tag later runs the association right away.
Each install command carries the token of one user group. Create one association per tag value, so one per operating system, user group, and Linux flavor.
The install command contains the user group token. Anyone who can view the association, its command history, its S3 output, or the AWS CloudTrail log bucket can read the token. Restrict IAM access to State Manager, Run Command, and the CloudTrail bucket accordingly.
Set up the association
Copy the install command
- Go to Devices in the Aikido app.
- Click Connect Device.
- Choose Manual install.
- Select the user group the machines should join.
- Copy the PowerShell install command for Windows or the Linux install command for Linux.
For Linux servers and VMs, append
--headlessto the Linux install command. Leave it off for desktops. See Install Device Protection for Linux.Test on one node with Run Command
- In the Systems Manager console, go to Run Command → Run command.
- Select
AWS-RunPowerShellScriptfor Windows orAWS-RunShellScriptfor Linux. - In Command parameters, paste the script from the next step.
- In Targets, choose manual selection and pick one node.
- Run the command and check the output for errors.
Create the association
In the Systems Manager console, go to State Manager → Create association and enter the values for your operating system.
Field Value Name AikidoDeviceProtection-windows-developersDocument AWS-RunPowerShellScriptParameters commands: the script below Targets Specify instance tags, key AikidoDeviceProtection, valuewindows-developersSpecify schedule On Schedule, rate of every 1 day Rate control Concurrency 10%, Error threshold10%commands if (Get-Service -Name EndpointProtection -ErrorAction SilentlyContinue) { exit 0 } # paste the install command from the Aikido app on the next lineField Value Name AikidoDeviceProtection-linux-developersDocument AWS-RunShellScriptParameters commands: the script below Targets Specify instance tags, key AikidoDeviceProtection, valuelinux-developersSpecify schedule On Schedule, rate of every 1 day Rate control Concurrency 10%, Error threshold10%commands if aikidoctl --simple >/dev/null 2>&1; then exit 0; fi # paste the install command from the Aikido app on this line # fail the run if the agent is missing or its service is not running aikidoctl --simple || exit 1 systemctl is-active --quiet aikido-endpoint-protection || exit 1Paste the install command on the empty line between the guard and the checks, not at the end. The last two lines make the association report Failed when the agent did not install or its service is not running.
For servers, create a second association with the value
linux-serversand the--headlessinstall command.Optionally, set Output options to write command output to S3. The output can contain the token, so protect the bucket.
Block uninstall on Windows (optional)
Create a second association that stops users from launching the Aikido uninstaller with an AppLocker rule. It targets a separate tag, so it never runs before the install.
- Create an association with the document
AWS-RunPowerShellScriptand the targets Specify instance tags, keyAikidoLockdown, valuetrue. - Set commands to the following script. It turns on the Application Identity service that AppLocker needs to enforce rules, then adds an AppLocker rule that blocks the uninstaller.
- Add the tag
AikidoLockdown=trueto a node only after it has rebooted and shows Active in the Aikido device list.
aikido-applocker.ps1 $ErrorActionPreference = "Stop" sc.exe config appidsvc start= auto Start-Service -Name AppIDSvc $tmp = "$env:TEMP\aikido-applocker.xml" Invoke-WebRequest -Uri "https://raw.githubusercontent.com/AikidoSec/safechain-internals/refs/heads/main/docs/aikido-applocker-deny.xml" -OutFile $tmp Set-AppLockerPolicy -XmlPolicy $tmp -Merge Remove-Item $tmp -Force if ((Get-Service -Name AppIDSvc).Status -ne "Running") { exit 1 }The first line stops the script at the first error and the last line fails the run if the Application Identity service is not running, so the association reports Failed instead of a silent success.
If end users are local administrators, AppLocker rules can be bypassed. Combine this policy with App Control for Business (WDAC) and removal of local admin rights for stronger enforcement.
- Create an association with the document
Reboot or start a new login shell
The association doesn't reboot nodes. Protection becomes active at these points:
- Windows: the agent fully activates on the next boot.
- Linux: protection becomes active in a new login shell or after a reboot. See When protection becomes active.
Reboot nodes in a maintenance window.
Verify the rollout
- In the Systems Manager console, go to State Manager, open the association, and check its execution history.
- Check the agent on a node. You can run these with Run Command.
Get-Service -Name EndpointProtectionaikidoctl --simple
systemctl is-active aikido-endpoint-protection- Go to Devices in the Aikido app. Each device appears in the list with an Active status.
Troubleshooting
| Problem | What to check |
|---|---|
| A node is missing from the targets | Follow the AWS guide Troubleshooting managed node availability. |
| The association status is Failed | Open the command output for the node and read the error. |
| The device doesn't appear in the Aikido app | Reboot the node and check that it has internet access. |
Windows
| 問題 | 対処法 |
|---|---|
| スクリプトの実行後、デバイスがダッシュボードに表示されない | デバイスを再起動してください。エージェントは次回の起動時に登録が完了します |
| MDM コンソールでスクリプトがエラーで終了する | テストホスト上でスクリプトを SYSTEM として手動で実行し、エラーの詳細を確認してください。また、デバイスがインストーラーをダウンロードするためにインターネットにアクセスできることを確認してください |
| エージェントサービスが実行されていない | デバイスを再起動してください。それでもサービスが存在しない場合は、インストールスクリプトを再実行してください |
| スクリプトが実行ポリシーによってブロックされる | MDM 経由で実行されるスクリプトは SYSTEM として実行されるため、ユーザーレベルの実行ポリシーによる制限を受けません。MDM がスクリプトの実行を制限する追加のポリシーを適用していないことを確認してください |
| インストール後、デバイスが非アクティブと表示される | エージェントを完全に有効化するには再起動が必要です。再起動後にもう一度確認してください |
Linux
| 問題 | 対処法 |
|---|---|
| パッケージはインストールされるが、デバイスがダッシュボードに表示されない | インストールコマンドに AIKIDO_TOKEN が設定されていませんでした。構成管理ツールはローカル環境をホストに転送しないため、タスク自体に変数を設定してから、パッケージを再度インストールしてください |
apt または dnf がファイルをインストールせず、リポジトリ内でパッケージを探してしまう | 名前ではなくパスを指定してください: apt install ./EndpointProtection-amd64.deb。先頭の ./ によって、パッケージマネージャーはそれをローカルファイルとして扱います |
| Red Hat 系のホストでインストールが失敗する | ビルドをメジャーバージョンに合わせてください。バージョン 9 では el9 パッケージを、バージョン 10 では el10 パッケージを使用します |
| サービスが実行されていない | systemctl status aikido-endpoint-protection を実行し、次に sudo aikidoctl diagnostics を実行して詳細を送信してください |
| Node.js または uv が依然として Aikido 証明書を拒否する | インストール時に NODE_EXTRA_CA_CERTS と UV_SYSTEM_CERTS がシステム全体に設定されますが、実行中のシェルにはこれらが反映されません。新しいログインシェルを開くか、デバイスを再起動してください |
| トークンが実行出力やログに表示される | ツールのマスキング機能を使用してください: Ansible では no_log、Chef では sensitive true、Puppet では Sensitive() |
| 複数のマシンがデバイス一覧で 1 つのエントリを共有している | それらのマシンは同じ /etc/machine-id で起動しています。Linux のデバイス ID はこのファイルに基づくため、クローン元のイメージでこのファイルをクリアし、初回起動時に systemd に新しいものを書き込ませてください |
| トレイアイコンが表示されない | Ubuntu 以外の GNOME では想定どおりの動作であり、見た目上の問題にすぎません。Tray Icon Support on Linux を参照してください |