With an access policy, you can configure restrictions for an organization and its resources as code (Configuration as Code). The configuration is stored in the .sourcecraft/policies.yaml file in the default branch of the special repository named .sourcecraft.
Unauthenticated access to the organization's public resources is prohibited both in the browser and when using Git over HTTP(S).
public_visibility_changes_disabled
You cannot set public visibility for the organization, its projects and repositories, including when creating resources.
non_federative_invitations_disabled
You cannot issue invitations to non-federated users (those without a federation ID), including invitations by email and nickname. For more information, see SAML-compatible identity federations.
To enable the restriction, set the parameter to true. To disable, set to false. By default, all restrictions are disabled.
Note
Once enabled, restrictive policies apply only to new resources and actions.
For example, after enabling the public_visibility_changes_disabled policy, previously created public repositories will remain public.
Similarly, after enabling the non_federative_invitations_disabled policy, previously added non-federated users are not removed from the organization.
List of allowed networks
The policies.ip_allowlist parameter sets the list of client networks from which you can access the organization's resources. It supports IPv4 and IPv6 networks in CIDR format. Networks are converted to canonical form; duplicate records are rejected.
Warning
Before you turn on filtering, make sure the list contains the network you are connecting from. Organization administrators are not exempt from IP address verification.
If the ip_allowlist parameter is missing or contains an empty list, IP address filtering is disabled. To disable previously configured filtering, set ip_allowlist: [] inside the policies section and save the changes to the default branch.
Using the list:
The list is updated after processing the changes pushed to the default branch. In the event of an update error, the previous rules are retained.
Requests originating from configured internal service networks and specific system background operations are exempt from the check.
Signed URL requests go through IP address verification, except for Git LFS signed URLs. You can use an already issued Git LFS link to get the file from an IP address outside the list of allowed networks. You cannot get a new link from such an address.
Previously cached public RAW files and repository archives may remain available until the cache expires – for up to five minutes.
If the organization does not renew its paid subscription, access ceases to be restricted.
Network restrictions for CI/CD, AI coworkers, and security scanning
IP address filtering applies to CI/CD. If worker networks are not on the allowlist, CI/CD stops working. Along with CI/CD, AI coworkers and security scanning stop working.
To run CI/CD on custom workers, add to policies.ip_allowlist the networks from which these workers access SourceCraft.
To restore CI/CD on workers provided by SourceCraft, AI coworkers, and security scanning, add the public IP address ranges of Yandex Virtual Private Cloud to policies.ip_allowlist. SourceCraft workers use addresses from these ranges.
Warning
These ranges are also used by virtual machines belonging to other Yandex Cloud users. If entire ranges are added, requests from such virtual machines will pass the allowlist check. This weakens the network restriction on access to the organization's resources.
To set up an access policy in a SourceCraft organization:
If the organization does not yet have a .sourcecraft repository, create one. To configure policies, you will need access to this repository and the ability to make changes to its default branch.
Note
In the organization, the following restrictions apply to the special .sourcecraft repository:
If the changes pass code review, save the configuration in a separate branch and create a pull request. The policies will be applied after merging into the .sourcecraft repository's default branch.
Checking the configuration
On the organization's page, open Settings → Configurations.
Find the Organization policies card and ensure that the Active status is displayed. If the configuration contains errors, fix the file and save the changes to the default branch.
To change the policies, edit the .sourcecraft/policies.yaml file in the .sourcecraft repository and save the changes to the default branch.