Coder Social home page Coder Social logo

luis-sousa-pinto / bulwark Goto Github PK

View Code? Open in Web Editor NEW

This project forked from softrams/bulwark

0.0 0.0 0.0 33.88 MB

An organizational asset and vulnerability management tool, with Jira integration, designed for generating application security reports.

License: MIT License

Shell 0.01% JavaScript 0.72% TypeScript 83.88% HTML 14.18% Dockerfile 0.75% SCSS 0.29% Sass 0.18%

bulwark's Introduction

An organizational asset and vulnerability management tool, with Jira integration, designed for generating application security reports.

Features

  • Multi-client Vulnerability Management
  • Security Report Generation
  • Jira Integration
  • Team-based Roles Authorization
  • API Key & Management
  • Email Integration
  • Markdown Support

Note

Please keep in mind, this project is in early development.

Demo

Bulwark Walkthrough Demo

Jira Integration

Bulwark Jira Demo

Launch with Docker

  1. Install Docker
  2. Create a .env file and supply the following properties:
MYSQL_DATABASE="bulwark"
MYSQL_PASSWORD="bulwark"
MYSQL_ROOT_PASSWORD="bulwark"
MYSQL_USER="root"
MYSQL_DB_CHECK="mysql"
DB_PASSWORD="bulwark"
DB_URL="172.16.16.3"
DB_ROOT="root"
DB_USERNAME="bulwark"
DB_PORT=3306
DB_NAME="bulwark"
DB_TYPE="mysql"
NODE_ENV="production"
DEV_URL="http://localhost:4200"
SERVER_ADDRESS="http://localhost"
PORT=4500
JWT_KEY="changeme"
JWT_REFRESH_KEY="changeme"
CRYPTO_SECRET="changeme"
CRYPTO_SALT="changeme"

Build and start Bulwark containers:

docker-compose up

Start/Stop Bulwark containers:

docker-compose start
docker-compose stop

Remove Bulwark containers:

docker-compose down

Bulwark will be available at localhost:4500

Local Installation

$ git clone (url)
$ cd bulwark
$ npm install

Running npm install will install both server-side and client-side modules. Furthermore, it will run the script npm run config which will dynamically set the environment variables in addition to updating the Angular environment.

Development Mode

Set NODE_ENV="development"

$ npm run config
$ npm run start:dev

Production Mode

Set NODE_ENV="production" Please note: npm install will automatically build in production mode

$ npm run config
$ npm run build:prod
$ npm start

Environment variables

Create a .env file on the root directory. This will be parsed with dotenv by the application.

DB_PASSWORD

DB_PASSWORD="somePassword"

Set this variable to database password

DB_USERNAME

DB_USERNAME="foobar"

Set this variable to database user name

DB_URL

DB_URL=something-foo-bar.dbnet

Set this variable to database URL

DB_PORT

DB_PORT=3306

Set this variable to database port

DB_NAME

DB_NAME="foobar"

Set this variable to database connection name

DB_TYPE

DB_TYPE="mysql"

The application was developed using a MySQL database. See the typeorm documentation for more database options.

NODE_ENV

NODE_ENV=production

Set this variable to determine node environment

DEV_URL="http://localhost:4200"

Used by Angular to build and serve the application

SERVER_ADDRESS="http://localhost"

Update if a different server address is required

PORT=4500

Update if a different server port is required

JWT_KEY

JWT_KEY="changeMe"

Set this variable to the JWT secret

JWT_REFRESH_KEY

JWT_REFRESH_KEY="changeMe"

Set this variable to the refresh JWT secret

CRYPTO_SECRET

CRYPTO_SECRET="randomValue"

Set this variable to the Scrypt password.

CRYPTO_SALT

CRYPTO_SECRET="randomValue"

Set this variable to the Scrypt salt.

Empty .env file template

DB_PASSWORD=""
DB_URL=""
DB_USERNAME=""
DB_PORT=3306
DB_NAME=""
DB_TYPE=""
NODE_ENV=""
DEV_URL="http://localhost:4200"
SERVER_ADDRESS="http://localhost"
PORT=4500
JWT_KEY=""
JWT_REFRESH_KEY=""
CRYPTO_SECRET=""
CRYPTO_SALT=""

Create Initial Database Migration

  1. Create the initial database migration
$ npm run migration:init
  1. Run the initial database migration
$ npm run migration:run

Default credentials

A user account is created on initial startup with the following credentials:

Upon first login, update the default user password under the profile section.

Roles

The application utilizes least privilege access with team-based authorization. Teams are assigned a role which determines the features available to that specific team. A user will inherit roles from team membership. Administrators have team management access and must assign users to teams. Initially, users are created with no team association and will not have access to any features in the application.

The three roles include:

  1. Admin
  2. Tester
  3. Read-Only

A team can only be associated to a single organization. However, a team can be associated to multiple assets within the same organization. A user can be a member of multiple teams. If a user is assigned to multiple teams of the same organization, the system will choose the highest authorized team.

Please note: The default user is automatically assigned to the Administrators team on initial startup

Role Matrix

Admin Tester Read-Only
User-Profile Management x x x
Team Management x
User Management x
Invite User x
Create User x
Email Settings Management x
Jira Integration x
Organization: Read x x x
Organization: Full Write x
Asset: Read x x x
Asset: Full Write x
Assessment: Read x x x
Assessment: Full Write x x
Vulnerability: Read x x x
Vulnerability: Full Write x x
Export Vulnerability to Jira x x
Report Generation x x x

API Key & Management

A user may generate a single API key which can be used in place of their authorization token. This API key allows for all actions against the application that the user is authorized for.

Generating an API key pair

  1. Login to the application
  2. Navigate to the User Profile section
  3. Select Generate API Key

This action will generate a pair of keys:

  1. Bulwark-Api-Key
    1. This is a generated plaintext value to identify the user.
  2. Bulwark-Secret-Key
    1. This is a generated plaintext value to verify the user by comparing a Bcrypt hash stored in the database.

Write down the generated keys in a safe place. You will not be able to retrieve the keys at a later time.

How to use API keys

The API key pair values must be matched and appended to the following HTTP request headers:

  • Bulwark-Api-Key
  • Bulwark-Secret-Key

Example:

GET /api/assessment/1 HTTP/1.1
Host: localhost:4500
Accept: application/json, text/plain, */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Bulwark-Api-Key: {{changeMe}}
Bulwark-Secret-Key: {{changeMe}}
Origin: http://localhost:4200
Connection: close
Referer: http://localhost:4200/
Pragma: no-cache
Cache-Control: no-cache

Built With

  • Typeorm - The ORM used
  • Angular - The Angular Framework
  • Express - A minimal and flexible Node.js web application framework

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Read the contribution guidelines for more information.

License

MIT

bulwark's People

Contributors

whamo12 avatar dependabot[bot] avatar alejandrosaenz117 avatar skewled avatar waterweasel4 avatar darrellrichards avatar noprod avatar mkmurali avatar noraj avatar nopr9d avatar markmuth avatar bmayen-sr avatar joshuaseidel avatar bmayen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.