diff --git a/.gitignore b/.gitignore index 04bea7fa..dfeb638c 100644 --- a/.gitignore +++ b/.gitignore @@ -177,6 +177,7 @@ config/local-config.json config/development.json config/production.json config/test.json +manifest.chrome.json # Sensitive configuration files config/secrets.json diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0a632d09..3774c483 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,13 +1,32 @@ # Contributing to Check -Thanks for taking the time to contribute! These guidelines help keep contributions consistent and reliable for this Chrome extension. +Thanks for taking the time to contribute! These guidelines help keep contributions consistent and reliable for this cross-browser extension. ## Development Setup + +### Chrome/Edge - Fork the repository and clone your fork. -- In Chrome or a Chromium-based browser, open `chrome://extensions`. +- Run `npm run build:chrome` to configure for Chrome/Edge. +- In Chrome or Edge, open `chrome://extensions` or `edge://extensions`. - Enable **Developer mode** and choose **Load unpacked**. - Select the repository root to load the extension. Reload the extension after making changes. +### Firefox +- Fork the repository and clone your fork. +- Run `npm run build:firefox` to configure for Firefox. +- In Firefox, open `about:debugging#/runtime/this-firefox`. +- Click **Load Temporary Add-on** and select `manifest.json`. +- Reload the extension after making changes. +- See [Firefox Support Guide](docs/firefox-support.md) for more details. + +## Cross-Browser Compatibility +- The extension supports Chrome, Edge, and Firefox through browser polyfills. +- Always test changes in both Chrome and Firefox before submitting. +- Use the browser polyfill APIs in your code: + - In ES modules: `import { chrome, storage } from "./browser-polyfill.js"` + - In traditional scripts: The polyfill is auto-loaded, just use `chrome.*` as normal +- Avoid browser-specific features unless absolutely necessary. + ## Coding Standards (ESLint) - No ESLint configuration is committed to the repository. Maintain the existing code style (2 spaces, semicolons, ES modules). - If you have ESLint installed locally, run `npx eslint scripts options popup` with the default recommended rules and resolve any issues before committing. @@ -18,10 +37,12 @@ Thanks for taking the time to contribute! These guidelines help keep contributio ## Testing Expectations - Automated tests are not currently available. Manually test changes by loading the extension and verifying: - - The background service worker initializes without errors. + - The background service worker/script initializes without errors. - Content scripts inject and execute as expected. - Options and popup pages function correctly. -- Include a brief summary of manual testing in your pull request. +- **Test in both Chrome and Firefox** to ensure cross-browser compatibility. +- See [Firefox Support Guide](docs/firefox-support.md) for Firefox testing instructions. +- Include a brief summary of manual testing in your pull request, noting which browsers were tested. ## Scripted Deployment Updates - Any new configuration settings result in a need to be managed by scripted deployment. As such, the following files need to be reviewed and have the settings added: diff --git a/README.md b/README.md index 0a3ea05e..4ff9b97d 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,8 @@ impersonate Microsoft 365 sign-in pages. Install it from the [Chrome](https://chromewebstore.google.com/detail/benimdeioplgkhanklclahllklceahbe) Store here or the [Edge](https://microsoftedge.microsoft.com/addons/detail/check-by-cyberdrain/knepjpocdagponkonnbggpcnhnaikajg) store here. +**Firefox Support**: The extension also works on Firefox 109+. See [Firefox Support](docs/firefox-support.md) for installation instructions. + ## Features - **Detection engine** β loads rules from `rules/detection-rules.json` and @@ -21,7 +23,7 @@ Install it from the [Chrome](https://chromewebstore.google.com/detail/benimdeiop ## Requirements -- Chrome 88+ or other Chromium-based browsers supporting Manifest V3 +- Chrome 88+, Edge 88+, or Firefox 109+ (browsers supporting Manifest V3) - Optional enterprise management via Group Policy or Microsoft Intune for policy enforcement @@ -29,11 +31,19 @@ Install it from the [Chrome](https://chromewebstore.google.com/detail/benimdeiop ### Manual +#### Chrome/Edge 1. Clone this repository. -2. In Chrome/Edge open `chrome://extensions/` and enable **Developer mode**. +2. In Chrome/Edge open `chrome://extensions/` or `edge://extensions` and enable **Developer mode**. 3. Click **Load unpacked** and select the project directory. 4. Verify the extension using `test-extension-loading.html`. +#### Firefox +1. Clone this repository. +2. Run `npm run build:firefox` to configure for Firefox. +3. Open `about:debugging#/runtime/this-firefox` in Firefox. +4. Click **Load Temporary Add-on** and select `manifest.json`. +5. For more details, see [Firefox Support](docs/firefox-support.md). + ### Enterprise Package the extension directory (zip) and deploy through your browserβs policy diff --git a/config/managed_schema.json b/config/managed_schema.json index 46a53e75..fa279af6 100644 --- a/config/managed_schema.json +++ b/config/managed_schema.json @@ -13,6 +13,14 @@ "type": "boolean", "default": true }, + "validPageBadgeTimeout": { + "title": "Valid Page Badge Timeout (seconds)", + "description": "Auto-dismiss timeout for the valid page badge in seconds. Set to 0 for no timeout (badge stays visible until manually dismissed).", + "type": "integer", + "minimum": 0, + "maximum": 300, + "default": 5 + }, "enablePageBlocking": { "title": "Page Blocking Enabled", "description": "Enable blocking of malicious pages", diff --git a/docs/README.md b/docs/README.md index 53e37e62..c587033b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -20,10 +20,12 @@ layout: ## What is Check? -**Check** is an browser extension that provides real-time protection against Microsoft 365 phishing attacks. +**Check** is a browser extension that provides real-time protection against Microsoft 365 phishing attacks. Specifically designed for enterprises and managed service providers, Check uses sophisticated detection algorithms to identify and block malicious login pages before credentials can be stolen by bad actors. +Check is available for **Chrome**, **Microsoft Edge**, and **Firefox** (109+). + The extension integrates seamlessly with existing security workflows, offering centralized management, comprehensive logging, and offers an optional CIPP integration for MSPs managing multiple Microsoft 365 tenants. Check is completely free, open source, and can be delivered to users completely white-label, it is an open source project licensed under AGPL-3. You can contribute to check at [https://github.com/cyberdrain/Check](https://github.com/cyberdrain/Check). @@ -32,6 +34,8 @@ Installing the plugin immediately gives you protection against AITM attacks, and Install for Edge **OR** Install for Chrome +**Firefox users:** See the [Firefox Support](firefox-support.md) guide for installation instructions. + ## Why was Check created? Check was created out of a need to have better protection against AITM attacks. During a CyberDrain brainstorming session CyberDrain's lead dev came up with the idea to create a Chrome extension to protect users: diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index 4d42d145..60231546 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -1,6 +1,7 @@ # Table of contents - [About](README.md) +- [Firefox Support](firefox-support.md) ## Deployment @@ -10,6 +11,7 @@ - [Domain Deployment](deployment/chrome-edge-deployment-instructions/windows/domain-deployment.md) - [RMM Deployment](deployment/chrome-edge-deployment-instructions/windows/rmm-deployment.md) - [MacOS](deployment/chrome-edge-deployment-instructions/macos.md) +- [Firefox Deployment](deployment/firefox-deployment.md) ## Settings diff --git a/docs/advanced/creating-detection-rules.md b/docs/advanced/creating-detection-rules.md index d247c0dc..08c39349 100644 --- a/docs/advanced/creating-detection-rules.md +++ b/docs/advanced/creating-detection-rules.md @@ -4,7 +4,7 @@ The extension uses a rule-driven architecture where all detection logic is defin * **Trusted domain patterns** - Microsoft domains that are always trusted * **Exclusion system** - Domains that should never be scanned -* **Phishing indicators** - Patterns that detect malicious content +* **Phishing indicators** - Patterns that detect malicious content (supports both regex and code-driven logic) * **Detection requirements** - Elements that identify Microsoft 365 login pages * **Blocking rules** - Conditions that immediately block pages * **Rogue apps detection** - Dynamic detection of known malicious OAuth applications @@ -70,7 +70,16 @@ These domains get immediate trusted status with valid badges: ] ``` -### Indicators +## Phishing Indicators + +The Check extension supports two types of phishing indicators: + +1. **Regex-based indicators** - Traditional pattern matching using regular expressions +2. **Code-driven indicators** - Advanced logic-based detection using structured operations + +### Regex-Based Indicators + +Traditional indicators use regular expressions to match patterns in page content: ```json { @@ -85,6 +94,258 @@ These domains get immediate trusted status with valid badges: } ``` +### Code-Driven Indicators + +Code-driven indicators allow complex detection logic without regex complexity. Set `code_driven: true` and define your logic in the `code_logic` object: + +```json +{ + "id": "phi_example_code_driven", + "code_driven": true, + "code_logic": { + "type": "all_of", + "operations": [ + { + "type": "substring_present", + "values": ["microsoft", "office", "365"] + }, + { + "type": "substring_present", + "values": ["password", "login"] + } + ] + }, + "severity": "high", + "description": "Microsoft branding with credential fields", + "action": "warn", + "category": "credential_harvesting", + "confidence": 0.8 +} +``` + +#### Code-Driven Logic Types + +**1. `substring_present`** - Check if substrings are in the page + +```json +{ + "type": "substring_present", + "values": ["microsoft", "office", "365"] +} +``` + +**2. `substring_count`** - Require minimum occurrences + +```json +{ + "type": "substring_count", + "substrings": ["verify", "urgent", "suspended"], + "min_count": 2 +} +``` + +**3. `substring_proximity`** - Words must appear near each other + +```json +{ + "type": "substring_proximity", + "word1": "urgent", + "word2": "action", + "max_distance": 500 +} +``` + +**4. `multi_proximity`** - Check multiple word pairs + +```json +{ + "type": "multi_proximity", + "pairs": [ + {"words": ["verify", "account"], "max_distance": 50}, + {"words": ["suspended", "365"], "max_distance": 50}, + {"words": ["secure", "microsoft"], "max_distance": 50} + ] +} +``` + +**5. `all_of`** - All conditions must match + +```json +{ + "type": "all_of", + "operations": [ + { + "type": "substring_present", + "values": ["microsoft"] + }, + { + "type": "substring_present", + "values": ["password"] + } + ] +} +``` + +**6. `any_of`** - At least one condition must match + +```json +{ + "type": "any_of", + "operations": [ + { + "type": "substring_proximity", + "word1": "urgent", + "word2": "action", + "max_distance": 500 + }, + { + "type": "substring_proximity", + "word1": "immediate", + "word2": "attention", + "max_distance": 500 + } + ] +} +``` + +**7. `has_but_not`** - Require some keywords, prohibit others + +```json +{ + "type": "has_but_not", + "required": ["microsoft", "login"], + "prohibited": [ + "sign in with microsoft", + "sso", + "oauth", + "third party auth" + ] +} +``` + +**8. `pattern_count`** - Count regex pattern matches + +```json +{ + "type": "pattern_count", + "patterns": ["