0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

IBM Cloud SaaS版 Sysdig Secure (Vulnerability Engine)を使ってみる。2 (agent upgrade編)

Posted at

2024/11/25
新規作成

経緯・課題

・IBM Cloud SaaS 版 sysdig secure の agent upgradeの手順メモです。

前提環境など

・MacOS Sonoma (14.5) Apple M1 Pro
・OpenShift 4.16.9
・helm
・IBM Cloud

参考知識

Sysdig Secure

1.sysdig agentのversion および status 確認

IBM Cloud の workload protection (sysdig secure) サービスコンソールを確認して、agentの稼働 versionを確認します。

現在 IBM Cloud の workload protectionは、「ロギングおよびモニタリング」ではなく、「セキュリティー」カテゴリのサービスになっています。「リソース・リスト」>「セキュリティー」から、「security and Compliance Center Workload Protection」のご自身が作成されたサービスを選択して、コンソールにアクセスします。
(2024/11/25時点)

メニュー左下の「Integrations」>「Sysdig Agents」にアクセスすると、下のような画面になります。
 
OutOfDate.png

ここでは、Up to Date に計上されているべき nodes 数が、Out of Date に 3 nodes 計上されていることがわかります。現行versionの詳細は、右下表のVersionカラムから確認することができます。図では13.0.3となっています。

または、以下のようにagent podに直接コマンドを投げる方法もあります。

version check CLI example (oc exec sysdig pod)

[work_bastion]$ oc exec sysdig-agent-8zctw -- /opt/draios/bin/dragent --version
Defaulted container "sysdig" out of: sysdig, sysdig-agent-kmodule (init)
13.0.3
[work_bastion]$ 

oc describe コマンドでも詳細情報を拾うことができます。

version check CLI example (oc describe sysdig pod)

[work_bastion]$ oc describe po/sysdig-agent-8zctw
Name:             sysdig-agent-8zctw
Namespace:        ibm-observe
Priority:         0
Service Account:  sysdig-agent
Node:             10.244.64.13/10.244.64.13
Start Time:       Wed, 13 Nov 2024 15:19:15 +0000
Labels:           app=sysdig-agent
                  app.kubernetes.io/instance=sysdig-agent
                  app.kubernetes.io/managed-by=Helm
                  app.kubernetes.io/name=agent
                  app.kubernetes.io/version='13.0.3'
                  controller-revision-hash=7d9d96448d
                  helm.sh/chart=agent-1.30.0
                  pod-template-generation=2
()

Containers:
  sysdig:
    Container ID:   cri-o://96ce030943f284a53bc04e1120e743395cc8f574308800f949eb68b30bab61b9
    Image:          icr.io/ext/sysdig/agent-slim:'13.0.3'
()
[work_bastion]$ 

IBM Cloud SaaS提供の workload protection (または sysdig ) の ROKS agentは、通常手順のinstallと異なり、導入先のnamespace名が 「ibm-obesrve」となる点に注意してください。
(2024/11/25時点)

sysdig agent の各種 statusについては、以下を参照してください。
Understand Agent Status

2.sysdig agent upgrade

OpenShiftの各 woker nodesにinstallされている agentを 最新版に更新します。
helmによるagent upgradeの手順はこちらに記載があります。

1. helm update
まず、OpenShift クラスタへのパッケージ管理をしているhelmサーバーにて、リポジトリを更新します。

helm repo update
[work_bastion]$ helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "sysdig" chart repository
Update Complete. ⎈Happy Helming!⎈

2. (option)get yaml
導入時のリソースファイル(values.yaml)が残っていなかった場合、ocコマンドで現行環境から取得します。

values.yaml
[wsysdig_244q]$ helm get values -n ibm-observe sysdig-agent -o yaml > values.sysdig.yaml

3. helm upgrade
 helmのupgradeコマンドを実施します。

helm upgrade
[wsysdig_244q]$ cat upgrade_sysdig.sh 
helm upgrade \
	--namespace ibm-observe\
	sysdig-agent \
	sysdig/sysdig-deploy \
	-f values.sysdig.yaml


[wsysdig_244q]$ ./upgrade_sysdig.sh 
Release "sysdig-agent" has been upgraded. Happy Helming!
NAME: sysdig-agent
LAST DEPLOYED: Wed Nov 13 15:19:05 2024
NAMESPACE: ibm-observe
STATUS: deployed
REVISION: 2
NOTES:
The agent for Sysdig Secure DevOps Platform is spinning up on each node in your
cluster. After a few seconds, you should see your hosts appearing in the
Sysdig Agent Health & Status Dashboard.

()

3.sysdig agent upgrade 確認

helm upgradeコマンド発行後、おそらく20分程度で各クラスターのpodの削除と作成が順次実行されます。
(ベースのchartのsysdig-agentだけでなく、workload protection の機能を持つ sub charts のnode-analyzer pod なども順次再起動されていきます。)
以下のようにpodの再始動状況を確認できます。

[wsysdig_244q]$ oc get pod -n ibm-observe
NAME                                         READY   STATUS    RESTARTS      AGE
sysdig-agent-8zctw                           1/1     Running   0          15m
sysdig-agent-9bwrv                           1/1     Running   0          7m46s
sysdig-agent-bpcmh                           1/1     Running   0          4m20s
sysdig-agent-kspmcollector-c458d4f4b-vwnp8   1/1     Running   0          15m
sysdig-agent-node-analyzer-47s8h             3/3     Running   0          13m
sysdig-agent-node-analyzer-qkpqr             3/3     Running   0          8m49s
sysdig-agent-node-analyzer-vnlzj             3/3     Running   0          15m
sysdig-agent-node-analyzer-zl227             3/3     Running   0          10m
sysdig-agent-v9s48                           1/1     Running   0          11m

一通りの再起動を確認後、前述のversion確認方法を実行して、更新状況を確認します。

version check CLI example (oc exec sysdig pod)
[work_bastion]$ oc exec sysdig-agent-8zctw -- /opt/draios/bin/dragent --version
Defaulted container "sysdig" out of: sysdig, sysdig-agent-kmodule (init)
13.5.0
[work_bastion]$ 

CLI上でupgradeを確認できた後、GUIコンソールに反映されるまでにしばらく時間がかかります。(十数分では反映されませんでした。)GUIに反映されると、以下のように Out of Date のnodes数(agent数)が 0 になり、Up to Date の nodes数に反映されます。

UpToDate.png

4.sysdig agent 最新情報

 agentの最新ver.と機能については、Release Notesにupdateがあります。(細かいver.updateが頻繁に行われています。)
また、RSS Feed URLが提供されています。

以上です。最後までご覧くださり有難うございました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?