
RAVEN (リスク分析とCI/CDの脆弱性列挙: Risk Analysis and Vulnerability Enumeration for CI/CD) は、GitHub Actions CI ワークフローに対して大規模スキャンを実行し、発見されたデータを Neo4j データベースに取り込むために設計された強力なセキュリティツールです。Cycode 研究チームによって開発・保守されています。
Raven を使用することで、GitHub 上でホストされている最も人気のあるリポジトリのいくつかにおいてセキュリティ脆弱性を特定し報告することができました。その中には以下が含まれます:
Raven を使用して発見されたすべての脆弱性は、ツールの Hall of Fame にリストされています。
このツールは、潜在的な CI/CD 脆弱性をスキャンおよび分析するために以下の機能を提供します:
Raven の可能な使用法:
このツールは、CI/CD セキュリティ分析のための信頼性が高くスケーラブルなソリューションを提供し、ユーザーが不適切な設定をクエリし、コードベースのセキュリティ態勢に関する貴重な洞察を得ることを可能にします。
昨年、Cycode Labs は CI/CD システムの基本的なセキュリティ問題について広範な研究を実施しました。多くのシステム、数千のプロジェクト、およびいくつかの設定を詳細に調査しました。結論は明らかです – セキュリティを開発者に委ねるモデルは失敗しています。これは、以前のコンテンツで何度も実証されています:
上記の脆弱性にはそれぞれ独自の特徴があり、開発者が最新のセキュリティ動向に追従することはほぼ不可能です。残念ながら、各脆弱性には共通点があります – それぞれの悪用が何百万もの被害者に影響を及ぼす可能性があることです。
これらの理由から、Raven は作成されました。これは CI/CD セキュリティ分析ワークフロー(および最初のユースケースとして GitHub Actions)のためのフレームワークです。私たちの焦点では、各問題が単独では脅威にならないが、組み合わさると深刻な脅威となる複雑なシナリオを調査しました。
Raven を使い始めるには、以下のインストール手順に従ってください:
ステップ 1: Raven パッケージをインストールします```bash pip3 install raven-cycode
**Step 2**: ローカルのRedisサーバーとNeo4jデータベースをセットアップする```bash
docker run -d --name raven-neo4j -p7474:7474 -p7687:7687 --env NEO4J_AUTH=neo4j/123456789 --volume raven-neo4j:/data neo4j:5.12
docker run -d --name raven-redis -p6379:6379 --volume raven-redis:/data redis:7.2.1
環境をセットアップする別の方法は、提供されたdocker composeファイルを実行することです。```bash git clone https://github.com/CycodeLabs/raven.git cd raven make setup
**ステップ 3**: Raven Downloader を実行する
アカウントモード:```bash
raven download account --token $GITHUB_TOKEN --account-name RavenDemo
クロールモード:```bash raven download crawl --token $GITHUB_TOKEN --min-stars 1000
**ステップ 4**: Raven Indexer を実行する```bash
raven index
ステップ5: レポーターで結果を確認する```bash raven report --format raw
この時点で、http://localhost:7474/browser/ に接続して Neo4j データベース内のデータを確認できます。
### 前提条件
- Python 3.9+
- Docker Compose v2.1.0+
- Docker Engine v1.13.0+
## インフラストラクチャ
Raven は 2 つの主要な Docker コンテナ (Redis と Neo4j) を使用しています。
`make setup` は `docker compose` コマンドを実行して環境を準備します。

## 使い方
このツールには、`download`、`index`、`report` という 3 つの主要な機能があります。
### ダウンロード
#### アカウントリポジトリのダウンロード```bash
usage: raven download account [-h] --token TOKEN [--debug] [--redis-host REDIS_HOST] [--redis-port REDIS_PORT] [--clean-redis] (--account-name ACCOUNT_NAME | --personal)
options:
-h, --help show this help message and exit
--token TOKEN GITHUB_TOKEN to download data from Github API (Needed for effective rate-limiting)
--debug Whether to print debug statements, default: False
--redis-host REDIS_HOST
Redis host, default: localhost
--redis-port REDIS_PORT
Redis port, default: 6379
--clean-redis, -cr Whether to clean cache in the redis, default: False
--account-name ACCOUNT_NAME
Account name for downloading the workflows, can be used multiple times
--personal Download repositories owned by the authenticated user
usage: raven download crawl [-h] --token TOKEN [--debug] [--redis-host REDIS_HOST] [--redis-port REDIS_PORT] [--clean-redis] [--max-stars MAX_STARS] [--min-stars MIN_STARS]
options: -h, --help show this help message and exit --token TOKEN GITHUB_TOKEN to download data from Github API (Needed for effective rate-limiting) --debug Whether to print debug statements, default: False --redis-host REDIS_HOST Redis host, default: localhost --redis-port REDIS_PORT Redis port, default: 6379 --clean-redis, -cr Whether to clean cache in the redis, default: False --max-stars MAX_STARS Maximum number of stars for a repository --min-stars MIN_STARS Minimum number of stars for a repository, default: 1000
### 索引```bash
usage: raven index [-h] [--redis-host REDIS_HOST] [--redis-port REDIS_PORT] [--clean-redis] [--neo4j-uri NEO4J_URI] [--neo4j-user NEO4J_USER] [--neo4j-pass NEO4J_PASS]
[--clean-neo4j] [--debug]
options:
-h, --help show this help message and exit
--redis-host REDIS_HOST
Redis host, default: localhost
--redis-port REDIS_PORT
Redis port, default: 6379
--clean-redis, -cr Whether to clean cache in the redis, default: False
--neo4j-uri NEO4J_URI
Neo4j URI endpoint, default: neo4j://localhost:7687
--neo4j-user NEO4J_USER
Neo4j username, default: neo4j
--neo4j-pass NEO4J_PASS
Neo4j password, default: 123456789
--clean-neo4j, -cn Whether to clean cache, and index from scratch, default: False
--debug Whether to print debug statements, default: False
usage: raven report [-h] [--redis-host REDIS_HOST] [--redis-port REDIS_PORT] [--clean-redis] [--neo4j-uri NEO4J_URI] [--neo4j-user NEO4J_USER] [--neo4j-pass NEO4J_PASS] [--clean-neo4j] [--tag {injection,unauthenticated,fixed,priv-esc,supply-chain,best-practice,endoflife,reconnaissance}] [--severity {info,low,medium,high,critical}] [--query_ids RQ-1,..,RQ-16] [--queries-path QUERIES_PATH] [--format {raw,json}] {slack} ...
positional arguments: {slack} slack Send report to slack channel
options: -h, --help show this help message and exit --redis-host REDIS_HOST Redis host, default: localhost --redis-port REDIS_PORT Redis port, default: 6379 --clean-redis, -cr Whether to clean cache in the redis, default: False --neo4j-uri NEO4J_URI Neo4j URI endpoint, default: neo4j://localhost:7687 --neo4j-user NEO4J_USER Neo4j username, default: neo4j --neo4j-pass NEO4J_PASS Neo4j password, default: 123456789 --clean-neo4j, -cn Whether to clean cache, and index from scratch, default: False --tag {injection,unauthenticated,fixed,priv-esc,supply-chain,best-practice,endoflife,reconnaissance}, -t {injection,unauthenticated,fixed,priv-esc,supply-chain,best-practice,endoflife,reconnaissance} Filter queries with specific tag --severity {info,low,medium,high,critical}, -s {info,low,medium,high,critical} Filter queries by severity level (default: info) --query_ids RQ-1,..,RQ-16, -id RQ-1,..,RQ-16 Filter queries by query ids (example: RQ-2,RQ-8) --queries-path QUERIES_PATH, -dp QUERIES_PATH Queries folder (default: library) --format {raw,json}, -f {raw,json} Report format (default: raw)
## 例
任意のアカウント(ユーザー/組織)に関連するすべてのワークフローとアクションを取得します。```bash
raven download account --token $GITHUB_TOKEN --account-name microsoft --account-name google --debug
すべての公開GitHubリポジトリをスクレイピングする。```bash raven download crawl --token $GITHUB_TOKEN --min-stars 100 --max-stars 1000 --debug
ダウンロードプロセスが完了した後、またはCtrl+Cで中断された場合、すべてのワークフローとアクションをNeo4jデータベースにインデックス化してください。```bash
raven index --debug
これで、クエリライブラリを使用してレポートを生成できます。```bash raven report --severity high --tag injection --tag unauthenticated
## レート制限
効果的なレート制限のために、Github トークンを提供する必要があります。
認証済みユーザーには、次のレート制限が適用されます。
- コード検索 - 1分あたり30クエリ
- その他のAPI - 1時間あたり5000
## 研究知識ベース
- [Issue Injections](https://github.com/CycodeLabs/raven/blob/main/docs/Issue%20Injections/README.md)
- [Pull Request Injections](https://github.com/CycodeLabs/raven/blob/main/docs/Pull%20Request%20Injections/README.md)
- [Workflow Run Injections](https://github.com/CycodeLabs/raven/blob/main/docs/Multi%20Prerequisite%20Exploits/README.md)
- [CodeSee Injections](https://github.com/CycodeLabs/raven/blob/main/docs/Codesee%20Injections/README.md)
## 現在の制限事項
- `Dockerfile` があるフォルダを参照して外部アクションを実行することは可能ですが (`action.yml` なし)、現在この動作はサポートされていません。
- `docker://...` URL を通じて Docker コンテナを参照して外部アクションを実行することは可能ですが、現在この動作はサポートされていません。
- アクションをローカルで参照して実行することは可能です。これは以前にチェックアウトされた別のリポジトリから来る可能性があるため、複雑な動作を引き起こします。現在の動作は、既存のリポジトリ内でそれを見つけようとします。
- ワークフロー構造全体をモデル化しているわけではありません。追加のフィールドが必要な場合は、[貢献](https://github.com/CycodeLabs/raven/blob/main/CONTRIBUTING.md) ガイドラインに従ってプルリクエストを送信してください。
## 将来の研究作業
- 汚染分析の実装。使用例 - ユーザーはプルリクエストのタイトル (制御可能なパラメータ) を `data` という名前のアクションパラメータに渡すことができます。そのアクションパラメータは実行コマンド `- run: echo ${{ inputs.data }}` で使用される可能性があり、コード実行の経路を作り出します。
- `GITHUB_ENV` の有害な誤用に関する調査を拡大します。これには以前の汚染分析も活用される可能性があります。
- `actions/github-script` に興味深い脅威の状況があるかどうかを調査します。もしあれば、グラフでモデル化できます。
## License
[Apache License 2.0](https://github.com/CycodeLabs/raven/blob/main/LICENSE.md)
## 殿堂入り - Raven を使用して発見・開示された脆弱性
| 名前 | スター | 修正 | 追加情報 |
| ------ | -------- | ---- | -------------------- |
| [freeCodeCamp/freeCodeCamp](https://github.com/freeCodeCamp/freeCodeCamp) |  | CodeSee パッケージの更新, [0871341](https://github.com/freeCodeCamp/freeCodeCamp/commit/0871341c9cbf96ab455bc3e0bce636e2ef2a2be2) | [ブログ](https://cycode.com/blog/cycode-secures-thousands-of-open-source-projects/) |
| [Significant-Gravitas/AutoGPT](https://github.com/Significant-Gravitas/AutoGPT) |  | [cdae7f8](https://github.com/Significant-Gravitas/AutoGPT/pull/6313/commits/cdae7f84ce0b2879fdcc1fa04956cdaa42a07bfb) | | [storybookjs/storybook](https://github.com/storybookjs/storybook) |  | [ffb8558](https://github.com/storybookjs/storybook/commit/ffb8558b7e5df4644299e5ec7009ade6ca1a721c) | [ブログ](https://cycode.com/ci-story-how-we-found-critical-vulnerabilities-in-storybook-project/) |
| [tiangolo/fastapi](https://github.com/tiangolo/fastapi) |  | [9efab1b](https://github.com/tiangolo/fastapi/commit/9efab1bd96ef061edf1753626573a0a2be1eef09) | [LinkedIn](https://www.linkedin.com/feed/update/urn:li:activity:7011753940283203584/) |
| [withastro/astro](https://github.com/withastro/astro) |  | [650fb1a](https://github.com/withastro/astro/commit/650fb1aa51a1c843c10bc89a11732b45a6345b00) | [ブログ](https://cycode.com/github-actions-vulnerabilities/) |
| [statelyai/xstate](https://github.com/statelyai/xstate) |  | CodeSee パッケージの更新 | [ブログ](https://cycode.com/blog/cycode-secures-thousands-of-open-source-projects/) |
| [bazelbuild/bazel](https://github.com/bazelbuild/bazel) |  | [3561f07](https://github.com/bazelbuild/continuous-integration/commit/3561f079e0414d31ebba923815695e1e714937cb) | [ブログ](https://cycode.com/blog/cycode-discovers-a-supply-chain-vulnerability-in-bazel/) |
| [docker-slim/docker-slim](https://github.com/docker-slim/docker-slim) |  | CodeSee パッケージの更新 | [ブログ](https://cycode.com/blog/cycode-secures-thousands-of-open-source-projects/) |
| [microsoft/fluentui](https://github.com/microsoft/fluentui) |  | [2ea6195](https://github.com/microsoft/fluentui/commit/2ea6195152131766641311ee5604e746b578d8e7) | [ブログ](https://cycode.com/blog/analyzing-the-vulnerability-that-could-have-compromised-microsoft-365-users/) |
| [tiangolo/sqlmodel](https://github.com/tiangolo/sqlmodel) |  | [cf36b2d](https://github.com/tiangolo/sqlmodel/commit/cf36b2d9baccf527bc61071850f102e2cd8bf6bf) | [LinkedIn](https://www.linkedin.com/feed/update/urn:li:activity:7011753940283203584/) |
| [tiangolo/typer](https://github.com/tiangolo/typer) |  | [0c106a1](https://github.com/tiangolo/typer/commit/0c106a169e5e3c7df6f98e32a6d8405c985b695a) | [LinkedIn](https://www.linkedin.com/feed/update/urn:li:activity:7011753940283203584/) |
| [juspay/hyperswitch](https://github.com/juspay/hyperswitch) |  | [a052f9a](https://github.com/juspay/hyperswitch/pull/2797/commits/a052f9a9c921ec0ff8c526097841be5777faf835) | |
| [autogluon/autogluon](https://github.com/autogluon/autogluon) |  | [ca18fa9](https://github.com/autogluon/autogluon/commit/ca18fa9fa2071f670125fd19700cf3570a6b5119) | |
| [apache/camel](https://github.com/apache/camel) |  | [02e512a](https://github.com/apache/camel/pull/11879/commits/02e512ae1ab0a471e80d86096ea79b45789aa105) | | [liquibase/liquibase](https://github.com/liquibase/liquibase) |  | [3278525](https://github.com/liquibase/liquibase/commit/3278525eaf974daea20808926f9a6816aecd01a7) | [ブログ](https://cycode.com/github-actions-vulnerabilities/) |
| [ossf/scorecard](https://github.com/ossf/scorecard) |  | [c9f582b](https://github.com/ossf/scorecard/commit/c9f582b620a57a1a476f4e3add505ff50c51a774) | |
| [Ombi-app/Ombi](https://github.com/Ombi-app/Ombi) |  | [5cc0d77](https://github.com/Ombi-app/Ombi/commit/5cc0d7727d72fe1fee8a3f6c3874d44a5b785de4) | [ブログ](https://cycode.com/github-actions-vulnerabilities/) |
| [wireapp/wire-ios](https://github.com/wireapp/wire-ios) |  | [9d39d6c](https://github.com/wireapp/wire-ios/commit/9d39d6c93b5a58a0bc8c1aba10e0d67756359630) | [ブログ](https://cycode.com/github-actions-vulnerabilities/) |
| [cloudscape-design/components](https://github.com/cloudscape-design/components) |  | [2921d2d](https://github.com/cloudscape-design/.github/commit/2921d2d1420fef5b849d5aecbcfb9138ac6b9dcc) | |
| [DynamoDS/Dynamo](https://github.com/DynamoDS/Dynamo) |  | 無効化されたワークフロー | [ブログ](https://cycode.com/github-actions-vulnerabilities/) |
| [fauna/faunadb-js](https://github.com/fauna/faunadb-js) |  | [ee6f53f](https://github.com/fauna/faunadb-js/commit/ee6f53f9c985bde41976743530e3846dee058587) | [ブログ](https://cycode.com/github-actions-vulnerabilities/) |
| [apache/incubator-kie-kogito-runtimes](https://github.com/apache/incubator-kie-kogito-runtimes) |  | [53c18e5](https://github.com/apache/incubator-kie-kogito-runtimes/commit/53c18e5372e5306e0aa580f201f820b80359ad11) | [ブログ](https://cycode.com/github-actions-vulnerabilities/) |
## CI/CD セキュリティ、AppSec、ASPM についてさらに知りたいですか? Cycode をチェック
Raven が気に入ったら、ソフトウェアデリバリー全体の脆弱性の可視化、優先順位付け、修復のためのさらに強化された機能を提供する [Cycode](https://cycode.com/?utm_source=github_website&utm_medium=referral&utm_campaign=raven_page) プラットフォームも気に入るでしょう。
堅牢で研究主導のパイプラインセキュリティ、アプリケーションセキュリティ、または ASPM ソリューションにご興味があれば、お気軽にお問い合わせいただくか、[https://cycode.com/book-a-demo/](https://cycode.com/book-a-demo/?utm_source=github_website&utm_medium=referral&utm_campaign=raven_page) のフォームからデモをリクエストしてください。