Comments (6)
That file is a sample file that's not intended to be used directly until it's modified.
For booleans, it shows both options.
This would normally be generated by hand based on the info in the template docs.
Someone built an addon to do this as well
https://addons.mozilla.org/en-US/firefox/addon/enterprise-policy-generator/
from policy-templates.
That file is a sample file that's not intended to be used directly until it's modified.
For booleans, it shows both options.
Yes, I know, that takes a lot of conversion, and I've noticed some errors.
This would normally be generated by hand based on the info in the template docs.
Oh, and thanks for the work you put into this, it would be nice to have some automated processes.
https://addons.mozilla.org/en-US/firefox/addon/enterprise-policy-generator/
Good to know, I checked out the project and it produces some meta data policies.js
, that's nice, but it seems the project stopped being updated about 4 years ago?
I was just thinking about something simple that would be helpful for this project, maybe just some cli utils.
By the way, I just performed some simple transformations on it (unfinished):
policy-templates.d.ts
/**
* @see {@link https://mozilla.github.io/policy-templates/#preferences Preferences}
*/
interface Preferences {
Type?: "number" | "boolean" | "string";
Value: number | boolean | string;
Status: "default" | "locked" | "user" | "clear";
}
/**
* @see {@link https://github.com/mozilla/policy-templates/blob/master/linux/policies.json}
*/
interface PolicyTemplate {
policies?: {
/** example: "managedfirefox.com,example.com" */
AllowedDomainsForApps?: string;
AppAutoUpdate?: boolean;
/** example: "106." */
AppUpdatePin?: string;
/** example: "https://yoursite.com" */
AppUpdateURL?: string;
Authentication?: {
/** example: ["mydomain.com", "https://myotherdomain.com"] */
SPNEGO?: string[];
/** example: ["mydomain.com", "https://myotherdomain.com"] */
Delegated?: string[];
/** example: ["mydomain.com", "https://myotherdomain.com"] */
NTLM?: string[];
AllowNonFQDN?: {
SPNEGO?: boolean;
NTLM?: boolean;
};
AllowProxies?: {
SPNEGO?: boolean;
NTLM?: boolean;
};
Locked?: boolean;
PrivateBrowsing?: boolean;
};
AutoLaunchProtocolsFromOrigins?: [
{
/** example: "zoommtg" */
protocol?: string;
/** example: ["https://somesite.zoom.us"] */
allowed_origins?: string[];
}
];
BackgroundAppUpdate?: boolean;
BlockAboutAddons?: boolean;
BlockAboutConfig?: boolean;
BlockAboutProfiles?: boolean;
BlockAboutSupport?: boolean;
Bookmarks?: [
{
/** example: "Example" */
Title?: string;
/** example: "https://example.com" */
URL?: string;
/** example: "https://example.com/favicon.ico" */
Favicon?: string;
Placement?: "toolbar" | "menu";
/** example: "FolderName" */
Folder?: string;
}
];
CaptivePortal?: boolean;
Certificates?: {
/** example: ["cert1.der", "/home/username/cert2.pem"] */
Install?: string[];
};
Containers?: {
Default?: [
{
/** example: "My container" */
name?: string;
/** example: "pet" */
icon?: string;
/** example: "turquoise" */
color?: string;
}
];
};
Cookies?: {
/** example: ["http://example.org/"] */
Allow?: string[];
/** example: ["http://example.edu/"] */
AllowSession?: string[];
/** example: ["http://example.edu/"] */
Block?: string[];
Default?: boolean;
AcceptThirdParty?: "always" | "never" | "from-visited";
ExpireAtSessionEnd?: boolean;
RejectTracker?: boolean;
Locked?: boolean;
Behavior?:
| "accept"
| "reject-foreign"
| "reject"
| "limit-foreign"
| "reject-tracker"
| "reject-tracker-and-partition-foreign";
BehaviorPrivateBrowsing?:
| "accept"
| "reject-foreign"
| "reject"
| "limit-foreign"
| "reject-tracker"
| "reject-tracker-and-partition-foreign";
};
/** example: "${home}/Downloads" */
DefaultDownloadDirectory?: string;
DisableAppUpdate?: boolean;
DisableBuiltinPDFViewer?: boolean;
DisabledCiphers?: {
CIPHER_NAME?: boolean;
};
DisableDeveloperTools?: boolean;
DisableFeedbackCommands?: boolean;
DisableFirefoxAccounts?: boolean;
DisableFirefoxScreenshots?: boolean;
DisableFirefoxStudies?: boolean;
DisableForgetButton?: boolean;
DisableFormHistory?: boolean;
DisableMasterPasswordCreation?: boolean;
DisablePasswordReveal?: boolean;
DisablePocket?: boolean;
DisablePrivateBrowsing?: boolean;
DisableProfileImport?: boolean;
DisableProfileRefresh?: boolean;
DisableSafeMode?: boolean;
DisableSecurityBypass?: {
InvalidCertificate?: boolean;
SafeBrowsing?: boolean;
};
DisableSetDesktopBackground?: boolean;
DisableSystemAddonUpdate?: boolean;
DisableTelemetry?: boolean;
DisplayBookmarksToolbar?: "always" | "never" | "newtab";
DisplayMenuBar?: "always" | "never" | "default-on" | "default-off";
DNSOverHTTPS?: {
Enabled?: boolean;
/** example: "URL_TO_ALTERNATE_PROVIDER" */
ProviderURL?: string;
Locked?: boolean;
/** example: ["example.com"] */
ExcludedDomains?: string[];
};
DontCheckDefaultBrowser?: boolean;
/** example: "${home}/Downloads" */
DownloadDirectory?: string;
EnableTrackingProtection?: {
Value?: boolean;
Locked?: boolean;
Cryptomining?: boolean;
Fingerprinting?: boolean;
EmailTracking?: boolean;
/** example: ["https://example.com"] */
Exceptions?: string[];
};
EncryptedMediaExtensions?: {
Enabled?: boolean;
Locked?: boolean;
};
ExemptDomainFileTypePairsFromFileTypeDownloadWarnings?: [
{
/** example: "jnlp" */
file_extension?: string;
/** example: ["example.com"] */
domains?: string[];
}
];
Extensions?: {
Install?: [
"https://addons.mozilla.org/firefox/downloads/somefile.xpi",
"//path/to/xpi"
];
/** example: ["[email protected]"] */
Uninstall?: string[];
/** example: ["[email protected]"] */
Locked?: string[];
};
ExtensionSettings?: {
"*": {
/** example: "Custom error message." */
blocked_install_message?: string;
/** example: ["https://yourwebsite.com/*"] */
install_sources?: string[];
/** example: "blocked" */
installation_mode?: string;
/** example: ["extension"] */
allowed_types?: string[];
};
"[email protected]": {
/** example: "force_installed" */
installation_mode?: string;
/** example: "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi" */
install_url?: string;
};
"[email protected]": {
/** example: "allowed" */
installation_mode?: string;
};
};
ExtensionUpdate?: boolean;
FirefoxHome?: {
Search?: boolean;
TopSites?: boolean;
SponsoredTopSites?: boolean;
Highlights?: boolean;
Pocket?: boolean;
SponsoredPocket?: boolean;
Snippets?: boolean;
Locked?: boolean;
};
FirefoxSuggest?: {
WebSuggestions?: boolean;
SponsoredSuggestions?: boolean;
ImproveSuggest?: boolean;
Locked?: boolean;
};
GoToIntranetSiteForSingleWordEntryInAddressBar?: boolean;
Handlers?: {
mimeTypes?: {
"application/msword": {
/** example: "useSystemDefault" */
action?: string;
ask?: false;
};
};
schemes?: {
mailto?: {
/** example: "useHelperApp" */
action?: string;
ask?: boolean;
handlers?: [
{
/** example: "Gmail" */
name?: string;
/** example: "https://mail.google.com/mail/?extsrc=mailto&url=%s" */
uriTemplate?: string;
}
];
};
};
extensions?: {
pdf?: {
/** example: "useHelperApp" */
action?: string;
ask?: boolean;
handlers?: [
{
/** example: "Adobe Acrobat" */
name?: string;
/** example: "/usr/bin/acroread" */
path?: string;
}
];
};
};
};
HardwareAcceleration?: boolean;
Homepage?: {
/** example: "http://example.com/" */
URL?: string;
Locked?: boolean;
/** example: ["http://example.org/", "http://example.edu/"] */
Additional?: string[];
StartPage?: "none" | "homepage" | "previous-session" | "homepage-locked";
};
InstallAddonsPermission?: {
/** example: ["http://example.org/", "http://example.edu/"] */
Allow?: string[];
Default?: boolean;
};
LegacySameSiteCookieBehaviorEnabled?: boolean;
/** example: ["example.org", "example.edu"] */
LegacySameSiteCookieBehaviorEnabledForDomainList?: string[];
/** example: ["http://example.org/", "http://example.edu/"] */
LocalFileLinks?: string[];
ManagedBookmarks?: [
{
/** example: "My managed bookmarks folder" */
toplevel_name?: string;
},
{
/** example: "example.com" */
url?: string;
/** example: "Example" */
name?: string;
},
{
/** example: "Mozilla links" */
name?: string;
children?: [
{
/** example: "https://mozilla.org" */
url?: string;
/** example: "Mozilla.org" */
name?: string;
},
{
/** example: "https://support.mozilla.org/" */
url?: string;
/** example: "SUMO" */
name?: string;
}
];
}
];
NetworkPrediction?: boolean;
NewTabPage?: boolean;
NoDefaultBookmarks?: boolean;
OfferToSaveLogins?: boolean;
OfferToSaveLoginsDefault?: boolean;
/** example: "http://example.org" */
OverrideFirstRunPage?: string;
/** example: "http://example.org" */
OverridePostUpdatePage?: string;
PasswordManagerEnabled?: boolean;
/** example: ["https://example.org", "https://example.edu"] */
PasswordManagerExceptions?: string[];
PDFjs?: {
Enabled?: boolean;
EnablePermissions?: boolean;
};
Permissions?: {
Camera?: {
/** example: ["https://example.org", "https://example.org:1234"] */
Allow?: string[];
/** example: ["https://example.edu"] */
Block?: string[];
BlockNewRequests?: boolean;
Locked?: boolean;
};
Microphone?: {
/** example: ["https://example.org"] */
Allow?: string[];
/** example: ["https://example.edu"] */
Block?: string[];
BlockNewRequests?: boolean;
Locked?: boolean;
};
Location?: {
/** example: ["https://example.org"] */
Allow?: string[];
/** example: ["https://example.edu"] */
Block?: string[];
BlockNewRequests?: boolean;
Locked?: boolean;
};
Notifications?: {
/** example: ["https://example.org"] */
Allow?: string[];
/** example: ["https://example.edu"] */
Block?: string[];
BlockNewRequests?: boolean;
Locked?: boolean;
};
Autoplay?: {
/** example: ["https://example.org"] */
Allow?: string[];
/** example: ["https://example.edu"] */
Block?: string[];
Default?: "allow-audio-video" | "block-audio" | "block-audio-video";
Locked?: boolean;
};
};
PictureInPicture?: {
Enabled?: boolean;
Locked?: boolean;
};
PopupBlocking?: {
/** example: ["http://example.org/", "http://example.edu/"] */
Allow?: string[];
Default?: boolean;
Locked?: boolean;
};
Preferences?: { [x: string]: Preferences };
PrimaryPassword?: boolean;
PrintingEnabled?: boolean;
PromptForDownloadLocation?: boolean;
Proxy?: {
Mode?: "none" | "system" | "manual" | "autoDetect" | "autoConfig";
Locked?: boolean;
/** example: "hostname" */
HTTPProxy?: string;
UseHTTPProxyForAllProtocols?: boolean;
/** example: "hostname" */
SSLProxy?: string;
/** example: "hostname" */
FTPProxy?: string;
/** example: "hostname" */
SOCKSProxy?: string;
SOCKSVersion?: 4 | 5;
/** example: "<local>" */
Passthrough?: string;
/** example: "URL_TO_AUTOCONFIG" */
AutoConfigURL?: string;
AutoLogin?: boolean;
UseProxyForDNS?: boolean;
};
/** example: "de,en-US" */
RequestedLocales?: string;
SanitizeOnShutdown?: {
Cache?: boolean;
Cookies?: boolean;
Downloads?: boolean;
FormData?: boolean;
History?: boolean;
Sessions?: boolean;
SiteSettings?: boolean;
OfflineApps?: boolean;
Locked?: boolean;
};
SearchEngines?: {
Add?: [
{
/** example: "Example1" */
Name?: string;
/** example: "https://www.example.org/q={searchTerms}" */
URLTemplate?: string;
Method?: "GET" | "POST";
/** example: "https://www.example.org/favicon.ico" */
IconURL?: string;
/** example: "example" */
Alias?: string;
/** example: "Description" */
Description?: string;
/** example: "name=value&q={searchTerms}" */
PostData?: string;
/** example: "https://www.example.org/suggestions/q={searchTerms}" */
SuggestURLTemplate?: string;
}
];
/** example: "NAME_OF_SEARCH_ENGINE" */
Default?: string;
PreventInstalls?: boolean;
/** example: ["NAME_OF_SEARCH_ENGINE"] */
Remove?: string[];
};
SearchSuggestEnabled?: boolean;
SecurityDevices?: {
/** example: "PATH_TO_LIBRARY_FOR_DEVICE" */
NAME_OF_DEVICE?: string;
};
ShowHomeButton?: boolean;
SSLVersionMax?: "tls1" | "tls1.1" | "tls1.2" | "tls1.3";
SSLVersionMin?: "tls1" | "tls1.1" | "tls1.2" | "tls1.3";
SupportMenu?: {
/** example: "Support Menu" */
Title?: string;
/** example: "http://example.com/support" */
URL?: string;
/** example: "S" */
AccessKey?: string;
};
StartDownloadsInTempDirectory?: boolean;
UserMessaging?: {
WhatsNew?: boolean;
ExtensionRecommendations?: boolean;
FeatureRecommendations?: boolean;
UrlbarInterventions?: boolean;
SkipOnboarding?: boolean;
MoreFromMozilla?: boolean;
Locked?: boolean;
};
UseSystemPrintDialog?: boolean;
WebsiteFilter?: {
/** example: ["<all_urls>"] */
Block?: string[];
/** example: ["http://example.org/*"] */
Exceptions?: string[];
};
};
}
from policy-templates.
So you're thinking this would be a separate file in github?
from policy-templates.
So you're thinking this would be a separate file in github?
I don't know. What do you think? If that helps people use the repo and get continued updates, why not?
But more importantly, I don't want anyone to increase their workload by maintaining this file individually.
So I'd like to have a set of source data there for generating these types, demo templates, or even the documentation.
Essentially I hope to reduce the workload of this repo and make it more usable by people.
It's not that easy to create anything useful from a document, and it's easy to make mistakes by repeating templates by hand.
Specifically, I might want create a generator similar to the project below that generates the required file types from upstream source data and is sustainably maintained.
Making an external project or extension may be easy, but keeping it up to date with upstream is not easy unless we embed it into a CI/CD workflow.
from policy-templates.
So it looks like the required upstream source data is at: policies-schema.json
from policy-templates.
I love this idea. Policies-schema.json definitely has all the information we need in it.
I'll support you however I can.
Right now my release work is very manual and anything I could automate would be great.
from policy-templates.
Related Issues (20)
- https-only mode and https-only exceptions HOT 12
- Bug: DNSOverHTTPS policy ignores other settings when "Locked": true is used. HOT 4
- Remove deprecated keys in example templates? HOT 2
- Add more missing `Preferences` ? HOT 11
- Blocking `about:telemetry` should be set separately out of `DisableTelemetry`? HOT 2
- Dead link in document `Adding policy support to your extension` HOT 3
- GPO Wish: dom.block_download_insecure HOT 4
- `PasswordManagerEnabled` should also hide `Manage Passwords` menu HOT 1
- About `runOncePerModification` policies HOT 2
- Intune Policy for "Signon.autofillForms" missing? HOT 4
- Please add new release for Firefox 127 HOT 1
- ExtensionSettings blocking browser localization HOT 12
- ExtensionSettings and removing add-ons HOT 4
- `NetworkPrediction` and bug 1596935? HOT 2
- GPO does not activate the Proxy HOT 3
- [Help] How to add multiple URLs to Allowed Notification Policy? HOT 6
- Policies aren't applying ? HOT 2
- Missing policy for Privacy-Preserving Attribution HOT 10
- Set default search engines on non-esr version?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from policy-templates.