{"meta":{"title":"アプライアンス用コードスキャンの構成","intro":"You can enable, configure, and disable code scanning for your enterprise. Code scanning allows users to scan code for vulnerabilities and errors.","product":"セキュリティとコードの品質","breadcrumbs":[{"href":"/ja/enterprise-server@3.20/code-security","title":"セキュリティとコードの品質"},{"href":"/ja/enterprise-server@3.20/code-security/how-tos","title":"やり方"},{"href":"/ja/enterprise-server@3.20/code-security/how-tos/secure-at-scale","title":"規模を拡大してもセキュリティを確保"},{"href":"/ja/enterprise-server@3.20/code-security/how-tos/secure-at-scale/configure-enterprise-security","title":"エンタープライズ セキュリティの構成"},{"href":"/ja/enterprise-server@3.20/code-security/how-tos/secure-at-scale/configure-enterprise-security/configure-specific-tools","title":"特定のツールを構成する"},{"href":"/ja/enterprise-server@3.20/code-security/how-tos/secure-at-scale/configure-enterprise-security/configure-specific-tools/configuring-code-scanning-for-your-appliance","title":"コード スキャンを構成する"}],"documentType":"article"},"body":"# アプライアンス用コードスキャンの構成\n\nYou can enable, configure, and disable code scanning for your enterprise. Code scanning allows users to scan code for vulnerabilities and errors.\n\n<!--The CodeQL CLI man pages include a link to a section in this article. If you rename this article,\nmake sure that you also update the MS short link: https://aka.ms/code-scanning-docs/configuring-ghes.-->\n\n## code scanning について\n\nCode scanning は、GitHub リポジトリ内のコードを分析して、セキュリティの脆弱性とコーディング エラーを見つけることができる機能です。 分析によって特定された問題は、リポジトリに表示されます。\n\ncode scanning を構成して、CodeQL の分析とサードパーティの分析を実行できます。 また、Code scanning では、GitHub Actions を使ったネイティブな分析の実行と、外部にある既存の CI/CD インフラストラクチャの使用もサポートされています。 次の箇条書きは、アクションを使って お使いの GitHub Enterprise Server インスタンス を許可するように code scanning を構成するときにユーザーが使用できるオプションをまとめたものです。\n\n* **CodeQL**: 既定の設定 (「[コード スキャンの既定セットアップの構成](/ja/enterprise-server@3.20/code-security/code-scanning/enabling-code-scanning/configuring-default-setup-for-code-scanning)」を参照してください) または詳細設定 (「[コード スキャンの詳細設定を構成する](/ja/enterprise-server@3.20/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/configuring-advanced-setup-for-code-scanning#configuring-advanced-setup-for-code-scanning-with-codeql)」を参照してください) のいずれかを使用して GitHub Actions を使用するか、サードパーティの継続的インテグレーション (CI) システムで CodeQL 分析を実行します (「[既存の CI システムでコード スキャンを使用する](/ja/enterprise-server@3.20/code-security/code-scanning/integrating-with-code-scanning/using-code-scanning-with-your-existing-ci-system)」を参照してください)。\n* **サードパーティ:** GitHub Actions またはサード パーティのツールを使い、結果を GitHub にアップロードします (「[SARIF ファイルを GitHub にアップロードする](/ja/enterprise-server@3.20/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github)」を参照)。\n\n## ライセンスに Advanced Security\n\nが含まれているかどうかを確認する\n\nEnterprise の設定を調べて、Enterprise が Advanced Security 製品のライセンスを所有しているかどうかを確認できます。 詳しくは、「[エンタープライズに対して GitHub Advanced Security 製品を有効にする](/ja/enterprise-server@3.20/admin/code-security/managing-github-advanced-security-for-your-enterprise/enabling-github-advanced-security-for-your-enterprise#checking-whether-your-license-includes-github-advanced-security)」をご覧ください。\n\n## code scanning の前提条件\n\n* GitHub Code Security または GitHub Advanced Security のライセンス (「[GitHub Advanced Security ライセンス請求](/ja/enterprise-server@3.20/billing/managing-billing-for-your-products/managing-billing-for-github-advanced-security/about-billing-for-github-advanced-security)」を参照してください)\n\n* 管理コンソールで Code scanning が有効になっている (「[エンタープライズに対して GitHub Advanced Security 製品を有効にする](/ja/enterprise-server@3.20/admin/code-security/managing-github-advanced-security-for-your-enterprise/enabling-github-advanced-security-for-your-enterprise)」を参照してください)\n\n* code scanning の分析を実行する VM またはコンテナー。\n\n<!-- Anchor to maintain the CodeQL CLI manual pages link: https://aka.ms/code-scanning-docs/configuring-ghes -->\n\n<a name=\"running-code-scanning-using-github-actions\"></a>\n\n## code scanning を使用して GitHub Actions を実行する\n\n### セルフホステッド ランナーのプロビジョニング\n\nGitHub は、code scanning ワークフローを使用して GitHub Actions を実行できます。 まず、環境内に 1 つ以上のセルフホスト GitHub Actions ランナーをプロビジョニングする必要があります。 セルフホストランナーは、リポジトリ、Organization、または Enterprise アカウントレベルでプロビジョニングできます。 「[セルフホステッド ランナー](/ja/enterprise-server@3.20/actions/hosting-your-own-runners/managing-self-hosted-runners/about-self-hosted-runners)」と「[自己ホストランナーの追加](/ja/enterprise-server@3.20/actions/hosting-your-own-runners/managing-self-hosted-runners/adding-self-hosted-runners)」を参照してください。\n\nCodeQL アクションを実行するために使用するセルフホストランナーの PATH 変数に Git が含まれていることを確認する必要があります。\n\n> \\[!NOTE]\n> CodeQL code scanning を使って Enterprise 内で Python で記述されたコートを分析する場合、セルフホステッド ランナーに Python 3 がインストールされていることを確認する必要があります。\n\n### ランナー スケール セットをプロビジョニングする\n\nActions Runner Controller を使用して、GitHub Enterprise Server インスタンス用の専用ランナー スケール セットを作成できます。 「[アクション ランナー コントローラーを使用してランナー スケール セットをデプロイする](/ja/enterprise-server@3.20/actions/hosting-your-own-runners/managing-self-hosted-runners-with-actions-runner-controller/deploying-runner-scale-sets-with-actions-runner-controller#using-arc-with-dependabot-and-code-scanning)」を参照してください。\n\n### code scanning のアクションをプロビジョニングする\n\nアクションを使用して code scanning で GitHub Enterprise Server を実行する場合は、アプライアンスでアクションを使用できる必要があります。\n\nCodeQL アクションは GitHub Enterprise Server のインストールに含まれています。 GitHub Enterprise Server 3.20 と GitHub Actions の両方がインターネットにアクセスできる場合、分析を実行するために必要な CodeQL 2.23.9 バンドルが、このアクションによって自動的にダウンロードされます。 または、同期ツールを使って、CodeQL 分析バンドルの最新のリリース バージョンをローカルで使用できるようにすることもできます。 後述する「[インターネットアクセスのないサーバーで CodeQL 分析を構成する](#configuring-codeql-analysis-on-a-server-without-internet-access)」を参照してください。\n\ncode scanning を設定することで、GitHub Connect のユーザがサードパーティのアクションを利用できるようにすることもできます。 後述する「[アプライアンス用コードスキャンの構成](/ja/enterprise-server@3.20/admin/code-security/managing-github-advanced-security-for-your-enterprise/configuring-code-scanning-for-your-appliance#configuring-github-connect-to-sync-github-actions)」を参照してください。\n\n### インターネットアクセスのないサーバーで CodeQL 分析を設定する\n\nGitHub Enterprise Server を実行しているサーバーがインターネットに接続されておらず、ユーザがリポジトリに対して CodeQL code scanning を有効にできるようにする場合は、CodeQL アクション同期ツールを使用して CodeQL 分析バンドルを GitHub.com からサーバーにコピーする必要があります。 ツールとその使用方法の詳細は、[https://github.com/github/codeql-action-sync-tool](https://github.com/github/codeql-action-sync-tool/) で手に入ります。\n\nCodeQL アクション同期ツールを構成すると、それを使用して、CodeQL アクションの最新リリースと関連する CodeQL 分析バンドルを同期できます。 これらは GitHub Enterprise Server と互換性があります。\n\n### GitHub Connect を同期するために GitHub Actions を設定する\n\n1. GitHub.com からオンデマンドでアクションワークフローをダウンロードする場合は、GitHub Connect を有効にする必要があります。 「[GitHub.com の GitHub Connect の有効化](/ja/enterprise-server@3.20/admin/configuration/configuring-github-connect/managing-github-connect#enabling-github-connect)」を参照してください。\n2. また、GitHub Actions を有効にする必要もあります。 「[GitHub Enterprise Server で GitHub Actions を開始する方法](/ja/enterprise-server@3.20/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/getting-started-with-github-actions-for-github-enterprise-server)」を参照してください。\n3. 次のステップは、GitHub.com を使用して、GitHub Connect に対するアクションへのアクセスを設定することです。 「[GitHub Connect を使用した GitHub.com アクションへの自動アクセスの有効化](/ja/enterprise-server@3.20/admin/github-actions/managing-access-to-actions-from-githubcom/enabling-automatic-access-to-githubcom-actions-using-github-connect)」を参照してください。\n4. セルフホストランナーをリポジトリ、組織、またはエンタープライズアカウントに追加します。 「[自己ホストランナーの追加](/ja/enterprise-server@3.20/actions/hosting-your-own-runners/managing-self-hosted-runners/adding-self-hosted-runners)」を参照してください。\n\n## CodeQL CLI を使用して code scanning を実行する\n\nGitHub Actions を使用しない場合は、code scanning を使用して CodeQL CLI を実行する必要があります。\n\nCodeQL CLI は、サードパーティの CI/CD システムを含め、任意のマシン上でコードベースを分析するために使用するコマンド ライン ツールです。 「[既存の CI システムでコード スキャンを使用する](/ja/enterprise-server@3.20/code-security/code-scanning/integrating-with-code-scanning/using-code-scanning-with-your-existing-ci-system)」を参照してください。"}