# Trusted Git repository policy

Canonical: https://www.nsecsoft.com/en/docs/ping64-data-security/dlp/git/policy/

Language: en-US

Updated: 2026-11-15T03:43:45.102775Z

Git Repository Access Control configures trusted repository scopes for Windows endpoints and records recognizable standard Git repository access. When an endpoint identifies an untrusted repository, it attempts to terminate the related Git process. Rule matching, process termination, and completion of the repository operation are different outcomes and must be checked separately.

This feature does not guarantee coverage of every Git client, command, or transport. It does not replace repository permissions, network controls, or other data security measures.

## Before You Begin

-   Use an account authorized to manage Data Loss Prevention policies. Viewing related records requires the appropriate viewing permission and can be performed by a person with that permission. Confirm pilot Windows endpoints are enrolled and appropriately licensed and within the administrator’s visible scope.
-   List required repository addresses, protocols, and ports. Distinguish access to an individual repository from access to an entire namespace. Do not include passwords or access tokens in addresses; account permissions remain managed by the Git service.
-   Prepare authorized trusted and untrusted test targets with test accounts and nonsensitive content. The policy may interrupt development or builds; start with a small number of recoverable pilot endpoints and prepare a rollback plan.

## Configure Trusted Repositories

1.  Switch to Data Loss Prevention, open Applications, enter **Git Repository Access Control**, and select **Trusted Repository Policies**.
2.  Create or edit a policy, enter its name, and check the effective time and target endpoints, groups, or tags. Start with the pilot scope.
3.  Under **Trusted Repositories**, select **Add Repository**. For each rule choose **Exact Repository** or **Repository Namespace** and enter the corresponding address. A policy requires 1 to 500 valid rules; do not add duplicates.
4.  Check the protocol, host, port, and path. HTTP, HTTPS, SSH, Git protocol addresses, and common abbreviated SSH addresses can be entered. Different protocols are not automatically equivalent; nondefault ports also affect matching.
5.  Save the entire policy and wait for the pilot endpoints to receive it. Test trusted and untrusted targets separately, then check matching and enforcement under **Access Records**. Expand the scope only after verification and the organization's change process.

These example addresses are not default trusted scopes:

| Rule | Example | Scope |
| --- | --- | --- |
| Exact Repository | `https://git.example.com/team/project.git` | Matches that repository, not all other repositories in the team. |
| Repository Namespace | `https://git.example.com/team` | Matches that path and its descendants, not a different path level with a similar prefix. |

For example, do not assume an HTTPS rule covers an SSH address on the same host. Configure and test each when both are needed. A namespace usually covers more repositories than an exact rule; verify the entire scope before saving.

**Address matching:** With the same protocol, host, and port, matching ignores a trailing `.git` in the repository path. Host names are case-insensitive, but repository paths are case-sensitive. For example, `team/project.git` and `team/project` match the same repository path; do not assume `team/Project` and `team/project` are equivalent. Test against the actual service addresses.

## Limitations and Troubleshooting

-   **Coverage:** Recognizable standard Git network operations include clone, fetch, pull, and push. Pilot different commands, options, clients, and Git LFS scenarios separately. An absent record does not prove no access occurred.
    
-   **Unidentified target:** Some targets that cannot be resolved are not blocked as untrusted. Use additional controls; do not treat this feature as a guarantee against every outbound transfer.
    
-   **Untrusted access not blocked:** Check whether the actual target was identified, the match result, and process enforcement. Termination may fail or the process may already have exited; even successful termination does not prove there was no earlier network communication or transfer.
    
-   **Trusted repository affected:** Check policy receipt and the actual address protocol, port, and path; check address rewriting and namespace scope. After changes, retest both allowed and restricted scenarios.
    
-   **Record not found:** Check endpoint and policy status, authorization, account visibility, dates, and filters; retry after reporting. If normal development is affected, restore business operations under your organization's process before reviewing scope.
    
-   [Git repository access records](https://www.nsecsoft.com/en/docs/ping64-data-security/dlp/git/records/)
