Skip to content

test: extended security review samples#6

Open
0mattchan wants to merge 1 commit into
mainfrom
test/extended-security-review-20260630-114624
Open

test: extended security review samples#6
0mattchan wants to merge 1 commit into
mainfrom
test/extended-security-review-20260630-114624

Conversation

@0mattchan

Copy link
Copy Markdown
Owner

Demo PR for DevSecOps agent extended detection. Do not merge. This intentionally adds unsafe GitHub Actions, Cloud Run, Dockerfile, and Terraform samples for security review testing.

@belltree04

belltree04 Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Security Review Report

Summary

  • Repository: 0mattchan/security-review-workflow
  • Pull Request: #6
  • Total Issues: 17
  • High: 12 / Medium: 4 / Low: 1
  • Action Level: L2
  • Decision: BLOCK
  • Remediation PR Allowed: True
  • Auto Apply Allowed: False

Detected Issues

Issue 1 — ci_github_actions_pull_request_target

Severity: HIGH

File: .github/workflows/unsafe-demo.yml

Issue: pull_request_target が追加されています

Recommendation: 外部PRのコード実行リスクがあるため、pull_request へ変更するか権限を厳格に制限してください


Issue 2 — ci_github_actions_permissions_write_all

Severity: HIGH

File: .github/workflows/unsafe-demo.yml

Issue: GitHub Actions に write-all 権限が追加されています

Recommendation: permissions は contents: read など必要最小限にしてください


Issue 3 — ci_github_actions_unpinned_action

Severity: HIGH

File: .github/workflows/unsafe-demo.yml

Issue: uses のアクションがバージョン固定されていません

Recommendation: 例: actions/checkout@v4 のようにタグまたはSHAで固定してください


Issue 4 — ci_github_actions_plaintext_secret

Severity: HIGH

File: .github/workflows/unsafe-demo.yml

Issue: GitHub Actions に機密情報らしき値が平文で追加されています

Recommendation: GitHub Secrets または Secret Manager を参照してください


Issue 5 — ci_github_actions_pipe_to_shell

Severity: HIGH

File: .github/workflows/unsafe-demo.yml

Issue: curl/wget の結果を直接 shell 実行しています

Recommendation: 取得元と内容を検証し、固定バージョンの公式アクションやチェックサム検証を使ってください


Issue 6 — dockerfile_latest_base_image

Severity: MEDIUM

File: samples/extended-review/Dockerfile

Issue: Dockerfile のベースイメージに latest タグが使われています

Recommendation: 固定バージョンタグまたはdigestを使用してください


Issue 7 — dockerfile_non_root_user_missing

Severity: MEDIUM

File: samples/extended-review/Dockerfile

Issue: Dockerfile で非rootユーザーが明示されていません

Recommendation: USER で非rootユーザーを指定してください


Issue 8 — dockerfile_pipe_to_shell

Severity: HIGH

File: samples/extended-review/Dockerfile

Issue: Dockerfile で curl/wget の結果を直接 shell 実行しています

Recommendation: チェックサム検証や公式パッケージを利用してください


Issue 9 — dockerfile_add_remote_url

Severity: MEDIUM

File: samples/extended-review/Dockerfile

Issue: Dockerfile の ADD で外部URLを直接取得しています

Recommendation: curl + checksum検証、またはCOPYに変更してください


Issue 10 — dockerfile_healthcheck_missing_advisory

Severity: LOW

File: samples/extended-review/Dockerfile

Issue: Dockerfile に HEALTHCHECK が追加されていません

Recommendation: 必要に応じて HEALTHCHECK を追加してください


Issue 11 — cloudbuild_cloudrun_allow_unauthenticated

Severity: HIGH

File: samples/extended-review/cloudbuild.yaml

Issue: Cloud Build から Cloud Run を unauthenticated 公開しています

Recommendation: 公開が必要なWebhook以外は認証を有効化し、公開理由を明記してください


Issue 12 — cloudbuild_image_latest_tag

