Compare commits

...

24 Commits
0.1.0 ... 0.2.0

Author SHA1 Message Date
undergroundwires
47e5560c92 Merge pull request #1 from undergroundwires/develop
Develop
2020-01-06 21:49:28 +00:00
undergroundwires
5cf8614b17 added changelog + version to 0.2.0 2020-01-06 22:43:17 +01:00
undergroundwires
a7da75d442 added text when nothing is chosen 2020-01-06 22:36:48 +01:00
undergroundwires
246e753ddc code-gen refactorings 2020-01-06 22:28:53 +01:00
undergroundwires
60e6348dc8 using font variables 2020-01-06 20:41:37 +01:00
undergroundwires
10a34fae2f added footer with version 2020-01-06 20:40:01 +01:00
undergroundwires
2cf9214b14 more descriptive subtitle 2020-01-06 20:19:35 +01:00
undergroundwires
cced601d68 added hyphen lines for longer names 2020-01-06 20:14:49 +01:00
undergroundwires
3140cc663b default selection is now none 2020-01-06 20:02:12 +01:00
undergroundwires
20020af7c1 using free function 2020-01-06 19:17:02 +01:00
undergroundwires
2aa3742e30 refactorings in parsing 2020-01-06 18:58:56 +01:00
undergroundwires
5ccc7c5952 fixed wrong line dumps 2020-01-06 18:57:00 +01:00
undergroundwires
aaea47e7d1 fixed maintainability badge URL 2020-01-06 18:40:12 +01:00
undergroundwires
57037aaefc simplified finding duplicates 2020-01-06 18:19:28 +01:00
undergroundwires
c359f1d89c 🎨 styled no JS error 2020-01-06 18:05:54 +01:00
undergroundwires
d38f6cd6a8 optimized find queries & refactorings 2020-01-06 17:45:53 +01:00
undergroundwires
c646c10273 refactoring to new function 2020-01-06 17:45:38 +01:00
undergroundwires
aff463dd64 better URL validation 2020-01-06 17:45:24 +01:00
undergroundwires
8d05b03c9f fixed wrong relation + lighter style 2020-01-06 00:11:19 +01:00
undergroundwires
7b4277d770 fixed contribution URL 2020-01-04 18:31:34 +01:00
undergroundwires
beb3c8339f switched content information to "why" section 2020-01-02 13:00:27 +01:00
undergroundwires
e99f210c9d typo fixes + whitespace refactorings 2020-01-01 12:31:41 +01:00
undergroundwires
090e831909 more badges 📛🏆📜 2019-12-31 17:02:08 +00:00
undergroundwires
a229aca68a added GitHub Actions badge for build & deploy 2019-12-31 15:41:38 +00:00
55 changed files with 787 additions and 604 deletions

25
CHANGELOG.md Normal file
View File

@@ -0,0 +1,25 @@
# Changelog
- All notable changes to this project will be documented in this file.
## [Unreleased]
## [0.2.0] - 2020-01-06
- Fixed typo in generated code.
- Better URL validation for documentation links in `application.yaml`.
- Slightly faster parsing of `application.yaml`
- Styled no JS error that's shown when JavaScript is disabled.
- The default selection is now *None* & instruction text is shown in code box when nothing is selected.
- Added hyphen lines when rendering of long function names
- Changed subtitle: added version as footer instead.
## [0.1.0] - 2019-12-31
- Initial release
## All releases
- [Unreleased] : https://github.com/undergroundwires/privacy.sexy/compare/v0.2.0...HEAD
- [v0.2.0] : https://github.com/undergroundwires/privacy.sexy/compare/v0.1.0...v0.2.0
- [v0.1.0] : https://github.com/undergroundwires/privacy.sexy/releases/tag/v0.1.0

View File

