3
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?

AKS クラスターを Defender for Containers で保護する

Last updated at Posted at 2025-12-16

こんにちは、 @yama-s です。
📅 Microsoft Azure Tech Advent Calendar 2025 の 17 日目 を担当します。

テーマは AKS, Defender for Containers を利用し
「AKS クラスターを Defender for Containers で保護する」です!

これから触ってみようかな、検証してみようかなとお考え中の方にすこしでもお役に立てる記事となれば幸いです。

Agenda

  1. 概要
  2. 構築ステップ
  3. 機能確認
  4. まとめ

1. 概要

AKS とは

Azure Kubernetes Service の略称で、Microsoft Azure が提供するマネージド Kubernetes クラスター サービスのことです。

image.png

Defender for Containers とは

Defender for Containers は、Microsoft Azure が提供するクラウドネイティブなセキュリティ機能で、コンテナ化されたアプリケーションや Kubernetes クラスターの脅威防御と脆弱性管理を行うサービスです。
AKS やオンプレミス、マルチクラウド環境の Kubernetes クラスターに対応し、以下の機能を提供します。

  • 脅威検出とアラート
  • ランタイム保護
  • 脆弱性スキャン
  • Kubernetes セキュリティ構成評価

2. 構築ステップ

以下のステップで進めていきます

a. 事前準備
b. AKS クラスターの作成
c. AKS クラスターへの接続
d. 検証用アプリのデプロイ
e. Defender for Containers の有効化

a. 事前準備

Azure VM を 1台作成します(今回は RHEL8 を使用)
image.png

作成した Azure VM に SSH 接続し、必要なツールをインストールします

### パッケージアップデート
$ sudo dnf update -y

### Azure CLI
$ sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
$ sudo dnf install -y https://packages.microsoft.com/config/rhel/8/packages-microsoft-prod.rpm
$ sudo dnf install -y azure-cli

### Kubectl
$ sudo az aks install-cli

### 確認
$ az --version
$ kubectl version –client

(出力例)
image.png

b. AKS クラスターの作成

AKS クラスターを作成します(今回はノード数を 3 で指定)

### Azure にログイン
$ az login    ### 表示に従ってコードの入力や認証を進める
### AKS リソース プロバイダーを登録、確認
$ az provider register --namespace Microsoft.ContainerService
$ az provider show --namespace Microsoft.ContainerService --query “registrationState” #Registered を確認

### AKS クラスターを作成
$ az aks create \
  --resource-group ResourceGroup1 \
  --name AKSCluster \
  --node-count 3 \
  --node-vm-size Standard_B2s \
  --enable-addons monitoring \
  --generate-ssh-keys

c. AKS クラスターへの接続

作成した AKS クラスター "AKSCluster" へ接続します

$ az aks get-credentials --resource-group ResourceGroup1 --name AKSCluster

(出力例)
image.png

d. 検証用アプリのデプロイ

検証用途で nginx を使用します

### Nginx をデプロイ
$ kubectl create deploy nginx --image=nginx
$ kubectl get pod

### 外部アクセス用に expose
$ kubectl expose deploy nginx --port=80 --type=LoadBalancer
$ kubectl get svc

(globalip:80 へアクセス時の画面例)
image.png

e. Defender for Containers の有効化

以下サイトを参考に有効化します
https://learn.microsoft.com/en-us/azure/defender-for-cloud/defender-for-containers-azure-enable-portal


(参考)
作成した AKS クラスターを Azure ポータルから確認すると以下のように見えてきます
image.png
数を指定して作成した 3 台のノードは以下です
image.png
kubectl get node すると以下です
image.png

3. 機能確認

以下を確認してみましょう

機能 内容
脅威検出とアラート Defender for Cloud の脅威インテリジェンスを活用し、攻撃パターンを検知
ランタイム保護 実行中のコンテナーに対する異常な動作や攻撃(例:特権昇格、ネットワーク侵害)をリアルタイムで検出
脆弱性スキャン コンテナーイメージの脆弱性を検出し、修正の推奨事項を提示
Kubernetes セキュリティ構成評価 クラスターの設定を CIS ベンチマークなどのベストプラクティスに照らして評価

作成した AKS クラスター "AKSCluster" の Defender for Cloud 画面から、見え方をチェックしていきます

脅威検出とアラート、ランタイム保護

[対象クラスター] > [Microsoft Defender for Cloud] > [アラート] タブより、検出したアラート一覧を確認可能です
image.png

脆弱性スキャン

[対象クラスター] > [Microsoft Defender for Cloud] > [脆弱性] タブより、検出した脆弱性一覧を確認可能です
image.png

Kubernetes セキュリティ構成評価

[対象クラスター] > [Microsoft Defender for Cloud] > [構成の誤り] タブより、検出した構成の誤りを確認可能です
image.png

[対象クラスター] > [Microsoft Defender for Cloud] > [コンプライアンス] タブより、コンプライアンス評価・準拠状況を確認可能です
image.png

Note: Microsoft Defender for Cloud - 規制コンプライアンスからの推奨事項は、コンプライアンスの保証として解釈しないでください。規制環境ごとにお客様のコントロールの有効性を評価および検証することは、お客様の責任です。これらのサービスには、次の利用規約が適用されます: ライセンス条項

4. まとめ

AKS クラスターを Defender for Containers の保護対象とし、各機能のポータルでの見え方について確認することができました。
みなさまも是非、お時間がある時に触ってみてください!

来週はいよいよクリスマスですね🎄
良い年末をお過ごしください。

Sayaka Yamauchi (syamauchi)


参考リンク

3
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
3
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?