Administrators
GPO and registry
3 min read
The most common way to distribute the Versora policy in a company is through the Windows registry, in the policies key. GPO writes the values, and Versora reads them when it opens.
| Key | When to use it | Weight |
|---|---|---|
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\MCK2\Versora | Computer policy: applies to all users of the machine. | Strongest |
HKEY_CURRENT_USER\SOFTWARE\Policies\MCK2\Versora | User policy: follows the person on any machine in the domain. | Right below HKLM |
Each key comes from the first source that has a valid value: first HKLM, then HKCU, then the policy.yml file. The sources don't add up within the same key.
For IT
The Policies subkey is writable only by administrators and by GPO. Regular users can only read it. That's why Versora trusts it without checking anything else.
One value per policy key, with the key's name. The name ignores case, _, - and .: AllowedServers, allowed_servers and Allowed-Servers are the same value. The reference for the names is in Policy keys.
Accepted types:
| Type | Use |
|---|---|
REG_SZ | Text: "Proxy"="http://proxy.empresa.com.br:3128". Also lists separated by ; or ,. |
REG_EXPAND_SZ | Text with %VARIABLE%. Versora expands the variables in DefaultsFolder. |
REG_DWORD | Numbers and on/off: "CommitTitleMax"=dword:00000048 (72), "SecretsScan"=dword:00000001. |
REG_QWORD | Numbers, like REG_DWORD. |
REG_MULTI_SZ | Lists, one item per line. |
Binary values and values larger than 64 KB are ignored.
Lists. Choose one of the formats:
REG_SZwith the items separated by;or,:"AllowedServers"="gitlab.empresa.com.br;*.empresa.com.br";REG_MULTI_SZ, with one item per line.
An unknown name appears in Preferences › Policy and team as "unknown keys: …". Check the spelling: the value doesn't apply.
The file below locks the proxy, limits the servers, turns on secret scanning, hides the SSH and GPG keys page, turns off team commands, sets a floor for commit messages, protects main and release/* in every repository, distributes the OAuth sign-in client id and keeps updates on the Stable channel only.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\MCK2\Versora]
"Proxy"="http://proxy.empresa.com.br:3128"
"ProxyBypass"="localhost;*.empresa.com.br"
"AllowedServers"="gitlab.empresa.com.br;*.empresa.com.br"
"SecretsScan"=dword:00000001
"Telemetry"="off"
"PreferencesHidden"="keys"
"PreferencesLocked"="network"
"TeamCommands"="deny"
"WelcomeWizard"="show"
"CommitTitleMax"=dword:00000048
"CommitConventional"="required"
"CommitTypes"="feat;fix;docs;refactor;test;chore"
"CommitSignoff"=dword:00000001
"AiCoauthor"="suggested"
"AiTrailer"="Co-authored-by: AI Assistant <[email protected]>"
"ProtectedBranches"="main;release/*"
"OAuthClientIds"="gitlab.empresa.com.br=<OAuth application's Application ID>"
"Updates"="stable"
Replace <OAuth application's Application ID> with the real client id of the application registered on GitLab. See Deployment.
For the user policy, use the same content with [HKEY_CURRENT_USER\SOFTWARE\Policies\MCK2\Versora].
There's no Versora ADMX template yet. Use one of these paths:
- registry Group Policy Preferences (GPP), creating the values above in the
SOFTWARE\Policies\MCK2\Versorakey:- for HKLM, in Computer Configuration › Preferences › Windows Settings › Registry;
- for HKCU, in User Configuration › Preferences › Windows Settings › Registry;
- the
.regfile imported by a machine startup script; - the
policy.ymlfile, distributed to%ProgramData%\MCK2\Versora\, when the machine isn't in a domain.
In each node, create one registry item per value, with the SOFTWARE\Policies\MCK2\Versora key (in HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER), the value name (for example Proxy) and one of the accepted types (see the table above). After applying the GPO, check it on the machine (see below).
- On the test machine, apply the GPO (or import the
.reg). - Open Versora. If it was already open, go to Preferences › Policy and team and click Reload the policy.
- Check:
- the Computer GPO source (or User GPO) with the "in effect" state;
- each value in the list, with the source badge;
- Ignored values: it should be empty. If it isn't, the line gives the key and the reason, for example "invalid proxy: … (use system, none or
http://host:port)"; - no "unknown keys: …".
- Open the affected pages (Network, Checks…) and check the "set by your company" notices.
Delete the value from the registry (or remove it from the GPO) and ask the person to reopen Versora or click Reload the policy. The choice they had before applies again, because the policy never erases preferences.