Severity: MEDIUM

File: samples/extended-review/cloudbuild.yaml

Issue: Cloud Build / deploy 設定で latest タグが使われています

Recommendation: ビルドSHAやリリースタグなど固定可能なタグを使ってください


Issue 13 — cloudbuild_plaintext_sensitive_env

Severity: HIGH

File: samples/extended-review/cloudbuild.yaml

Issue: Cloud Run 環境変数に機密情報らしき値を直接設定しています

Recommendation: --set-secrets または Secret Manager 参照に変更してください


Issue 14 — tf_public_iam_member

Severity: HIGH

File: samples/extended-review/main.tf

Issue: Terraform で public IAM member が追加されています

Recommendation: allUsers / allAuthenticatedUsers を避け、必要な主体だけに絞ってください


Issue 15 — tf_overprivileged_iam_role

Severity: HIGH

File: samples/extended-review/main.tf

Issue: Terraform で強いIAMロールが追加されています

Recommendation: 最小権限の個別ロールに分割してください


Issue 16 — tf_firewall_allow_all

Severity: HIGH

File: samples/extended-review/main.tf

Issue: Terraform で 0.0.0.0/0 の許可が追加されています

Recommendation: CIDRを必要最小限に制限してください


Issue 17 — tf_service_account_key_created

Severity: HIGH

File: samples/extended-review/main.tf

Issue: Terraform でサービスアカウントキー作成が追加されています

Recommendation: Workload Identity / Secret Manager 等を使い、長期鍵の作成を避けてください


Risk Assessment

Summary

提供されたCI/CDパイプライン、コンテナビルドプロセス、およびクラウドインフラ設定において、広範囲にわたり重大なセキュリティ脆弱性が多数検出されました。特に、CI/CDでの過剰な権限付与と機密情報の平文記述、コンテナビルド時の未検証リモートスクリプト実行、そしてクラウドインフラにおける広範なアクセス許可と長期的な認証情報管理の問題が顕著です。

Risk

これらの脆弱性は、CI/CD環境の乗っ取り、サプライチェーン攻撃による悪意あるコードの混入、クラウド環境への不正アクセス、機密情報の漏洩、特権昇格、およびリソースの不正利用に直結する可能性があり、組織のセキュリティ体制に深刻なリスクをもたらします。

Recommended Action

  1. CI/CDパイプラインの厳格化: GitHub Actionsではpull_request_targetの権限を最小限に絞り、利用するアクションは必ずタグまたはSHAで固定してください。機密情報はGitHub Secretsなどセキュアな方法で管理し、リモートスクリプトの直接実行は避けてください。
  2. コンテナイメージのセキュアなビルド: Dockerfileではベースイメージを特定のバージョンに固定し、非rootユーザーでの実行を徹底してください。curl | shADD <URL>による外部コンテンツの直接取得は、チェックサム検証を追加するか、信頼できるパッケージ管理システム経由で行うように変更してください。
  3. クラウドインフラの最小権限徹底: Terraformで管理されるIAM設定は最小権限の原則に基づき、allUsersownerのような広範な権限付与は避け、厳格なアクセス制御を適用してください。ファイアウォールルールは必要なポートとソースIPアドレスに制限し、サービスアカウントキーの作成はWorkload Identityなど短期間の認証メカニズムへ移行を検討してください。

Notes

  • This comment was generated automatically by the security review workflow.
  • Findings are based on changed diff lines only.

@0mattchan 0mattchan added do-not-merge This PR must not be merged demo Demo PR for presentation/testing labels Jun 30, 2026
@0mattchan

Copy link
Copy Markdown
Owner Author

This PR is intentionally unsafe and is used only for DevSecOps Agent extended security review testing. Do not merge.

Verified result:

  • Total Issues: 17
  • High: 12
  • Medium: 4
  • Low: 1
  • Decision: BLOCK
  • Action Level: L2
  • Auto Apply: false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

demo Demo PR for presentation/testing do-not-merge This PR must not be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants