Skip to content

Commit

Permalink
Merge pull request #16 from AdvancedThreatAnalytics/develop
Browse files Browse the repository at this point in the history
Release v5.1
  • Loading branch information
jfmdev committed Aug 30, 2021
2 parents 3ec4397 + feab990 commit 0399778
Show file tree
Hide file tree
Showing 79 changed files with 12,154 additions and 12,196 deletions.
18 changes: 18 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"env": {
"browser": true,
"es2021": true,
"node": true,
"jest": true,
"webextensions": true
},
"extends": [
"eslint:recommended",
"prettier"
],
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"rules": {}
}
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.DS_Store

node_modules
dist
dist.zip

# Editor files
.idea
.vscode

yarn-error.log*
4 changes: 4 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"endOfLine": "auto",
"tabWidth": 2
}
43 changes: 29 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/AdvancedThreatAnalytics/threat-analytics-search/blob/main/LICENSE)

# Threat Analytics Search Chrome extension

The **Threat Analytics Search** extension allows Google Chrome users to highlight specific text and conduct searches using various services. For instance, if you have a domain name you want to research, you could highlight that domain name and automatically search across as many registrars or threat exchanges you want.
The **Threat Analytics Search** extension allows Google Chrome and Microsoft Edge users to highlight specific text and conduct searches using various services. For instance, if you have a domain name you want to research, you could highlight that domain name and automatically search across as many registrars or threat exchanges you want.

## Features

Expand All @@ -11,34 +12,33 @@ Once the extension is installed, it will attempt to download a configuration fil

By default, the extension uses a configuration file hosted in this repository, but it can be configured to fetch it from any URL.

If needed, configuration files can be encrypted using AES-CSC. You would then provide the decryption key in the extension settings.
Configuration files can be encrypted using AES-CBC. You would then provide the decryption key in the extension settings.

Optionally, there is a setting to automatically re-fetch the configuration file once a week.

### Search providers
### Search Providers

For each search provider, the extension will generate an item in the context menu, so that provider can be used to search the selected texts.
For each Search Provider, the extension will generate an item in the context menu, so it can be used to search the selected texts.

> There are two types of search providers:
>
> - GET providers, that will perform the search by opening the provider's site in a new tab (where the result will be shown).
> - POST providers, that will perform the search by executing a POST request (on the provider's server) and show the result in a dialog.
> - GET Providers, that will perform the search by opening the provider's site in a new tab (where the result will be shown).
> - POST Providers, that will perform the search by executing a POST request (on the provider's server) and show the result in a dialog.
The extension also adds "groups" to the context menu. Clicking on these items will conduct the search using several search providers at the same time.

If configured, the extension also defines three special sections on the contextual menu to conduct searches on [Carbon Black](https://www.carbonblack.com/), [NetWitness Investigator](http://www.emc.com/security/security-analytics/security-analytics.htm) and [RSA Security Analytics](https://community.rsa.com/t5/rsa-netwitness-investigator/tkb-p/netwitness-investigator).

## Development

The extension is implemented with JavaScript, using the following libraries
The extension is implemented with JavaScript. The full list of dependencies can be found on the [package.json](./package.json) file, but the most relevant ones are:

| Library | Used for |
|------------------------------------------|-------------------------------|
| [Mustache](https://mustache.github.io/) | UI |
| AES-CBC | Configuration file encryption |
| [Luxon](https://moment.github.io/luxon/) | Utility |
| [Lodash](https://lodash.com/) | Utility |
| [Bootstrap](https://getbootstrap.com/) | UI |
| Library | Used for |
|--------------------------------------------|------------|
| [Mustache](https://mustache.github.io/) | Templates |
| [aes-js](https://github.com/ricmoo/aes-js) | Encryption |
| [Bootstrap](https://getbootstrap.com/) | UI |
| [Font Awesome](https://fontawesome.com/) | Icons |

### Code structure

Expand All @@ -56,6 +56,21 @@ The application is divided into three sections:

Additionally, there is a migration page that is used to relocate the user's settings from the local storage, i.e. `localStorage`, to Chrome's storage, i.e. `chrome.storage.local`. This change was required after upgrading the manifest file to version 3 since service workers (unlike background pages) do not have access to the local storage.

### Building

Building is done using [Webpack](https://webpack.js.org/).
To build the "distribution" code, you first have to execute `yarn`, to install all dependencies, and then execute: `yarn run build:dev` (for development mode), `yarn run build` (for production on Google Chrome), or `yarn run build:edge` (for production on Microsoft Edge) to build once; or `yarn run live` to watch file changes (in development mode) and rebuild on file change.
These commands will create `dist` directory and copies all files into it and minifies them.

> Optionally, you can do `yarn run zip` for compress the content of the `dist` directory into a zip file (you can also do `yarn run build:zip` or `yarn run build:edge:zip` to execute both the build and zipping actions with a single command).
### Testing

Tesing is done using [Jest](https://jestjs.io/) and all test files are located inside `tests/` folder.

- Unit tests are located on the `tests/unit` folder, and can be run using the `yarn run test:unit` command.
- Unit tests are located on the `tests/e2e` folder, and can be run using the `yarn run test:e2e` command (don't forget to build the extension before doing it).

### Packaging

To package and distribute the extension see the [Chrome documentation](https://developer.chrome.com/docs/extensions/mv3/hosting/).
6 changes: 6 additions & 0 deletions babel.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": ["@babel/preset-env"],
"plugins": [
"@babel/plugin-transform-runtime"
]
}
Loading

0 comments on commit 0399778

Please sign in to comment.