<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.1.1">Jekyll</generator><link href="https://blog.ewan-colyer.co.uk/feed.xml" rel="self" type="application/atom+xml" /><link href="https://blog.ewan-colyer.co.uk/" rel="alternate" type="text/html" /><updated>2020-11-02T12:36:55+00:00</updated><id>https://blog.ewan-colyer.co.uk/feed.xml</id><title type="html">Ewans blog</title><subtitle>Welcome to my blog, hopefully it will be home to some tech things that I consider worth sharing</subtitle><entry><title type="html">Auditing installed chrome extensions</title><link href="https://blog.ewan-colyer.co.uk/chrome/security/2020/10/30/auditing-chrome-extensions.html" rel="alternate" type="text/html" title="Auditing installed chrome extensions" /><published>2020-10-30T15:55:00+00:00</published><updated>2020-10-30T15:55:00+00:00</updated><id>https://blog.ewan-colyer.co.uk/chrome/security/2020/10/30/auditing-chrome-extensions</id><content type="html" xml:base="https://blog.ewan-colyer.co.uk/chrome/security/2020/10/30/auditing-chrome-extensions.html">&lt;h1 id=&quot;about&quot;&gt;About&lt;/h1&gt;
&lt;p&gt;So, you want to work out what chrome extensions your users have installed, but don’t want to use &lt;a target=&quot;_blank&quot; href=&quot;https://support.google.com/chrome/a/answer/9116814?hl=en&quot;&gt;Google’s Chrome Cloud Managment&lt;/a&gt; (free for 1 admin user, but paid after that), what do you do?&lt;/p&gt;

&lt;p&gt;This isn’t a sound way to get all extensions installed on a device, it is intended to help gauge the impact on moving to a model where you have a blocklist or an allowlist for chrome extensions.&lt;/p&gt;

&lt;p&gt;I think it is often underestimated how much a chrome extension can make an employees’ life easier and going in all guns blazing moving to an allowlist without working out the impact might lead to an &lt;a target=&quot;_blank&quot; href=&quot;https://youtu.be/w8KQmps-Sog?t=162&quot;&gt;uprising&lt;/a&gt;, or your employees just trying to avoid these measures.&lt;/p&gt;

&lt;h1 id=&quot;what-do-we-need&quot;&gt;What do we need?&lt;/h1&gt;

&lt;li&gt; A list of installed extensions on macs&lt;/li&gt;
&lt;li&gt; A way to process that list into data that is easy to interpret.&lt;/li&gt;

&lt;h1 id=&quot;the-extension-attribute&quot;&gt;The extension attribute&lt;/h1&gt;

&lt;p&gt;Thanks to &lt;a target=&quot;_blank&quot; href=&quot;https://stackoverflow.com/questions/17377337/where-to-find-extensions-installed-folder-for-google-chrome-on-mac&quot;&gt;this&lt;/a&gt; post, I found that the default location of installed chrome extensions is in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/Library/Application\ Support/Google/Chrome/Default&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So what do we do from here? my first thought is that we can just &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ls&lt;/code&gt; the directory, chuck commas between each extension ID and echo it into an extension attribute in your chosen MDM.&lt;/p&gt;

&lt;p&gt;Here is how I did it, it’s not necessarily the neatest or best way to do it. But it’s the way that worked for me.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-zsh&quot; data-lang=&quot;zsh&quot;&gt;&lt;span class=&quot;c&quot;&gt;#!/bin/zsh&lt;/span&gt;

&lt;span class=&quot;nv&quot;&gt;currentUser&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-l&lt;/span&gt; /dev/console | &lt;span class=&quot;nb&quot;&gt;cut&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot; &quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f4&lt;/span&gt;&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;userHome&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt; dscl &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;read&lt;/span&gt; /Users/&lt;span class=&quot;nv&quot;&gt;$currentUser&lt;/span&gt; NFSHomeDirectory | &lt;span class=&quot;nb&quot;&gt;awk&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'{print $NF}'&lt;/span&gt; &lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;


&lt;span class=&quot;c&quot;&gt;# checking that files dont exist before starting&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[[&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; /tmp/extensions.txt &lt;span class=&quot;o&quot;&gt;]]&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;then
    &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;rm&lt;/span&gt; /tmp/extensions.txt
