日本語

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 AmazonSSMManagedInstanceCore policy 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 AikidoDeviceProtection with one value per operating system, user group, and Linux flavor, for example windows-developers, linux-developers, and linux-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

  1. Copy the install command

    1. Go to Devices in the Aikido app.
    2. Click Connect Device.
    3. Choose Manual install.
    4. Select the user group the machines should join.
    5. Copy the PowerShell install command for Windows or the Linux install command for Linux.

    For Linux servers and VMs, append --headless to the Linux install command. Leave it off for desktops. See Install Device Protection for Linux.

  2. Test on one node with Run Command

    1. In the Systems Manager console, go to Run Command → Run command.
    2. Select AWS-RunPowerShellScript for Windows or AWS-RunShellScript for Linux.
    3. In Command parameters, paste the script from the next step.
    4. In Targets, choose manual selection and pick one node.
    5. Run the command and check the output for errors.
  3. Create the association

    In the Systems Manager console, go to State Manager → Create association and enter the values for your operating system.

    FieldValue
    NameAikidoDeviceProtection-windows-developers
    DocumentAWS-RunPowerShellScript
    Parameterscommands: the script below
    TargetsSpecify instance tags, key AikidoDeviceProtection, value windows-developers
    Specify scheduleOn Schedule, rate of every 1 day
    Rate controlConcurrency 10%, Error threshold 10%
    commands
    if (Get-Service -Name EndpointProtection -ErrorAction SilentlyContinue) { exit 0 }
    # paste the install command from the Aikido app on the next line

    Optionally, set Output options to write command output to S3. The output can contain the token, so protect the bucket.

  4. 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.

    1. Create an association with the document AWS-RunPowerShellScript and the targets Specify instance tags, key AikidoLockdown, value true.
    2. 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.
    3. Add the tag AikidoLockdown=true to 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.

  5. 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

  1. In the Systems Manager console, go to State Manager, open the association, and check its execution history.
  2. Check the agent on a node. You can run these with Run Command.
Get-Service -Name EndpointProtection
  1. Go to Devices in the Aikido app. Each device appears in the list with an Active status.

Troubleshooting

ProblemWhat to check
A node is missing from the targetsFollow the AWS guide Troubleshooting managed node availability.
The association status is FailedOpen the command output for the node and read the error.
The device doesn't appear in the Aikido appReboot 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 を参照してください
Linux 展開リファレンス SCCM を使用して Device Protection を展開install コマンドを実行する Microsoft Configuration Manager (SCCM) パッケージを使用して、管理対象の Windows デバイスに Aikido Device Protection をデプロイします。 Device Protection 用のユーザーグループ