Cloud One Workload Security(Deep Security)がAlmaLinux OSに対応したのでインストールしてみた

2021.10.29

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

こんにちは、コカコーラが大好きなカジです。

Cloud One Workload Security(以後C1WSと記載、Deep Security)が、AlmaLinuxに対応したのでインストールしてみたいと思います。

AlmaLinuxについて

AlmaLinux OS 8についてや、構築方法については以下のブログを参照ください。

AlmaLinuxにおけるCloud One Workload Securityの対応可能な機能について

詳細は以下のドキュメントに記載されています。

Deep Security Agent 20の以下のバージョンからサポートされていますので注意してください。

Note 6: AlmaLinux 8 is currently supported on Deep Security Agent 20.0.0-3165+ for Red Hat Enterprise Linux 8, since AlmaLinux 8 is a direct fork of RHEL 8.

また、対応機能は以下のようになっています。

2021/10/29時点での上記のAlmaLinuxサポート機能の画像は以下でした。 Amazon LinuxやCentOS/RHELと同じ機能に対応しておりました。

Deep Security Agentをインストール

前提条件

C1WSのアカウントを作成し、ポリシー作成を完了しておいて下さい。

C1WSにて以下を実行

サポート情報 > インストールスクリプト をクリック

インストール対象のOSをLinuxで選択し、「インストール後にAgentを自動的に有効化」をチェックします。

「セキュリティポリシー」にて設定したいポリシーを選択し、スクリプトをクリップボードへコピーします。

EC2にSSHでログインして以下を実行(SSMのRun CommandでAWS-RunShellScriptでも可能)

インストールスクリプトをviで作成し、貼り付けて保存し実行します。

後で気づいたのですが、AlmaLinuxは、SSM Agentがインストールされており、EC2 IAM Roleで権限を与えることで、SSMのRun CommandのAWS-RunShellScriptでもインストール可能でした。

$ vi dsa_install.sh
画像のインストールスクリプトを出力して貼り付けて保存
$ chmod 755 dsa_install.sh
$ sudo ./dsa_install.sh
Downloading agent package...
Installing agent package...
warning: /tmp/agent.rpm: Header V4 RSA/SHA256 Signature, key ID e1051cbd: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Host platform - NAME="AlmaLinux"
Updating / installing...
   1:ds_agent-20.0.0-3288.el8         ################################# [100%]
enable ds_agent service with systemd
Created symlink /etc/systemd/system/multi-user.target.wants/ds_agent.service → /usr/lib/systemd/system/ds_agent.service.
Install the agent package successfully
2021-10-29 08:55:09: Warning: Cannot set locale to language "Japanese".
2021-10-29 08:55:09: Error: locale 'ja_JP' cannot be set.
HTTP Status: 200 - OK
2021-10-29 08:55:10: Warning: Cannot set locale to language "Japanese".
2021-10-29 08:55:10: Error: locale 'ja_JP' cannot be set.
Activation will be re-attempted 30 time(s) in case of failure
dsa_control
HTTP Status: 200 - OK
Response:
Attempting to connect to https://agents.deepsecurity.trendmicro.com:443/
SSL handshake completed successfully - initiating command session.
Connected with (NONE) to peer at agents.deepsecurity.trendmicro.com
Received a 'GetHostInfo' command from the manager.
Received a 'SetDSMCert' command from the manager.
Received a 'SetAgentCredentials' command from the manager.
Received a 'GetAgentEvents' command from the manager.
Received a 'SetAgentStatus' command from the manager.
Received a 'GetInterfaces' command from the manager.
Received a 'GetAgentEvents' command from the manager.
Received a 'GetHostMetaData' command from the manager.
Received a 'GetHostMetaData' command from the manager.
Received a 'GetAgentStatus' command from the manager.
Received a 'GetAgentEvents' command from the manager.
Received a 'GetDockerVersion' command from the manager.
Received a 'SetXDRInformation' command from the manager.
Received a 'SetSecurityConfiguration' command from the manager.
Received a 'GetAgentEvents' command from the manager.
Received a 'GetAgentStatus' command from the manager.
Received a 'GetIoT' command from the manager.
Received a 'SetDSMCACert' command from the manager.
Received a 'Metrics' command from the manager.
Command session completed.

C1WSのコンソールでコンピュータ登録されていることを確認します。

EICARテストファイルを使って検知させてみる

curlコマンドでEICARテストファイルをダウンロードし、不正プログラム機能によりリアルタイムで退避されるため、ファイルが存在しないことを確認

$ curl -OL https://secure.eicar.org/eicar.com.txt
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    68  100    68    0     0     47      0  0:00:01  0:00:01 --:--:--    47
$ ls -ltr
total 4
-rwxr-xr-x. 1 ec2-user ec2-user 3084 Oct 29 08:50 dsa_install.sh
$

不正プログラム機能によりリアルタイムで退避されるため、ファイルが存在しない

Cloud One Workload Securityのコンソールで検知を確認します。

まとめ

Deep Security Agent 20.0.0-3165以降のバージョンで利用可能なことに気をつけましょう

省略しましたが、EC2のAlmaLinuxは、SSM Agentがプリインストールされており、SSHログインしなくてもDeep Security Agentインストール可能でした。

どなたかのお役に立てれば光栄です。

参考元