SlideShare a Scribd company logo
VexLLM: LLMを用いたVEX自動生成ツール
須田 瑛大 (NTT ソフトウェアイノベーションセンタ)
akihiro.suda.cz@hco.ntt.co.jp
Vuls 祭り #10 (2024/08/20)
https://github.com/AkihiroSuda/vexllm
• Trivy などを使うと大量に脆弱性が検出されるが、全て対処
しないといけないわけではない
– イメージに含まれる全てのライブラリの全ての関数を使うわけでは
ない
– 全てのコマンドラインツールの全ての引数を使うわけではない
– 実際に攻撃可能なものは3%程度 (先ほどの福田さんの発表参照)
2
背景: 脆弱性が検出されすぎる
• 例: python:3.12.4 イメージには CVE-2024-32002
(9.0 CRITICAL) を持つ git バイナリが含まれる
– git の submodules と シンボリックリンクに関する脆弱性
– git を実行しないことがわかっているなら気にする必要はない
– git を実行するとしても実行対象リポジトリが定数になっているなら
実際に攻撃を受ける可能性は必ずしも高くはない
– CVSSv3 スコアが 9.0 だからといって焦る必要はない
3
背景: 脆弱性が検出されすぎる
• 気にしなくてよい脆弱性の番号をVEX や .trivyignore に書いてお
けば、Trivy の警告を抑制できる
– .trivyignore: 無視する脆弱性番号しか含まない簡易VEX
• しかし、VEX や .trivyignore を自分で書くのは大変
4
VEXや.trivyignoreで脆弱性情報を抑制できる
• https://github.com/AkihiroSuda/vexllm
• OpenAI などの LLM に OpenVEX や .trivyignore を出力させる
• 用途に応じてヒントを指定する
5
VexLLM
vexllm generate python.json .trivyignore 
--hint-not-server 
--hint-compromise-on-availability 
--hint-used-commands=python3 
--hint-unused-commands=git,wget,curl,apt,apt-get
• https://github.com/AkihiroSuda/vexllm
• OpenAI などの LLM に OpenVEX や .trivyignore を出力させる
• 用途に応じてヒントを指定する
6
VexLLM
vexllm generate python.json .trivyignore 
--hint-not-server 
--hint-compromise-on-availability 
--hint-used-commands=python3 
--hint-unused-commands=git,wget,curl,apt,apt-get
入力 (TrivyのJSON) 出力
サーバ用途ではない
情報漏洩や改竄は
妥協できないが
可用性については
運用対処の余地が
ありうる
絶対使われるコマンド
絶対使われないコマンド
7
.trivyignore 出力例
# {"vulnerability":{"@id":"CVE-2024-32002","description":"Git is a revision cont
rol system. Prior to versions 2.45.1, 2.44.1, 2.43.4, 2.42.2, 2.41.1, 2.40.2, an
d 2.39.4, repositories with submodules can be crafted in a way that exploits a b
ug in Git whereby it can be fooled into writing files not into the submodule's w
orktree but into a `.git/` directory. This allows writing a hook that will be ex
ecuted while the clone operation is still running, giving the user no opportunit
y to inspect the code that is being executed. The problem has been patched in ve
rsions 2.45.1, 2.44.1, 2.43.4, 2.42.2, 2.41.1, 2.40.2, and 2.39.4. If symbolic l
ink support is disabled in Git (e.g. via `git config --global core.symlinks fals
e`), the described attack won't work. As always, it is best to avoid cloning rep
ositories from untrusted sources."},"products":[{"@id":"git-man@1:2.39.2-1.1"}],
"status":"not_affected","justification":"vulnerable_code_not_in_execute_path","i
mpact_statement":"{"confidence":0.6,"reason":"This RCE vulnerability is spe
cific to recursive clones in Git, which is not a commonly used feature in the co
ntext of a Python container image."}"}
CVE-2024-32002 黄色い部分がLLMの出力
コメント行はOpenVEXのJSON
• 出力は毎回異なることが多い
• false positive も false negative も多い
• なるべく人間がレビューして手直しすべき
8
あくまでも参考程度
9
内部で生成しているプロンプト [1/2]
You are a security expert talented for triaging vulnerability reports.
You judge whether a vulnerability is likely negligible under the specified hints.
### Hints
* Artifact type: "container_image"
* Artifact name: "python:3.12.4"
* The artifact is a container image. So, kernel-related vulnerabilities are safely negligible.
* The artifact is not used as a network server program. So, server-specific vulnerabilities are safely
negligible.
* The following shell commands are known to be used: [python3]
* The following shell commands are known to be unused and their vulnerabilities are negligible,
although these commands might be still present in the artifact: [git wget curl apt apt-get]
* Put solid focus on Confidentiality and Integrity rather than Availability. e.g., denial -of-service
does not need to be considered as catastrophic as data leakage and modification.
### Input format:
The input is similar to [Trivy](https://github.com/aquasecurity/trivy)'s JSON, but not exactly same.
10
内部で生成しているプロンプト [2/2]
### Output format
If you find negligible vulnerabilities, print a JSON map formatted and indented as follows:
```json
{
"CVE-2042-12345": {"confidence": 0.4, "reason": "This DDOS vulnerability is only exploitable in
public server programs."},
"CVE-2042-23456": {"confidence": 0.8, "reason": "The vulnerable package "foo" is unlikely
used."}
}
```
* `confidence` (0.0-1.0): higher value if you are confident with the answer.
* `reason`: the reason why you think the vulnerability is negligible. Should be unique, descriptive,
and in 2 or 3 sentences.
Do not include non-negligible vulnerabilities in the result.
Only print a valid JSON.
• false positive や false negative の定量評価
• Trivy のプラグインとして実行できるようにする
• Trivy の CLI ともっと密に連携させる
– いちいちJSONや.trivyignoreを作る操作を要らなくする
• Trivy 以外、OpenVEX以外にも対応する
• 各種OSSコミュニティで採用してもらうことを目指す
– LLMに与えるヒント(絶対使うコマンド、使わないコマンドなど)のファイルを
作成・メンテナンスしてもらうようにしたい (VEX Hub上で?)
11
今後
Ad

More Related Content

Similar to 【Vuls祭り#10 (2024/08/20)】 VexLLM: LLMを用いたVEX自動生成ツール (20)

TEE (Trusted Execution Environment)は第二の仮想化技術になるか?
TEE (Trusted Execution Environment)は第二の仮想化技術になるか?TEE (Trusted Execution Environment)は第二の仮想化技術になるか?
TEE (Trusted Execution Environment)は第二の仮想化技術になるか?
Kuniyasu Suzaki
 
Resilience Engineering on Kubernetes
Resilience Engineering on KubernetesResilience Engineering on Kubernetes
Resilience Engineering on Kubernetes
Toru Makabe
 
ライブコーディングとデモで理解するWebセキュリティの基礎
ライブコーディングとデモで理解するWebセキュリティの基礎ライブコーディングとデモで理解するWebセキュリティの基礎
ライブコーディングとデモで理解するWebセキュリティの基礎
Takahisa Kishiya
 
TypeScript製フレームワーク「Nest」のご紹介
TypeScript製フレームワーク「Nest」のご紹介TypeScript製フレームワーク「Nest」のご紹介
TypeScript製フレームワーク「Nest」のご紹介
bitbank, Inc. Tokyo, Japan
 
2015 0227 OSC-Spring Tokyo NETMF
2015 0227 OSC-Spring Tokyo NETMF2015 0227 OSC-Spring Tokyo NETMF
2015 0227 OSC-Spring Tokyo NETMF
Atomu Hidaka
 
Serfが面白いと俺の中で話題にwwwwww
Serfが面白いと俺の中で話題にwwwwwwSerfが面白いと俺の中で話題にwwwwww
Serfが面白いと俺の中で話題にwwwwww
Masahito Zembutsu
 
コンテナを突き破れ!! ~コンテナセキュリティ入門基礎の基礎~(Kubernetes Novice Tokyo #11 発表資料)
コンテナを突き破れ!! ~コンテナセキュリティ入門基礎の基礎~(Kubernetes Novice Tokyo #11 発表資料)コンテナを突き破れ!! ~コンテナセキュリティ入門基礎の基礎~(Kubernetes Novice Tokyo #11 発表資料)
コンテナを突き破れ!! ~コンテナセキュリティ入門基礎の基礎~(Kubernetes Novice Tokyo #11 発表資料)
NTT DATA Technology & Innovation
 
ALMツールたべくらべ
ALMツールたべくらべALMツールたべくらべ
ALMツールたべくらべ
Kaoru NAKAMURA
 
RISC-Vのセキュリティ技術(TEE, Root of Trust, Remote Attestation)
RISC-Vのセキュリティ技術(TEE, Root of Trust, Remote Attestation)RISC-Vのセキュリティ技術(TEE, Root of Trust, Remote Attestation)
RISC-Vのセキュリティ技術(TEE, Root of Trust, Remote Attestation)
Kuniyasu Suzaki
 
KubernetesのRBACを掘り下げてみる(Kubernetes Novice Tokyo #17 発表資料)
KubernetesのRBACを掘り下げてみる(Kubernetes Novice Tokyo #17 発表資料)KubernetesのRBACを掘り下げてみる(Kubernetes Novice Tokyo #17 発表資料)
KubernetesのRBACを掘り下げてみる(Kubernetes Novice Tokyo #17 発表資料)
NTT DATA Technology & Innovation
 
セキュリティオペレーション自動化に向けた、基盤技術と共通インターフェースの構築 [ISOC-JP workshop, 2016/05/20]
セキュリティオペレーション自動化に向けた、基盤技術と共通インターフェースの構築  [ISOC-JP workshop, 2016/05/20]セキュリティオペレーション自動化に向けた、基盤技術と共通インターフェースの構築  [ISOC-JP workshop, 2016/05/20]
セキュリティオペレーション自動化に向けた、基盤技術と共通インターフェースの構築 [ISOC-JP workshop, 2016/05/20]
Takeshi Takahashi
 
DeClang 誕生!Clang ベースのハッキング対策コンパイラ【DeNA TechCon 2020 ライブ配信】
DeClang 誕生!Clang ベースのハッキング対策コンパイラ【DeNA TechCon 2020 ライブ配信】DeClang 誕生!Clang ベースのハッキング対策コンパイラ【DeNA TechCon 2020 ライブ配信】
DeClang 誕生!Clang ベースのハッキング対策コンパイラ【DeNA TechCon 2020 ライブ配信】
DeNA
 
[CB19] アンチウイルスをオラクルとしたWindows Defenderに対する新しい攻撃手法 by 市川遼
[CB19] アンチウイルスをオラクルとしたWindows Defenderに対する新しい攻撃手法 by 市川遼 [CB19] アンチウイルスをオラクルとしたWindows Defenderに対する新しい攻撃手法 by 市川遼
[CB19] アンチウイルスをオラクルとしたWindows Defenderに対する新しい攻撃手法 by 市川遼
CODE BLUE
 
IDAの脆弱性とBug Bounty by 千田 雅明
IDAの脆弱性とBug Bounty by 千田 雅明IDAの脆弱性とBug Bounty by 千田 雅明
IDAの脆弱性とBug Bounty by 千田 雅明
CODE BLUE
 
クロスサイトリクエストフォージェリ(CSRF)とその対策
クロスサイトリクエストフォージェリ(CSRF)とその対策クロスサイトリクエストフォージェリ(CSRF)とその対策
クロスサイトリクエストフォージェリ(CSRF)とその対策
JPCERT Coordination Center
 
[Intermediate 01] イントロダクション / Bitcoin を動作させる
[Intermediate 01] イントロダクション / Bitcoin を動作させる[Intermediate 01] イントロダクション / Bitcoin を動作させる
[Intermediate 01] イントロダクション / Bitcoin を動作させる
Yuto Takei
 
Postgre SQL security_20170412
Postgre SQL security_20170412Postgre SQL security_20170412
Postgre SQL security_20170412
Kazuki Omo
 
Di shen pacsec_jp-final
Di shen pacsec_jp-finalDi shen pacsec_jp-final
Di shen pacsec_jp-final
PacSecJP
 
[1C5] Docker Comose & Swarm mode Orchestration (Japan Container Days - Day1)
[1C5] Docker Comose & Swarm mode Orchestration (Japan Container Days - Day1)[1C5] Docker Comose & Swarm mode Orchestration (Japan Container Days - Day1)
[1C5] Docker Comose & Swarm mode Orchestration (Japan Container Days - Day1)
Masahito Zembutsu
 
LC2005 LT
LC2005 LTLC2005 LT
LC2005 LT
Kunio Miyamoto, Ph.D.
 
TEE (Trusted Execution Environment)は第二の仮想化技術になるか?
TEE (Trusted Execution Environment)は第二の仮想化技術になるか?TEE (Trusted Execution Environment)は第二の仮想化技術になるか?
TEE (Trusted Execution Environment)は第二の仮想化技術になるか?
Kuniyasu Suzaki
 
Resilience Engineering on Kubernetes
Resilience Engineering on KubernetesResilience Engineering on Kubernetes
Resilience Engineering on Kubernetes
Toru Makabe
 
ライブコーディングとデモで理解するWebセキュリティの基礎
ライブコーディングとデモで理解するWebセキュリティの基礎ライブコーディングとデモで理解するWebセキュリティの基礎
ライブコーディングとデモで理解するWebセキュリティの基礎
Takahisa Kishiya
 
TypeScript製フレームワーク「Nest」のご紹介
TypeScript製フレームワーク「Nest」のご紹介TypeScript製フレームワーク「Nest」のご紹介
TypeScript製フレームワーク「Nest」のご紹介
bitbank, Inc. Tokyo, Japan
 
2015 0227 OSC-Spring Tokyo NETMF
2015 0227 OSC-Spring Tokyo NETMF2015 0227 OSC-Spring Tokyo NETMF
2015 0227 OSC-Spring Tokyo NETMF
Atomu Hidaka
 
Serfが面白いと俺の中で話題にwwwwww
Serfが面白いと俺の中で話題にwwwwwwSerfが面白いと俺の中で話題にwwwwww
Serfが面白いと俺の中で話題にwwwwww
Masahito Zembutsu
 
コンテナを突き破れ!! ~コンテナセキュリティ入門基礎の基礎~(Kubernetes Novice Tokyo #11 発表資料)
コンテナを突き破れ!! ~コンテナセキュリティ入門基礎の基礎~(Kubernetes Novice Tokyo #11 発表資料)コンテナを突き破れ!! ~コンテナセキュリティ入門基礎の基礎~(Kubernetes Novice Tokyo #11 発表資料)
コンテナを突き破れ!! ~コンテナセキュリティ入門基礎の基礎~(Kubernetes Novice Tokyo #11 発表資料)
NTT DATA Technology & Innovation
 
ALMツールたべくらべ
ALMツールたべくらべALMツールたべくらべ
ALMツールたべくらべ
Kaoru NAKAMURA
 
RISC-Vのセキュリティ技術(TEE, Root of Trust, Remote Attestation)
RISC-Vのセキュリティ技術(TEE, Root of Trust, Remote Attestation)RISC-Vのセキュリティ技術(TEE, Root of Trust, Remote Attestation)
RISC-Vのセキュリティ技術(TEE, Root of Trust, Remote Attestation)
Kuniyasu Suzaki
 
KubernetesのRBACを掘り下げてみる(Kubernetes Novice Tokyo #17 発表資料)
KubernetesのRBACを掘り下げてみる(Kubernetes Novice Tokyo #17 発表資料)KubernetesのRBACを掘り下げてみる(Kubernetes Novice Tokyo #17 発表資料)
KubernetesのRBACを掘り下げてみる(Kubernetes Novice Tokyo #17 発表資料)
NTT DATA Technology & Innovation
 
セキュリティオペレーション自動化に向けた、基盤技術と共通インターフェースの構築 [ISOC-JP workshop, 2016/05/20]
セキュリティオペレーション自動化に向けた、基盤技術と共通インターフェースの構築  [ISOC-JP workshop, 2016/05/20]セキュリティオペレーション自動化に向けた、基盤技術と共通インターフェースの構築  [ISOC-JP workshop, 2016/05/20]
セキュリティオペレーション自動化に向けた、基盤技術と共通インターフェースの構築 [ISOC-JP workshop, 2016/05/20]
Takeshi Takahashi
 
DeClang 誕生!Clang ベースのハッキング対策コンパイラ【DeNA TechCon 2020 ライブ配信】
DeClang 誕生!Clang ベースのハッキング対策コンパイラ【DeNA TechCon 2020 ライブ配信】DeClang 誕生!Clang ベースのハッキング対策コンパイラ【DeNA TechCon 2020 ライブ配信】
DeClang 誕生!Clang ベースのハッキング対策コンパイラ【DeNA TechCon 2020 ライブ配信】
DeNA
 
[CB19] アンチウイルスをオラクルとしたWindows Defenderに対する新しい攻撃手法 by 市川遼
[CB19] アンチウイルスをオラクルとしたWindows Defenderに対する新しい攻撃手法 by 市川遼 [CB19] アンチウイルスをオラクルとしたWindows Defenderに対する新しい攻撃手法 by 市川遼
[CB19] アンチウイルスをオラクルとしたWindows Defenderに対する新しい攻撃手法 by 市川遼
CODE BLUE
 
IDAの脆弱性とBug Bounty by 千田 雅明
IDAの脆弱性とBug Bounty by 千田 雅明IDAの脆弱性とBug Bounty by 千田 雅明
IDAの脆弱性とBug Bounty by 千田 雅明
CODE BLUE
 
クロスサイトリクエストフォージェリ(CSRF)とその対策
クロスサイトリクエストフォージェリ(CSRF)とその対策クロスサイトリクエストフォージェリ(CSRF)とその対策
クロスサイトリクエストフォージェリ(CSRF)とその対策
JPCERT Coordination Center
 
[Intermediate 01] イントロダクション / Bitcoin を動作させる
[Intermediate 01] イントロダクション / Bitcoin を動作させる[Intermediate 01] イントロダクション / Bitcoin を動作させる
[Intermediate 01] イントロダクション / Bitcoin を動作させる
Yuto Takei
 
Postgre SQL security_20170412
Postgre SQL security_20170412Postgre SQL security_20170412
Postgre SQL security_20170412
Kazuki Omo
 
Di shen pacsec_jp-final
Di shen pacsec_jp-finalDi shen pacsec_jp-final
Di shen pacsec_jp-final
PacSecJP
 
[1C5] Docker Comose & Swarm mode Orchestration (Japan Container Days - Day1)
[1C5] Docker Comose & Swarm mode Orchestration (Japan Container Days - Day1)[1C5] Docker Comose & Swarm mode Orchestration (Japan Container Days - Day1)
[1C5] Docker Comose & Swarm mode Orchestration (Japan Container Days - Day1)
Masahito Zembutsu
 

More from Akihiro Suda (20)

20250403 [KubeCon EU] containerd - Project Update and Deep Dive.pdf
20250403 [KubeCon EU] containerd - Project Update and Deep Dive.pdf20250403 [KubeCon EU] containerd - Project Update and Deep Dive.pdf
20250403 [KubeCon EU] containerd - Project Update and Deep Dive.pdf
Akihiro Suda
 
20250403 [KubeCon EU Pavilion] containerd.pdf
20250403 [KubeCon EU Pavilion] containerd.pdf20250403 [KubeCon EU Pavilion] containerd.pdf
20250403 [KubeCon EU Pavilion] containerd.pdf
Akihiro Suda
 
20250402 [KubeCon EU Pavilion] Lima.pdf_
20250402 [KubeCon EU Pavilion] Lima.pdf_20250402 [KubeCon EU Pavilion] Lima.pdf_
20250402 [KubeCon EU Pavilion] Lima.pdf_
Akihiro Suda
 
20241115 [KubeCon NA Pavilion] Lima.pdf_
20241115 [KubeCon NA Pavilion] Lima.pdf_20241115 [KubeCon NA Pavilion] Lima.pdf_
20241115 [KubeCon NA Pavilion] Lima.pdf_
Akihiro Suda
 
20241113 [KubeCon NA Pavilion] containerd.pdf
20241113 [KubeCon NA Pavilion] containerd.pdf20241113 [KubeCon NA Pavilion] containerd.pdf
20241113 [KubeCon NA Pavilion] containerd.pdf
Akihiro Suda
 
【情報科学若手の会 (2024/09/14】なぜオープンソースソフトウェアにコントリビュートすべきなのか
【情報科学若手の会 (2024/09/14】なぜオープンソースソフトウェアにコントリビュートすべきなのか【情報科学若手の会 (2024/09/14】なぜオープンソースソフトウェアにコントリビュートすべきなのか
【情報科学若手の会 (2024/09/14】なぜオープンソースソフトウェアにコントリビュートすべきなのか
Akihiro Suda
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
Akihiro Suda
 
20240321 [KubeCon EU Pavilion] Lima.pdf_
20240321 [KubeCon EU Pavilion] Lima.pdf_20240321 [KubeCon EU Pavilion] Lima.pdf_
20240321 [KubeCon EU Pavilion] Lima.pdf_
Akihiro Suda
 
20240320 [KubeCon EU Pavilion] containerd.pdf
20240320 [KubeCon EU Pavilion] containerd.pdf20240320 [KubeCon EU Pavilion] containerd.pdf
20240320 [KubeCon EU Pavilion] containerd.pdf
Akihiro Suda
 
20240201 [HPC Containers] Rootless Containers.pdf
20240201 [HPC Containers] Rootless Containers.pdf20240201 [HPC Containers] Rootless Containers.pdf
20240201 [HPC Containers] Rootless Containers.pdf
Akihiro Suda
 
[Podman Special Event] Kubernetes in Rootless Podman
[Podman Special Event] Kubernetes in Rootless Podman[Podman Special Event] Kubernetes in Rootless Podman
[Podman Special Event] Kubernetes in Rootless Podman
Akihiro Suda
 
[KubeConNA2023] Lima pavilion
[KubeConNA2023] Lima pavilion[KubeConNA2023] Lima pavilion
[KubeConNA2023] Lima pavilion
Akihiro Suda
 
[KubeConNA2023] containerd pavilion
[KubeConNA2023] containerd pavilion[KubeConNA2023] containerd pavilion
[KubeConNA2023] containerd pavilion
Akihiro Suda
 
[DockerConハイライト] OpenPubKeyによるイメージの署名と検証.pdf
[DockerConハイライト] OpenPubKeyによるイメージの署名と検証.pdf[DockerConハイライト] OpenPubKeyによるイメージの署名と検証.pdf
[DockerConハイライト] OpenPubKeyによるイメージの署名と検証.pdf
Akihiro Suda
 
[CNCF TAG-Runtime] Usernetes Gen2
[CNCF TAG-Runtime] Usernetes Gen2[CNCF TAG-Runtime] Usernetes Gen2
[CNCF TAG-Runtime] Usernetes Gen2
Akihiro Suda
 
[DockerCon 2023] Reproducible builds with BuildKit for software supply chain ...
[DockerCon 2023] Reproducible builds with BuildKit for software supply chain ...[DockerCon 2023] Reproducible builds with BuildKit for software supply chain ...
[DockerCon 2023] Reproducible builds with BuildKit for software supply chain ...
Akihiro Suda
 
The internals and the latest trends of container runtimes
The internals and the latest trends of container runtimesThe internals and the latest trends of container runtimes
The internals and the latest trends of container runtimes
Akihiro Suda
 
[KubeConEU2023] Lima pavilion
[KubeConEU2023] Lima pavilion[KubeConEU2023] Lima pavilion
[KubeConEU2023] Lima pavilion
Akihiro Suda
 
[KubeConEU2023] containerd pavilion
[KubeConEU2023] containerd pavilion[KubeConEU2023] containerd pavilion
[KubeConEU2023] containerd pavilion
Akihiro Suda
 
[Container Plumbing Days 2023] Why was nerdctl made?
[Container Plumbing Days 2023] Why was nerdctl made?[Container Plumbing Days 2023] Why was nerdctl made?
[Container Plumbing Days 2023] Why was nerdctl made?
Akihiro Suda
 
20250403 [KubeCon EU] containerd - Project Update and Deep Dive.pdf
20250403 [KubeCon EU] containerd - Project Update and Deep Dive.pdf20250403 [KubeCon EU] containerd - Project Update and Deep Dive.pdf
20250403 [KubeCon EU] containerd - Project Update and Deep Dive.pdf
Akihiro Suda
 
20250403 [KubeCon EU Pavilion] containerd.pdf
20250403 [KubeCon EU Pavilion] containerd.pdf20250403 [KubeCon EU Pavilion] containerd.pdf
20250403 [KubeCon EU Pavilion] containerd.pdf
Akihiro Suda
 
20250402 [KubeCon EU Pavilion] Lima.pdf_
20250402 [KubeCon EU Pavilion] Lima.pdf_20250402 [KubeCon EU Pavilion] Lima.pdf_
20250402 [KubeCon EU Pavilion] Lima.pdf_
Akihiro Suda
 
20241115 [KubeCon NA Pavilion] Lima.pdf_
20241115 [KubeCon NA Pavilion] Lima.pdf_20241115 [KubeCon NA Pavilion] Lima.pdf_
20241115 [KubeCon NA Pavilion] Lima.pdf_
Akihiro Suda
 
20241113 [KubeCon NA Pavilion] containerd.pdf
20241113 [KubeCon NA Pavilion] containerd.pdf20241113 [KubeCon NA Pavilion] containerd.pdf
20241113 [KubeCon NA Pavilion] containerd.pdf
Akihiro Suda
 
【情報科学若手の会 (2024/09/14】なぜオープンソースソフトウェアにコントリビュートすべきなのか
【情報科学若手の会 (2024/09/14】なぜオープンソースソフトウェアにコントリビュートすべきなのか【情報科学若手の会 (2024/09/14】なぜオープンソースソフトウェアにコントリビュートすべきなのか
【情報科学若手の会 (2024/09/14】なぜオープンソースソフトウェアにコントリビュートすべきなのか
Akihiro Suda
 
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
20240415 [Container Plumbing Days] Usernetes Gen2 - Kubernetes in Rootless Do...
Akihiro Suda
 
20240321 [KubeCon EU Pavilion] Lima.pdf_
20240321 [KubeCon EU Pavilion] Lima.pdf_20240321 [KubeCon EU Pavilion] Lima.pdf_
20240321 [KubeCon EU Pavilion] Lima.pdf_
Akihiro Suda
 
20240320 [KubeCon EU Pavilion] containerd.pdf
20240320 [KubeCon EU Pavilion] containerd.pdf20240320 [KubeCon EU Pavilion] containerd.pdf
20240320 [KubeCon EU Pavilion] containerd.pdf
Akihiro Suda
 
20240201 [HPC Containers] Rootless Containers.pdf
20240201 [HPC Containers] Rootless Containers.pdf20240201 [HPC Containers] Rootless Containers.pdf
20240201 [HPC Containers] Rootless Containers.pdf
Akihiro Suda
 
[Podman Special Event] Kubernetes in Rootless Podman
[Podman Special Event] Kubernetes in Rootless Podman[Podman Special Event] Kubernetes in Rootless Podman
[Podman Special Event] Kubernetes in Rootless Podman
Akihiro Suda
 
[KubeConNA2023] Lima pavilion
[KubeConNA2023] Lima pavilion[KubeConNA2023] Lima pavilion
[KubeConNA2023] Lima pavilion
Akihiro Suda
 
[KubeConNA2023] containerd pavilion
[KubeConNA2023] containerd pavilion[KubeConNA2023] containerd pavilion
[KubeConNA2023] containerd pavilion
Akihiro Suda
 
[DockerConハイライト] OpenPubKeyによるイメージの署名と検証.pdf
[DockerConハイライト] OpenPubKeyによるイメージの署名と検証.pdf[DockerConハイライト] OpenPubKeyによるイメージの署名と検証.pdf
[DockerConハイライト] OpenPubKeyによるイメージの署名と検証.pdf
Akihiro Suda
 
[CNCF TAG-Runtime] Usernetes Gen2
[CNCF TAG-Runtime] Usernetes Gen2[CNCF TAG-Runtime] Usernetes Gen2
[CNCF TAG-Runtime] Usernetes Gen2
Akihiro Suda
 
[DockerCon 2023] Reproducible builds with BuildKit for software supply chain ...
[DockerCon 2023] Reproducible builds with BuildKit for software supply chain ...[DockerCon 2023] Reproducible builds with BuildKit for software supply chain ...
[DockerCon 2023] Reproducible builds with BuildKit for software supply chain ...
Akihiro Suda
 
The internals and the latest trends of container runtimes
The internals and the latest trends of container runtimesThe internals and the latest trends of container runtimes
The internals and the latest trends of container runtimes
Akihiro Suda
 
[KubeConEU2023] Lima pavilion
[KubeConEU2023] Lima pavilion[KubeConEU2023] Lima pavilion
[KubeConEU2023] Lima pavilion
Akihiro Suda
 
[KubeConEU2023] containerd pavilion
[KubeConEU2023] containerd pavilion[KubeConEU2023] containerd pavilion
[KubeConEU2023] containerd pavilion
Akihiro Suda
 
[Container Plumbing Days 2023] Why was nerdctl made?
[Container Plumbing Days 2023] Why was nerdctl made?[Container Plumbing Days 2023] Why was nerdctl made?
[Container Plumbing Days 2023] Why was nerdctl made?
Akihiro Suda
 
Ad

【Vuls祭り#10 (2024/08/20)】 VexLLM: LLMを用いたVEX自動生成ツール

  • 1. VexLLM: LLMを用いたVEX自動生成ツール 須田 瑛大 (NTT ソフトウェアイノベーションセンタ) [email protected] Vuls 祭り #10 (2024/08/20) https://github.com/AkihiroSuda/vexllm
  • 2. • Trivy などを使うと大量に脆弱性が検出されるが、全て対処 しないといけないわけではない – イメージに含まれる全てのライブラリの全ての関数を使うわけでは ない – 全てのコマンドラインツールの全ての引数を使うわけではない – 実際に攻撃可能なものは3%程度 (先ほどの福田さんの発表参照) 2 背景: 脆弱性が検出されすぎる
  • 3. • 例: python:3.12.4 イメージには CVE-2024-32002 (9.0 CRITICAL) を持つ git バイナリが含まれる – git の submodules と シンボリックリンクに関する脆弱性 – git を実行しないことがわかっているなら気にする必要はない – git を実行するとしても実行対象リポジトリが定数になっているなら 実際に攻撃を受ける可能性は必ずしも高くはない – CVSSv3 スコアが 9.0 だからといって焦る必要はない 3 背景: 脆弱性が検出されすぎる
  • 4. • 気にしなくてよい脆弱性の番号をVEX や .trivyignore に書いてお けば、Trivy の警告を抑制できる – .trivyignore: 無視する脆弱性番号しか含まない簡易VEX • しかし、VEX や .trivyignore を自分で書くのは大変 4 VEXや.trivyignoreで脆弱性情報を抑制できる
  • 5. • https://github.com/AkihiroSuda/vexllm • OpenAI などの LLM に OpenVEX や .trivyignore を出力させる • 用途に応じてヒントを指定する 5 VexLLM vexllm generate python.json .trivyignore --hint-not-server --hint-compromise-on-availability --hint-used-commands=python3 --hint-unused-commands=git,wget,curl,apt,apt-get
  • 6. • https://github.com/AkihiroSuda/vexllm • OpenAI などの LLM に OpenVEX や .trivyignore を出力させる • 用途に応じてヒントを指定する 6 VexLLM vexllm generate python.json .trivyignore --hint-not-server --hint-compromise-on-availability --hint-used-commands=python3 --hint-unused-commands=git,wget,curl,apt,apt-get 入力 (TrivyのJSON) 出力 サーバ用途ではない 情報漏洩や改竄は 妥協できないが 可用性については 運用対処の余地が ありうる 絶対使われるコマンド 絶対使われないコマンド
  • 7. 7 .trivyignore 出力例 # {"vulnerability":{"@id":"CVE-2024-32002","description":"Git is a revision cont rol system. Prior to versions 2.45.1, 2.44.1, 2.43.4, 2.42.2, 2.41.1, 2.40.2, an d 2.39.4, repositories with submodules can be crafted in a way that exploits a b ug in Git whereby it can be fooled into writing files not into the submodule's w orktree but into a `.git/` directory. This allows writing a hook that will be ex ecuted while the clone operation is still running, giving the user no opportunit y to inspect the code that is being executed. The problem has been patched in ve rsions 2.45.1, 2.44.1, 2.43.4, 2.42.2, 2.41.1, 2.40.2, and 2.39.4. If symbolic l ink support is disabled in Git (e.g. via `git config --global core.symlinks fals e`), the described attack won't work. As always, it is best to avoid cloning rep ositories from untrusted sources."},"products":[{"@id":"git-man@1:2.39.2-1.1"}], "status":"not_affected","justification":"vulnerable_code_not_in_execute_path","i mpact_statement":"{"confidence":0.6,"reason":"This RCE vulnerability is spe cific to recursive clones in Git, which is not a commonly used feature in the co ntext of a Python container image."}"} CVE-2024-32002 黄色い部分がLLMの出力 コメント行はOpenVEXのJSON
  • 8. • 出力は毎回異なることが多い • false positive も false negative も多い • なるべく人間がレビューして手直しすべき 8 あくまでも参考程度
  • 9. 9 内部で生成しているプロンプト [1/2] You are a security expert talented for triaging vulnerability reports. You judge whether a vulnerability is likely negligible under the specified hints. ### Hints * Artifact type: "container_image" * Artifact name: "python:3.12.4" * The artifact is a container image. So, kernel-related vulnerabilities are safely negligible. * The artifact is not used as a network server program. So, server-specific vulnerabilities are safely negligible. * The following shell commands are known to be used: [python3] * The following shell commands are known to be unused and their vulnerabilities are negligible, although these commands might be still present in the artifact: [git wget curl apt apt-get] * Put solid focus on Confidentiality and Integrity rather than Availability. e.g., denial -of-service does not need to be considered as catastrophic as data leakage and modification. ### Input format: The input is similar to [Trivy](https://github.com/aquasecurity/trivy)'s JSON, but not exactly same.
  • 10. 10 内部で生成しているプロンプト [2/2] ### Output format If you find negligible vulnerabilities, print a JSON map formatted and indented as follows: ```json { "CVE-2042-12345": {"confidence": 0.4, "reason": "This DDOS vulnerability is only exploitable in public server programs."}, "CVE-2042-23456": {"confidence": 0.8, "reason": "The vulnerable package "foo" is unlikely used."} } ``` * `confidence` (0.0-1.0): higher value if you are confident with the answer. * `reason`: the reason why you think the vulnerability is negligible. Should be unique, descriptive, and in 2 or 3 sentences. Do not include non-negligible vulnerabilities in the result. Only print a valid JSON.
  • 11. • false positive や false negative の定量評価 • Trivy のプラグインとして実行できるようにする • Trivy の CLI ともっと密に連携させる – いちいちJSONや.trivyignoreを作る操作を要らなくする • Trivy 以外、OpenVEX以外にも対応する • 各種OSSコミュニティで採用してもらうことを目指す – LLMに与えるヒント(絶対使うコマンド、使わないコマンドなど)のファイルを 作成・メンテナンスしてもらうようにしたい (VEX Hub上で?) 11 今後