ノート: Secret scanningはGitHub Enterprise Server 3.0ではベータでした。 secret scanningの一般に利用なリリースについては、GitHub Enterprise Serverの最新リリースにアップグレードしてください。
ノート: この機能を使う前には、サイト管理者がGitHub Enterprise Serverのインスタンスのsecret scanningを有効化していなければなりません。 詳しい情報については「アプライアンスのためのsecret scanningの設定」を参照してください。
リポジトリへの secret scanning を有効化する
You can enable secret scanning for any repository that is owned by an organization. Once enabled, secret scanningはGitHubリポジトリ中に存在するすべてのブランチのGit履歴全体に対して、あらゆるシークレットをスキャンします。
-
GitHub Enterprise Serverで、リポジトリのメインページにアクセスしてください。
-
リポジトリ名の下で Settings(設定)をクリックしてください。

-
左のサイドバーで、Security & analysis(セキュリティと分析)をクリックしてください。

-
If Advanced Security is not already enabled for the repository, to the right of "GitHub Advanced Security", click Enable.

-
Review the impact of enabling Advanced Security, then click Enable GitHub Advanced Security for this repository.
-
When you enable Advanced Security, secret scanning may automatically be enabled for the repository due to the organization's settings. [Secret scanning] と [Enable] ボタンが表示されている場合でも、[Enable] をクリックして secret scanning を有効化する必要があります。 [Disable] ボタンが表示されている場合、secret scanning はすでに有効化されています。

リポジトリで secret scanning からのアラートを除外する
secret_scanning.yml ファイルを使用して、secret scanning からディレクトリを除外できます。 たとえば、テストまたはランダムに生成されたコンテンツを含むディレクトリを除外できます。
-
GitHub Enterprise Serverで、リポジトリのメインページにアクセスしてください。
-
ファイルのリストの上で、Add file(ファイルの追加)ドロップダウンを使い、Create new file(新規ファイルの作成をクリックしてください。

-
ファイル名フィールドに、.github/secret_scanning.yml と入力します。
-
[Edit new file] に
paths-ignore:と入力してから、secret scanning から除外するパスを入力します。paths-ignore: - "foo/bar/*.js"*などの特殊文字を使用して、パスをフィルタできます。 フィルタパターンに関する詳しい情報については、「GitHub Actionsのワークフロー構文」を参照してください。ノート:
paths-ignoreに 1,000 以上のエントリがある場合、secret scanning は最初の 1,000 ディレクトリのみをスキャン対象から除外します。- secret_scanning.yml が 1MB 以上ある場合、secret scanning はファイル全体を無視します。
secret scanning からの個々のアラートを無視することもできます。 詳しい情報については、「secret scanning からのアラートを管理する」を参照してください。

