---
title: "ターミナルがダサいとモテない。trivy で mac を見てみる 編 | grasys blog"
url: "https://blog.grasys.io/post/yusukeh/terminal-trivy/"
description: "macosの脆弱性確認 Photo by Bernard Hermant on Unsplash 恵比寿でIT企業をやっているとモテると聞いて創業しましたが早いことありがたいことに10年目に突入した長谷川です。 まだモテる成果は出ていません、、、これからです！（もうめんどくさいのでカウントやめました😆） [](ht…"
---

# ターミナルがダサいとモテない。trivy で mac を見てみる 編

-   ![](/_astro/noicon.CTHOhNiB_1HMs6A.webp)[yusukeh](/authors/yusukeh/)
-   公開日：2025年9月10日
-   カテゴリー：[Tech](/categories/tech/)
-   タグ：[#SBOM](/tags/sbom/)[#シリーズ: ターミナル環境](/tags/シリーズ-ターミナル環境/)[#trivy](/tags/trivy/)[#脆弱性診断](/tags/脆弱性診断/)

![ターミナルがダサいとモテない。trivy で mac を見てみる 編](/_astro/ogp.D64lC2mE_ZkTrP5.webp)

macosの脆弱性確認

![ターミナルがダサいとモテない。trivy で mac を見てみる 編](/_astro/01-0-YEWje6UujCA_8YqM-ea5e288a.pwPEd300_ZClxYJ.webp)

Photo by [Bernard Hermant](https://unsplash.com/@bernardhermant?utm_source=medium&utm_medium=referral) on [Unsplash](https://unsplash.com/?utm_source=medium&utm_medium=referral)

恵比寿でIT企業をやっているとモテると聞いて創業しましたが早いことありがたいことに10年目に突入した長谷川です。

まだモテる成果は出ていません、、、これからです！（もうめんどくさいのでカウントやめました😆）

[](https://aquasecurity.github.io/trivy/v0.56/?source=post_page-----694843fdf2e3---------------------------------------)

[Overview - Trivy](https://aquasecurity.github.io/trivy/v0.56/?source=post_page-----694843fdf2e3---------------------------------------)

aquasecurityさんの[trivy](https://aquasecurity.github.io/trivy/v0.56/)でmacosの確認をしてみます。

[trivy](https://aquasecurity.github.io/trivy/v0.56/)ではいろいろなものを確認することができます。

> Targets (what Trivy can scan):
> 
> \- Container Image
> 
> \- Filesystem
> 
> \- Git Repository (remote)
> 
> \- Virtual Machine Image
> 
> \- Kubernetes
> 
> \- AWS
> 
> Scanners (what Trivy can find there):
> 
> \- OS packages and software dependencies in use (SBOM)
> 
> \- Known vulnerabilities (CVEs)
> 
> \- IaC issues and misconfigurations
> 
> \- Sensitive information and secrets
> 
> \- Software licenses

## Install

[homebrew](https://brew.sh/)に普通にあります🤣

Plain textcontent\_copy

```
brew install trivy
```

参考に[uv](https://github.com/astral-sh/uv)のdirectoryをscanしてみます。

## Get yusuke’s stories in your inbox

Join Medium for free to get updates from this writer.Subscribe

自分の[uv](https://github.com/astral-sh/uv)は現状こうなっています。

## uv python list –python-preference=only-managed

Plain textcontent\_copy

```
uv python list --python-preference=only-managed
cpython-3.13.0+freethreaded-macos-aarch64-none    <download available>
cpython-3.13.0-macos-aarch64-none                 /Users/yusukeh/uv/python/cpython-3.13.0-macos-aarch64-none/bin/python3 -> python3.13
cpython-3.12.7-macos-aarch64-none                 <download available>
cpython-3.12.3-macos-aarch64-none                 /Users/yusukeh/uv/python/cpython-3.12.3-macos-aarch64-none/bin/python3 -> python3.12
cpython-3.11.10-macos-aarch64-none                <download available>
cpython-3.11.5-macos-aarch64-none                 /Users/yusukeh/uv/python/cpython-3.11.5-macos-aarch64-none/bin/python3 -> python3.11
cpython-3.10.15-macos-aarch64-none                <download available>
cpython-3.9.20-macos-aarch64-none                 <download available>
cpython-3.8.20-macos-aarch64-none                 <download available>
pypy-3.10.14-macos-aarch64-none                   <download available>
pypy-3.9.19-macos-aarch64-none                    <download available>
pypy-3.8.16-macos-aarch64-none                    <download available>
```

\--python-preference=only-managedを入れないと、[uv](https://github.com/astral-sh/uv)で入れてないpythonも検知する・・・😅

## uv tool list

Plain textcontent\_copy

```
uv tool list
ansible v10.5.0
- ansible-community
ansible-shell v0.0.5
- ansible-shell
gptme v0.20.0
- gptme
- gptme-eval
- gptme-server
hatch v1.13.0
- hatch
hawk v0.1
- hawk
jupyterlab v4.2.5
- jlpm
- jupyter-lab
- jupyter-labextension
- jupyter-labhub
litellm v1.50.2
- litellm
mackup v0.8.41
- mackup
magika v0.5.1
- magika
mdbom v0.3.0
- mdb
pip v24.2
- pip
- pip3
- pip3.12
pyinfra v3.1.1
- pyinfra
rich-cli v1.8.0
- rich
ruff v0.7.0
- ruff
slack-export-viewer v1.4.4
- slack-export-viewer
- slack-export-viewer-cli
sqlfluff v3.2.4
- sqlfluff
wheel v0.44.0
- wheel
```

## trivy filesystem

以下のコマンドで実行してみます。

自分の環境変数は以下のようになっているため

UV\_HOME=${HOME}/uv

filesystemのPATHはUV\_HOMEを指定しています。

Plain textcontent\_copy

```
trivy filesystem \
        --scanners vuln,license,misconfig,secret\
        --detection-priority comprehensive \
        --severity UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL \
        --format table \
        --output trivy_filesystem_uv.txt ${UV_HOME}
```

ちょっとERROR出てますがまあ止まらないので・・・🤣  
\--skip-files入れた方がいいんだろうけど・・・

Plain textcontent\_copy

```
2024-10-24T13:08:43+09:00       INFO    [vuln] Vulnerability scanning is enabled
2024-10-24T13:09:50+09:00       ERROR   [dockerfile parser] Failed to parse Dockerfileedfile_path="tools/ansible/lib/python3.12/site-packages/ansible_collections/community/zabbix/roles/zabbix_agent/molecule/with-server/Dockerfile.j2" err="process dockerfile instructions: unknown instruction: {%"
2024-10-24T13:09:50+09:00       ERROR   [dockerfile parser] Failed to parse Dockerfile'-file_path="tools/ansible/lib/python3.12/site-packages/ansible_collections/google/cloud/molecule/gcloud/Dockerfile.j2" err="process dockerfile instructions: unknown instruction: {%"ps://aquasecurity.github.io/trivy/v0.56/docs/scanner/secret#recommendation for faster secret detection
2024-10-24T13:09:50+09:00       ERROR   [dockerfile parser] Failed to parse Dockerfile  file_path="tools/ansible/lib/python3.12/site-packages/ansible_collections/google/cloud/molecule/gcsfuse/Dockerfile.j2" err="process dockerfile instructions: unknown instruction: {%"
2024-10-24T13:09:50+09:00       ERROR   [dockerfile parser] Failed to parse Dockerfile  file_path="tools/ansible-shell/lib/python3.12/site-packages/ansible_collections/community/zabbix/roles/zabbix_agent/molecule/with-server/Dockerfile.j2" err="process dockerfile instructions: unknown instruction: {%"
2024-10-24T13:09:50+09:00       ERROR   [dockerfile parser] Failed to parse Dockerfile  file_path="tools/ansible-shell/lib/python3.12/site-packages/ansible_collections/google/cloud/molecule/gcloud/Dockerfile.j2" err="process dockerfile instructions: unknown instruction: {%"
2024-10-24T13:09:50+09:00       ERROR   [dockerfile parser] Failed to parse Dockerfile  file_path="tools/ansible-shell/lib/python3.12/site-packages/ansible_collections/google/cloud/molecule/gcsfuse/Dockerfile.j2" err="process dockerfile instructions: unknown instruction: {%"
2024-10-24T13:09:50+09:00       ERROR   [dockerfile parser] Failed to parse Dockerfile  file_path="tools/litellm/lib/python3.12/site-packages/litellm/deprecated_litellm_server/Dockerfile" err="dockerfile parse error: file with no instructions"
2024-10-24T13:09:58+09:00       INFO    Suppressing dependencies for development and testing. To display them, try the '--include-dev-deps' flag.
2024-10-24T13:09:58+09:00       INFO    Number of language-specific files       num=90
2024-10-24T13:09:58+09:00       INFO    [pip] Detecting vulnerabilities...
2024-10-24T13:09:58+09:00       INFO    [poetry] Detecting vulnerabilities...
2024-10-24T13:09:58+09:00       INFO    [pipenv] Detecting vulnerabilities...
2024-10-24T13:09:58+09:00       INFO    [yarn] Detecting vulnerabilities...
2024-10-24T13:09:58+09:00       INFO    [python-pkg] Detecting vulnerabilities...
2024-10-24T13:09:58+09:00       INFO    Detected config files   num=25
```

## 結果

Plain textcontent\_copy

```

tools/ansible-shell/lib/python3.12/site-packages/ansible_collections/cisco/intersight/requirements.txt (pip)
============================================================================================================
Total: 2 (HIGH: 2, CRITICAL: 0)

┌──────────────┬────────────────┬──────────┬────────┬───────────────────┬───────────────┬────────────────────────────────────────────────────────────┐
│   Library    │ Vulnerability  │ Severity │ Status │ Installed Version │ Fixed Version │                           Title                            │
├──────────────┼────────────────┼──────────┼────────┼───────────────────┼───────────────┼────────────────────────────────────────────────────────────┤
│ cryptography │ CVE-2023-0286  │ HIGH     │ fixed  │ 36.0.0            │ 39.0.1        │ openssl: X.400 address type confusion in X.509 GeneralName │
│              │                │          │        │                   │               │ https://avd.aquasec.com/nvd/cve-2023-0286                  │
│              ├────────────────┤          │        │                   ├───────────────┼────────────────────────────────────────────────────────────┤
│              │ CVE-2023-50782 │          │        │                   │ 42.0.0        │ python-cryptography: Bleichenbacher timing oracle attack   │
│              │                │          │        │                   │               │ against RSA decryption - incomplete fix for...             │
│              │                │          │        │                   │               │ https://avd.aquasec.com/nvd/cve-2023-50782                 │
└──────────────┴────────────────┴──────────┴────────┴───────────────────┴───────────────┴────────────────────────────────────────────────────────────┘

tools/ansible-shell/lib/python3.12/site-packages/ansible_collections/cisco/meraki/requirements.txt (pip)
========================================================================================================
Total: 1 (HIGH: 1, CRITICAL: 0)

┌─────────┬─────────────────────┬──────────┬────────┬───────────────────┬───────────────┬───────────────────────────────────────────────────┐
│ Library │    Vulnerability    │ Severity │ Status │ Installed Version │ Fixed Version │                       Title                       │
├─────────┼─────────────────────┼──────────┼────────┼───────────────────┼───────────────┼───────────────────────────────────────────────────┤
│ meraki  │ GHSA-6x4h-9622-fqr6 │ HIGH     │ fixed  │ 1.33.0            │ 1.40.1        │ Improper validation in meraki                     │
│         │                     │          │        │                   │               │ https://github.com/advisories/GHSA-6x4h-9622-fqr6 │
└─────────┴─────────────────────┴──────────┴────────┴───────────────────┴───────────────┴───────────────────────────────────────────────────┘

~~ 長過ぎるので省略 ~~
```

結構出た😅

ansibleがめっちゃ出てる😅

## Appendix

[](https://github.com/awesomeSBOM/awesome-sbom?source=post_page-----694843fdf2e3---------------------------------------)[GitHub - awesomeSBOM/awesome-sbom: A curated list of SBOM (Software Bill Of Materials) related…](https://github.com/awesomeSBOM/awesome-sbom?source=post_page-----694843fdf2e3---------------------------------------)

ここを見るといろいろあります。

個人的にはいろいろ試してみましたが、以下は使いやすくて良さげです。

-   [bomber](https://github.com/devops-kung-fu/bomber)
    
-   [osv-scanner](https://github.com/google/osv-scanner)
    
-   [meta-package-manager](https://github.com/kdeldycke/meta-package-manager)
    

trivyは使いやすくてSecretやLicenseなども見てくれるので楽で素敵！

因みにtrivyで/opt/homebrewを確認すると、自分は毎日updateしてますが、かなりありました😅

ターミナル環境について他の記事も書いているので、よろしければこちらもご覧ください！  
[『ターミナルがダサいとモテない』シリーズ一覧](https://blog.grasys.io/tags/series-terminal-update)

転載：[ターミナルがダサいとモテない。trivyでmacを見てみる編](https://medium.com/@yusuke_h/%E3%82%BF%E3%83%BC%E3%83%9F%E3%83%8A%E3%83%AB%E3%81%8C%E3%83%80%E3%82%B5%E3%81%84%E3%81%A8%E3%83%A2%E3%83%86%E3%81%AA%E3%81%84-trivy%E3%81%A7mac%E3%82%92%E8%A6%8B%E3%81%A6%E3%81%BF%E3%82%8B%E7%B7%A8-694843fdf2e3)

## この記事を書いた人

[![](/_astro/yusukeh.BvUd2yKE_1mQ6Fp.webp)](/authors/yusukeh/)

### [yusukeh](/authors/yusukeh/)

Fly high. Think deep. Move fast. Go far.🦅

-   [X](https://x.com/yusukeh "X")
-   [GitHub](https://github.com/yusukeh "GitHub")
-   [Medium](https://medium.com/@yusukeh "Medium")
-   [Facebook](https://www.facebook.com/yusuke.exzm "Facebook")
-   [Instagram](https://www.instagram.com/yusukehasegawa/ "Instagram")
-   [LinkedIn](https://www.linkedin.com/in/hasegawa-yusuke-091b4164/ "LinkedIn")

[プロフィールと記事一覧](/authors/yusukeh/)