@@ -1,16 +1,27 @@
# privacy.sexy # privacy.sexy
Privacy & security generator tool for Windows. ![Build & deploy status](https://github.com/undergroundwires/privacy.sexy/workflows/Build%20&%20deploy/badge.svg)
![Vulnerabilities](https://snyk.io/test/github/undergroundwires/privacy.sexy/badge.svg)
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/undergroundwires/privacy.sexy/issues)
[![Language grade: JavaScript](https://img.shields.io/lgtm/grade/javascript/g/undergroundwires/privacy.sexy.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/undergroundwires/privacy.sexy/context:javascript)
[![Maintainability](https://api.codeclimate.com/v1/badges/3a70b7ef602e2264342c/maintainability)](https://codeclimate.com/github/undergroundwires/privacy.sexy/maintainability)
Web tool to generate scripts for enforcing privacy & security best-practices such as stopping data collection of Windows and different softwares on it.
> because privacy is sexy 🍑🍆 > because privacy is sexy 🍑🍆
[https://privacy.sexy](https://privacy.sexy) [https://privacy.sexy](https://privacy.sexy)
In this repo you find: ## Why privacy.sexy
- Application & infrastructure code of privacy.sexy, simply everything is code & open-sourced. - You don't need to run any compiled software on your system, just run the generated scripts.
- Fully automated CI/CD pipeline to AWS for provisioning serverless infrastructure using GitHub actions. - It's open source, both application & infrastructure is 100% transparent
- Vue.js application in conjunction with domain-driven design, event-driven architecture & data-driven programming. - Fully automated C/CD pipeline to AWS for provisioning serverless infrastructure using GitHub actions.
- Have full visibility into what the tweaks do as you enable them.
- Easily extendable
## Extend scripts
Fork it & add more scripts in `src/application/application.yml` and send a pull request 👌
## Commands ## Commands
@@ -25,10 +36,6 @@ In this repo you find:
- Run tests: `npm run test:unit` - Run tests: `npm run test:unit`
- Lint and fix files: `npm run lint` - Lint and fix files: `npm run lint`
## Extend scripts
Fork it & add more scripts in `src/application/application.yml` and send a pull request 👌
## Architecture ## Architecture
### Application ### Application

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 KiB

After

Width:  |  Height:  |  Size: 236 KiB

View File

@@ -9,11 +9,23 @@
</head> </head>
<body> <body>
<noscript> <noscript>
<strong> <style>
The page does not work without JavaScript enabled. #javascriptDisabled {
Please enable it to continue. background:#eceef1;
There's no shady stuff as 100% of the website is open source. margin: 5rem auto;
</strong> max-width: 800px;
font-size: 7px;
padding: 3rem;
border: 1px solid#333a45;
font-size: 1.5rem;
line-height: 150%;
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
}
</style>
<div id="javascriptDisabled">
<h1>Problem loading page</h1>
<p>The page does not work without JavaScript enabled. Please enable it to use privacy.sexy. There's no shady stuff as 100% of the website is open source.</p>
</div>
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<!-- built files will be auto injected --> <!-- built files will be auto injected -->

View File

@@ -1,17 +1,17 @@
<template> <template>
<div id="app"> <div id="app">
<div class="wrapper"> <div class="wrapper">
<TheHeader <TheHeader class="row"
class="row" github-url="https://github.com/undergroundwires/privacy.sexy" />
github-url="https://github.com/undergroundwires/privacy.sexy"/>
<!-- <TheSearchBar> </TheSearchBar> --> <!-- <TheSearchBar> </TheSearchBar> -->
<!-- <div style="display: flex; justify-content: space-between;"> --> <!-- <div style="display: flex; justify-content: space-between;"> -->
<!-- <TheGrouper></TheGrouper> --> <!-- <TheGrouper></TheGrouper> -->
<TheSelector class="row" /> <TheSelector class="row" />
<!-- </div> --> <!-- </div> -->
<CardList /> <CardList />
<TheCodeArea class="row" theme="xcode"/> <TheCodeArea class="row" theme="xcode" />
<TheCodeButtons class="row" /> <TheCodeButtons class="row" />
<TheFooter />
</div> </div>
</div> </div>
</template> </template>
@@ -20,6 +20,7 @@
import { Component, Vue, Prop } from 'vue-property-decorator'; import { Component, Vue, Prop } from 'vue-property-decorator';
import { ApplicationState, IApplicationState } from '@/application/State/ApplicationState'; import { ApplicationState, IApplicationState } from '@/application/State/ApplicationState';
import TheHeader from './presentation/TheHeader.vue'; import TheHeader from './presentation/TheHeader.vue';
import TheFooter from './presentation/TheFooter.vue';
import TheCodeArea from './presentation/TheCodeArea.vue'; import TheCodeArea from './presentation/TheCodeArea.vue';
import TheCodeButtons from './presentation/TheCodeButtons.vue'; import TheCodeButtons from './presentation/TheCodeButtons.vue';
import TheSearchBar from './presentation/TheSearchBar.vue'; import TheSearchBar from './presentation/TheSearchBar.vue';
@@ -36,6 +37,7 @@ import CardList from './presentation/Scripts/Cards/CardList.vue';
TheGrouper, TheGrouper,
CardList, CardList,
TheSelector, TheSelector,
TheFooter,
}, },
}) })
export default class App extends Vue { export default class App extends Vue {
@@ -53,7 +55,7 @@ export default class App extends Vue {
body { body {
background: $light-gray; background: $light-gray;
font-family: 'Slabo 27px', serif; font-family: $fancy-font;
color: $slate; color: $slate;
} }

View File

@@ -1,103 +0,0 @@
import { Category } from '../domain/Category';
import { Application } from '../domain/Application';
import { Script } from '@/domain/Script';
// import applicationFile from 'js-yaml-loader!@/application/application.yaml';
// import applicationFile from 'json-loader!yaml-loader!@/application/application.yaml';
import applicationFile, { YamlCategory, YamlScript, YamlDocumentable } from 'js-yaml-loader!./application.yaml';
// import test from './test-loader!./test.txt';
interface ApplicationResult {
readonly application: Application;
readonly selectedScripts: Script[];
}
export class ApplicationParser {
public static buildApplication(): ApplicationResult {
const name = applicationFile.name as string;
const version = applicationFile.version as number;
const categories = new Array<Category>();
const selectedScripts = new Array<Script>();
if (!applicationFile.actions || applicationFile.actions.length <= 0) {
throw new Error('Application does not define any action');
}
for (const action of applicationFile.actions) {
const category = ApplicationParser.parseCategory(action, selectedScripts);
categories.push(category);
}
const app = new Application(name, version, categories);
return {application: app, selectedScripts};
}
private static categoryIdCounter = 0;
private static parseCategory(category: YamlCategory, selectedScripts: Script[]): Category {
if (!category.children || category.children.length <= 0) {
throw Error('Category has no children');
}
const subCategories = new Array<Category>();
const subScripts = new Array<Script>();
for (const categoryOrScript of category.children) {
if (ApplicationParser.isCategory(categoryOrScript)) {
const subCategory = ApplicationParser.parseCategory(categoryOrScript as YamlCategory, selectedScripts);
subCategories.push(subCategory);
} else if (ApplicationParser.isScript(categoryOrScript)) {
const yamlScript = categoryOrScript as YamlScript;
const script = new Script(
/* name */ yamlScript.name,
/* code */ yamlScript.code,
/* docs */ this.parseDocUrls(yamlScript));
subScripts.push(script);
if (yamlScript.default === true) {
selectedScripts.push(script);
}
} else {
throw new Error(`Child element is neither a category or a script.
Parent: ${category.category}, element: ${categoryOrScript}`);
}
}
return new Category(
/*id*/ ApplicationParser.categoryIdCounter++,
/*name*/ category.category,
/*docs*/ this.parseDocUrls(category),
/*categories*/ subCategories,
/*scripts*/ subScripts,
);
}
private static parseDocUrls(documentable: YamlDocumentable): ReadonlyArray<string> {
if (!documentable.docs) {
return [];
}
const docs = documentable.docs;
const result = new Array<string>();
const addDoc = (doc: string) => {
if (!doc) {
throw new Error('Documentiton url is null or empty');
}
if (doc.includes('\n')) {
throw new Error('Documentation url cannot be multi-lined.');
}
result.push(doc);
};
if (docs instanceof Array) {
for (const doc of docs) {
if (typeof doc !== 'string') {
throw new Error('Docs field (documentation url) must be an array of strings');
}
addDoc(doc as string);
}
} else if (typeof docs === 'string') {
addDoc(docs as string);
} else {
throw new Error('Docs field (documentation url) must a string or array of strings');
}
return result;
}
private static isScript(categoryOrScript: any): boolean {
return categoryOrScript.code && categoryOrScript.code.length > 0;
}
private static isCategory(categoryOrScript: any): boolean {
return categoryOrScript.category && categoryOrScript.category.length > 0;
}
}

View File

@@ -0,0 +1,20 @@
import { Category } from '../../domain/Category';
import { Application } from '../../domain/Application';
import { Script } from '@/domain/Script';
import applicationFile from 'js-yaml-loader!./../application.yaml';
import { parseCategory } from './CategoryParser';
export function parseApplication(): Application {
const name = applicationFile.name as string;
const version = applicationFile.version as number;
const categories = new Array<Category>();
if (!applicationFile.actions || applicationFile.actions.length <= 0) {
throw new Error('Application does not define any action');
}
for (const action of applicationFile.actions) {
const category = parseCategory(action);
categories.push(category);
}
const app = new Application(name, version, categories);
return app;
}

View File

@@ -0,0 +1,60 @@
import { YamlCategory, YamlScript } from 'js-yaml-loader!./application.yaml';
import { Script } from '@/domain/Script';
import { Category } from '../../domain/Category';
import { parseDocUrls } from './DocumentationParser';
let categoryIdCounter: number = 0;
interface ICategoryChildren {
subCategories: Category[];
subScripts: Script[];
}
export function parseCategory(category: YamlCategory): Category {
if (!category.children || category.children.length <= 0) {
throw Error('Category has no children');
}
const children: ICategoryChildren = {
subCategories: new Array<Category>(),
subScripts: new Array<Script>(),
};
for (const categoryOrScript of category.children) {
parseCategoryChild(categoryOrScript, children, category);
}
return new Category(
/*id*/ categoryIdCounter++,
/*name*/ category.category,
/*docs*/ parseDocUrls(category),
/*categories*/ children.subCategories,
/*scripts*/ children.subScripts,
);
}
function parseCategoryChild(
categoryOrScript: any, children: ICategoryChildren, parent: YamlCategory) {
if (isCategory(categoryOrScript)) {
const subCategory = parseCategory(categoryOrScript as YamlCategory);
children.subCategories.push(subCategory);
} else if (isScript(categoryOrScript)) {
const yamlScript = categoryOrScript as YamlScript;
const script = new Script(
/* name */ yamlScript.name,
/* code */ yamlScript.code,
/* docs */ parseDocUrls(yamlScript),
/* is recommended? */ yamlScript.recommend);
children.subScripts.push(script);
} else {
throw new Error(`Child element is neither a category or a script.
Parent: ${parent.category}, element: ${categoryOrScript}`);
}
}
function isScript(categoryOrScript: any): boolean {
return categoryOrScript.code && categoryOrScript.code.length > 0;
}
function isCategory(categoryOrScript: any): boolean {
return categoryOrScript.category && categoryOrScript.category.length > 0;
}

View File

@@ -0,0 +1,49 @@
import { YamlDocumentable } from 'js-yaml-loader!./application.yaml';
export function parseDocUrls(documentable: YamlDocumentable): ReadonlyArray<string> {
const docs = documentable.docs;
if (!docs) {
return [];
}
const result = new DocumentationUrls();
if (docs instanceof Array) {
for (const doc of docs) {
if (typeof doc !== 'string') {
throw new Error('Docs field (documentation url) must be an array of strings');
}
result.add(doc);
}
} else if (typeof docs === 'string') {
result.add(docs);
} else {
throw new Error('Docs field (documentation url) must a string or array of strings');
}
return result.getAll();
}
class DocumentationUrls {
private readonly urls = new Array<string>();
public add(url: string) {
validateUrl(url);
this.urls.push(url);
}
public getAll(): ReadonlyArray<string> {
return this.urls;
}
}
function validateUrl(docUrl: string): void {
if (!docUrl) {
throw new Error('Documentation url is null or empty');
}
if (docUrl.includes('\n')) {
throw new Error('Documentation url cannot be multi-lined.');
}
const res = docUrl.match(
/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g);
if (res == null) {
throw new Error(`Invalid documentation url: ${docUrl}`);
}
}

View File

@@ -6,7 +6,7 @@ import { IUserSelection } from './Selection/IUserSelection';
import { AsyncLazy } from '../../infrastructure/Threading/AsyncLazy'; import { AsyncLazy } from '../../infrastructure/Threading/AsyncLazy';
import { Signal } from '../../infrastructure/Events/Signal'; import { Signal } from '../../infrastructure/Events/Signal';
import { ICategory } from '../../domain/ICategory'; import { ICategory } from '../../domain/ICategory';
import { ApplicationParser } from '../ApplicationParser'; import { parseApplication } from '../Parser/ApplicationParser';
import { IApplicationState } from './IApplicationState'; import { IApplicationState } from './IApplicationState';
import { Script } from '../../domain/Script'; import { Script } from '../../domain/Script';
import { Application } from '../../domain/Application'; import { Application } from '../../domain/Application';
@@ -21,8 +21,9 @@ export class ApplicationState implements IApplicationState {
/** Application instance with all scripts. */ /** Application instance with all scripts. */
private static instance = new AsyncLazy<IApplicationState>(() => { private static instance = new AsyncLazy<IApplicationState>(() => {
const app = ApplicationParser.buildApplication(); const application = parseApplication();
const state = new ApplicationState(app.application, app.selectedScripts); const selectedScripts = new Array<Script>();
const state = new ApplicationState(application, selectedScripts);
return Promise.resolve(state); return Promise.resolve(state);
}); });
@@ -33,33 +34,13 @@ export class ApplicationState implements IApplicationState {
private constructor( private constructor(
/** Inner instance of the all scripts */ /** Inner instance of the all scripts */
private readonly app: Application, public readonly app: Application,
/** Initially selected scripts */ /** Initially selected scripts */
public readonly defaultScripts: Script[]) { public readonly defaultScripts: Script[]) {
this.selection = new UserSelection(app, defaultScripts); this.selection = new UserSelection(app, defaultScripts);
this.code = new ApplicationCode(this.selection, app.version.toString()); this.code = new ApplicationCode(this.selection, app.version.toString());
this.filter = new UserFilter(app); this.filter = new UserFilter(app);
} }
public getCategory(categoryId: number): ICategory | undefined {
return this.app.findCategory(categoryId);
}
public get categories(): ReadonlyArray<ICategory> {
return this.app.categories;
}
public get appName(): string {
return this.app.name;
}
public get appVersion(): number {
return this.app.version;
}
public get appTotalScripts(): number {
return this.app.totalScripts;
}
} }
export { IApplicationState, IUserFilter }; export { IApplicationState, IUserFilter };

View File

@@ -1,4 +1,4 @@
import { CodeBuilder } from './CodeBuilder'; import { UserScriptGenerator } from './UserScriptGenerator';
import { IUserSelection } from './../Selection/IUserSelection'; import { IUserSelection } from './../Selection/IUserSelection';
import { Signal } from '@/infrastructure/Events/Signal'; import { Signal } from '@/infrastructure/Events/Signal';
import { IApplicationCode } from './IApplicationCode'; import { IApplicationCode } from './IApplicationCode';
@@ -8,12 +8,12 @@ export class ApplicationCode implements IApplicationCode {
public readonly changed = new Signal<string>(); public readonly changed = new Signal<string>();
public current: string; public current: string;
private readonly codeBuilder: CodeBuilder; private readonly generator: UserScriptGenerator;
constructor(userSelection: IUserSelection, private readonly version: string) { constructor(userSelection: IUserSelection, private readonly version: string) {
if (!userSelection) { throw new Error('userSelection is null or undefined'); } if (!userSelection) { throw new Error('userSelection is null or undefined'); }
if (!version) { throw new Error('version is null or undefined'); } if (!version) { throw new Error('version is null or undefined'); }
this.codeBuilder = new CodeBuilder(); this.generator = new UserScriptGenerator();
this.setCode(userSelection.selectedScripts); this.setCode(userSelection.selectedScripts);
userSelection.changed.on((scripts) => { userSelection.changed.on((scripts) => {
this.setCode(scripts); this.setCode(scripts);
@@ -21,7 +21,7 @@ export class ApplicationCode implements IApplicationCode {
} }
private setCode(scripts: ReadonlyArray<IScript>) { private setCode(scripts: ReadonlyArray<IScript>) {
this.current = this.codeBuilder.buildCode(scripts, this.version); this.current = scripts.length === 0 ? '' : this.generator.buildCode(scripts, this.version);
this.changed.notify(this.current); this.changed.notify(this.current);
} }
} }

View File

@@ -1,27 +1,51 @@
import { AdminRightsFunctionRenderer } from './Renderer/AdminRightsFunctionRenderer'; const NewLine = '\n';
import { AsciiArtRenderer } from './Renderer/AsciiArtRenderer'; const TotalFunctionSeparatorChars = 58;
import { FunctionRenderer } from './Renderer/FunctionRenderer';
import { Script } from '@/domain/Script';
export class CodeBuilder { export class CodeBuilder {
private readonly functionRenderer: FunctionRenderer; private readonly lines = new Array<string>();
private readonly adminRightsFunctionRenderer: AdminRightsFunctionRenderer;
private readonly asciiArtRenderer: AsciiArtRenderer;
public constructor() { public appendLine(code?: string): CodeBuilder {
this.functionRenderer = new FunctionRenderer(); this.lines.push(code);
this.adminRightsFunctionRenderer = new AdminRightsFunctionRenderer(); return this;
this.asciiArtRenderer = new AsciiArtRenderer();
} }
public buildCode(scripts: ReadonlyArray<Script>, version: string): string { public appendTrailingHyphensCommentLine(
if (!scripts) { throw new Error('scripts is undefined'); } totalRepeatHyphens: number = TotalFunctionSeparatorChars): CodeBuilder {
if (!version) { throw new Error('version is undefined'); } return this.appendCommentLine('-'.repeat(totalRepeatHyphens));
return `@echo off\n\n${this.asciiArtRenderer.renderAsciiArt(version)}\n\n` }
+ `${this.adminRightsFunctionRenderer.renderAdminRightsFunction()}\n\n`
+ scripts.map((script) => this.functionRenderer.renderFunction(script.name, script.code)).join('\n\n') public appendCommentLine(commentLine?: string): CodeBuilder {
+ '\n\n' this.lines.push(`:: ${commentLine}`);
+ 'pause\n' return this;
+ 'exit /b 0'; }
public appendFunction(name: string, code: string): CodeBuilder {
if (!name) { throw new Error('name cannot be empty or null'); }
if (!code) { throw new Error('code cannot be empty or null'); }
return this
.appendLine()
.appendCommentLineWithHyphensAround(name)
.appendLine(`echo --- ${name}`)
.appendLine(code)
.appendTrailingHyphensCommentLine();
}
public appendCommentLineWithHyphensAround(
sectionName: string,
totalRepeatHyphens: number = TotalFunctionSeparatorChars): CodeBuilder {
if (!sectionName) { throw new Error('sectionName cannot be empty or null'); }
if (sectionName.length >= totalRepeatHyphens) {
return this.appendCommentLine(sectionName);
}
const firstHyphens = '-'.repeat(Math.floor((totalRepeatHyphens - sectionName.length) / 2));
const secondHyphens = '-'.repeat(Math.ceil((totalRepeatHyphens - sectionName.length) / 2));
return this
.appendTrailingHyphensCommentLine()
.appendCommentLine(firstHyphens + sectionName + secondHyphens)
.appendTrailingHyphensCommentLine();
}
public toString(): string {
return this.lines.join(NewLine);
} }
} }

View File

@@ -1,18 +0,0 @@
import { FunctionRenderer } from './FunctionRenderer';
export class AdminRightsFunctionRenderer {
private readonly functionRenderer: FunctionRenderer;
constructor() {
this.functionRenderer = new FunctionRenderer();
}
public renderAdminRightsFunction() {
const name = 'Ensure admin priviliges';
const code = 'fltmc >nul 2>&1 || (\n' +
' echo This batch script requires administrator privileges. Right-click on\n' +
' echo the script and select "Run as administrator".\n' +
' pause\n' +
' exit 1\n' +
')';
return this.functionRenderer.renderFunction(name, code);
}
}

View File

@@ -1,16 +0,0 @@
import { CodeRenderer } from './CodeRenderer';
export class AsciiArtRenderer extends CodeRenderer {
public renderAsciiArt(version: string): string {
if (!version) { throw new Error('Version is not defined'); }
return (
'██████╗ ██████╗ ██╗██╗ ██╗ █████╗ ██████╗██╗ ██╗███████╗███████╗██╗ ██╗██╗ ██╗\n' +
'██╔══██╗██╔══██╗██║██║ ██║██╔══██╗██╔════╝╚██╗ ██╔╝██╔════╝██╔════╝╚██╗██╔╝╚██╗ ██╔╝\n' +
'██████╔╝██████╔╝██║██║ ██║███████║██║ ╚████╔╝ ███████╗█████╗ ╚███╔╝ ╚████╔╝ \n' +
'██╔═══╝ ██╔══██╗██║╚██╗ ██╔╝██╔══██║██║ ╚██╔╝ ╚════██║██╔══╝ ██╔██╗ ╚██╔╝ \n' +
'██║ ██║ ██║██║ ╚████╔╝ ██║ ██║╚██████╗ ██║██╗███████║███████╗██╔╝ ██╗ ██║ \n' +
'╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝╚═╝╚══════╝╚══════╝╚═╝ ╚═╝ ╚═╝ ')
.split('\n').map((line) => this.renderComment(line)).join('\n')
+ `\n${this.renderComment(`https://privacy.sexy — v${version}${new Date().toUTCString()}`)}`;
}
}

View File

@@ -1,11 +0,0 @@
export abstract class CodeRenderer {
protected readonly totalFunctionSeparatorChars = 58;
protected readonly trailingHyphens = '-'.repeat(this.totalFunctionSeparatorChars);
protected renderComment(line?: string): string {
return line ? `:: ${line}` : ':: ';
}
}

View File

@@ -1,31 +0,0 @@
import { CodeRenderer } from './CodeRenderer';
export class FunctionRenderer extends CodeRenderer {
public renderFunction(name: string, code: string) {
if (!name) { throw new Error('name cannot be empty or null'); }
if (!code) { throw new Error('code cannot be empty or null'); }
return this.renderFunctionStartComment(name) + '\n'
+ `echo --- ${name}` + '\n'
+ code + '\n'
+ this.renderFunctionEndComment();
}
private renderFunctionStartComment(functionName: string): string {
if (functionName.length >= this.totalFunctionSeparatorChars) {
return this.renderComment(functionName);
}
return this.renderComment(this.trailingHyphens) + '\n' +
this.renderFunctionName(functionName) + '\n' +
this.renderComment(this.trailingHyphens);
}
private renderFunctionName(functionName: string) {
const autoFirstHypens = '-'.repeat(Math.floor((this.totalFunctionSeparatorChars - functionName.length) / 2));
const secondHypens = '-'.repeat(Math.ceil((this.totalFunctionSeparatorChars - functionName.length) / 2));
return `${this.renderComment()}${autoFirstHypens}${functionName}${secondHypens}`;
}
private renderFunctionEndComment(): string {
return this.renderComment(this.trailingHyphens);
}
}

View File

@@ -0,0 +1,31 @@
import { CodeBuilder } from './CodeBuilder';
import { Script } from '@/domain/Script';
const adminRightsScript = {
name: 'Ensure admin privileges',
code: 'fltmc >nul 2>&1 || (\n' +
' echo This batch script requires administrator privileges. Right-click on\n' +
' echo the script and select "Run as administrator".\n' +
' pause\n' +
' exit 1\n' +
')',
};
export class UserScriptGenerator {
public buildCode(scripts: ReadonlyArray<Script>, version: string): string {
if (!scripts) { throw new Error('scripts is undefined'); }
if (!scripts.length) { throw new Error('scripts are empty'); }
if (!version) { throw new Error('version is undefined'); }
const builder = new CodeBuilder()
.appendLine('@echo off')
.appendCommentLine(`https://privacy.sexy — v${version}${new Date().toUTCString()}`)
.appendFunction(adminRightsScript.name, adminRightsScript.code).appendLine();
for (const script of scripts) {
builder.appendFunction(script.name, script.code).appendLine();
}
return builder.appendLine()
.appendLine('pause')
.appendLine('exit /b 0')
.toString();
}
}

View File

@@ -16,8 +16,8 @@ export class UserFilter implements IUserFilter {
throw new Error('Filter must be defined and not empty. Use removeFilter() to remove the filter'); throw new Error('Filter must be defined and not empty. Use removeFilter() to remove the filter');
} }
const filteredScripts = this.application.getAllScripts().filter( const filteredScripts = this.application.getAllScripts().filter(
(script) => script.name.toLowerCase().includes(filter.toLowerCase()) (script) => script.name.toLowerCase().includes(filter.toLowerCase()) ||
|| script.code.toLowerCase().includes(filter.toLowerCase())); script.code.toLowerCase().includes(filter.toLowerCase()));
const matches: IFilterMatches = { const matches: IFilterMatches = {
scriptMatches: filteredScripts, scriptMatches: filteredScripts,

View File

@@ -1,3 +1,4 @@
import { IApplication } from './../../domain/IApplication';
import { IUserFilter } from './Filter/IUserFilter'; import { IUserFilter } from './Filter/IUserFilter';
import { IUserSelection } from './Selection/IUserSelection'; import { IUserSelection } from './Selection/IUserSelection';
import { ISignal } from '@/infrastructure/Events/ISignal'; import { ISignal } from '@/infrastructure/Events/ISignal';
@@ -10,12 +11,6 @@ export interface IApplicationState {
readonly code: IApplicationCode; readonly code: IApplicationCode;
readonly filter: IUserFilter; readonly filter: IUserFilter;
readonly stateChanged: ISignal<IApplicationState>; readonly stateChanged: ISignal<IApplicationState>;
readonly categories: ReadonlyArray<ICategory>;
readonly appName: string;
readonly appVersion: number;
readonly appTotalScripts: number;
readonly selection: IUserSelection; readonly selection: IUserSelection;
readonly defaultScripts: ReadonlyArray<IScript>; readonly app: IApplication;
getCategory(categoryId: number): ICategory | undefined;
} }

View File

@@ -1,5 +1,5 @@
name: privacy.sexy name: privacy.sexy
version: 0.1.0 version: 0.2.0
actions: actions:
- -
category: Privacy cleanup category: Privacy cleanup
@@ -9,26 +9,26 @@ actions:
children: children:
- -
name: Clear Listary indexes name: Clear Listary indexes
default: false recommend: false
code: del /f /s /q %appdata%\Listary\UserData > nul code: del /f /s /q %appdata%\Listary\UserData > nul
- -
name: Clear Java cache name: Clear Java cache
default: true recommend: true
code: rd /s /q "%APPDATA%\Sun\Java\Deployment\cache" code: rd /s /q "%APPDATA%\Sun\Java\Deployment\cache"
- -
name: Clear Flash traces name: Clear Flash traces
default: true recommend: true
code: rd /s /q "%APPDATA%\Macromedia\Flash Player" code: rd /s /q "%APPDATA%\Macromedia\Flash Player"
- -
name: Clear Steam dumps, logs and traces name: Clear Steam dumps, logs and traces
default: true recommend: true
code: |- code: |-
del /f /q %ProgramFiles(x86)%\Steam\Dumps del /f /q %ProgramFiles(x86)%\Steam\Dumps
del /f /q %ProgramFiles(x86)%\Steam\Traces del /f /q %ProgramFiles(x86)%\Steam\Traces
del /f /q %ProgramFiles(x86)%\Steam\appcache\*.log del /f /q %ProgramFiles(x86)%\Steam\appcache\*.log
- -
name: Clear Visual Studio telemetry & feedback data name: Clear Visual Studio telemetry & feedback data
default: true recommend: true
code: |- code: |-
rmdir /s /q "%AppData%\vstelemetry" 2>nul rmdir /s /q "%AppData%\vstelemetry" 2>nul
rmdir /s /q "%LocalAppData%\Microsoft\VSApplicationInsights" 2>nul rmdir /s /q "%LocalAppData%\Microsoft\VSApplicationInsights" 2>nul
@@ -45,7 +45,7 @@ actions:
children: children:
- -
name: Clear windows recent files name: Clear windows recent files
default: true recommend: true
docs: https://www.tenforums.com/tutorials/3476-reset-clear-recent-items-frequent-places-windows-10-a.html docs: https://www.tenforums.com/tutorials/3476-reset-clear-recent-items-frequent-places-windows-10-a.html
code: |- code: |-
rd /s /q "%USERPROFILE%\Recent" rd /s /q "%USERPROFILE%\Recent"
@@ -54,56 +54,56 @@ actions:
del /f /q %APPDATA%\Microsoft\Windows\Recent\CustomDestinations\* del /f /q %APPDATA%\Microsoft\Windows\Recent\CustomDestinations\*
- -
name: Clear regedit last key name: Clear regedit last key
default: true recommend: true
code: |- code: |-
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit" /va /f reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit" /va /f
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Regedit" /va /f reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Regedit" /va /f
- -
name: Clear regedit favorites name: Clear regedit favorites
default: true recommend: true
code: |- code: |-
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\Favorites" /va /f reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\Favorites" /va /f
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Regedit\Favorites" /va /f reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Regedit\Favorites" /va /f
- -
name: Clear list of recent programs opened name: Clear list of recent programs opened
default: true recommend: true
code: |- code: |-
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\LastVisitedPidlMRU" /va /f reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\LastVisitedPidlMRU" /va /f
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\LastVisitedPidlMRULegacy" /va /f reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\LastVisitedPidlMRULegacy" /va /f
- -
name: Clear Adobe Media Browser MRU name: Clear Adobe Media Browser MRU
default: true recommend: true
code: reg delete "HKEY_CURRENT_USER\Software\Adobe\MediaBrowser\MRU" /va /f code: reg delete "HKEY_CURRENT_USER\Software\Adobe\MediaBrowser\MRU" /va /f
- -
name: Clear MSPaint MRU name: Clear MSPaint MRU
default: true recommend: true
code: |- code: |-
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Paint\Recent File List" /va /f reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Paint\Recent File List" /va /f
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Paint\Recent File List" /va /f reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Paint\Recent File List" /va /f
- -
name: Clear Wordpad MRU name: Clear Wordpad MRU
default: true recommend: true
code: reg delete "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Wordpad\Recent File List" /va /f code: reg delete "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Applets\Wordpad\Recent File List" /va /f
- -
name: Clear Map Network Drive MRU MRU name: Clear Map Network Drive MRU MRU
default: true recommend: true
code: |- code: |-
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Map Network Drive MRU" /va /f reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Map Network Drive MRU" /va /f
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Map Network Drive MRU" /va /f reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Map Network Drive MRU" /va /f
- -
name: Clear Windows Search Assistant history name: Clear Windows Search Assistant history
default: true recommend: true
code: reg delete "HKEY_CURRENT_USER\Software\Microsoft\Search Assistant\ACMru" /va /f code: reg delete "HKEY_CURRENT_USER\Software\Microsoft\Search Assistant\ACMru" /va /f
- -
name: Clear list of Recent Files Opened, by Filetype name: Clear list of Recent Files Opened, by Filetype
default: true recommend: true
code: |- code: |-
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs" /va /f reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs" /va /f
reg delete "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs" /va /f reg delete "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs" /va /f
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU" /va /f reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU" /va /f
- -
name: Clear windows media player recent files and urls name: Clear windows media player recent files and urls
default: true recommend: true
code: |- code: |-
reg delete "HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\Player\RecentFileList" /va /f reg delete "HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\Player\RecentFileList" /va /f
reg delete "HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\Player\RecentURLList" /va /f reg delete "HKEY_CURRENT_USER\Software\Microsoft\MediaPlayer\Player\RecentURLList" /va /f
@@ -111,13 +111,13 @@ actions:
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MediaPlayer\Player\RecentURLList" /va /f reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MediaPlayer\Player\RecentURLList" /va /f
- -
name: Clear Most Recent Application's Use of DirectX name: Clear Most Recent Application's Use of DirectX
default: true recommend: true
code: |- code: |-
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Direct3D\MostRecentApplication" /va /f reg delete "HKEY_CURRENT_USER\Software\Microsoft\Direct3D\MostRecentApplication" /va /f
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Direct3D\MostRecentApplication" /va /f reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Direct3D\MostRecentApplication" /va /f
- -
name: Clear Windows Run MRU & typedpaths name: Clear Windows Run MRU & typedpaths
default: true recommend: true
code: |- code: |-
reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /va /f reg delete "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /va /f
reg delete "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\TypedPaths" /va /f reg delete "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\TypedPaths" /va /f
@@ -126,7 +126,7 @@ actions:
children: children:
- -
name: Clear Internet Explorer traces name: Clear Internet Explorer traces
default: true recommend: true
code: |- code: |-
del /f /q "%localappdata%\Microsoft\Windows\INetCache\IE\*" del /f /q "%localappdata%\Microsoft\Windows\INetCache\IE\*"
reg delete "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\TypedURLs" /va /f reg delete "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Internet Explorer\TypedURLs" /va /f
@@ -142,7 +142,7 @@ actions:
rd /s /q "%localappdata%\Microsoft\InternetExplorer\DOMStore" rd /s /q "%localappdata%\Microsoft\InternetExplorer\DOMStore"
- -
name: Clear Google Chrome traces name: Clear Google Chrome traces
default: true recommend: true
code: |- code: |-
del /f /q "%localappdata%\Google\Software Reporter Tool\*.log" del /f /q "%localappdata%\Google\Software Reporter Tool\*.log"
rd /s /q "%USERPROFILE%\Local Settings\Application Data\Google\Chrome\User Data" rd /s /q "%USERPROFILE%\Local Settings\Application Data\Google\Chrome\User Data"
@@ -154,7 +154,7 @@ actions:
children: children:
- -
name: Clear browsing history and caches name: Clear browsing history and caches
default: true recommend: true
code: |- code: |-
set ignoreFiles="content-prefs.sqlite" "permissions.sqlite" "favicons.sqlite" set ignoreFiles="content-prefs.sqlite" "permissions.sqlite" "favicons.sqlite"
for %%d in ("%APPDATA%\Mozilla\Firefox\Profiles\" for %%d in ("%APPDATA%\Mozilla\Firefox\Profiles\"
@@ -178,21 +178,21 @@ actions:
) )
- -
name: Clear all user settings and data name: Clear all user settings and data
default: false recommend: false
enables: Clear browsing history and caches enables: Clear browsing history and caches
code: |- code: |-
rd "%localappdata%\Local\Mozilla\Firefox\Profiles" rd "%localappdata%\Local\Mozilla\Firefox\Profiles"
rd /s /q "%APPDATA%\Mozilla\Firefox\Profiles" rd /s /q "%APPDATA%\Mozilla\Firefox\Profiles"
- -
name: Clear Opera traces name: Clear Opera traces
default: true recommend: true
code: |- code: |-
rd /s /q "%USERPROFILE%\AppData\Local\Opera\Opera" rd /s /q "%USERPROFILE%\AppData\Local\Opera\Opera"
rd /s /q "%APPDATA%\Opera\Opera" rd /s /q "%APPDATA%\Opera\Opera"
rd /s /q "%USERPROFILE%\Local Settings\Application Data\Opera\Opera" rd /s /q "%USERPROFILE%\Local Settings\Application Data\Opera\Opera"
- -
name: Clear Safari traces name: Clear Safari traces
default: true recommend: true
code: |- code: |-
rd /s /q "%USERPROFILE%\AppData\Local\Apple Computer\Safari\Traces" rd /s /q "%USERPROFILE%\AppData\Local\Apple Computer\Safari\Traces"
rd /s /q "%APPDATA%\Apple Computer\Safari" rd /s /q "%APPDATA%\Apple Computer\Safari"
@@ -206,11 +206,11 @@ actions:
children: children:
- -
name: Clear thumbnail cache name: Clear thumbnail cache
default: false recommend: false
code: del /f /s /q /a %LocalAppData%\Microsoft\Windows\Explorer\*.db code: del /f /s /q /a %LocalAppData%\Microsoft\Windows\Explorer\*.db
- -
name: Clear Windows log files name: Clear Windows log files
default: true recommend: true
code: |- code: |-
del /f /q %SystemRoot%\Temp\CBS\* del /f /q %SystemRoot%\Temp\CBS\*
del /f /q %SystemRoot%\comsetup.log del /f /q %SystemRoot%\comsetup.log
@@ -246,14 +246,14 @@ actions:
rd /s /q "%localappdata%\Microsoft\Windows\Traces" rd /s /q "%localappdata%\Microsoft\Windows\Traces"
- -
name: Clear Windows temp files name: Clear Windows temp files
default: true recommend: true
code: |- code: |-
del /f /q %localappdata%\Temp\* del /f /q %localappdata%\Temp\*
rd /s /q "%WINDIR%\Temp" rd /s /q "%WINDIR%\Temp"
rd /s /q "%TEMP%" rd /s /q "%TEMP%"
- -
name: Clear main telemetry file name: Clear main telemetry file
default: true recommend: true
code: echo "" > %ProgramData%\Microsoft\Diagnosis\ETLTraces\AutoLogger\AutoLogger-Diagtrack-Listener.etl code: echo "" > %ProgramData%\Microsoft\Diagnosis\ETLTraces\AutoLogger\AutoLogger-Diagtrack-Listener.etl
- -
name: Empty trash bin name: Empty trash bin
@@ -263,25 +263,25 @@ actions:
children: children:
- -
name: Disable ad customization with Advertising ID name: Disable ad customization with Advertising ID
default: true recommend: true
code: |- code: |-
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v "Enabled" /t REG_DWORD /d 0 /f reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" /v "Enabled" /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" /v "DisabledByGroupPolicy" /t REG_DWORD /d 1 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AdvertisingInfo" /v "DisabledByGroupPolicy" /t REG_DWORD /d 1 /f
- -
name: Disable online device metadata collection name: Disable online device metadata collection
default: true recommend: true
code: |- code: |-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata" /v "PreventDeviceMetadataFromNetwork" /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Device Metadata" /v "PreventDeviceMetadataFromNetwork" /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" /v "PreventDeviceMetadataFromNetwork" /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Device Metadata" /v "PreventDeviceMetadataFromNetwork" /t REG_DWORD /d 1 /f
- -
name: Opt out from Windows privacy consent name: Opt out from Windows privacy consent
default: true recommend: true
code: |- code: |-
reg add "HKCU\SOFTWARE\Microsoft\Personalization\Settings" /v "AcceptedPrivacyPolicy" /t REG_DWORD /d 0 /f reg add "HKCU\SOFTWARE\Microsoft\Personalization\Settings" /v "AcceptedPrivacyPolicy" /t REG_DWORD /d 0 /f
reg add "HKU\DefaultUser\Software\Microsoft\Personalization\Settings" /v "AcceptedPrivacyPolicy" /d "0" /t REG_DWORD /f reg add "HKU\DefaultUser\Software\Microsoft\Personalization\Settings" /v "AcceptedPrivacyPolicy" /d "0" /t REG_DWORD /f
- -
name: Disable windows telemetry & data collection name: Disable windows telemetry & data collection
default: true recommend: true
code: |- code: |-
reg add "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v "AllowTelemetry" /d 0 /t REG_DWORD /f reg add "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v "AllowTelemetry" /d 0 /t REG_DWORD /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v "AllowTelemetry" /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" /v "AllowTelemetry" /t REG_DWORD /d 0 /f
@@ -295,7 +295,7 @@ actions:
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat" /v "AITEnable" /t REG_DWORD /d 0 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat" /v "AITEnable" /t REG_DWORD /d 0 /f
- -
name: Disable Windows feedback name: Disable Windows feedback
default: true recommend: true
code: |- code: |-
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Siuf\Rules" /v "NumberOfSIUFInPeriod" /t REG_DWORD /d 0 /f reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Siuf\Rules" /v "NumberOfSIUFInPeriod" /t REG_DWORD /d 0 /f
:: removing this value sets feedback frequency to never :: removing this value sets feedback frequency to never
@@ -304,7 +304,7 @@ actions:
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v "DoNotShowFeedbackNotifications" /t REG_DWORD /d 1 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\DataCollection" /v "DoNotShowFeedbackNotifications" /t REG_DWORD /d 1 /f
- -
name: Disable text and handwriting collection name: Disable text and handwriting collection
default: true recommend: true
code: |- code: |-
reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\InputPersonalization" /v "RestrictImplicitInkCollection" /t REG_DWORD /d 1 /f reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\InputPersonalization" /v "RestrictImplicitInkCollection" /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\InputPersonalization" /v "RestrictImplicitInkCollection" /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\InputPersonalization" /v "RestrictImplicitInkCollection" /t REG_DWORD /d 1 /f
@@ -321,124 +321,124 @@ actions:
children: children:
- -
name: Deny app access to location name: Deny app access to location
default: false recommend: false
code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessLocation" /t REG_DWORD /d 2 /f code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessLocation" /t REG_DWORD /d 2 /f
- -
name: Deny app access to motion data name: Deny app access to motion data
default: false recommend: false
code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessMotion" /t REG_DWORD /d 2 /f code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessMotion" /t REG_DWORD /d 2 /f
- -
name: Deny app access to phone name: Deny app access to phone
default: false recommend: false
code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessPhone" /t REG_DWORD /d 2 /f code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessPhone" /t REG_DWORD /d 2 /f
- -
name: Deny app access to trusted devices name: Deny app access to trusted devices
default: false recommend: false
code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessTrustedDevices" /t REG_DWORD /d 2 /f code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessTrustedDevices" /t REG_DWORD /d 2 /f
- -
name: Deny app sync with devices name: Deny app sync with devices
default: false recommend: false
code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsSyncWithDevices" /t REG_DWORD /d 2 /f code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsSyncWithDevices" /t REG_DWORD /d 2 /f
- -
name: Deny app access to camera name: Deny app access to camera
default: false recommend: false
code: |- code: |-
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\webcam" /v "Value" /d "Deny" /t REG_SZ /f reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\webcam" /v "Value" /d "Deny" /t REG_SZ /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessCamera" /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessCamera" /t REG_DWORD /d 2 /f
- -
name: Deny app access to microphone name: Deny app access to microphone
default: true recommend: true
code: |- code: |-
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\microphone" /v "Value" /d "Deny" /t REG_SZ /f reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\microphone" /v "Value" /d "Deny" /t REG_SZ /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessMicrophone" /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessMicrophone" /t REG_DWORD /d 2 /f
- -
name: Deny app access to diagnostics info about your other apps name: Deny app access to diagnostics info about your other apps
default: true recommend: true
code: |- code: |-
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appDiagnostics" /v "Value" /d "Deny" /t REG_SZ /f reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appDiagnostics" /v "Value" /d "Deny" /t REG_SZ /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsGetDiagnosticInfo" /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsGetDiagnosticInfo" /t REG_DWORD /d 2 /f
- -
name: Deny app access to your file system name: Deny app access to your file system
default: true recommend: true
code: |- code: |-
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\broadFileSystemAccess" /v "Value" /d "Deny" /t REG_SZ /f reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\broadFileSystemAccess" /v "Value" /d "Deny" /t REG_SZ /f
- -
name: Deny app access to your contacts name: Deny app access to your contacts
default: true recommend: true
code: |- code: |-
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\contacts" /v "Value" /d "Deny" /t REG_SZ /f reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\contacts" /v "Value" /d "Deny" /t REG_SZ /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessContacts" /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessContacts" /t REG_DWORD /d 2 /f
- -
name: Deny app access to Notifications name: Deny app access to Notifications
default: true recommend: true
code: |- code: |-
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userNotificationListener" /v "Value" /d "Deny" /t REG_SZ /f reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userNotificationListener" /v "Value" /d "Deny" /t REG_SZ /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessNotifications" /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessNotifications" /t REG_DWORD /d 2 /f
- -
name: Deny app access to Account Information name: Deny app access to Account Information
default: true recommend: true
code: |- code: |-
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userAccountInformation" /v "Value" /d "Deny" /t REG_SZ /f reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userAccountInformation" /v "Value" /d "Deny" /t REG_SZ /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessAccountInfo" /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessAccountInfo" /t REG_DWORD /d 2 /f
- -
name: Deny app access to Calendar name: Deny app access to Calendar
default: true recommend: true
code: |- code: |-
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appointments" /v "Value" /d "Deny" /t REG_SZ /f reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\appointments" /v "Value" /d "Deny" /t REG_SZ /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessCalendar" /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessCalendar" /t REG_DWORD /d 2 /f
- -
name: Deny app access to call history name: Deny app access to call history
default: true recommend: true
code: |- code: |-
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\phoneCallHistory" /v "Value" /d "Deny" /t REG_SZ /f reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\phoneCallHistory" /v "Value" /d "Deny" /t REG_SZ /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessCallHistory" /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessCallHistory" /t REG_DWORD /d 2 /f
- -
name: Deny app access to email name: Deny app access to email
default: true recommend: true
code: |- code: |-
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\email" /v "Value" /d "Deny" /t REG_SZ /f reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\email" /v "Value" /d "Deny" /t REG_SZ /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessEmail" /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessEmail" /t REG_DWORD /d 2 /f
- -
name: Deny app access to tasks name: Deny app access to tasks
default: true recommend: true
code: |- code: |-
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userDataTasks" /v "Value" /d "Deny" /t REG_SZ /f reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\userDataTasks" /v "Value" /d "Deny" /t REG_SZ /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessTasks" /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessTasks" /t REG_DWORD /d 2 /f
- -
name: Deny app access to messaging name: Deny app access to messaging
default: true recommend: true
code: |- code: |-
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\chat" /v "Value" /d "Deny" /t REG_SZ /f reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\chat" /v "Value" /d "Deny" /t REG_SZ /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessMessaging" /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessMessaging" /t REG_DWORD /d 2 /f
- -
name: Deny app access to radios name: Deny app access to radios
default: true recommend: true
code: |- code: |-
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\radios" /v "Value" /d "Deny" /t REG_SZ /f reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\radios" /v "Value" /d "Deny" /t REG_SZ /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessRadios" /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\AppPrivacy" /v "LetAppsAccessRadios" /t REG_DWORD /d 2 /f
- -
name: Deny app access to videos name: Deny app access to videos
default: true recommend: true
code: |- code: |-
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\videosLibrary" /v "Value" /d "Deny" /t REG_SZ /f reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\videosLibrary" /v "Value" /d "Deny" /t REG_SZ /f
- -
name: Deny app access to pictures name: Deny app access to pictures
default: true recommend: true
code: |- code: |-
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\picturesLibrary" /v "Value" /d "Deny" /t REG_SZ /f reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\picturesLibrary" /v "Value" /d "Deny" /t REG_SZ /f
- -
name: Deny app access to documents name: Deny app access to documents
default: true recommend: true
code: |- code: |-
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\documentsLibrary" /v "Value" /d "Deny" /t REG_SZ /f reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\documentsLibrary" /v "Value" /d "Deny" /t REG_SZ /f
- -
name: Deny app access to bluetooth devices name: Deny app access to bluetooth devices
default: true recommend: true
code: |- code: |-
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\bluetoothSync" /v "Value" /d "Deny" /t REG_SZ /f reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\CapabilityAccessManager\ConsentStore\bluetoothSync" /v "Value" /d "Deny" /t REG_SZ /f
- -
name: Deny location access name: Deny location access
default: true recommend: true
code: |- code: |-
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" /v "DisableLocation" /d "1" /t REG_DWORD /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" /v "DisableLocation" /d "1" /t REG_DWORD /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" /v "DisableLocationScripting" /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\LocationAndSensors" /v "DisableLocationScripting" /t REG_DWORD /d 1 /f
@@ -448,7 +448,7 @@ actions:
reg add "HKLM\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" /v "Status" /d "0" /t REG_DWORD /f reg add "HKLM\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" /v "Status" /d "0" /t REG_DWORD /f
- -
name: Deny sensor access name: Deny sensor access
default: true recommend: true
code: |- code: |-
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" /v "SensorPermissionState" /d "0" /t REG_DWORD /f reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" /v "SensorPermissionState" /d "0" /t REG_DWORD /f
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" /v Value /t REG_SZ /d Deny /f reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\DeviceAccess\Global\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" /v Value /t REG_SZ /d Deny /f
@@ -458,7 +458,7 @@ actions:
children: children:
- -
name: Disable cortana name: Disable cortana
default: true recommend: true
code: |- code: |-
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowCortana" /t REG_DWORD /d 0 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "AllowCortana" /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Microsoft\PolicyManager\default\Experience\AllowCortana" /v "value" /t REG_DWORD /d 0 /f reg add "HKLM\SOFTWARE\Microsoft\PolicyManager\default\Experience\AllowCortana" /v "value" /t REG_DWORD /d 0 /f
@@ -473,26 +473,26 @@ actions:
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "DisableWebSearch" /t REG_DWORD /d 1 / reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v "DisableWebSearch" /t REG_DWORD /d 1 /
- -
name: Disable web search in search bar name: Disable web search in search bar
default: true recommend: true
code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v DisableWebSearch /t REG_DWORD /d 1 /f code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v DisableWebSearch /t REG_DWORD /d 1 /f
- -
name: Disable search web when searching pc name: Disable search web when searching pc
default: true recommend: true
code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v ConnectedSearchUseWeb /t REG_DWORD /d 0 /f code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v ConnectedSearchUseWeb /t REG_DWORD /d 0 /f
- -
name: Disable search indexing encrypted items / stores name: Disable search indexing encrypted items / stores
default: true recommend: true
code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v AllowIndexingEncryptedStoresOrItems /t REG_DWORD /d 0 /f code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v AllowIndexingEncryptedStoresOrItems /t REG_DWORD /d 0 /f
- -
name: Disable location based info in searches name: Disable location based info in searches
default: true recommend: true
code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v AllowSearchToUseLocation /t REG_DWORD /d 0 /f code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v AllowSearchToUseLocation /t REG_DWORD /d 0 /f
- -
name: Disable language detection name: Disable language detection
default: true recommend: true
code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v AlwaysUseAutoLangDetection /t REG_DWORD /d 0 /f code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Search" /v AlwaysUseAutoLangDetection /t REG_DWORD /d 0 /f
name: Turn Off Suggested Content in Settings app name: Turn Off Suggested Content in Settings app
default: true recommend: true
docs: https://www.tenforums.com/tutorials/100541-turn-off-suggested-content-settings-app-windows-10-a.html docs: https://www.tenforums.com/tutorials/100541-turn-off-suggested-content-settings-app-windows-10-a.html
code: |- code: |-
reg add HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager /v "SubscribedContent-338393Enabled" /d "0" /t REG_DWORD /f reg add HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager /v "SubscribedContent-338393Enabled" /d "0" /t REG_DWORD /f
@@ -500,13 +500,13 @@ actions:
reg add HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager /v "SubscribedContent-353696Enabled" /d "0" /t REG_DWORD /f reg add HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager /v "SubscribedContent-353696Enabled" /d "0" /t REG_DWORD /f
- -
name: Disable biometrics name: Disable biometrics
default: true recommend: true
code: |- code: |-
reg add "HKLM\SOFTWARE\Policies\Microsoft\Biometrics" /v "Enabled" /t REG_DWORD /d 0 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Biometrics" /v "Enabled" /t REG_DWORD /d 0 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Services\WbioSrvc" /v "Start" /t REG_DWORD /d 4 /f reg add "HKLM\SYSTEM\CurrentControlSet\Services\WbioSrvc" /v "Start" /t REG_DWORD /d 4 /f
- -
name: Disable Wi-Fi sense name: Disable Wi-Fi sense
default: true recommend: true
code: |- code: |-
reg add "HKLM\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" /v "value" /t REG_DWORD /d 0 /f reg add "HKLM\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" /v "value" /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" /v "value" /t REG_DWORD /d 0 /f reg add "HKLM\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" /v "value" /t REG_DWORD /d 0 /f
@@ -514,57 +514,57 @@ actions:
- -
name: Disable App Launch Tracking name: Disable App Launch Tracking
docs: https://www.thewindowsclub.com/enable-or-disable-app-launch-tracking-in-windows-10 docs: https://www.thewindowsclub.com/enable-or-disable-app-launch-tracking-in-windows-10
default: true recommend: true
code: reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "Start_TrackProgs" /d "0" /t REG_DWORD /f code: reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "Start_TrackProgs" /d "0" /t REG_DWORD /f
- -
name: Disable Inventory Collector name: Disable Inventory Collector
default: true recommend: true
code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat" /v "DisableInventory" /t REG_DWORD /d 1 /f code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat" /v "DisableInventory" /t REG_DWORD /d 1 /f
- -
name: Disable Auto Downloading Maps name: Disable Auto Downloading Maps
default: true recommend: true
code: |- code: |-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Maps" /v "AllowUntriggeredNetworkTrafficOnSettingsPage" /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Maps" /v "AllowUntriggeredNetworkTrafficOnSettingsPage" /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Maps" /v "AutoDownloadAndUpdateMapData" /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Maps" /v "AutoDownloadAndUpdateMapData" /t REG_DWORD /d 0 /f
- -
name: Disable targeted tips name: Disable targeted tips
default: true recommend: true
code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableSoftLanding" /t REG_DWORD /d 1 /f code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableSoftLanding" /t REG_DWORD /d 1 /f
- -
name: Disable steps recorder name: Disable steps recorder
default: true recommend: true
code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat" /v "DisableUAR" /t REG_DWORD /d 1 /f code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\AppCompat" /v "DisableUAR" /t REG_DWORD /d 1 /f
- -
name: Disable game screen recording name: Disable game screen recording
default: true recommend: true
code: |- code: |-
reg add "HKCU\System\GameConfigStore" /v "GameDVR_Enabled" /t REG_DWORD /d 0 /f reg add "HKCU\System\GameConfigStore" /v "GameDVR_Enabled" /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\GameDVR" /v "AllowGameDVR" /t REG_DWORD /d 0 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\GameDVR" /v "AllowGameDVR" /t REG_DWORD /d 0 /f
- -
name: Disable Windows DRM internet access name: Disable Windows DRM internet access
docs: https://getadmx.com/?Category=Windows_10_2016&Policy=Microsoft.Policies.DigitalRights2::DisableOnline docs: https://getadmx.com/?Category=Windows_10_2016&Policy=Microsoft.Policies.DigitalRights2::DisableOnline
default: true recommend: true
code: reg add "HKLM\SOFTWARE\Policies\Microsoft\WMDRM" /v "DisableOnline" /t REG_DWORD /d 1 /f code: reg add "HKLM\SOFTWARE\Policies\Microsoft\WMDRM" /v "DisableOnline" /t REG_DWORD /d 1 /f
- -
name: Disable feedback on write (sending typing info) name: Disable feedback on write (sending typing info)
default: true recommend: true
code: |- code: |-
reg add "HKLM\SOFTWARE\Microsoft\Input\TIPC" /v "Enabled" /t REG_DWORD /d 0 /f reg add "HKLM\SOFTWARE\Microsoft\Input\TIPC" /v "Enabled" /t REG_DWORD /d 0 /f
reg add "HKCU\SOFTWARE\Microsoft\Input\TIPC" /v "Enabled" /t REG_DWORD /d 0 /f reg add "HKCU\SOFTWARE\Microsoft\Input\TIPC" /v "Enabled" /t REG_DWORD /d 0 /f
- -
name: Disable Activity Feed name: Disable Activity Feed
default: true recommend: true
code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /v "EnableActivityFeed" /d "0" /t REG_DWORD /f code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /v "EnableActivityFeed" /d "0" /t REG_DWORD /f
- -
name: Disable Windows Insider Program name: Disable Windows Insider Program
default: true recommend: true
code: |- code: |-
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds" /v "AllowBuildPreview" /t REG_DWORD /d 0 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds" /v "AllowBuildPreview" /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds" /v "EnableConfigFlighting" /t REG_DWORD /d 0 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds" /v "EnableConfigFlighting" /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds" /v "EnableExperimentation" /t REG_DWORD /d 0 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\PreviewBuilds" /v "EnableExperimentation" /t REG_DWORD /d 0 /f
- -
name: Disable the Windows Connect Now wizard name: Disable the Windows Connect Now wizard
default: false recommend: false
docs: docs:
- https://docs.microsoft.com/en-us/windows/win32/wcn/about-windows-connect-now - https://docs.microsoft.com/en-us/windows/win32/wcn/about-windows-connect-now
- https://www.windows-security.org/f637a705712eb59f8cd410673c96472e/prohibit-access-of-the-windows-connect-now-wizards - https://www.windows-security.org/f637a705712eb59f8cd410673c96472e/prohibit-access-of-the-windows-connect-now-wizards
@@ -574,7 +574,7 @@ actions:
children: children:
- -
name: Disable all settings sync name: Disable all settings sync
default: true recommend: true
enabler: all those bottom enabler: all those bottom
code: |- code: |-
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableSettingSync" /t REG_DWORD /d 2 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableSettingSync" /t REG_DWORD /d 2 /f
@@ -583,50 +583,50 @@ actions:
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\SettingSync" /v "SyncPolicy" /t REG_DWORD /d 5 /f reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\SettingSync" /v "SyncPolicy" /t REG_DWORD /d 5 /f
- -
name: Disable Application Setting Sync name: Disable Application Setting Sync
default: true recommend: true
code: |- code: |-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableApplicationSettingSync" /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableApplicationSettingSync" /t REG_DWORD /d 2 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableApplicationSettingSyncUserOverride" /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableApplicationSettingSyncUserOverride" /t REG_DWORD /d 1 /f
- -
name: Disable App Sync Setting Sync name: Disable App Sync Setting Sync
default: true recommend: true
code: |- code: |-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableAppSyncSettingSync" /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableAppSyncSettingSync" /t REG_DWORD /d 2 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableAppSyncSettingSyncUserOverride" /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableAppSyncSettingSyncUserOverride" /t REG_DWORD /d 1 /f
- -
name: Disable Credentials Setting Sync name: Disable Credentials Setting Sync
default: true recommend: true
code: |- code: |-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableCredentialsSettingSync" /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableCredentialsSettingSync" /t REG_DWORD /d 2 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableCredentialsSettingSyncUserOverride" /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableCredentialsSettingSyncUserOverride" /t REG_DWORD /d 1 /f
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\SettingSync\Groups\Credentials" /v "Enabled" /t REG_DWORD /d 0 /f reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\SettingSync\Groups\Credentials" /v "Enabled" /t REG_DWORD /d 0 /f
- -
name: Disable Desktop Theme Setting Sync name: Disable Desktop Theme Setting Sync
default: true recommend: true
code: |- code: |-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableDesktopThemeSettingSync" /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableDesktopThemeSettingSync" /t REG_DWORD /d 2 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableDesktopThemeSettingSyncUserOverride" /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableDesktopThemeSettingSyncUserOverride" /t REG_DWORD /d 1 /f
- -
name: Disable Personalization Setting Sync name: Disable Personalization Setting Sync
default: true recommend: true
code: |- code: |-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisablePersonalizationSettingSync" /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisablePersonalizationSettingSync" /t REG_DWORD /d 2 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisablePersonalizationSettingSyncUserOverride" /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisablePersonalizationSettingSyncUserOverride" /t REG_DWORD /d 1 /f
- -
name: Disable Start Layout Setting Sync name: Disable Start Layout Setting Sync
default: true recommend: true
code: |- code: |-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableStartLayoutSettingSync" /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableStartLayoutSettingSync" /t REG_DWORD /d 2 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableStartLayoutSettingSyncUserOverride" /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableStartLayoutSettingSyncUserOverride" /t REG_DWORD /d 1 /f
- -
name: Disable Web Browser Setting Sync name: Disable Web Browser Setting Sync
default: true recommend: true
code: |- code: |-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableWebBrowserSettingSync" /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableWebBrowserSettingSync" /t REG_DWORD /d 2 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableWebBrowserSettingSyncUserOverride" /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableWebBrowserSettingSyncUserOverride" /t REG_DWORD /d 1 /f
- -
name: Disable Windows Setting Sync name: Disable Windows Setting Sync
default: true recommend: true
code: |- code: |-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableWindowsSettingSync" /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableWindowsSettingSync" /t REG_DWORD /d 2 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableWindowsSettingSyncUserOverride" /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\SettingSync" /v "DisableWindowsSettingSyncUserOverride" /t REG_DWORD /d 1 /f
@@ -641,36 +641,36 @@ actions:
children: children:
- -
name: Disable SQM 64 bit OS key name: Disable SQM 64 bit OS key
default: true recommend: true
code: |- code: |-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VSCommon\14.0\SQM" /v OptIn /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VSCommon\14.0\SQM" /v OptIn /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VSCommon\15.0\SQM" /v OptIn /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VSCommon\15.0\SQM" /v OptIn /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VSCommon\16.0\SQM" /v OptIn /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VSCommon\16.0\SQM" /v OptIn /t REG_DWORD /d 0 /f
- -
name: Disable SQM 32 bit OS key name: Disable SQM 32 bit OS key
default: true recommend: true
code: |- code: |-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VSCommon\14.0\SQM" /v OptIn /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VSCommon\14.0\SQM" /v OptIn /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VSCommon\15.0\SQM" /v OptIn /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VSCommon\15.0\SQM" /v OptIn /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VSCommon\16.0\SQM" /v OptIn /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VSCommon\16.0\SQM" /v OptIn /t REG_DWORD /d 0 /f
- -
name: Disable SQM group policy name: Disable SQM group policy
default: true recommend: true
code: reg add "HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\VisualStudio\SQM" /v OptIn /t REG_DWORD /d 0 /f code: reg add "HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\VisualStudio\SQM" /v OptIn /t REG_DWORD /d 0 /f
- -
name: Disable visual studio telemetry name: Disable visual studio telemetry
default: true recommend: true
code: reg add "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\Telemetry" /v TurnOffSwitch /t REG_DWORD /d 1 /f code: reg add "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\Telemetry" /v TurnOffSwitch /t REG_DWORD /d 1 /f
- -
name: Disable Visual Studio feedback name: Disable Visual Studio feedback
default: true recommend: true
code: |- code: |-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\VisualStudio\Feedback" /v DisableFeedbackDialog /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\VisualStudio\Feedback" /v DisableFeedbackDialog /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\VisualStudio\Feedback" /v DisableEmailInput /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\VisualStudio\Feedback" /v DisableEmailInput /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\VisualStudio\Feedback" /v DisableScreenshotCapture /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\VisualStudio\Feedback" /v DisableScreenshotCapture /t REG_DWORD /d 1 /f
- -
name: Stop and disable Visual Studio Standard Collector Service name: Stop and disable Visual Studio Standard Collector Service
default: true recommend: true
code: |- code: |-
sc stop "VSStandardCollectorService150" sc stop "VSStandardCollectorService150"
net stop VSStandardCollectorService150 2>nul net stop VSStandardCollectorService150 2>nul
@@ -680,7 +680,7 @@ actions:
children: children:
- -
name: Disable Microsoft SpyNet (Windows Defender cloud export for analysis) name: Disable Microsoft SpyNet (Windows Defender cloud export for analysis)
default: true recommend: true
code: |- code: |-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting" /v "DisableGenericRePorts" /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Reporting" /v "DisableGenericRePorts" /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" /v "LocalSettingOverrideSpynetReporting" /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" /v "LocalSettingOverrideSpynetReporting" /t REG_DWORD /d 0 /f
@@ -688,15 +688,15 @@ actions:
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" /v "SubmitSamplesConsent" /t REG_DWORD /d 2 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Spynet" /v "SubmitSamplesConsent" /t REG_DWORD /d 2 /f
- -
name: Disable sending infection information name: Disable sending infection information
default: true recommend: true
code: reg add "HKLM\SOFTWARE\Policies\Microsoft\MRT" /v "DontReportInfectionInformation" /t REG_DWORD /d 1 /f code: reg add "HKLM\SOFTWARE\Policies\Microsoft\MRT" /v "DontReportInfectionInformation" /t REG_DWORD /d 1 /f
- -
name: Disable NetCore Cli telemetry name: Disable NetCore Cli telemetry
default: true recommend: true
code: setx DOTNET_CLI_TELEMETRY_OPTOUT 1 code: setx DOTNET_CLI_TELEMETRY_OPTOUT 1
- -
name: Disable Visual Studio Code telemetry name: Disable Visual Studio Code telemetry
default: true recommend: true
docs: https://code.visualstudio.com/docs/getstarted/telemetry docs: https://code.visualstudio.com/docs/getstarted/telemetry
code: |- code: |-
mkdir %appdata%\Code\User mkdir %appdata%\Code\User
@@ -704,7 +704,7 @@ actions:
echo { "telemetry.enableCrashReporter": false, "telemetry.enableTelemetry": false } > %appdata%\Code\User\settings.json echo { "telemetry.enableCrashReporter": false, "telemetry.enableTelemetry": false } > %appdata%\Code\User\settings.json
- -
name: Disable Microsoft Office telemetry name: Disable Microsoft Office telemetry
default: true recommend: true
docs: https://docs.microsoft.com/en-us/deployoffice/compat/manage-the-privacy-of-data-monitored-by-telemetry-in-office docs: https://docs.microsoft.com/en-us/deployoffice/compat/manage-the-privacy-of-data-monitored-by-telemetry-in-office
code: |- code: |-
reg add "HKCU\SOFTWARE\Policies\Microsoft\Office\16.0\osm" /v "Enablelogging" /t REG_DWORD /d 0 /f reg add "HKCU\SOFTWARE\Policies\Microsoft\Office\16.0\osm" /v "Enablelogging" /t REG_DWORD /d 0 /f
@@ -717,61 +717,61 @@ actions:
children: children:
- -
name: Disable live tile data collection name: Disable live tile data collection
default: true recommend: true
code: reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\MicrosoftEdge\Main" /v "PreventLiveTileDataCollection" /t REG_DWORD /d 1 /f code: reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\MicrosoftEdge\Main" /v "PreventLiveTileDataCollection" /t REG_DWORD /d 1 /f
- -
name: Disable MFU tracking name: Disable MFU tracking
default: true recommend: true
code: reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\EdgeUI" /v "DisableMFUTracking" /t REG_DWORD /d 1 /f code: reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\EdgeUI" /v "DisableMFUTracking" /t REG_DWORD /d 1 /f
- -
name: Disable recent apps name: Disable recent apps
default: true recommend: true
code: reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\EdgeUI" /v "DisableRecentApps" /t REG_DWORD /d 1 /f code: reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\EdgeUI" /v "DisableRecentApps" /t REG_DWORD /d 1 /f
- -
name: Turn off backtracking name: Turn off backtracking
default: true recommend: true
code: reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\EdgeUI" /v "TurnOffBackstack" /t REG_DWORD /d 1 /f code: reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\EdgeUI" /v "TurnOffBackstack" /t REG_DWORD /d 1 /f
- -
name: Disable Search Suggestions in Edge name: Disable Search Suggestions in Edge
default: true recommend: true
code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\SearchScopes" /v "ShowSearchSuggestionsGlobal" /t REG_DWORD /d 0 /f code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MicrosoftEdge\SearchScopes" /v "ShowSearchSuggestionsGlobal" /t REG_DWORD /d 0 /f
- -
category: Configure Internet Explorer category: Configure Internet Explorer
children: children:
- -
name: Disable Geolocation in Internet Explorer name: Disable Geolocation in Internet Explorer
default: true recommend: true
code: reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Geolocation" /v "PolicyDisableGeolocation" /t REG_DWORD /d 1 /f code: reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Geolocation" /v "PolicyDisableGeolocation" /t REG_DWORD /d 1 /f
- -
name: Disable Internet Explorer InPrivate logging name: Disable Internet Explorer InPrivate logging
default: true recommend: true
code: |- code: |-
reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Safety\PrivacIE" /v "DisableLogging" /t REG_DWORD /d 1 /f reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\Safety\PrivacIE" /v "DisableLogging" /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Safety\PrivacIE" /v "DisableLogging" /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\Safety\PrivacIE" /v "DisableLogging" /t REG_DWORD /d 1 /f
- -
name: Disable Internet Explorer CEIP name: Disable Internet Explorer CEIP
default: true recommend: true
code: |- code: |-
reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\SQM" /v "DisableCustomerImprovementProgram" /t REG_DWORD /d 0 /f reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\Internet Explorer\SQM" /v "DisableCustomerImprovementProgram" /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\SQM" /v "DisableCustomerImprovementProgram" /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Internet Explorer\SQM" /v "DisableCustomerImprovementProgram" /t REG_DWORD /d 0 /f
- -
name: Disable calling legacy WCM policies name: Disable calling legacy WCM policies
default: true recommend: true
code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings" /v "CallLegacyWCMPolicies" /t REG_DWORD /d 0 /f code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings" /v "CallLegacyWCMPolicies" /t REG_DWORD /d 0 /f
- -
name: Disable SSLv3 fallback name: Disable SSLv3 fallback
default: true recommend: true
code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings" /v "EnableSSL3Fallback" /t REG_DWORD /d 0 /f code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings" /v "EnableSSL3Fallback" /t REG_DWORD /d 0 /f
- -
name: Disable ignoring cert errors name: Disable ignoring cert errors
default: true recommend: true
code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings" /v "PreventIgnoreCertErrors" /t REG_DWORD /d 1 /f code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings" /v "PreventIgnoreCertErrors" /t REG_DWORD /d 1 /f
- -
category: Configure Google Chrome category: Configure Google Chrome
children: children:
- -
name: Disable Chrome Software Reporter Tool name: Disable Chrome Software Reporter Tool
default: true recommend: true
code: |- code: |-
icacls "%localappdata%\Google\Chrome\User Data\SwReporter" /inheritance:r /deny "*S-1-1-0:(OI)(CI)(F)" "*S-1-5-7:(OI)(CI)(F)" icacls "%localappdata%\Google\Chrome\User Data\SwReporter" /inheritance:r /deny "*S-1-1-0:(OI)(CI)(F)" "*S-1-5-7:(OI)(CI)(F)"
cacls "%localappdata%\Google\Chrome\User Data\SwReporter" /e /c /d %username% cacls "%localappdata%\Google\Chrome\User Data\SwReporter" /e /c /d %username%
@@ -782,13 +782,13 @@ actions:
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v "1" /t REG_SZ /d "software_reporter_tool.exe" /f reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun" /v "1" /t REG_SZ /d "software_reporter_tool.exe" /f
- -
name: Disable Chrome metrics reporting name: Disable Chrome metrics reporting
default: true recommend: true
code: |- code: |-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome" /v "MetricsReportingEnabled" /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome" /v "MetricsReportingEnabled" /t REG_DWORD /d 0 /f
reg add "HKEY_CURRENT_USER\SOFTWARE\Policies\Google\Chrome" /v "MetricsReportingEnabled" /t REG_DWORD /d 0 /f reg add "HKEY_CURRENT_USER\SOFTWARE\Policies\Google\Chrome" /v "MetricsReportingEnabled" /t REG_DWORD /d 0 /f
- -
name: Disable Google update service name: Disable Google update service
default: true recommend: true
code: |- code: |-
sc config gupdate start= disabled sc config gupdate start= disabled
sc config gupdatem start= disabled sc config gupdatem start= disabled
@@ -796,25 +796,25 @@ actions:
schtasks /Change /DISABLE /TN "GoogleUpdateTaskMachineUA" schtasks /Change /DISABLE /TN "GoogleUpdateTaskMachineUA"
- -
name: Disable Adobe Acrobat update service name: Disable Adobe Acrobat update service
default: true recommend: true
code: |- code: |-
sc config AdobeARMservice start= disabled sc config AdobeARMservice start= disabled
schtasks /Change /DISABLE /TN "Adobe Acrobat Update Task" schtasks /Change /DISABLE /TN "Adobe Acrobat Update Task"
- -
name: Disable Razer Game Scanner Service name: Disable Razer Game Scanner Service
default: true recommend: true
code: |- code: |-
sc stop "Razer Game Scanner Service" sc stop "Razer Game Scanner Service"
sc config "Razer Game Scanner Service" start= disabled sc config "Razer Game Scanner Service" start= disabled
- -
name: Disable Logitech Gaming Registry Service name: Disable Logitech Gaming Registry Service
default: true recommend: true
code: |- code: |-
sc stop "LogiRegistryService" sc stop "LogiRegistryService"
sc config "LogiRegistryService" start= disabled sc config "LogiRegistryService" start= disabled
- -
name: Disable Dropbox auto update service name: Disable Dropbox auto update service
default: true recommend: true
code: |- code: |-
sc config dbupdate start= disabled sc config dbupdate start= disabled
sc config dbupdatem start= disabled sc config dbupdatem start= disabled
@@ -825,11 +825,11 @@ actions:
children: children:
- -
name: Do not send Windows Media Player statistics name: Do not send Windows Media Player statistics
default: true recommend: true
code: reg add "HKCU\SOFTWARE\Microsoft\MediaPlayer\Preferences" /v "UsageTracking" /t REG_DWORD /d 0 /f code: reg add "HKCU\SOFTWARE\Microsoft\MediaPlayer\Preferences" /v "UsageTracking" /t REG_DWORD /d 0 /f
- -
name: Disable meta data retrieval name: Disable meta data retrieval
default: true recommend: true
code: |- code: |-
reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\WindowsMediaPlayer" /v "PreventCDDVDMetadataRetrieval" /t REG_DWORD /d 1 /f reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\WindowsMediaPlayer" /v "PreventCDDVDMetadataRetrieval" /t REG_DWORD /d 1 /f
reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\WindowsMediaPlayer" /v "PreventMusicFileMetadataRetrieval" /t REG_DWORD /d 1 /f reg add "HKEY_CURRENT_USER\Software\Policies\Microsoft\WindowsMediaPlayer" /v "PreventMusicFileMetadataRetrieval" /t REG_DWORD /d 1 /f
@@ -844,33 +844,33 @@ actions:
children: children:
- -
name: Spectre variant 2 and meltdown (Intel) name: Spectre variant 2 and meltdown (Intel)
default: false recommend: false
code: |- code: |-
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v FeatureSettingsOverride /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v FeatureSettingsOverride /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v FeatureSettingsOverrideMask /t REG_DWORD /d 3 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v FeatureSettingsOverrideMask /t REG_DWORD /d 3 /f
- -
name: Spectre variant 2 and meltdown (AMD) name: Spectre variant 2 and meltdown (AMD)
default: false recommend: false
code: |- code: |-
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v FeatureSettingsOverride /t REG_DWORD /d 64 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v FeatureSettingsOverride /t REG_DWORD /d 64 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v FeatureSettingsOverrideMask /t REG_DWORD /d 3 /f reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v FeatureSettingsOverrideMask /t REG_DWORD /d 3 /f
- -
name: Spectre variant 2 and meltdown (HyperV) name: Spectre variant 2 and meltdown (HyperV)
default: false recommend: false
code: reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization" /v MinVmVersionForCpuBasedMitigations /t REG_SZ /d "1.0" /f code: reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Virtualization" /v MinVmVersionForCpuBasedMitigations /t REG_SZ /d "1.0" /f
- -
name: Disable administrative shares name: Disable administrative shares
default: true recommend: true
code: reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" /v "AutoShareWks" /t REG_DWORD /d 0 /f code: reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" /v "AutoShareWks" /t REG_DWORD /d 0 /f
- -
name: Force enable data execution prevention (DEP) name: Force enable data execution prevention (DEP)
default: false recommend: false
code: |- code: |-
reg add "HKEY_LOCAL_MACHINE \ SOFTWARE \ Policies \ Microsoft \ Windows \ Explorer" /v "NoDataExecutionPrevention" /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE \ SOFTWARE \ Policies \ Microsoft \ Windows \ Explorer" /v "NoDataExecutionPrevention" /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE \ SOFTWARE \ Policies \ Microsoft \ Windows \ System" /v "DisableHHDEP" /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE \ SOFTWARE \ Policies \ Microsoft \ Windows \ System" /v "DisableHHDEP" /t REG_DWORD /d 0 /f
- -
name: Disable AutoPlay and AutoRun name: Disable AutoPlay and AutoRun
default: false recommend: false
docs: docs:
- https://en.wikipedia.org/wiki/AutoRun - https://en.wikipedia.org/wiki/AutoRun
- https://www.stigviewer.com/stig/windows_10/2019-01-04/finding/V-63667 - https://www.stigviewer.com/stig/windows_10/2019-01-04/finding/V-63667
@@ -882,59 +882,59 @@ actions:
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "NoAutoplayfornonVolume" /t REG_DWORD /d 1 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "NoAutoplayfornonVolume" /t REG_DWORD /d 1 /f
- -
name: Disable remote Assistance name: Disable remote Assistance
default: true recommend: true
docs: https://www.stigviewer.com/stig/windows_10/2019-01-04/finding/V-63651 docs: https://www.stigviewer.com/stig/windows_10/2019-01-04/finding/V-63651
code: |- code: |-
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Remote Assistance" /v "fAllowToGetHelp" /t REG_DWORD /d 0 /f reg add "HKLM\SYSTEM\CurrentControlSet\Control\Remote Assistance" /v "fAllowToGetHelp" /t REG_DWORD /d 0 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Remote Assistance" /v "fAllowFullControl" /t REG_DWORD /d 0 /f reg add "HKLM\SYSTEM\CurrentControlSet\Control\Remote Assistance" /v "fAllowFullControl" /t REG_DWORD /d 0 /f
- -
name: Disable lock screen camera name: Disable lock screen camera
default: true recommend: true
docs: https://www.stigviewer.com/stig/windows_8_8.1/2014-06-27/finding/V-43237 docs: https://www.stigviewer.com/stig/windows_8_8.1/2014-06-27/finding/V-43237
code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Personalization" /v "NoLockScreenCamera" /t REG_DWORD /d 1 /f code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Personalization" /v "NoLockScreenCamera" /t REG_DWORD /d 1 /f
- -
name: Prevent the storage of the LAN Manager hash of passwords name: Prevent the storage of the LAN Manager hash of passwords
default: true recommend: true
docs: https://www.stigviewer.com/stig/windows_10/2019-01-04/finding/V-63797 docs: https://www.stigviewer.com/stig/windows_10/2019-01-04/finding/V-63797
code: reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "NoLMHash" /t REG_DWORD /d 1 /f code: reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "NoLMHash" /t REG_DWORD /d 1 /f
- -
name: Disable Windows Installer Always install with elevated privileges name: Disable Windows Installer Always install with elevated privileges
default: true recommend: true
docs: https://www.stigviewer.com/stig/windows_10/2019-01-04/finding/V-63797 docs: https://www.stigviewer.com/stig/windows_10/2019-01-04/finding/V-63797
code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer" /v "AlwaysInstallElevated" /t REG_DWORD /d 0 /f code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Installer" /v "AlwaysInstallElevated" /t REG_DWORD /d 0 /f
- -
name: Prevent WinRM from using Basic Authentication name: Prevent WinRM from using Basic Authentication
default: true recommend: true
docs: https://www.stigviewer.com/stig/windows_10/2019-01-04/finding/V-63335 docs: https://www.stigviewer.com/stig/windows_10/2019-01-04/finding/V-63335
code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client" /v "AllowBasic" /t REG_DWORD /d 0 /f code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client" /v "AllowBasic" /t REG_DWORD /d 0 /f
- -
name: Restrict anonymous enumeration of shares name: Restrict anonymous enumeration of shares
default: true recommend: true
docs: https://www.stigviewer.com/stig/windows_10/2019-01-04/finding/V-63749 docs: https://www.stigviewer.com/stig/windows_10/2019-01-04/finding/V-63749
code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client" /v "AllowBasic" /t REG_DWORD /d 0 /f code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client" /v "AllowBasic" /t REG_DWORD /d 0 /f
- -
name: Systems must be maintained at a supported (security) level name: Systems must be maintained at a supported (security) level
default: true recommend: true
docs: https://www.stigviewer.com/stig/windows_10/2019-01-04/finding/V-63349 docs: https://www.stigviewer.com/stig/windows_10/2019-01-04/finding/V-63349
code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client" /v "AllowBasic" /t REG_DWORD /d 0 /f code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WinRM\Client" /v "AllowBasic" /t REG_DWORD /d 0 /f
- -
name: Refuse less secure authentication name: Refuse less secure authentication
default: true recommend: true
docs: https://www.stigviewer.com/stig/windows_10/2019-01-04/finding/V-63801 docs: https://www.stigviewer.com/stig/windows_10/2019-01-04/finding/V-63801
code: reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "LmCompatibilityLevel" /t REG_DWORD /d 5 /f code: reg add "HKLM\SYSTEM\CurrentControlSet\Control\Lsa" /v "LmCompatibilityLevel" /t REG_DWORD /d 5 /f
- -
name: Enable Structured Exception Handling Overwrite Protection (SEHOP) name: Enable Structured Exception Handling Overwrite Protection (SEHOP)
default: true recommend: true
docs: https://www.stigviewer.com/stig/windows_10/2019-01-04/finding/V-68849 docs: https://www.stigviewer.com/stig/windows_10/2019-01-04/finding/V-68849
code: reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel" /v "DisableExceptionChainValidation" /t REG_DWORD /d 0 /f code: reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel" /v "DisableExceptionChainValidation" /t REG_DWORD /d 0 /f
- -
name: Block Anonymous enumeration of SAM accounts name: Block Anonymous enumeration of SAM accounts
default: true recommend: true
docs: https://www.stigviewer.com/stig/windows_10/2019-01-04/finding/V-63745 docs: https://www.stigviewer.com/stig/windows_10/2019-01-04/finding/V-63745
code: reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel" /v "DisableExceptionChainValidation" /t REG_DWORD /d 0 /f code: reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel" /v "DisableExceptionChainValidation" /t REG_DWORD /d 0 /f
- -
name: Restrict anonymous access to Named Pipes and Shares name: Restrict anonymous access to Named Pipes and Shares
default: true recommend: true
docs: https://www.stigviewer.com/stig/windows_10/2019-01-04/finding/V-63759 docs: https://www.stigviewer.com/stig/windows_10/2019-01-04/finding/V-63759
code: reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters" /v "RestrictNullSessAccess" /t REG_DWORD /d 1 /f code: reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanManServer\Parameters" /v "RestrictNullSessAccess" /t REG_DWORD /d 1 /f
- -
@@ -942,11 +942,11 @@ actions:
children: children:
- -
name: Disable Windows Defender name: Disable Windows Defender
default: false recommend: false
code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v DisableAntiSpyware /t REG_DWORD /d 1 /f code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows Defender" /v DisableAntiSpyware /t REG_DWORD /d 1 /f
- -
name: Disable Smart Screen name: Disable Smart Screen
default: false recommend: false
code: |- code: |-
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /v "EnableSmartScreen" /t REG_DWORD /d 0 /f reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\System" /v "EnableSmartScreen" /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /v "SmartScreenEnabled" /t REG_SZ /d "Off" /f reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" /v "SmartScreenEnabled" /t REG_SZ /d "Off" /f
@@ -955,18 +955,18 @@ actions:
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost" /v "EnableWebContentEvaluation" /t REG_DWORD /d 0 /f reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost" /v "EnableWebContentEvaluation" /t REG_DWORD /d 0 /f
- -
name: Disable scheduled On Demand anti malware scanner (MRT) name: Disable scheduled On Demand anti malware scanner (MRT)
default: false recommend: false
code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MRT" /v "DontOfferThroughWUAU" /t REG_DWORD /d 1 /f code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\MRT" /v "DontOfferThroughWUAU" /t REG_DWORD /d 1 /f
- -
category: UI for privacy category: UI for privacy
children: children:
- -
name: Disable lock screen app notifications name: Disable lock screen app notifications
default: true recommend: true
code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System" /v "DisableLockScreenAppNotifications" /t REG_DWORD /d 1 /f code: reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\System" /v "DisableLockScreenAppNotifications" /t REG_DWORD /d 1 /f
- -
name: Disable online content in explorer name: Disable online content in explorer
default: true recommend: true
code: |- code: |-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "AllowOnlineTips" /t REG_DWORD /d 0 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "AllowOnlineTips" /t REG_DWORD /d 0 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoInternetOpenWith" /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoInternetOpenWith" /t REG_DWORD /d 1 /f
@@ -975,21 +975,21 @@ actions:
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoWebServices" /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoWebServices" /t REG_DWORD /d 1 /f
- -
name: Disable & auto-clear recent documents in explorer name: Disable & auto-clear recent documents in explorer
default: true recommend: true
code: |- code: |-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoRecentDocsHistory" /t REG_DWORD /d 1 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoRecentDocsHistory" /t REG_DWORD /d 1 /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "ClearRecentDocsOnExit" /t REG_DWORD /d 1 /f reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "ClearRecentDocsOnExit" /t REG_DWORD /d 1 /f
- -
name: Disable Live Tiles push notifications name: Disable Live Tiles push notifications
default: true recommend: true
code: reg add "HKCU\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications" /v "NoTileApplicationNotification" /t REG_DWORD /d 1 /f code: reg add "HKCU\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\PushNotifications" /v "NoTileApplicationNotification" /t REG_DWORD /d 1 /f
- -
name: Turn off "Look For An App In The Store" option name: Turn off "Look For An App In The Store" option
default: true recommend: true
code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "NoUseStoreOpenWith" /t REG_DWORD /d 1 /f code: reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Explorer" /v "NoUseStoreOpenWith" /t REG_DWORD /d 1 /f
- -
name: Do not show recently used files in Quick Access name: Do not show recently used files in Quick Access
default: true recommend: true
docs: https://www.tenforums.com/tutorials/2713-add-remove-recent-files-quick-access-windows-10-a.html docs: https://www.tenforums.com/tutorials/2713-add-remove-recent-files-quick-access-windows-10-a.html
code: |- code: |-
if %PROCESSOR_ARCHITECTURE%==x86 ( REM is 32 bit? if %PROCESSOR_ARCHITECTURE%==x86 ( REM is 32 bit?
@@ -1003,13 +1003,13 @@ actions:
children: children:
# - # -
# name: Run script on start-up (EXPERIMENTAL) # name: Run script on start-up (EXPERIMENTAL)
# default: false # recommend: false
# code: |- # code: |-
# del /f /q %AppData%\Microsoft\Windows\Start Menu\Programs\Startup\privacy-cleanup.bat # del /f /q %AppData%\Microsoft\Windows\Start Menu\Programs\Startup\privacy-cleanup.bat
# copy "%~dpnx0" "%AppData%\Microsoft\Windows\Start Menu\Programs\Startup\privacy-cleanup" # copy "%~dpnx0" "%AppData%\Microsoft\Windows\Start Menu\Programs\Startup\privacy-cleanup"
- -
name: Change NTP (time) server to pool.ntp.org name: Change NTP (time) server to pool.ntp.org
default: false recommend: false
code: |- code: |-
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32time\Parameters" /v "NtpServer" /t REG_SZ /d "pool.ntp.org, 0x8" /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32time\Parameters" /v "NtpServer" /t REG_SZ /d "pool.ntp.org, 0x8" /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32time\Parameters" /v "Type" /t REG_SZ /d "NTP" /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32time\Parameters" /v "Type" /t REG_SZ /d "NTP" /f
@@ -1020,7 +1020,7 @@ actions:
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32time\TimeProviders\NtpClient" /v "SpecialPollInterval" /t REG_DWORD /d 1024 /f reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\W32time\TimeProviders\NtpClient" /v "SpecialPollInterval" /t REG_DWORD /d 1024 /f
- -
name: Apply settings for all future users (EXPERIMENTAL) name: Apply settings for all future users (EXPERIMENTAL)
default: false recommend: false
code: |- code: |-
REG UNLOAD HKU\DefaultUser REG UNLOAD HKU\DefaultUser
reg load HKU\DefaultUser %SystemDrive%\Users\Default\NTUSER.DAT reg load HKU\DefaultUser %SystemDrive%\Users\Default\NTUSER.DAT

View File

@@ -1,23 +1,28 @@
declare module 'js-yaml-loader!*' { declare module 'js-yaml-loader!*' {
type CategoryOrScript = YamlCategory | YamlScript; type CategoryOrScript = YamlCategory | YamlScript;
type DocumentationUrls = ReadonlyArray<string> | string; type DocumentationUrls = ReadonlyArray<string> | string;
export interface YamlDocumentable { export interface YamlDocumentable {
docs?: DocumentationUrls; docs?: DocumentationUrls;
} }
export interface YamlScript extends YamlDocumentable { export interface YamlScript extends YamlDocumentable {
name: string; name: string;
code: string; code: string;
default: boolean; recommend: boolean;
} }
export interface YamlCategory extends YamlDocumentable { export interface YamlCategory extends YamlDocumentable {
children: ReadonlyArray<CategoryOrScript>; children: ReadonlyArray<CategoryOrScript>;
category: string; category: string;
} }
interface ApplicationYaml { interface ApplicationYaml {
name: string; name: string;
version: number; version: number;
actions: ReadonlyArray<YamlCategory>; actions: ReadonlyArray<YamlCategory>;
} }
const content: ApplicationYaml; const content: ApplicationYaml;
export default content; export default content;
} }

View File

@@ -4,42 +4,60 @@ import { IScript } from './IScript';
import { IApplication } from './IApplication'; import { IApplication } from './IApplication';
export class Application implements IApplication { export class Application implements IApplication {
private static mustHaveCategories(categories: ReadonlyArray<ICategory>) { public get totalScripts(): number { return this.flattened.allScripts.length; }
if (!categories || categories.length === 0) { public get totalCategories(): number { return this.flattened.allCategories.length; }
throw new Error('an application must consist of at least one category');
private readonly flattened: IFlattenedApplication;
constructor(
public readonly name: string,
public readonly version: number,
public readonly categories: ReadonlyArray<ICategory>) {
if (!name) {
throw Error('Application has no name');
} }
if (!version) {
throw Error('Version cannot be zero');
} }
/** this.flattened = flatten(categories);
* Checks all categories against duplicates, throws exception if it find any duplicates if (this.flattened.allCategories.length === 0) {
* @return {number} Total unique categories throw new Error('Application must consist of at least one category');
*/
/** Checks all categories against duplicates, throws exception if it find any duplicates returns total categories */
private static mustNotHaveDuplicatedCategories(categories: ReadonlyArray<ICategory>): number {
return Application.ensureNoDuplicateEntities(categories, Application.visitAllCategoriesOnce);
} }
/** if (this.flattened.allScripts.length === 0) {
* Checks all scripts against duplicates, throws exception if it find any scripts duplicates total scripts. throw new Error('Application must consist of at least one script');
* @return {number} Total unique scripts
*/
private static mustNotHaveDuplicatedScripts(categories: ReadonlyArray<ICategory>): number {
return Application.ensureNoDuplicateEntities(categories, Application.visitAllScriptsOnce);
} }
/** if (this.flattened.allScripts.filter((script) => script.isRecommended).length === 0) {
* Checks entities against duplicates using a visit function, throws exception if it find any duplicates. throw new Error('Application must consist of at least one recommended script');
* @return {number} Result from the visit function }
*/ ensureNoDuplicates(this.flattened.allCategories);
private static ensureNoDuplicateEntities<TKey>( ensureNoDuplicates(this.flattened.allScripts);
categories: ReadonlyArray<ICategory>, }
visitFunction: (categories: ReadonlyArray<ICategory>,
handler: (entity: IEntity<TKey>) => any) => number): number { public findCategory(categoryId: number): ICategory | undefined {
return this.flattened.allCategories.find((category) => category.id === categoryId);
}
public getRecommendedScripts(): readonly IScript[] {
return this.flattened.allScripts.filter((script) => script.isRecommended);
}
public findScript(scriptId: string): IScript | undefined {
return this.flattened.allScripts.find((script) => script.id === scriptId);
}
public getAllScripts(): IScript[] {
return this.flattened.allScripts;
}
}
function ensureNoDuplicates<TKey>(entities: ReadonlyArray<IEntity<TKey>>) {
const totalOccurencesById = new Map<TKey, number>(); const totalOccurencesById = new Map<TKey, number>();
const totalVisited = visitFunction(categories, for (const entity of entities) {
(entity) => totalOccurencesById.set(entity.id, (totalOccurencesById.get(entity.id) || 0) + 1);
totalOccurencesById.set(entity.id, }
(totalOccurencesById.get(entity.id) || 0) + 1));
const duplicatedIds = new Array<TKey>(); const duplicatedIds = new Array<TKey>();
totalOccurencesById.forEach((count, id) => { totalOccurencesById.forEach((index, id) => {
if (count > 1) { if (index > 1) {
duplicatedIds.push(id); duplicatedIds.push(id);
} }
}); });
@@ -48,71 +66,37 @@ export class Application implements IApplication {
throw new Error( throw new Error(
`Duplicate entities are detected with following id(s): ${duplicatedIdsText}`); `Duplicate entities are detected with following id(s): ${duplicatedIdsText}`);
} }
return totalVisited; }
}
// Runs handler on each category and returns sum of total visited categories interface IFlattenedApplication {
private static visitAllCategoriesOnce( allCategories: ICategory[];
categories: ReadonlyArray<ICategory>, handler: (category: ICategory) => any): number { allScripts: IScript[];
let total = 0; }
function flattenRecursive(
categories: ReadonlyArray<ICategory>,
flattened: IFlattenedApplication) {
for (const category of categories) { for (const category of categories) {
handler(category); flattened.allCategories.push(category);
total++;
if (category.subCategories && category.subCategories.length > 0) {
total += Application.visitAllCategoriesOnce(
category.subCategories as ReadonlyArray<ICategory>, handler);
}
}
return total;
}
// Runs handler on each script and returns sum of total visited scripts
private static visitAllScriptsOnce(
categories: ReadonlyArray<ICategory>, handler: (script: IScript) => any): number {
let total = 0;
Application.visitAllCategoriesOnce(categories, (category) => {
if (category.scripts) { if (category.scripts) {
for (const script of category.scripts) { for (const script of category.scripts) {
handler(script); flattened.allScripts.push(script);
total++;
} }
} }
}); if (category.subCategories && category.subCategories.length > 0) {
return total; flattenRecursive(
category.subCategories as ReadonlyArray<ICategory>,
flattened);
} }
public readonly totalScripts: number;
public readonly totalCategories: number;
constructor(
public readonly name: string,
public readonly version: number,
public readonly categories: ReadonlyArray<ICategory>) {
Application.mustHaveCategories(categories);
this.totalCategories = Application.mustNotHaveDuplicatedCategories(categories);
this.totalScripts = Application.mustNotHaveDuplicatedScripts(categories);
}
public findCategory(categoryId: number): ICategory | undefined {
let result: ICategory | undefined;
Application.visitAllCategoriesOnce(this.categories, (category) => {
if (category.id === categoryId) {
result = category;
}
});
return result;
}
public findScript(scriptId: string): IScript | undefined {
let result: IScript | undefined;
Application.visitAllScriptsOnce(this.categories, (script) => {
if (script.id === scriptId) {
result = script;
}
});
return result;
}
public getAllScripts(): IScript[] {
const result = new Array<IScript>();
Application.visitAllScriptsOnce(this.categories, (script) => {
result.push(script);
});
return result;
} }
} }
function flatten(
categories: ReadonlyArray<ICategory>): IFlattenedApplication {
const flattened: IFlattenedApplication = {
allCategories: new Array<ICategory>(),
allScripts: new Array<IScript>(),
};
flattenRecursive(categories, flattened);
return flattened;
}

View File

@@ -7,8 +7,8 @@ export class Category extends BaseEntity<number> implements ICategory {
if (!category.name) { if (!category.name) {
throw new Error('name is null or empty'); throw new Error('name is null or empty');
} }
if ((!category.subCategories || category.subCategories.length === 0) if ((!category.subCategories || category.subCategories.length === 0) &&
&& (!category.scripts || category.scripts.length === 0)) { (!category.scripts || category.scripts.length === 0)) {
throw new Error('A category must have at least one sub-category or scripts'); throw new Error('A category must have at least one sub-category or scripts');
} }
} }

View File

@@ -2,7 +2,13 @@ import { IScript } from '@/domain/IScript';
import { ICategory } from '@/domain/ICategory'; import { ICategory } from '@/domain/ICategory';
export interface IApplication { export interface IApplication {
readonly name: string;
readonly version: number;
readonly categories: ReadonlyArray<ICategory>; readonly categories: ReadonlyArray<ICategory>;
readonly totalScripts: number;
readonly totalCategories: number;
getRecommendedScripts(): ReadonlyArray<IScript>;
findCategory(categoryId: number): ICategory | undefined; findCategory(categoryId: number): ICategory | undefined;
findScript(scriptId: string): IScript | undefined; findScript(scriptId: string): IScript | undefined;
getAllScripts(): ReadonlyArray<IScript>; getAllScripts(): ReadonlyArray<IScript>;

View File

@@ -4,5 +4,6 @@ import { IDocumentable } from './IDocumentable';
export interface IScript extends IEntity<string>, IDocumentable { export interface IScript extends IEntity<string>, IDocumentable {
readonly name: string; readonly name: string;
readonly code: string; readonly code: string;
readonly isRecommended: boolean;
readonly documentationUrls: ReadonlyArray<string>; readonly documentationUrls: ReadonlyArray<string>;
} }

View File

@@ -9,36 +9,30 @@ export class Script extends BaseEntity<string> implements IScript {
} }
private static ensureCodeHasUniqueLines(name: string, code: string): void { private static ensureCodeHasUniqueLines(name: string, code: string): void {
const lines = code.split('\n'); const lines = code.split('\n')
.filter((line) => this.mayBeUniqueLine(line));
if (lines.length === 0) { if (lines.length === 0) {
return; return;
} }
const checkForDuplicates = (line: string) => { const duplicateLines = lines.filter((e, i, a) => a.indexOf(e) !== i);
const trimmed = line.trim();
if (trimmed.length === 1 && trimmed === ')' || trimmed === '(') {
return false;
}
return true;
};
const duplicateLines = new Array<string>();
const uniqueLines = new Set<string>();
let validatedLineCount = 0;
for (const line of lines) {
if (!checkForDuplicates(line)) {
continue;
}
uniqueLines.add(line);
if (uniqueLines.size !== validatedLineCount + 1) {
duplicateLines.push(line);
}
validatedLineCount++;
}
if (duplicateLines.length !== 0) { if (duplicateLines.length !== 0) {
throw Error(`Duplicates detected in script "${name}":\n ${duplicateLines.join('\n')}`); throw Error(`Duplicates detected in script "${name}":\n ${duplicateLines.join('\n')}`);
} }
} }
constructor(public name: string, public code: string, public documentationUrls: ReadonlyArray<string>) { private static mayBeUniqueLine(codeLine: string): boolean {
const trimmed = codeLine.trim();
if (trimmed === ')' || trimmed === '(') { // "(" and ")" are used often in batch code
return false;
}
return true;
}
constructor(
public name: string,
public code: string,
public documentationUrls: ReadonlyArray<string>,
public isRecommended: boolean) {
super(name); super(name);
if (code == null || code.length === 0) { if (code == null || code.length === 0) {
throw new Error('Code is empty or null'); throw new Error('Code is empty or null');

9
src/global.d.ts vendored
View File

@@ -1,9 +1,9 @@
// Two ways of typing other libraries: https://stackoverflow.com/a/53070501 // Two ways of typing other libraries: https://stackoverflow.com/a/53070501
declare module 'liquor-tree' { declare module 'liquor-tree' {
import { PluginObject } from 'vue'; import { PluginObject } from 'vue';
import { VueClass } from 'vue-class-component/lib/declarations'; import { VueClass } from 'vue-class-component/lib/declarations';
// https://github.com/amsik/liquor-tree/blob/master/src/lib/Tree.js // https://github.com/amsik/liquor-tree/blob/master/src/lib/Tree.js
export interface ILiquorTree { export interface ILiquorTree {
readonly model: ReadonlyArray<ILiquorTreeExistingNode>; readonly model: ReadonlyArray<ILiquorTreeExistingNode>;
@@ -14,6 +14,7 @@ declare module 'liquor-tree' {
interface ICustomLiquorTreeData { interface ICustomLiquorTreeData {
documentationUrls: ReadonlyArray<string>; documentationUrls: ReadonlyArray<string>;
} }
/** /**
* Returned from Node tree view events. * Returned from Node tree view events.
* See constructor in https://github.com/amsik/liquor-tree/blob/master/src/lib/Node.js * See constructor in https://github.com/amsik/liquor-tree/blob/master/src/lib/Node.js
@@ -24,6 +25,7 @@ declare module 'liquor-tree' {
states: ILiquorTreeNodeState | undefined; states: ILiquorTreeNodeState | undefined;
children: ReadonlyArray<ILiquorTreeExistingNode> | undefined; children: ReadonlyArray<ILiquorTreeExistingNode> | undefined;
} }
/** /**
* Sent to liquor tree to define of new nodes. * Sent to liquor tree to define of new nodes.
* https://github.com/amsik/liquor-tree/blob/master/src/lib/Node.js * https://github.com/amsik/liquor-tree/blob/master/src/lib/Node.js
@@ -35,13 +37,16 @@ declare module 'liquor-tree' {
children: ReadonlyArray<ILiquorTreeNewNode> | undefined; children: ReadonlyArray<ILiquorTreeNewNode> | undefined;
data: ICustomLiquorTreeData; data: ICustomLiquorTreeData;
} }
// https://github.com/amsik/liquor-tree/blob/master/src/lib/Node.js // https://github.com/amsik/liquor-tree/blob/master/src/lib/Node.js
interface ILiquorTreeNodeState { interface ILiquorTreeNodeState {
checked: boolean; checked: boolean;
} }
interface ILiquorTreeNodeData extends ICustomLiquorTreeData { interface ILiquorTreeNodeData extends ICustomLiquorTreeData {
text: string; text: string;
} }
// https://github.com/amsik/liquor-tree/blob/master/src/components/TreeRoot.vue // https://github.com/amsik/liquor-tree/blob/master/src/components/TreeRoot.vue
interface ILiquorTreeOptions { interface ILiquorTreeOptions {
checkbox: boolean; checkbox: boolean;
@@ -49,11 +54,13 @@ declare module 'liquor-tree' {
filter: ILiquorTreeFilter; filter: ILiquorTreeFilter;
deletion(node: ILiquorTreeNewNode): boolean; deletion(node: ILiquorTreeNewNode): boolean;
} }
// https://github.com/amsik/liquor-tree/blob/master/src/components/TreeRoot.vue // https://github.com/amsik/liquor-tree/blob/master/src/components/TreeRoot.vue
interface ILiquorTreeFilter { interface ILiquorTreeFilter {
emptyText: string; emptyText: string;
matcher(query: string, node: ILiquorTreeNewNode): boolean; matcher(query: string, node: ILiquorTreeNewNode): boolean;
} }
const LiquorTree: PluginObject<any> & VueClass<any>; const LiquorTree: PluginObject<any> & VueClass<any>;
export default LiquorTree; export default LiquorTree;
} }

View File

@@ -1,14 +1,13 @@
import { IEntity } from './IEntity'; import { IEntity } from './IEntity';
export abstract class BaseEntity<TId> implements IEntity<TId> { export abstract class BaseEntity<TId> implements IEntity<TId> {
constructor(public id: TId) { protected constructor(public id: TId) {
if (typeof id !== 'number' && !id) { if (typeof id !== 'number' && !id) {
throw new Error('Id cannot be null or empty'); throw new Error('Id cannot be null or empty');
} }
} }
public equals(otherId: TId): boolean { public equals(otherId: TId): boolean {
return this.id === otherId; return this.id === otherId;
} }
} }

View File

@@ -3,6 +3,7 @@ import { IRepository } from './IRepository';
export class InMemoryRepository<TKey, TEntity extends IEntity<TKey>> implements IRepository<TKey, TEntity> { export class InMemoryRepository<TKey, TEntity extends IEntity<TKey>> implements IRepository<TKey, TEntity> {
private readonly items: TEntity[]; private readonly items: TEntity[];
constructor(items?: TEntity[]) { constructor(items?: TEntity[]) {
this.items = items || new Array<TEntity>(); this.items = items || new Array<TEntity>();
} }

View File

@@ -10,7 +10,7 @@ export class SaveFileDialog {
const blob = new Blob([file], { type: fileType }); const blob = new Blob([file], { type: fileType });
fileSaver.saveAs(blob, fileName); fileSaver.saveAs(blob, fileName);
} catch (e) { } catch (e) {
window.open('data:' + fileType + ',' + encodeURIComponent(file.toString()), '_blank', ''); window.open(`data:${fileType},${encodeURIComponent(file.toString())}`, '_blank', '');
} }
} }
} }

View File

@@ -6,7 +6,7 @@ export class AsyncLazy<T> {
private isCreatingValue = false; private isCreatingValue = false;
private value: T | undefined; private value: T | undefined;
constructor(private valueFactory: () => Promise<T>) { } constructor(private valueFactory: () => Promise<T>) {}
public setValueFactory(valueFactory: () => Promise<T>) { public setValueFactory(valueFactory: () => Promise<T>) {
this.valueFactory = valueFactory; this.valueFactory = valueFactory;

View File

@@ -11,8 +11,15 @@ import { faTimes, faFileDownload, faCopy, faSearch, faInfoCircle } from '@fortaw
export class IconBootstrapper implements IVueBootstrapper { export class IconBootstrapper implements IVueBootstrapper {
public bootstrap(vue: VueConstructor): void { public bootstrap(vue: VueConstructor): void {
library.add(faGithub, faFolderOpen, faFolder, library.add(
faTimes, faFileDownload, faCopy, faSearch, faInfoCircle); faGithub,
faFolderOpen,
faFolder,
faTimes,
faFileDownload,
faCopy,
faSearch,
faInfoCircle);
vue.component('font-awesome-icon', FontAwesomeIcon); vue.component('font-awesome-icon', FontAwesomeIcon);
} }
} }

View File

@@ -29,6 +29,7 @@ export default class IconButton extends StatefulVue {
<style scoped lang="scss"> <style scoped lang="scss">
@import "@/presentation/styles/colors.scss"; @import "@/presentation/styles/colors.scss";
@import "@/presentation/styles/fonts.scss";
.button { .button {
display: flex; display: flex;
@@ -63,7 +64,7 @@ export default class IconButton extends StatefulVue {
} }
&__text { &__text {
display: none; display: none;
font-family: 'Yesteryear', cursive; font-family: $artistic-font;
font-size: 1.5em; font-size: 1.5em;
color: $gray; color: $gray;
font-weight: 500; font-weight: 500;

View File

@@ -31,7 +31,7 @@ export default class CardList extends StatefulVue {
public async mounted() { public async mounted() {
const state = await this.getCurrentStateAsync(); const state = await this.getCurrentStateAsync();
this.setCategories(state.categories); this.setCategories(state.app.categories);
} }
public onSelected(categoryId: number, isExpanded: boolean) { public onSelected(categoryId: number, isExpanded: boolean) {
@@ -57,6 +57,6 @@ export default class CardList extends StatefulVue {
width: 100%; width: 100%;
text-align: center; text-align: center;
font-size: 3.5em; font-size: 3.5em;
font: $default-font; font: $normal-font;
} }
</style> </style>

View File

@@ -55,7 +55,7 @@ export default class CardListItem extends StatefulVue {
private async getCardTitleAsync(categoryId: number): Promise<string | undefined> { private async getCardTitleAsync(categoryId: number): Promise<string | undefined> {
const state = await this.getCurrentStateAsync(); const state = await this.getCurrentStateAsync();
const category = state.getCategory(this.categoryId); const category = state.app.findCategory(this.categoryId);
return category ? category.name : undefined; return category ? category.name : undefined;
} }
} }

View File

@@ -4,7 +4,7 @@ import { INode } from './../SelectableTree/INode';
export class ScriptNodeParser { export class ScriptNodeParser {
public static parseNodes(categoryId: number, state: IApplicationState): INode[] | undefined { public static parseNodes(categoryId: number, state: IApplicationState): INode[] | undefined {
const category = state.getCategory(categoryId); const category = state.app.findCategory(categoryId);
if (!category) { if (!category) {
throw new Error(`Category with id ${categoryId} does not exist`); throw new Error(`Category with id ${categoryId} does not exist`);
} }

View File

@@ -1,6 +1,14 @@
<template> <template>
<div class="container"> <div class="container">
<div class="part">Select:</div> <div class="part">Select:</div>
<div class="part">
<SelectableOption
label="None"
:enabled="isNoneSelected"
@click="selectNoneAsync()">
</SelectableOption>
</div>
<div class="part"> | </div>
<div class="part"> <div class="part">
<SelectableOption <SelectableOption
label="Recommended" label="Recommended"
@@ -14,14 +22,6 @@
:enabled="isAllSelected" :enabled="isAllSelected"
@click="selectAllAsync()" /> @click="selectAllAsync()" />
</div> </div>
<div class="part"> | </div>
<div class="part">
<SelectableOption
label="None"
:enabled="isNoneSelected"
@click="selectNoneAsync()">
</SelectableOption>
</div>
</div> </div>
</template> </template>
@@ -63,7 +63,7 @@ export default class TheSelector extends StatefulVue {
return; return;
} }
const state = await this.getCurrentStateAsync(); const state = await this.getCurrentStateAsync();
state.selection.selectOnly(state.defaultScripts); state.selection.selectOnly(state.app.getRecommendedScripts());
} }
public async selectNoneAsync(): Promise<void> { public async selectNoneAsync(): Promise<void> {
@@ -76,8 +76,8 @@ export default class TheSelector extends StatefulVue {
private updateSelections(state: IApplicationState) { private updateSelections(state: IApplicationState) {
this.isNoneSelected = state.selection.totalSelected === 0; this.isNoneSelected = state.selection.totalSelected === 0;
this.isAllSelected = state.selection.totalSelected === state.appTotalScripts; this.isAllSelected = state.selection.totalSelected === state.app.totalScripts;
this.isRecommendedSelected = this.areSame(state.defaultScripts, state.selection.selectedScripts); this.isRecommendedSelected = this.areSame(state.app.getRecommendedScripts(), state.selection.selectedScripts);
} }
private areSame(scripts: ReadonlyArray<IScript>, other: ReadonlyArray<IScript>): boolean { private areSame(scripts: ReadonlyArray<IScript>, other: ReadonlyArray<IScript>): boolean {
@@ -100,7 +100,7 @@ export default class TheSelector extends StatefulVue {
display: flex; display: flex;
margin-right:5px; margin-right:5px;
} }
font:16px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace; font-family: $normal-font;
} }
</style> </style>

View File

@@ -31,7 +31,7 @@ export default class TheGrouper extends StatefulVue {
.container { .container {
// text-align:left; // text-align:left;
font:16px/normal 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace; font:$normal-font;
} }
.enabled { .enabled {

View File

@@ -7,7 +7,21 @@ import { Component, Prop, Watch, Vue } from 'vue-property-decorator';
import { StatefulVue, IApplicationState } from './StatefulVue'; import { StatefulVue, IApplicationState } from './StatefulVue';
import ace from 'ace-builds'; import ace from 'ace-builds';
import 'ace-builds/webpack-resolver'; import 'ace-builds/webpack-resolver';
import { CodeBuilder } from '../application/State/Code/CodeBuilder';
const NothingChosenCode =
new CodeBuilder()
.appendCommentLine('privacy.sexy — 🔐 Enforce privacy & security best-practices on Windows')
.appendCommentLineWithHyphensAround('🧐 Why privacy.sexy')
.appendCommentLine(' ✔️ Rich tweak pool to harden security & privacy of the OS and other softwares on it.')
.appendCommentLine(' ✔️ You don\'t need to run any compiled software on your system, just run the generated scripts.')
.appendCommentLine(' ✔️ Have full visibility into what the tweaks do as you enable them.')
.appendCommentLine(' ✔️ Free software, 100% transparency: both application & infrastructure code are open-sourced.')
.appendCommentLineWithHyphensAround('🤔 How to use')
.appendCommentLine(' 📙 Start by exploring different categories and choosing different tweaks.')
.appendCommentLine(' 📙 You can select "Recommended" on the top to select "safer" tweaks. Always double check!')
.appendCommentLine(' 📙 After you choose any tweak, you can download & copy to execute your script.')
.toString();
@Component @Component
export default class TheCodeArea extends StatefulVue { export default class TheCodeArea extends StatefulVue {
@@ -17,29 +31,29 @@ export default class TheCodeArea extends StatefulVue {
@Prop() private theme!: string; @Prop() private theme!: string;
public async mounted() { public async mounted() {
this.editor = this.initializeEditor(); this.editor = initializeEditor(this.theme, this.editorId);
const state = await this.getCurrentStateAsync(); const state = await this.getCurrentStateAsync();
this.updateCode(state.code.current); this.updateCode(state.code.current);
state.code.changed.on((code) => this.updateCode(code)); state.code.changed.on((code) => this.updateCode(code));
} }
private updateCode(code: string) { private updateCode(code: string) {
this.editor.setValue(code || 'Something is bad 😢', 1); this.editor.setValue(code || NothingChosenCode, 1);
} }
}
private initializeEditor(): ace.Ace.Editor { function initializeEditor(theme: string, editorId: string): ace.Ace.Editor {
const lang = 'batchfile'; const lang = 'batchfile';
const theme = this.theme || 'github'; theme = theme || 'github';
const editor = ace.edit(this.editorId); const editor = ace.edit(editorId);
editor.getSession().setMode(`ace/mode/${lang}`); editor.getSession().setMode(`ace/mode/${lang}`);
editor.setTheme(`ace/theme/${theme}`); editor.setTheme(`ace/theme/${theme}`);
editor.setReadOnly(true); editor.setReadOnly(true);
editor.setAutoScrollEditorIntoView(true); editor.setAutoScrollEditorIntoView(true);
// this.editor.getSession().setUseWrapMode(true); editor.getSession().setUseWrapMode(true); // So code is readable on mobile
// this.editor.setOption("indentedSoftWrap", false);
return editor; return editor;
}
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@@ -0,0 +1,31 @@
<template>
<div id="footer">
{{text}}
</div>
</template>
<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator';
import { StatefulVue } from './StatefulVue';
@Component
export default class TheFooter extends StatefulVue {
private text: string = '';
public async mounted() {
const state = await this.getCurrentStateAsync();
this.text = `v${state.app.version}`;
}
}
</script>
<style scoped lang="scss">
@import "@/presentation/styles/colors.scss";
@import "@/presentation/styles/fonts.scss";
#footer {
color: $gray;
font-size: 0.7em;
font-family: $artistic-font;
text-align: center;
}
</style>

View File

@@ -20,14 +20,15 @@ export default class TheHeader extends StatefulVue {
public async mounted() { public async mounted() {
const state = await this.getCurrentStateAsync(); const state = await this.getCurrentStateAsync();
this.title = state.appName; this.title = state.app.name;
this.subtitle = `Privacy generator tool for Windows v${state.appVersion}`; this.subtitle = 'Enforce privacy & security on Windows';
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import "@/presentation/styles/colors.scss"; @import "@/presentation/styles/colors.scss";
@import "@/presentation/styles/fonts.scss";
#container { #container {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -50,7 +51,7 @@ export default class TheHeader extends StatefulVue {
margin: 0; margin: 0;
font-size: 1.5em; font-size: 1.5em;
color: $gray; color: $gray;
font-family: 'Yesteryear', cursive; font-family: $artistic-font;
font-weight: 500; font-weight: 500;
line-height: 1.2; line-height: 1.2;
} }

View File

@@ -38,7 +38,7 @@ export default class TheSearchBar extends StatefulVue {
padding-top: 30px; padding-top: 30px;
padding-right: 30%; padding-right: 30%;
padding-left: 30%; padding-left: 30%;
font: $default-font; font: $normal-font;
} }
.search { .search {

View File

@@ -23,4 +23,6 @@
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
} }
$default-font: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace; $normal-font: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
$artistic-font: 'Yesteryear', cursive;
$fancy-font: 'Slabo 27px';

View File

@@ -1,4 +1,6 @@
// based on https://github.com/Akryum/v-tooltip/blob/83615e394c96ca491a4df04b892ae87e833beb97/demo-src/src/App.vue#L179-L303 // based on https://github.com/Akryum/v-tooltip/blob/83615e394c96ca491a4df04b892ae87e833beb97/demo-src/src/App.vue#L179-L303
@import "@/presentation/styles/colors.scss";
.tooltip { .tooltip {
display: block !important; display: block !important;
z-index: 10000; z-index: 10000;

View File

@@ -1,4 +1,5 @@
// Overrides base styling for LiquorTree // Overrides base styling for LiquorTree
@import "@/presentation/styles/colors.scss";
.tree-node > .tree-content > .tree-anchor > span { .tree-node > .tree-content > .tree-anchor > span {
color: $white !important; color: $white !important;

8
src/shims-tsx.d.ts vendored
View File

@@ -3,9 +3,13 @@ import Vue, { VNode } from 'vue';
declare global { declare global {
namespace JSX { namespace JSX {
// tslint:disable no-empty-interface // tslint:disable no-empty-interface
interface Element extends VNode {} interface Element extends VNode {
}
// tslint:disable no-empty-interface // tslint:disable no-empty-interface
interface ElementClass extends Vue {} interface ElementClass extends Vue {
}
interface IntrinsicElements { interface IntrinsicElements {
[elem: string]: any; [elem: string]: any;
} }

View File

@@ -11,7 +11,7 @@ describe('UserSelection', () => {
// arrange // arrange
const app = new ApplicationStub() const app = new ApplicationStub()
.withCategory(new CategoryStub(1) .withCategory(new CategoryStub(1)
.withScripts('s1', 's2', 's3', 's4')); .withScriptIds('s1', 's2', 's3', 's4'));
const selectedScripts = [new ScriptStub('s1'), new ScriptStub('s2'), new ScriptStub('s3')]; const selectedScripts = [new ScriptStub('s1'), new ScriptStub('s2'), new ScriptStub('s3')];
const sut = new UserSelection(app, selectedScripts); const sut = new UserSelection(app, selectedScripts);
@@ -26,7 +26,7 @@ describe('UserSelection', () => {
// arrange // arrange
const app = new ApplicationStub() const app = new ApplicationStub()
.withCategory(new CategoryStub(1) .withCategory(new CategoryStub(1)
.withScripts('s1', 's2', 's3', 's4')); .withScriptIds('s1', 's2', 's3', 's4'));
const selectedScripts = [new ScriptStub('s1'), new ScriptStub('s2'), new ScriptStub('s3')]; const selectedScripts = [new ScriptStub('s1'), new ScriptStub('s2'), new ScriptStub('s3')];
const sut = new UserSelection(app, selectedScripts); const sut = new UserSelection(app, selectedScripts);
const expected = [new ScriptStub('s2'), new ScriptStub('s3'), new ScriptStub('s4')]; const expected = [new ScriptStub('s2'), new ScriptStub('s3'), new ScriptStub('s4')];

View File

@@ -0,0 +1,62 @@
import { ScriptStub } from './../stubs/ScriptStub';
import { CategoryStub } from './../stubs/CategoryStub';
import { Application } from './../../../src/domain/Application';
import 'mocha';
import { expect } from 'chai';
describe('Application', () => {
it('getRecommendedScripts returns as expected', () => {
// arrange
const expected = [
new ScriptStub('S3').withIsRecommended(true),
new ScriptStub('S4').withIsRecommended(true),
];
const sut = new Application('name', 2, [
new CategoryStub(3).withScripts(expected[0], new ScriptStub('S1').withIsRecommended(false)),
new CategoryStub(2).withScripts(expected[1], new ScriptStub('S2').withIsRecommended(false)),
]);
// act
const actual = sut.getRecommendedScripts();
// assert
expect(expected[0]).to.deep.equal(actual[0]);
expect(expected[1]).to.deep.equal(actual[1]);
});
it('cannot construct without categories', () => {
// arrange
const categories = [];
// act
function construct() { return new Application('name', 2, categories); }
// assert
expect(construct).to.throw('Application must consist of at least one category');
});
it('cannot construct without scripts', () => {
// arrange
const categories = [
new CategoryStub(3),
new CategoryStub(2),
];
// act
function construct() { return new Application('name', 2, categories); }
// assert
expect(construct).to.throw('Application must consist of at least one script');
});
it('cannot construct without any recommended scripts', () => {
// arrange
const categories = [
new CategoryStub(3).withScripts(new ScriptStub('S1').withIsRecommended(false)),
new CategoryStub(2).withScripts(new ScriptStub('S2').withIsRecommended(false)),
];
// act
function construct() { return new Application('name', 2, categories); }
// assert
expect(construct).to.throw('Application must consist of at least one recommended script');
});
});

View File

@@ -0,0 +1,17 @@
import 'mocha';
import { expect } from 'chai';
import { Script } from '@/domain/Script';
describe('Script', () => {
it('cannot construct with duplicate lines', () => {
// arrange
const code = 'duplicate\nduplicate\ntest\nduplicate';
// act
function construct() { return new Script('ScriptName', code, [], true); }
// assert
expect(construct).to.throw();
});
});

View File

@@ -1,6 +1,10 @@
import { IApplication, ICategory, IScript } from '@/domain/IApplication'; import { IApplication, ICategory, IScript } from '@/domain/IApplication';
export class ApplicationStub implements IApplication { export class ApplicationStub implements IApplication {
public readonly totalScripts = 0;
public readonly totalCategories = 0;
public readonly name = 'StubApplication';
public readonly version = 1;
public readonly categories = new Array<ICategory>(); public readonly categories = new Array<ICategory>();
public withCategory(category: ICategory): IApplication { public withCategory(category: ICategory): IApplication {
@@ -10,11 +14,12 @@ export class ApplicationStub implements IApplication {
public findCategory(categoryId: number): ICategory { public findCategory(categoryId: number): ICategory {
throw new Error('Method not implemented.'); throw new Error('Method not implemented.');
} }
public getRecommendedScripts(): readonly IScript[] {
throw new Error('Method not implemented.');
}
public findScript(scriptId: string): IScript { public findScript(scriptId: string): IScript {
throw new Error('Method not implemented.'); throw new Error('Method not implemented.');
} }
public getAllScripts(): ReadonlyArray<IScript> { public getAllScripts(): ReadonlyArray<IScript> {
throw new Error('Method not implemented.'); throw new Error('Method not implemented.');
} }

View File

@@ -11,10 +11,16 @@ export class CategoryStub extends BaseEntity<number> implements ICategory {
constructor(id: number) { constructor(id: number) {
super(id); super(id);
} }
public withScripts(...scriptIds: string[]): CategoryStub { public withScriptIds(...scriptIds: string[]): CategoryStub {
for (const scriptId of scriptIds) { for (const scriptId of scriptIds) {
this.scripts.push(new ScriptStub(scriptId)); this.scripts.push(new ScriptStub(scriptId));
} }
return this; return this;
} }
public withScripts(...scripts: IScript[]): CategoryStub {
for (const script of scripts) {
this.scripts.push(script);
}
return this;
}
} }

View File

@@ -5,8 +5,14 @@ export class ScriptStub extends BaseEntity<string> implements IScript {
public readonly name = `name${this.id}`; public readonly name = `name${this.id}`;
public readonly code = `name${this.id}`; public readonly code = `name${this.id}`;
public readonly documentationUrls = new Array<string>(); public readonly documentationUrls = new Array<string>();
public isRecommended = false;
constructor(public readonly id: string) { constructor(public readonly id: string) {
super(id); super(id);
} }
public withIsRecommended(value: boolean): ScriptStub {
this.isRecommended = value;
return this;
}
} }