diff --git a/CHANGELOG.md b/CHANGELOG.md index eaa01fc..dc8d837 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,17 @@ # Azure Mask Changelog +## 1.1.5 (2019-04-22) +### Changed +- Name to "Az Mask" as "Azure Mask" was taken down due to trademark infringement ("Azure") +- Regex used to find sensitive data to the simplified version looking for text with a signature following the Subscription ID pattern + +### Added +- Ability to hide tooltips/title attribute for masked elements using css `pointer-events: none;` + ## 1.1.4 (2018-08-15) -_New Features_ +### Added - Add support for government portal URLs [#44](https://github.com/clarkio/azure-mask/pull/44) diff --git a/extension/1.1.5/az-mask-0.1.5.crx b/extension/1.1.5/az-mask-0.1.5.crx new file mode 100644 index 0000000..576d95b Binary files /dev/null and b/extension/1.1.5/az-mask-0.1.5.crx differ diff --git a/extension/1.1.5/az-mask-1.1.5.zip b/extension/1.1.5/az-mask-1.1.5.zip new file mode 100644 index 0000000..7dc5647 Binary files /dev/null and b/extension/1.1.5/az-mask-1.1.5.zip differ diff --git a/src/content-script/mask-process.js b/src/content-script/mask-process.js index 673741d..a4c7dbb 100644 --- a/src/content-script/mask-process.js +++ b/src/content-script/mask-process.js @@ -1,8 +1,12 @@ const isMaskedKeyName = 'isMasked'; const maskEnabledClassName = 'az-mask-enabled'; -const sensitiveDataRegex = /^\s*([a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12})|((([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,})))\s*$/; +const sensitiveDataRegex = /^([a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12})$/; +/* ** Original regex prior to 2019-04-18 ** + * const sensitiveDataRegex = /^\s*([a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12})|((([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,})))\s*$/; + * + */ const sensitiveDataClassName = 'azdev-sensitive'; -const blurCss = 'filter: blur(10px);'; +const blurCss = 'filter: blur(10px); pointer-events: none;'; const tagNamesToMatch = ['DIV']; // uppercase // add CSS style to blur @@ -10,13 +14,29 @@ const style = document.createElement('style'); style.appendChild(document.createTextNode('')); document.head.appendChild(style); -style.sheet.insertRule(`.${maskEnabledClassName} .azdev-sensitive { ${blurCss} }`); -style.sheet.insertRule(`.${maskEnabledClassName} .fxs-avatarmenu-username { display: none }`); // hide name instead of blurring -style.sheet.insertRule(`.${maskEnabledClassName} input.azc-bg-light { ${blurCss} }`); // input boxes used for keys, connection strings, etc -style.sheet.insertRule(`.${maskEnabledClassName} a.fxs-topbar-reportbug { display:none; }`); // report a bug button (MS internal only) +style.sheet.insertRule( + `.${maskEnabledClassName} .azdev-sensitive { ${blurCss} }` +); +style.sheet.insertRule( + `.${maskEnabledClassName} .fxs-avatarmenu-username { display: none }` +); // hide name instead of blurring +style.sheet.insertRule( + `.${maskEnabledClassName} input.azc-bg-light { ${blurCss} }` +); // input boxes used for keys, connection strings, etc +style.sheet.insertRule( + `.${maskEnabledClassName} a.fxs-topbar-reportbug { display:none; }` +); // report a bug button (MS internal only) +style.sheet.insertRule( + `.${maskEnabledClassName} div.fxs-topbar-internal { display:none; }` +); // "Preview" element in top navigation bar (MS internal only) +style.sheet.insertRule( + `.${maskEnabledClassName} .fxs-mecontrol-flyout { ${blurCss} }` +); // user account menu getStoredMaskedStatus(isMasked => { - isMasked ? document.body.classList.add(maskEnabledClassName) : document.body.classList.remove(maskEnabledClassName); + isMasked + ? document.body.classList.add(maskEnabledClassName) + : document.body.classList.remove(maskEnabledClassName); }); // add class to elements already on the screen @@ -27,7 +47,11 @@ Array.from(document.querySelectorAll(tagNamesToMatch.join())) // add class to elements that are added to DOM later const observer = new MutationObserver(mutations => { mutations - .filter(m => shouldCheckContent(m.target, m.type) && sensitiveDataRegex.test(m.target.textContent)) + .filter( + m => + shouldCheckContent(m.target, m.type) && + sensitiveDataRegex.test(m.target.textContent.trim()) + ) .forEach(m => { const node = m.type === 'characterData' ? m.target.parentNode : m.target; if (node.classList) { @@ -44,7 +68,10 @@ const config = { observer.observe(document.body, config); function shouldCheckContent(target, mutationType) { - return mutationType === 'characterData' || (target && tagNamesToMatch.some(tn => tn === target.tagName)); + return ( + mutationType === 'characterData' || + (target && tagNamesToMatch.some(tn => tn === target.tagName)) + ); } function getStoredMaskedStatus(callback) { @@ -52,7 +79,9 @@ function getStoredMaskedStatus(callback) { const { isMasked } = items; if (typeof isMasked !== 'boolean') { // default to true - chrome.storage.local.set({ [isMaskedKeyName]: true }, () => callback(true)); + chrome.storage.local.set({ [isMaskedKeyName]: true }, () => + callback(true) + ); } else { callback(isMasked); } diff --git a/src/manifest.json b/src/manifest.json index 15ad3eb..8526bd3 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,8 +1,8 @@ { "manifest_version": 2, - "name": "Azure Mask", - "version": "1.1.4", - "description": "Conceals sensitive Azure information found in the portal views", + "name": "Az Mask", + "version": "1.1.5", + "description": "Does it's best to find and conceal sensitive Azure information found in the portal views", "icons": { "16": "/icons/icon16.png", "48": "/icons/icon48.png", @@ -22,7 +22,8 @@ ], "js": ["/content-script/mask-process.js"], "run_at": "document_idle", - "all_frames": true + "all_frames": true, + "match_about_blank": true } ], "permissions": [ diff --git a/src/popout/popout.js b/src/popout/popout.js index 7282b3d..3daa94a 100644 --- a/src/popout/popout.js +++ b/src/popout/popout.js @@ -1,5 +1,3 @@ -const sensitiveDataRegex = /^([a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12})|((([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,})))$/; -const sensitiveDataClassName = 'azdev-sensitive'; let allMasksEnabled = true; let allMasksCheckbox = document.getElementById('toggle-all-masks'); @@ -8,7 +6,7 @@ allMasksCheckbox.addEventListener('click', toggleAllMasks); chrome.tabs.executeScript( { code: "document.body.classList.contains('az-mask-enabled');", - allFrames: false + allFrames: true }, results => { if (results) { @@ -39,11 +37,11 @@ function injectDisableAllMasks() { }); } -document.addEventListener('DOMContentLoaded', function () { - var y = document.getElementById("index_link"); - y.addEventListener("click", openIndex); +document.addEventListener('DOMContentLoaded', function() { + var y = document.getElementById('index_link'); + y.addEventListener('click', openIndex); }); function openIndex() { - chrome.tabs.create({ active: true, url: "https://aka.ms/publicportal" }); + chrome.tabs.create({ active: true, url: 'https://aka.ms/publicportal' }); }