Demo: secretlint/webextension
11 |This page exposes credentials.
12 |13 | 1. Open browser's Developer Tools 14 | 2. ✅ Disable Cache 15 | 3. Reload page and secretlint report found credentials in your request/response. 16 |17 |
User Name:
18 |├── .secretlintignore ├── .githooks └── pre-commit ├── .mocharc.json ├── docs └── screenshot.png ├── app ├── images │ ├── icon-32.png │ ├── icon-96.png │ └── icon-192.png ├── scripts │ ├── secretlint │ │ ├── rule.allows.ts │ │ ├── lint.ts │ │ └── rule.patterns.ts │ ├── settings.ts │ ├── types.ts │ ├── dev_tools_panel.ts │ ├── dev_tools_panel │ │ ├── base.css │ │ ├── App.css │ │ └── App.tsx │ ├── settings │ │ ├── SettingSchema.ts │ │ ├── SettingSchema.validator.ts │ │ ├── CodeEditor.tsx │ │ └── App.tsx │ ├── contentScript.ts │ ├── background.ts │ └── dev_tools.ts ├── pages │ ├── dev_tools.html │ ├── settings.html │ └── dev_tools_panel.html ├── _locales │ └── en │ │ └── messages.json └── manifest.json ├── demo ├── index.css ├── index.js ├── index.html └── user.json ├── test └── tsconfig.json ├── renovate.json ├── .github └── workflows │ ├── test.yml │ └── codeql-analysis.yml ├── netlify.toml ├── .eslintrc.js ├── tsconfig.json ├── LICENSE ├── webextension-toolbox.config.js ├── package.json ├── .eslintignore ├── .gitignore └── README.md /.secretlintignore: -------------------------------------------------------------------------------- 1 | demo/ 2 | README.md 3 | -------------------------------------------------------------------------------- /.githooks/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | npx --no-install lint-staged 3 | -------------------------------------------------------------------------------- /.mocharc.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": [ 3 | "ts-node-test-register" 4 | ] 5 | } -------------------------------------------------------------------------------- /docs/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretlint/webextension/HEAD/docs/screenshot.png -------------------------------------------------------------------------------- /app/images/icon-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretlint/webextension/HEAD/app/images/icon-32.png -------------------------------------------------------------------------------- /app/images/icon-96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretlint/webextension/HEAD/app/images/icon-96.png -------------------------------------------------------------------------------- /app/images/icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/secretlint/webextension/HEAD/app/images/icon-192.png -------------------------------------------------------------------------------- /app/scripts/secretlint/rule.allows.ts: -------------------------------------------------------------------------------- 1 | export const RULES_DEFAULT_ALLOWS = [ 2 | // local ip 3 | "0.0.0.0", 4 | "1.1.1.1", 5 | "1.2.3.4" 6 | ]; 7 | -------------------------------------------------------------------------------- /demo/index.css: -------------------------------------------------------------------------------- 1 | /* Notice https://hooks.slack.com/services/T11111AA/BAAAA111A/qKisfWavfyBGqKgirRWalryDG */ 2 | html, 3 | body { 4 | width: 100%; 5 | } 6 | 7 | .main { 8 | max-width: 800px; 9 | } 10 | -------------------------------------------------------------------------------- /app/scripts/settings.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom"; 3 | import { App } from "./settings/App"; 4 | 5 | ReactDOM.render(React.createElement(App), document.querySelector("#main")); 6 | -------------------------------------------------------------------------------- /app/scripts/types.ts: -------------------------------------------------------------------------------- 1 | import { SecretLintCoreResultMessage } from "@secretlint/types"; 2 | 3 | export type SecretLintMessage = SecretLintCoreResultMessage & { 4 | url: string; 5 | sliceContent: string; 6 | }; 7 | -------------------------------------------------------------------------------- /app/scripts/dev_tools_panel.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom"; 3 | import { App } from "./dev_tools_panel/App"; 4 | 5 | ReactDOM.render(React.createElement(App), document.querySelector("#main")); 6 | -------------------------------------------------------------------------------- /test/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "declaration": false, 5 | "noEmit": true 6 | }, 7 | "include": [ 8 | "../src/**/*", 9 | "./**/*" 10 | ] 11 | } -------------------------------------------------------------------------------- /app/pages/dev_tools.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |This page exposes credentials.
12 |13 | 1. Open browser's Developer Tools 14 | 2. ✅ Disable Cache 15 | 3. Reload page and secretlint report found credentials in your request/response. 16 |17 |
User Name:
18 |Not found secrets in this page.
29 |40 | 🔑{" "} 41 | {message.docsUrl ? ( 42 | 48 | {message.ruleId} 49 | 50 | ) : ( 51 | {message.ruleId} 52 | )}{" "} 53 | {message.message} 54 |
55 |56 | 📍{" "} 57 | 58 | {message.url} 59 | 60 |
61 |{JSON.stringify(message, null, 4)}
65 | 121 | If match following patterns, just ignore it. For more details, see{" "} 122 | 123 | Document📝 124 | 125 |
126 |129 | If match following patterns, report it as error. For more details, see{" "} 130 | 131 | Document📝 132 | 133 |
134 |