# カスタム パターンの管理

カスタム パターンを表示、編集、削除したり、カスタム パターンのプッシュ保護を有効にしたりすることができます。

カスタム パターンは、 secret scanningでサポートされている既定のパターンで検出されないシークレットを識別するために使用できるユーザー定義パターンです。 詳細については、「[シークレット スキャンのカスタム パターンの定義](/ja/code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/custom-patterns/defining-custom-patterns-for-secret-scanning)」を参照してください。

エンタープライズ レベルでは、カスタム パターンの作成者のみがパターンを編集し、ドライ ランで使用できます。 リポジトリおよび組織レベルでカスタム パターンを編集する場合、同様の制限はありません。

## カスタム パターンの編集

カスタム パターンへの変更を保存すると、以前のバージョンのパターンを使用して作成されたすべての シークレット スキャンニング アラート が閉じます。

1. カスタム パターンが作成された場所に移動します。 カスタム パターンは、リポジトリ、Organization または Enterprise アカウントに作成できます。
   * リポジトリまたは組織の場合は、カスタム パターンが作成されたリポジトリまたは組織の "Advanced Security" 設定を表示します。 詳細については、「[リポジトリのカスタム パターンの定義](/ja/code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/custom-patterns/defining-custom-patterns-for-secret-scanning#defining-a-custom-pattern-for-a-repository)」または「[Organization のカスタム パターンの定義](/ja/code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/custom-patterns/defining-custom-patterns-for-secret-scanning#defining-a-custom-pattern-for-an-organization)」を参照してください。
   * 企業の場合、\[ポリシー] に \[Advanced Security Code security] 領域が表示され、\[ **セキュリティ機能**] をクリックします。 詳細については、「[Enterprise アカウントのカスタム パターンの定義](/ja/code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/custom-patterns/defining-custom-patterns-for-secret-scanning#defining-a-custom-pattern-for-an-enterprise-account)」を参照してください。
2. \[カスタム パターン] で、編集するカスタム パターンの右側にある \[ <svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-pencil" aria-label="Edit pattern" role="img"><path d="M11.013 1.427a1.75 1.75 0 0 1 2.474 0l1.086 1.086a1.75 1.75 0 0 1 0 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 0 1-.927-.928l.929-3.25c.081-.286.235-.547.445-.758l8.61-8.61Zm.176 4.823L9.75 4.81l-6.286 6.287a.253.253 0 0 0-.064.108l-.558 1.953 1.953-.558a.253.253 0 0 0 .108-.064Zm1.238-3.763a.25.25 0 0 0-.354 0L10.811 3.75l1.439 1.44 1.263-1.263a.25.25 0 0 0 0-.354Z"></path></svg>] をクリックします。
3. 編集したカスタム パターンをテストする準備ができたら、アラートを作成せずに一致するものを特定するため、 **\[保存してドライ ラン]** をクリックします。
4. 変更をレビューしてテストしたら、**\[変更を公開]** をクリックします。
5. 任意で、カスタム パターンのプッシュ保護を有効にするには、 **\[有効にする]** をクリックします。

   > \[!NOTE]
   >
   > * カスタム パターンのプッシュ保護は、プッシュ保護として secret scanning が有効になっているリポジトリにのみ適用されます。 プッシュ保護の有効化の詳細については、「[プッシュプロテクション](/ja/code-security/secret-scanning/protecting-pushes-with-secret-scanning)」を参照してください。
   > * 一般的なカスタム パターンに対してプッシュ保護を有効にすると、共同作成者が混乱する可能性があります。

   ![カスタム パターン ページのスクリーンショット。プッシュ保護を有効にするボタンが強調表示されています。](/assets/images/help/repository/secret-scanning-custom-pattern-enable-push-protection.png)
6. 任意で、カスタム パターンのプッシュ保護を無効にするには、 **\[Disable] (無効にする)** をクリックします。

   ![カスタム パターン ページのスクリーンショット。プッシュ保護を無効にするボタンが濃いオレンジ色の枠線で強調表示されています。](/assets/images/help/repository/secret-scanning-disable-push-protection-custom-pattern.png)

## カスタムパターンの削除

カスタム パターンを削除すると、 GitHub には、パターンに関連する シークレット スキャンニング アラート を閉じるか、これらのアラートを保持するかを選択できます。

1. カスタム パターンが作成された場所に移動します。 カスタム パターンは、リポジトリ、Organization または Enterprise アカウントに作成できます。
   * リポジトリまたは組織の場合は、カスタム パターンが作成されたリポジトリまたは組織の "Advanced Security" 設定を表示します。 詳細については、「[リポジトリのカスタム パターンの定義](/ja/code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/custom-patterns/defining-custom-patterns-for-secret-scanning#defining-a-custom-pattern-for-a-repository)」または「[Organization のカスタム パターンの定義](/ja/code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/custom-patterns/defining-custom-patterns-for-secret-scanning#defining-a-custom-pattern-for-an-organization)」を参照してください。
   * 企業の場合、\[ポリシー] に \[Advanced Security Code security] 領域が表示され、\[ **セキュリティ機能**] をクリックします。 詳細については、「[Enterprise アカウントのカスタム パターンの定義](/ja/code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/custom-patterns/defining-custom-patterns-for-secret-scanning#defining-a-custom-pattern-for-an-enterprise-account)」を参照してください。
2. 削除するカスタム パターンの右側にある \[ <svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-trash" aria-label="Remove pattern" role="img"><path d="M11 1.75V3h2.25a.75.75 0 0 1 0 1.5H2.75a.75.75 0 0 1 0-1.5H5V1.75C5 .784 5.784 0 6.75 0h2.5C10.216 0 11 .784 11 1.75ZM4.496 6.675l.66 6.6a.25.25 0 0 0 .249.225h5.19a.25.25 0 0 0 .249-.225l.66-6.6a.75.75 0 0 1 1.492.149l-.66 6.6A1.748 1.748 0 0 1 10.595 15h-5.19a1.75 1.75 0 0 1-1.741-1.575l-.66-6.6a.75.75 0 1 1 1.492-.15ZM6.5 1.75V3h3V1.75a.25.25 0 0 0-.25-.25h-2.5a.25.25 0 0 0-.25.25Z"></path></svg>] をクリックします。
3. 確認をレビューし、カスタム パターンに関連する開いているアラートを処理する方法を選択します。
4. **\[はい、このパターンを削除します]** をクリックします。

カスタム パターンを削除するときにアラートを閉じる場合は、削除プロセスがバックグラウンドで非同期的に行われることに注意する必要があります。 大量のアラート (数千以上) を生成したカスタム パターンの場合、削除プロセスが完了するまでに数分から数時間かかる場合があります。 プロセスの完了中に作業を続けることができます。

## カスタム パターンのプッシュ保護を有効にする

エンタープライズ、組織、またはリポジトリ レベルで格納されているカスタム パターンのプッシュ保護として、 secret scanning を有効にすることができます。

### 企業で保存されたカスタム パターンのプッシュ保護を有効にする

> \[!NOTE]
>
> * カスタム パターンのプッシュ保護を有効にするには、エンタープライズ レベルでプッシュ保護として secret scanning を有効にする必要があります。
> * 一般的なカスタム パターンに対してプッシュ保護を有効にすると、共同作成者が混乱する可能性があります。

エンタープライズ レベルでカスタム パターンのプッシュ保護を有効にする前に、必ず予行演習でもカスタム パターンをテストしてください。 ドライ ランは、自分が管理アクセス権を持つリポジトリでのみ実行できます。 エンタープライズ所有者が、組織内の任意のリポジトリでドライ ランを実行するためのアクセス権を必要とする場合は、組織所有者ロールが割り当てられている必要があります。 詳しくは、「[あなたの企業が所有する組織での役割を管理する](/ja/enterprise-cloud@latest/admin/user-management/managing-organizations-in-your-enterprise/managing-your-role-in-an-organization-owned-by-your-enterprise)」をご覧ください。

1. 企業ページに移動してください。 たとえば、GitHub.com の [\[Enterprise\]](https://github.com/settings/enterprises?ref_product=ghec\&ref_type=engagement\&ref_style=text) ページから。

2. ページの上部にある \[**ポリシーの<svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-law" aria-label="law" role="img"><path d="M8.75.75V2h.985c.304 0 .603.08.867.231l1.29.736c.038.022.08.033.124.033h2.234a.75.75 0 0 1 0 1.5h-.427l2.111 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.006.005-.01.01-.045.04c-.21.176-.441.327-.686.45C14.556 10.78 13.88 11 13 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L12.178 4.5h-.162c-.305 0-.604-.079-.868-.231l-1.29-.736a.245.245 0 0 0-.124-.033H8.75V13h2.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5h2.5V3.5h-.984a.245.245 0 0 0-.124.033l-1.289.737c-.265.15-.564.23-.869.23h-.162l2.112 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.016.015-.045.04c-.21.176-.441.327-.686.45C4.556 10.78 3.88 11 3 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L2.178 4.5H1.75a.75.75 0 0 1 0-1.5h2.234a.249.249 0 0 0 .125-.033l1.288-.737c.265-.15.564-.23.869-.23h.984V.75a.75.75 0 0 1 1.5 0Zm2.945 8.477c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327Zm-10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327Z"></path></svg>**] をクリックします。

3. <svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-law" aria-label="law" role="img"><path d="M8.75.75V2h.985c.304 0 .603.08.867.231l1.29.736c.038.022.08.033.124.033h2.234a.75.75 0 0 1 0 1.5h-.427l2.111 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.006.005-.01.01-.045.04c-.21.176-.441.327-.686.45C14.556 10.78 13.88 11 13 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L12.178 4.5h-.162c-.305 0-.604-.079-.868-.231l-1.29-.736a.245.245 0 0 0-.124-.033H8.75V13h2.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1 0-1.5h2.5V3.5h-.984a.245.245 0 0 0-.124.033l-1.289.737c-.265.15-.564.23-.869.23h-.162l2.112 4.692a.75.75 0 0 1-.154.838l-.53-.53.529.531-.001.002-.002.002-.006.006-.016.015-.045.04c-.21.176-.441.327-.686.45C4.556 10.78 3.88 11 3 11a4.498 4.498 0 0 1-2.023-.454 3.544 3.544 0 0 1-.686-.45l-.045-.04-.016-.015-.006-.006-.004-.004v-.001a.75.75 0 0 1-.154-.838L2.178 4.5H1.75a.75.75 0 0 1 0-1.5h2.234a.249.249 0 0 0 .125-.033l1.288-.737c.265-.15.564-.23.869-.23h.984V.75a.75.75 0 0 1 1.5 0Zm2.945 8.477c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327Zm-10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327Z"></path></svg> \[Policies] で、**\[Advanced Security Code security]** をクリックします。

4. \[Advanced Security Code security] の \[ **セキュリティ機能**] をクリックします。

5. \[Secret scanning] の \[カスタム パターン] で、目的のパターンの <svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-pencil" aria-label="Edit custom pattern" role="img"><path d="M11.013 1.427a1.75 1.75 0 0 1 2.474 0l1.086 1.086a1.75 1.75 0 0 1 0 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 0 1-.927-.928l.929-3.25c.081-.286.235-.547.445-.758l8.61-8.61Zm.176 4.823L9.75 4.81l-6.286 6.287a.253.253 0 0 0-.064.108l-.558 1.953 1.953-.558a.253.253 0 0 0 .108-.064Zm1.238-3.763a.25.25 0 0 0-.354 0L10.811 3.75l1.439 1.44 1.263-1.263a.25.25 0 0 0 0-.354Z"></path></svg> をクリックします。

   > \[!NOTE] エンタープライズ レベルでは、自分が作成したカスタム パターンに対してのみ、プッシュ保護を編集して有効にすることができます。

6. カスタム パターンのプッシュ保護を有効にするには、\[プッシュ保護] まで下にスクロールして、**\[有効化]** をクリックします。

   > \[!NOTE] プッシュ保護を有効にするオプションは、公開されたパターンでのみ表示されます。

   ![カスタム パターン ページのスクリーンショット。プッシュ保護を有効にするボタンが濃いオレンジ色の枠線で強調表示されています。](/assets/images/help/repository/secret-scanning-custom-pattern-enable-push-protection.png)

### カスタム パターンの組織でプッシュ保護として secret scanning を有効にする

組織レベルでカスタム パターンのプッシュ保護を有効にする前に、組織内でスキャンするリポジトリの secret scanning を有効にする必要があります。 組織内のすべてのリポジトリで secret scanning を有効にするには、 [組織のセキュリティおよび分析設定を管理する](/ja/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/managing-security-and-analysis-settings-for-your-organization) を参照してください。

1. GitHub の右上隅にあるプロフィール画像をクリックしてから、**\[<svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-organization" aria-label="organization" role="img"><path d="M1.75 16A1.75 1.75 0 0 1 0 14.25V1.75C0 .784.784 0 1.75 0h8.5C11.216 0 12 .784 12 1.75v12.5c0 .085-.006.168-.018.25h2.268a.25.25 0 0 0 .25-.25V8.285a.25.25 0 0 0-.111-.208l-1.055-.703a.749.749 0 1 1 .832-1.248l1.055.703c.487.325.779.871.779 1.456v5.965A1.75 1.75 0 0 1 14.25 16h-3.5a.766.766 0 0 1-.197-.026c-.099.017-.2.026-.303.026h-3a.75.75 0 0 1-.75-.75V14h-1v1.25a.75.75 0 0 1-.75.75Zm-.25-1.75c0 .138.112.25.25.25H4v-1.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 .75.75v1.25h2.25a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25h-8.5a.25.25 0 0 0-.25.25ZM3.75 6h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5ZM3 3.75A.75.75 0 0 1 3.75 3h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 3 3.75Zm4 3A.75.75 0 0 1 7.75 6h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 7 6.75ZM7.75 3h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5ZM3 9.75A.75.75 0 0 1 3.75 9h.5a.75.75 0 0 1 0 1.5h-.5A.75.75 0 0 1 3 9.75ZM7.75 9h.5a.75.75 0 0 1 0 1.5h-.5a.75.75 0 0 1 0-1.5Z"></path></svg> Your organizations]** をクリックします。

2. 組織をクリックして選択します。

3. Organization 名の下で、**\[<svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-gear" aria-label="gear" role="img"><path d="M8 0a8.2 8.2 0 0 1 .701.031C9.444.095 9.99.645 10.16 1.29l.288 1.107c.018.066.079.158.212.224.231.114.454.243.668.386.123.082.233.09.299.071l1.103-.303c.644-.176 1.392.021 1.82.63.27.385.506.792.704 1.218.315.675.111 1.422-.364 1.891l-.814.806c-.049.048-.098.147-.088.294.016.257.016.515 0 .772-.01.147.038.246.088.294l.814.806c.475.469.679 1.216.364 1.891a7.977 7.977 0 0 1-.704 1.217c-.428.61-1.176.807-1.82.63l-1.102-.302c-.067-.019-.177-.011-.3.071a5.909 5.909 0 0 1-.668.386c-.133.066-.194.158-.211.224l-.29 1.106c-.168.646-.715 1.196-1.458 1.26a8.006 8.006 0 0 1-1.402 0c-.743-.064-1.289-.614-1.458-1.26l-.289-1.106c-.018-.066-.079-.158-.212-.224a5.738 5.738 0 0 1-.668-.386c-.123-.082-.233-.09-.299-.071l-1.103.303c-.644.176-1.392-.021-1.82-.63a8.12 8.12 0 0 1-.704-1.218c-.315-.675-.111-1.422.363-1.891l.815-.806c.05-.048.098-.147.088-.294a6.214 6.214 0 0 1 0-.772c.01-.147-.038-.246-.088-.294l-.815-.806C.635 6.045.431 5.298.746 4.623a7.92 7.92 0 0 1 .704-1.217c.428-.61 1.176-.807 1.82-.63l1.102.302c.067.019.177.011.3-.071.214-.143.437-.272.668-.386.133-.066.194-.158.211-.224l.29-1.106C6.009.645 6.556.095 7.299.03 7.53.01 7.764 0 8 0Zm-.571 1.525c-.036.003-.108.036-.137.146l-.289 1.105c-.147.561-.549.967-.998 1.189-.173.086-.34.183-.5.29-.417.278-.97.423-1.529.27l-1.103-.303c-.109-.03-.175.016-.195.045-.22.312-.412.644-.573.99-.014.031-.021.11.059.19l.815.806c.411.406.562.957.53 1.456a4.709 4.709 0 0 0 0 .582c.032.499-.119 1.05-.53 1.456l-.815.806c-.081.08-.073.159-.059.19.162.346.353.677.573.989.02.03.085.076.195.046l1.102-.303c.56-.153 1.113-.008 1.53.27.161.107.328.204.501.29.447.222.85.629.997 1.189l.289 1.105c.029.109.101.143.137.146a6.6 6.6 0 0 0 1.142 0c.036-.003.108-.036.137-.146l.289-1.105c.147-.561.549-.967.998-1.189.173-.086.34-.183.5-.29.417-.278.97-.423 1.529-.27l1.103.303c.109.029.175-.016.195-.045.22-.313.411-.644.573-.99.014-.031.021-.11-.059-.19l-.815-.806c-.411-.406-.562-.957-.53-1.456a4.709 4.709 0 0 0 0-.582c-.032-.499.119-1.05.53-1.456l.815-.806c.081-.08.073-.159.059-.19a6.464 6.464 0 0 0-.573-.989c-.02-.03-.085-.076-.195-.046l-1.102.303c-.56.153-1.113.008-1.53-.27a4.44 4.44 0 0 0-.501-.29c-.447-.222-.85-.629-.997-1.189l-.289-1.105c-.029-.11-.101-.143-.137-.146a6.6 6.6 0 0 0-1.142 0ZM11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM9.5 8a1.5 1.5 0 1 0-3.001.001A1.5 1.5 0 0 0 9.5 8Z"></path></svg> Settings]** をクリックします。 \[設定] タブが表示されない場合は、 **\[<svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-kebab-horizontal" aria-label="More" role="img"><path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg>]** ドロップダウン メニューを選び、 **\[設定]** をクリックします。

   ![組織のプロファイルのタブのスクリーンショット。 \[設定\] タブが濃いオレンジ色の枠線で囲まれています。](/assets/images/help/discussions/org-settings-global-nav-update.png)

4. サイドバーの「セキュリティ」セクションで、 **Advanced Security** ドロップダウンメニューを選択し、 **Global settings** をクリックします。

5. \[カスタム パターン] で、目的のパターンの <svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-pencil" aria-label="Edit custom pattern" role="img"><path d="M11.013 1.427a1.75 1.75 0 0 1 2.474 0l1.086 1.086a1.75 1.75 0 0 1 0 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 0 1-.927-.928l.929-3.25c.081-.286.235-.547.445-.758l8.61-8.61Zm.176 4.823L9.75 4.81l-6.286 6.287a.253.253 0 0 0-.064.108l-.558 1.953 1.953-.558a.253.253 0 0 0 .108-.064Zm1.238-3.763a.25.25 0 0 0-.354 0L10.811 3.75l1.439 1.44 1.263-1.263a.25.25 0 0 0 0-.354Z"></path></svg> をクリックします。

6. カスタム パターンのプッシュ保護を有効にするには、\[プッシュ保護] まで下にスクロールして、**\[有効化]** をクリックします。

   > \[!NOTE]
   >
   > * プッシュ保護を有効にするオプションは、公開されたパターンでのみ表示されます。
   > * カスタム パターンのプッシュ保護は、プッシュ保護として secret scanning が有効になっている組織のリポジトリにのみ適用されます。
   > * 一般的なカスタム パターンに対してプッシュ保護を有効にすると、共同作成者が混乱する可能性があります。

   ![カスタム パターン ページの \[プッシュ保護\] セクションのスクリーンショット。 \[有効にする\] というボタンが濃いオレンジ色の枠線で囲まれています。](/assets/images/help/repository/secret-scanning-custom-pattern-enable-push-protection.png)

### カスタム パターンのリポジトリでプッシュ保護として secret scanning を有効にする

リポジトリ レベルでカスタム パターンのプッシュ保護を有効にする前に、リポジトリのカスタム パターンを定義し、それをリポジトリ内でテストする必要があります。 詳細については、「[シークレット スキャンのカスタム パターンの定義](/ja/code-security/secret-scanning/using-advanced-secret-scanning-and-push-protection-features/custom-patterns/defining-custom-patterns-for-secret-scanning#defining-a-custom-pattern-for-a-repository)」を参照してください。

1. GitHub で、リポジトリのメイン ページに移動します。
2. リポジトリ名の下にある **<svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-gear" aria-label="gear" role="img"><path d="M8 0a8.2 8.2 0 0 1 .701.031C9.444.095 9.99.645 10.16 1.29l.288 1.107c.018.066.079.158.212.224.231.114.454.243.668.386.123.082.233.09.299.071l1.103-.303c.644-.176 1.392.021 1.82.63.27.385.506.792.704 1.218.315.675.111 1.422-.364 1.891l-.814.806c-.049.048-.098.147-.088.294.016.257.016.515 0 .772-.01.147.038.246.088.294l.814.806c.475.469.679 1.216.364 1.891a7.977 7.977 0 0 1-.704 1.217c-.428.61-1.176.807-1.82.63l-1.102-.302c-.067-.019-.177-.011-.3.071a5.909 5.909 0 0 1-.668.386c-.133.066-.194.158-.211.224l-.29 1.106c-.168.646-.715 1.196-1.458 1.26a8.006 8.006 0 0 1-1.402 0c-.743-.064-1.289-.614-1.458-1.26l-.289-1.106c-.018-.066-.079-.158-.212-.224a5.738 5.738 0 0 1-.668-.386c-.123-.082-.233-.09-.299-.071l-1.103.303c-.644.176-1.392-.021-1.82-.63a8.12 8.12 0 0 1-.704-1.218c-.315-.675-.111-1.422.363-1.891l.815-.806c.05-.048.098-.147.088-.294a6.214 6.214 0 0 1 0-.772c.01-.147-.038-.246-.088-.294l-.815-.806C.635 6.045.431 5.298.746 4.623a7.92 7.92 0 0 1 .704-1.217c.428-.61 1.176-.807 1.82-.63l1.102.302c.067.019.177.011.3-.071.214-.143.437-.272.668-.386.133-.066.194-.158.211-.224l.29-1.106C6.009.645 6.556.095 7.299.03 7.53.01 7.764 0 8 0Zm-.571 1.525c-.036.003-.108.036-.137.146l-.289 1.105c-.147.561-.549.967-.998 1.189-.173.086-.34.183-.5.29-.417.278-.97.423-1.529.27l-1.103-.303c-.109-.03-.175.016-.195.045-.22.312-.412.644-.573.99-.014.031-.021.11.059.19l.815.806c.411.406.562.957.53 1.456a4.709 4.709 0 0 0 0 .582c.032.499-.119 1.05-.53 1.456l-.815.806c-.081.08-.073.159-.059.19.162.346.353.677.573.989.02.03.085.076.195.046l1.102-.303c.56-.153 1.113-.008 1.53.27.161.107.328.204.501.29.447.222.85.629.997 1.189l.289 1.105c.029.109.101.143.137.146a6.6 6.6 0 0 0 1.142 0c.036-.003.108-.036.137-.146l.289-1.105c.147-.561.549-.967.998-1.189.173-.086.34-.183.5-.29.417-.278.97-.423 1.529-.27l1.103.303c.109.029.175-.016.195-.045.22-.313.411-.644.573-.99.014-.031.021-.11-.059-.19l-.815-.806c-.411-.406-.562-.957-.53-1.456a4.709 4.709 0 0 0 0-.582c-.032-.499.119-1.05.53-1.456l.815-.806c.081-.08.073-.159.059-.19a6.464 6.464 0 0 0-.573-.989c-.02-.03-.085-.076-.195-.046l-1.102.303c-.56.153-1.113.008-1.53-.27a4.44 4.44 0 0 0-.501-.29c-.447-.222-.85-.629-.997-1.189l-.289-1.105c-.029-.11-.101-.143-.137-.146a6.6 6.6 0 0 0-1.142 0ZM11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM9.5 8a1.5 1.5 0 1 0-3.001.001A1.5 1.5 0 0 0 9.5 8Z"></path></svg> \[Settings]** をクリックします。 \[設定] タブが表示されない場合は、 **\[<svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-kebab-horizontal" aria-label="More" role="img"><path d="M8 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3ZM1.5 9a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Zm13 0a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z"></path></svg>]** ドロップダウン メニューを選び、 **\[設定]** をクリックします。

   ![タブを示すリポジトリ ヘッダーのスクリーンショット。 \[設定\] タブが濃いオレンジ色の枠線で強調表示されています。](/assets/images/help/repository/repo-actions-settings.png)
3. サイドバーの \[Security] セクションで、**\[<svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-codescan" aria-label="codescan" role="img"><path d="M8.47 4.97a.75.75 0 0 0 0 1.06L9.94 7.5 8.47 8.97a.75.75 0 1 0 1.06 1.06l2-2a.75.75 0 0 0 0-1.06l-2-2a.75.75 0 0 0-1.06 0ZM6.53 6.03a.75.75 0 0 0-1.06-1.06l-2 2a.75.75 0 0 0 0 1.06l2 2a.75.75 0 1 0 1.06-1.06L5.06 7.5l1.47-1.47Z"></path><path d="M12.246 13.307a7.501 7.501 0 1 1 1.06-1.06l2.474 2.473a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM1.5 7.5a6.002 6.002 0 0 0 3.608 5.504 6.002 6.002 0 0 0 6.486-1.117.748.748 0 0 1 .292-.293A6 6 0 1 0 1.5 7.5Z"></path></svg> Advanced Security]** をクリックします。
4. \[Secret Protection] の \[カスタム パターン] で、目的のパターンの <svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-pencil" aria-label="Edit custom pattern" role="img"><path d="M11.013 1.427a1.75 1.75 0 0 1 2.474 0l1.086 1.086a1.75 1.75 0 0 1 0 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 0 1-.927-.928l.929-3.25c.081-.286.235-.547.445-.758l8.61-8.61Zm.176 4.823L9.75 4.81l-6.286 6.287a.253.253 0 0 0-.064.108l-.558 1.953 1.953-.558a.253.253 0 0 0 .108-.064Zm1.238-3.763a.25.25 0 0 0-.354 0L10.811 3.75l1.439 1.44 1.263-1.263a.25.25 0 0 0 0-.354Z"></path></svg> をクリックします。
5. カスタム パターンのプッシュ保護を有効にするには、\[プッシュ保護] まで下にスクロールして、**\[有効化]** をクリックします。

   > \[!NOTE] プッシュ保護を有効にするオプションは、公開されたパターンでのみ表示されます。

   ![カスタム パターン ページの \[プッシュ保護\] セクションのスクリーンショット。 \[有効にする\] というボタンが濃いオレンジ色の枠線で囲まれています。](/assets/images/help/repository/secret-scanning-custom-pattern-enable-push-protection.png)