1.4.21 • Published 4 years ago

sentinel-ast v1.4.21

Weekly downloads
10
License
Apache-2.0
Repository
github
Last release
4 years ago

npm License Build Status

Sentinel

Sentinel is a framework that enables automated security testing via a suite of industry standard test frameworks and security tools.

It is built on Cucumber and Node.js. This allows for security test cases to be defined in Gherkin/BDD syntax making them human readable and self documenting. The idea is that we make security testing a concept that is approachable(tests written by developers, testers, security guys), repeatable(when integrated with your CI/CD pipelines) and auditable(when used to gather evidence in compliancy initiatives).

Sentinel was inspired by existing security frameworks(Gauntlt, Mittn, BDD-Security) but we felt the need to provide our own flavour to security testing with a modern javascript and docker based environment.

Features

Sentinel is currently integrated with

  • Automated security scanners - Open Zap, SSLyze and snyk to find security vulnerabilities in your web applications.
  • Selenium/WebDriver and Node.js for implementing browser and API based automated tests.
  • Docker/Compose that enables drop-in isolation of integrated components during runtime. It also enables what we call the Bring-Your-Own-Container(s) feature, which gives consumers of Sentinel the capability to attach their web applications/services as containers onto Sentinels' networking infrastructure.
  • Reporting tools.

It has been designed from ground-up to be completely extensible.

Quickstart

We want to get you off the ground and started as quick as possible in just a few steps. Running commands below on your shell will install Node.js, Docker and Sentinel running security tests against a local containerized website.

sh -c "$(curl -fsSL https://raw.githubusercontent.com/nintexplatform/sentinel/master/bin/install-dependencies.sh)"
git clone https://github.com/nintexplatform/sentinel-example.git && cd sentinel-example
npm install 
npm run test

On Linux, run the install-dependencies script under sudo for root privileges.

Once the tests have completed, you can find a generated report under sentinel-example/report directory

We've introduced an example use case of Sentinel in the sentinel-example repo

Getting Started

To install the framework: 1. Install prequisites 2. Install Sentinel via npm

Install Prerequisites

These prerequisites must be installed first. 1. Node.js Version 7+ 2. Docker 3. Docker Compose

Alternatively, for Docker + Compose, you can also install Docker for Mac or Windows which is a fast and easy way to get Docker + Compose.

-or-

Use our quick-install script

sh -c "$(curl -fsSL https://raw.githubusercontent.com/nintexplatform/sentinel/master/bin/install-dependencies.sh)"

Install Sentinel via npm

npm install -g sentinel-ast

From this point, see the For Developers section below on how to use Sentinel.

For Developers

Sentinel CLI

Getting Sentinel to run is simple and done primarily through a global(if npm installed with -g) CLI.

sentinel

  Usage: sentinel [options] [command]


  Options:

    -V, --version  output the version number
    -h, --help     output usage information


  Commands:

    init                             Initializes configuration & test templates in the current directory
    run-compose [COMMAND] [ARGS...]  Runs docker compose commands
    run-cucumber [options] [DIR]     Runs cucumber tests
    start-services [options]         Starts services in its containers
    stop-services [options]          Stops services and its containers
sentinel init
  • From an empty directory, you should always run this command first. It initializes the current directory with a default config.env, feature templates and config json files.
  • The default parameters in config.env are explained below. They should be configured prior to starting up the services.
sentinel start-services
  • This command starts all integrated services as containers.
sentinel stop-services
  • This command stops all containers hosting integrated services.
sentinel run-compose
  • This command proxies the CLI arguments to Docker compose.
sentinel run-cucumber
  • This command proxies the CLI arguments to Cucumber-js.

Integrations

The framework ships with a few integrated components out of the box. If they are hosted within containers, we refer to them as services.

Cucumber Report

Adds cucumber hooks to create a report at the end of a test run.
Integrates the Cucumber Html Reporter

Slack

Adds hooks to post results at the end of a test run to Slack.

Node

This is a general purpose Node.js container that tests are run in.
It reads environment variables from config.env Node Version 7+

Selenium WebDriver

