> For the complete documentation index, see [llms.txt](https://fric-team-8.gitbook.io/fric/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fric-team-8.gitbook.io/fric/master.md).

# Findings and Reporting Information Console - FRIC

&#x20;[![CodeFactor](https://www.codefactor.io/repository/github/kevinapodaca/fric-team8-sbsg/badge?s=acb59e049c14218072eb3bde141bc7207113f122)](https://www.codefactor.io/repository/github/kevinapodaca/fric-team8-sbsg)

## Scope of Product

The Cyber Experimentation & Analysis Division (CEAD) recognizes the complexity and the time it takes to manage task assignments, progress, vulnerability discovery during a cyber engagement and generate custom reports that presents the discovered vulnerabilities and potential issues to CEAD’s target audience. They want a system that would aid the management of task, collection of evidence, and report generation during a cyber engagement.

The University of Texas at El Paso (UTEP) and CEAD are collaborating to develop Findings and Reporting Information Console (FRIC) system that will provide the ability to manage task assignment and progress, and facilitate the collection of evidence on existing vulnerabilities, and generation of custom reports.

This is the FRIC system, as developed by Team 8 (SBSG) of the Fall 2020 CS 4311 cohort at the University of Texas at El Paso. FRIC uses the following technologies for its development.

* PWA/SPA — Single page app
* Built with Vue.js, Buefy & Bulma
* SCSS sources with variables
* Mobile Responsive

## Table of Contents

* [Quick Start](/fric/master.md#quick-start)
* [Browser Support](/fric/master.md#browser-support)
* [Reporting Issues](/fric/master.md#reporting-issues)
* [Licensing](/fric/master.md#licensing)
* [Useful Links](/fric/master.md#useful-links)

## Deploy with Docker 🐳 (Work in Progress...)

{% hint style="danger" %}
We recommend you go through the manual installation first to ensure proper installation of the FRIC tool. Deploying through Docker is still a work in progress.
{% endhint %}

In an effort to simplify the process of deploying our application, we use Docker container technology to eliminate the need to manually install any dependencies or services on your host machine. We setup a Docker system with containers for each of our services needed to run FRIC.

> To learn about Docker and how it works read the official documentation here <https://www.docker.com/why-docker>
>
> Follow these steps to install docker on your machine <https://docs.docker.com/get-docker/>

💡To run FRIC using **Docker** follow these steps

* Download the source code.
* Build the frontend ui by `cd frontend` and then running the following&#x20;

```bash
docker build -t kevinapodaca/team8:frontend -f Dockerfile .
```

* Now you can run the frontend container by issuing the following command

```
docker run --name fric -e VUE_APP_API_HOST=127.0.0.1 -e VUE_APP_API_PORT=3000 -p 8080:8080 -d kevinapodaca/team8:frontend
```

> Note that the ports being exported could be changed if needed. See <https://docs.docker.com/engine/reference/commandline/run/>

* Run the command `docker ps` to list the current processes, and copy the *Network ID* of the process named **kevinapodaca/team8:frontend**.
* You can now run `docker start id` and replace the word *id* with the network id you copied in the previous step

> This has now started the frontend services container for FRIC.

* Build the backend by cd backend and then run the following&#x20;

```
docker build -t kevinapodaca/team8:backend -f Dockerfile .
```

* Now you can run the backend container by issuing the following command

```
docker run --name fric-backend -e DATABSE_HOSTNAME=IP-ADDR -d kevinapodaca/team8:backend
```

### Kubernetes Cluster Deployment 📛

To run the app using a Kubernetes cluster follow the commands from the root directory:

1. Deploy the mongoDB instance with `kubectl apply -f k8s-mongodb.yml`
2. Deploy the backend instance with `kubectl apply -f k8s-backend.yml`
3. Deploy the frontend instance with `kubectl apply -f k8s-frontend.yml`

## Deploying Manually Quick Start 🖲️

{% hint style="success" %}
Use this method of installation until the Docker setup is completed. This notification will be removed when that is complete.
{% endhint %}

FRIC uses the `MEVN` stack. This is a full javascript-based technology stack. Before attempting to run the project you should check that you have the following things installed.

### Mongo 🗄️

This is needed to be able to create a database instance of FRIC and be able to perform CRUD operations on it. To check if you have mongo installed type the command&#x20;

> mongo -version

To install mongoDB please use the following guides:

#### macOS Install

Using brew `brew tap mongodb/brew` and then `brew install mongodb-community@4.4`

Next make sure you start the services using `brew services start mongodb-community@4.4`

Finally, to begin using mongo run the following command `mongo`

> For more details on installing mongoDB on mac please reference <https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/>

#### Windows Install

Download the installer from <https://www.mongodb.com/try/download/community?tck=docs_server>

Run through the installation process and make sure to:

1. Use the `Complete` setup type when prompted for one.
2. Select `Install mongoDB as a Service` when configuring the service

Now connect the shell to the mongoDB instance by navigating (in file explorer to) `C:\Program Files\MongoDB\Server\4.4\bin\` and double click on the `mongo.exe` file

> For more details on installing mongoDB on windows please reference <https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/>

#### Linux Install

We tested the installation on the *CentOS,* a Red-Hat-based distribution, to install mongoDB use the following steps:

1. `gedit /etc/yum.repos.d/mongodb.repo`
2. Now add the following lines to this file

```
[mongodb-org-4.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc
```

Now you can just install mongo with `yum install -y mongodb-org server`

To start the services run the command `systemctl enable mongod && systemctl start mongod`

### NodeJS 🟩

FRIC relies on the javascript runtime environment *NodeJS* to compile, transpile, and serve content. As such, it is necessary that you have this installed to be able to run any `npm` command.

To install nodeJS on your machine navigate to <https://nodejs.org/en/download/> and select the appropriate installer for your operating system.&#x20;

{% hint style="warning" %}
As of 12/05/2020 we recommend you use the LTS installer for nodeJS, we cannot guarantee our tool is supported on the latest release of nodeJS
{% endhint %}

Finally, ensure that you have both nodeJS installed and the node package manager by running the command `node -v` and `npm -v`. FRIC was developed and tested with node version **v15.0.1** and npm with version **7.0.3**

### 🌟 Congrats! You should now have everything ready to use our tool! Follow the next steps 🌟

### Get the repo

Download the source code with `git clone https://github.com/KevinApodaca/FRIC-team8-SBSG.git`

### Install

To install all dependencies for the **backend** services: `cd backend` followed by`npm install`

> When running the install in the backend folder, it is also necessary to also run this command
>
> `npm install --save-dev @babel/cli`

To install all dependencies for the **frontend** : `cd frontend` followed by `npm install`

### Serve

To pre-compile & hot-reload for development, launch two terminal windows/tabs (one in which you are in the frontend directory, the other in which you are in the backend directory) and use the following commands.

1. `npm run serve`in the frontend directory
2. `npm start` in the backend directory

You should now be given a localhost url in which you can visit the project through the browser.

### Build

Production-ready with minified bundle `npm run build`

## Browser Support

Currently supports

* Firefox
* Chrome
* Safari
* Brave
* Opera
* Edge
* Min

## Reporting Issues

We are accepting issues and pull requests on Github, if you notice an issue be sure to raise an issue up.&#x20;

If you notice something that could be improved, feel free to send a pull request up and explain what's happening and how your solution fixes it.

## Useful Links

* [Vue.js Guide](https://vuejs.org/v2/guide/)
* [Vue CLI Guide](https://cli.vuejs.org/guide/)
* [Buefy](https://buefy.org)
* [Bulma](https://bulma.io)