&lt;span class=&quot;k&quot;&gt;else
    &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;extensions.txt does not already exist&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;fi

if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[[&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; /tmp/extensionsNew.txt &lt;span class=&quot;o&quot;&gt;]]&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;then
    &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;rm&lt;/span&gt; /tmp/extensionsNew.txt
&lt;span class=&quot;k&quot;&gt;else
    &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;extensions.txt does not already exist&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;


&lt;span class=&quot;c&quot;&gt;# gets names of all files in the extensions dir&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[[&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$userHome&lt;/span&gt;/Library/Application&lt;span class=&quot;se&quot;&gt;\ &lt;/span&gt;Support/Google/Chrome/Default/Extensions &lt;span class=&quot;o&quot;&gt;]]&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;then
    &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Extensions dir exists&quot;&lt;/span&gt;
    
    &lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$userHome&lt;/span&gt;/Library/Application&lt;span class=&quot;se&quot;&gt;\ &lt;/span&gt;Support/Google/Chrome/Default/Extensions/ &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; /tmp/extensions.txt 
    &lt;span class=&quot;nb&quot;&gt;tr&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'\n'&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;','&lt;/span&gt; &amp;lt; /tmp/extensions.txt &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; /tmp/extensionsNew.txt
    &lt;span class=&quot;nv&quot;&gt;extensions&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cat&lt;/span&gt; /tmp/extensionsNew.txt&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;

    &lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&amp;lt;result&amp;gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$extensions&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&amp;lt;/result&amp;gt;&quot;&lt;/span&gt;

    &lt;span class=&quot;nb&quot;&gt;rm&lt;/span&gt; /tmp/extensions.txt
    &lt;span class=&quot;nb&quot;&gt;rm&lt;/span&gt; /tmp/extensionsNew.txt

    &lt;span class=&quot;nb&quot;&gt;exit &lt;/span&gt;0
&lt;span class=&quot;k&quot;&gt;else
    &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;extensions dir does not exist&quot;&lt;/span&gt;
    
    &lt;span class=&quot;nb&quot;&gt;exit &lt;/span&gt;0
&lt;span class=&quot;k&quot;&gt;fi&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Any suggestions on how the above could be better done are appreciated.&lt;/p&gt;

&lt;p&gt;So now we have our list of extensions into our MDM, we have 2 options:&lt;/p&gt;

&lt;li&gt; Use their API&lt;/li&gt;
&lt;li&gt; Export a CSV&lt;/li&gt;

&lt;blockquote&gt;
  &lt;p&gt;note, the script that I have written expects only 2 columns and will have to be adapted to expect more than that.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I decided to use a CSV for this, mostly because having not used my MDM’s API before it would be quicker to import it for this one-off task.&lt;/p&gt;

&lt;h1 id=&quot;what-does-the-script-do&quot;&gt;What does the script do?&lt;/h1&gt;

&lt;li&gt;Loads the CSV and manipulates the data into a json array&lt;/li&gt;
&lt;li&gt;Checks if the data exists in the extensions_mapper array, if it does add to a known array, if not add to a unknown one&lt;/li&gt;
&lt;li&gt;If the ID already exists in one of the arrays add 1 to the count&lt;/li&gt;
&lt;li&gt;Then repeat this for the whole of the origional array&lt;/li&gt;
&lt;li&gt;Finally write both arrays to file&lt;/li&gt;

&lt;p&gt;The array that is spat out by the csvLoader() will look something like the below which will also be written into the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;results/&lt;/code&gt; directory.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot; data-lang=&quot;json&quot;&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;id1&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;id2&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;id3&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;id2&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;id3&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;id1&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;input/extensions_mapper&lt;/code&gt; file should look like the below, obviously you would duplicate this object for each extension, the script then iterates through this array for every extension and works out whether it should add it to the known or unknown list.&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot; data-lang=&quot;json&quot;&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;exampleChromeExtensionID&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;extension_name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;extension_name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;publisher&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;nameOfPublisher&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;If the extension is found in the extensions_mapper array it is referred to as a “Known extension”, otherwise an “Unknown extension”. Below you will see an example of an object that is in the known list:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot; data-lang=&quot;json&quot;&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;ggjhpefgjjfobnfoldnjipclpcfbgbhl&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; 
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;extension_name&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;My Apps Secure Sign-in Extension&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; 
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;publisher&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Microsoft&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; 
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;count&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;and this is one in the Unknown list:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-json&quot; data-lang=&quot;json&quot;&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;exampleID&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; 
        &lt;/span&gt;&lt;span class=&quot;nl&quot;&gt;&quot;count&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;mi&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;]&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;p&gt;Hopefully, the info in these 2 arrays will give you enough info for you to start making an assessment as to the impact of blocking an extension in your environment.&lt;/p&gt;

&lt;h1 id=&quot;plans-for-the-futureissues&quot;&gt;Plans for the future/issues:&lt;/h1&gt;

&lt;p&gt;I have come across a fair few extensions that can not be found in the chrome store, so I am thinking of adding a “know_unknown” array to take these out of the unknown list to make it easier to spot new extensions on devices.&lt;/p&gt;

&lt;p&gt;I had a quick go at trying to scrape the chrome store in order to automatically generate the extensionMapper array, but after a quick go it I didn’t have any more time to spend on it, I might revisit this in the future at some point as this would save &lt;strong&gt;a lot&lt;/strong&gt; of time getting this script bootstrapped!&lt;/p&gt;

&lt;h1 id=&quot;where-to-find-this-project&quot;&gt;Where to find this project?&lt;/h1&gt;

&lt;p&gt;You can find it on &lt;a target=&quot;_blank&quot; href=&quot;https://github.com/ewancolyer/chrome-extension-tools&quot;&gt;GitHub&lt;/a&gt;, any questions ping me a message on the &lt;a href=&quot;https://MACAdmins.org&quot;&gt;Mac Admins&lt;/a&gt; slack&lt;/p&gt;

&lt;h1 id=&quot;followups&quot;&gt;Followups&lt;/h1&gt;

&lt;p&gt;Thanks to Gavin in the #london channel for sharing &lt;a target=&quot;_blank&quot; href=&quot;https://www.youtube.com/watch?v=ompZ_fwhL4s&quot;&gt;this talk&lt;/a&gt; that gives some background info around the risks of having extensions, some examples of this actually happening and some other ways to deal with these issues.&lt;/p&gt;</content><author><name></name></author><category term="chrome" /><category term="security" /><summary type="html">About So, you want to work out what chrome extensions your users have installed, but don’t want to use Google’s Chrome Cloud Managment (free for 1 admin user, but paid after that), what do you do?</summary></entry><entry><title type="html">Welcome, not sure why you’re here though!</title><link href="https://blog.ewan-colyer.co.uk/welcome/about/2020/10/29/welcome-to-my-blog.html" rel="alternate" type="text/html" title="Welcome, not sure why you’re here though!" /><published>2020-10-29T15:06:32+00:00</published><updated>2020-10-29T15:06:32+00:00</updated><id>https://blog.ewan-colyer.co.uk/welcome/about/2020/10/29/welcome-to-my-blog</id><content type="html" xml:base="https://blog.ewan-colyer.co.uk/welcome/about/2020/10/29/welcome-to-my-blog.html">&lt;p&gt;Welcome to my blog, hopefully it will soon be home to some things that I consider interesting and worth sharing.&lt;/p&gt;

&lt;p&gt;Most of the things on here will be loosley related to macs &amp;amp; managing them. Feel free to contact me about any things on here through the &lt;a target=&quot;_blank&quot; href=&quot;https://MACadmins.org&quot;&gt;MacAdmins slack&lt;/a&gt; (I’m Ewan on there).&lt;/p&gt;

&lt;p&gt;Outside of work I’m a big outdoors person, who is mainly into kayaking, but will also venture out climbing, cycling/mountain biking and climbing! Hit me up if your in the south west of England (around Bristol/Bath) and want to meet up :)&lt;/p&gt;</content><author><name></name></author><category term="Welcome" /><category term="about" /><summary type="html">Welcome to my blog, hopefully it will soon be home to some things that I consider interesting and worth sharing.</summary></entry></feed>