Skip to content
This repository was archived by the owner on Nov 21, 2024. It is now read-only.

Commit abcf630

Browse files
authored
Merge pull request #8 from mlmitch/testing
Corrections before submission to extension store
2 parents 1ada2b8 + 8aaccb6 commit abcf630

File tree

7 files changed

+475
-25
lines changed

7 files changed

+475
-25
lines changed

NOTICES

Lines changed: 437 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
1-
# Weaklayer Sensor
1+
This is the source for the Weaklayer Sensor.
2+
It is a browser extension designed to act endpoint detection and response (EDR), except in the browser.
3+
This is why I use the term 'browser detection and response'.
4+
5+
Firefox (>= 57.0) is currently supported (desktop only).
6+
Unfortunately Firefox on Android does not work because it is missing the [managed storage API](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/storage/managed).
7+
Support for other browsers with the WebExtensions API is in the works.
8+
9+
# Building the Extension
10+
This requires you have the `npm` command line utility.
11+
12+
```
13+
git clone https://github.com/weaklayer/sensor.git
14+
cd sensor
15+
npm install
16+
npm run build-firefox
17+
```
18+
19+
The result is a minified browser extension identical to our extension store submissions (firefox in this case).
20+
The `dist` directory contains the extension that you can load as a temporary add-on in Firefox developer edition.

manifests/chromium/managed-storage-schema.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
},
5454
"installKey": {
5555
"type": "object",
56-
"description": "The installation secret that the sensor uses to enroll.",
56+
"description": "The key that the sensor uses to install.",
5757
"required": [
5858
"group",
5959
"secret",
@@ -62,12 +62,12 @@
6262
"properties": {
6363
"group": {
6464
"type": "string",
65-
"description": "The group that the sensor will enroll under.",
65+
"description": "The group that the sensor will install under.",
6666
"format": "uuid"
6767
},
6868
"secret": {
6969
"type": "string",
70-
"description": "Base64 encoded 512-bit secret that acts as a password for the sensor to enroll in the above group.",
70+
"description": "Base64 encoded 512-bit secret that acts as a password for the sensor to install in the above group.",
7171
"pattern": "^[A-Za-z0-9+/]{86}==$"
7272
},
7373
"checksum": {

manifests/firefox/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
"browser_specific_settings": {
33
"gecko": {
44
5-
"strict_min_version": "54.0"
5+
"strict_min_version": "57.0"
66
}
77
},
88
"name": "Weaklayer Sensor",
99
"author": "Weaklayer",
10-
"version": "1.0.0",
10+
"version": "0.0.1",
1111
"description": "Browser Detection and Response",
1212
"manifest_version": 2,
1313
"icons": {

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
"webpack-cli": "^3.3.12"
3636
},
3737
"dependencies": {
38-
"base64-js": "^1.3.1",
39-
"uuid": "^8.2.0",
40-
"webextension-polyfill": "^0.6.0"
38+
"base64-js": "1.3.1",
39+
"uuid": "8.2.0",
40+
"webextension-polyfill": "0.6.0"
4141
}
42-
}
42+
}

src/background/background.ts

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,25 @@ import { BackgroundHub } from './BackgroundHub'
2323
import { EventCollector } from './EventCollector'
2424

2525
console.info(`
26-
This is Weaklayer Sensor.
26+
Weaklayer Sensor is available under the terms of the GNU Affero General Public License (GNU AGPL).
27+
Please see the program source for the exact GNU AGPL version.
2728
28-
Weaklayer Sensor is free software: you can redistribute it and/or modify
29-
it under the terms of the GNU Affero General Public License as published by
30-
the Free Software Foundation, either version 3 of the License, or
31-
(at your option) any later version.
29+
The Weaklayer Sensor source is available at https://github.com/weaklayer/sensor
3230
33-
This program is distributed in the hope that it will be useful,
34-
but WITHOUT ANY WARRANTY; without even the implied warranty of
35-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36-
GNU Affero General Public License for more details.
37-
38-
You should have received a copy of the GNU Affero General Public License
39-
along with this program. If not, see <https://www.gnu.org/licenses/>.
31+
The Weaklayer Gateway source is available at https://github.com/weaklayer/gateway
4032
33+
For more information, please see https://weaklayer.com
4134
`)
4235

43-
const enroller = new Installer()
44-
const sensorEventApi = new SensorEventAPI(enroller)
36+
const installer = new Installer()
37+
const sensorEventApi = new SensorEventAPI(installer)
4538

4639
const eventCollector = new EventCollector((es) => sensorEventApi.submit(es))
4740
const eventHub = new BackgroundHub((e) => eventCollector.comsumeEvent(e))
4841

4942
// Manually trigger an auth token get on startup
5043
// This will force any required network calls
5144
// So the token is present locally when it is needed.
52-
enroller.getAuthorizationToken().then(() => {
45+
installer.getAuthorizationToken().then(() => {
5346
console.info('Authorization token present.')
5447
})

webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ module.exports = {
3030
new CopyWebpackPlugin({
3131
patterns: [
3232
{ from: 'LICENSE' },
33+
{ from: 'NOTICES' },
3334
{ from: 'node_modules/webextension-polyfill/dist/browser-polyfill.min.js' },
3435
{ from: 'node_modules/webextension-polyfill/dist/browser-polyfill.min.js.map' },
3536
{ from: 'icon16.png' },

0 commit comments

Comments
 (0)