The node Selenium WebDriver package.
It has cucumber hooks to configure the webdriver and adds the driver instance to the world.
It also has a docker service for running a chrome container for remote control of the browser.

SSLyze

A service which can be used for running a SSLyze scan against a host.
GitHub

Zap

A service which hosts OWASP ZAP.
GitHub

Snyk

A service which can be used for packages and dependency scanning projects. snyk.io

Enabling integrations

Enabling integrations and loading up additional services is managed via a config file. It needs to be created in the root folder of the project that references Sentinel, as .sentinel.json

Sample .sentinel.json :

{
  "integrations": {
    "whitelist": [
      "node",
      "docker",
      "cucumber-report",
      "selenium",
      "sslyze",
      "zap"
    ],
    "customServices": [
        "./nodegoat-app/docker-compose.yml"
    ]
  }
}

Extensibility

Extending the framework starts with packaging your new component as a sub-directory within the /integration directory. These components can hook into the Sentinel runtime in a number of ways.

  • Cucumber support files
    Any files found in a components cucumber folder gets required when starting tests.
    This can be used to add step definitions, modify the world, add hooks etc.
    (Refer to /integration/selenium)
  • Docker container/service
    Required binaries, cli tools, etc can be exposed as a webservice by adding a compose-*.yml file in the integrations folder. This lets you define containers that can host the cli and allows test code to use REST calls to access it by service name. (Refer to /integration/sslyze)
  • Javascript module
    You can create reusable Page Objects or interfaces needed to communicate to services by including the classes and exporting them from the index.js in the framework's root directory. By doing so, consumers of the Sentinel framework can have access to these objects at runtime.
    (Refer to /integration/zap)

Environment Variables

IntegrationNameDescriptionRequiredDefault / Optional Values
sslyzeSSLYZE_SERVER_URLUrl to sslyze api serverfalsehttp://sslyze:8081/
zapZAP_SERVER_URLUrl to zap api serverfalsehttp://zap:8080/
zapZAP_MAX_DEPTHzap crawling max depthfalse5
zapZAP_THREAD_DEPTHzap thread numberfalse5
snykSNYK_TOKENAuth token for snykfalse
snykSNYK_URLUrl to snyk api serverfalsehttp://snyk:8086/
applicationAUT_SERVER_URLUrl to application under testtruehttps://nodegoat:4000
seleniumSELENIUM_BROWSERWebdriver capabilitiesfalsechrome
seleniumSELENIUM_REMOTE_URLWebdriver urltruehttp://selenium:4444/wd/hub
seleniumSELENIUM_REMOTE_CAPABILITYFor remote selenium servicesfalse./remoteSelenium.config.template.json
seleniumWEBDRIVER_PAGE_TIMEOUTWebdriver page load timeoutfalse45000
seleniumWEBDRIVER_LONG_TIMEOUTTimeout for long running stepfalse30000
seleniumEXECUTION_ENVIRONMENTFor zap proxyfalselocal (default) / proxy / remote
cucumberFEATURE_DIRFeature file locationfalse./features/
cucumberCUCUMBER_LONG_TIMEOUTtimeout for cucumber stepsfalse30000
cucumber-reportCUCUMBER_REPORT_DIRpath to store reportsfalse./report/
slackSLACK_FEATUREON or OFF the processfalse'ON' / 'OFF' (default)
slackSLACK_WEBHOOK_URISpecify the Incoming webhooks url - Referencefalse-
1.4.20

4 years ago

1.4.21

4 years ago

1.4.19

4 years ago

1.4.17

4 years ago

1.4.18

4 years ago

1.4.16

4 years ago

1.4.15

4 years ago

1.4.14

4 years ago

1.4.13

4 years ago

1.4.12

4 years ago

1.4.11

4 years ago

1.4.10

4 years ago

1.4.9

5 years ago

1.4.8

5 years ago

1.4.7

5 years ago

1.4.6

5 years ago

1.4.5

6 years ago

1.4.4

6 years ago

1.4.3

6 years ago

1.4.2

6 years ago

1.4.1

6 years ago

1.4.0

6 years ago

1.3.1

6 years ago

1.3.0

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.9

6 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago