[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-04 UTC。"],[],[],null,["# Enable data loss prevention\n\nThis document describes how to safeguard your sensitive information with\nintegrated data loss prevention (DLP) in Secure Source Manager.\n\nDLP in Secure Source Manager, enhances the security of your codebase by\nanalyzing every commit pushed to your repositories, actively scanning for\nsensitive information that should be encrypted or removed. If such data is\ndetected, DLP automatically rejects the push, preventing sensitive details from\nbeing inadvertently merged.\n| **Note:** When using DLP, it is recommended that your commit doesn't exceed 100MB.\n\nDLP in Secure Source Manager treats the following categories of information as\nsensitive:\n\n- **Encryption Keys**: This includes items like SSH public keys.\n- **AWS Credentials**: Access keys and secret keys for Amazon Web Services.\n- **GCP Credentials**: Service account keys and other Google Cloud secrets.\n- **OAuth Client Secrets**: Secrets used for application authentication using OAuth.\n- **Secret Keys**: Sensitive keys used for authentication or authorization.\n\nEnable data loss prevention\n---------------------------\n\nEnsure the following roles and settings are enabled for your repository.\n\n### Required roles\n\n\nTo get the permissions that\nyou need to enable Data Loss Prevention,\n\nask your administrator to grant you the\n\n\n[Secure Source Manager Repository Admin](/iam/docs/roles-permissions/securesourcemanager#securesourcemanager.repoAdmin) (`roles/securesourcemanager.repoAdmin`)\nIAM role on the Secure Source Manager instance.\n\n\nFor more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\nYou might also be able to get\nthe required permissions through [custom\nroles](/iam/docs/creating-custom-roles) or other [predefined\nroles](/iam/docs/roles-overview#predefined).\n\nFor information on granting Secure Source Manager roles,\nsee [Access control with IAM](/secure-source-manager/docs/access-control) and\n[Grant users instance access](/secure-source-manager/docs/grant-users-instance-access).\n\n### Update repository settings\n\nYou can activate DLP for your repositories through the Secure Source Manager\ninterface:\n\n1. Navigate to the repository where you want to enable DLP.\n2. Click the **Settings** icon.\n3. Locate the **Data Loss Prevention** toggle switch.\n4. Slide the toggle to the **On** position.\n\nWorking with DLP in Secure Source Manager\n-----------------------------------------\n\nOnce DLP is enabled, it actively monitors commits to your repository. If any\nsensitive information is identified in a commit, the system prevents the commit\nfrom being merged, and users receive an error message in their command-line\ninterface indicating the presence of sensitive data. At this point, users have\ntwo options:\n\n### Revert the change\n\nTo remove the sensitive information, you can revert the problematic commit using\nthe following command: \n\n git reset --soft \u003cvar label=\"project id\" translate=\"no\"\u003esha1-commit-id\u003c/var\u003e\n\nReplace \u003cvar translate=\"no\"\u003esha1-commit-id\u003c/var\u003e with the actual commit ID.\n\nBecause Git retains the history of all commits, sensitive material can still be\nrecovered from previous commits. To avoid this, use the `git reset --soft`\ncommand. Then, correct the files and commit them again to remove the data from\nthe branch's recent history.\n\n### Force-push the commit (bypass DLP)\n\nIn specific situations where the detected information is deemed acceptable,\nusers with appropriate permissions can choose to bypass the DLP check and\nforce-push the commit: \n\n git push -o dlpskip=true origin \u003cvar label=\"branch name\" translate=\"no\"\u003ebranch-name\u003c/var\u003e\n\nReplace \u003cvar translate=\"no\"\u003ebranch-name\u003c/var\u003e with the name of the branch you're merging.\n| **Note:** Force-pushing should be used with extreme care, because it can overwrite remote history and bypass important security checks. Ensure you fully understand the implications before using this option.\n\nWhat's next\n-----------\n\n- [Branch protection overview](/secure-source-manager/docs/branch-protection-overview)"]]