GithubHelp home page GithubHelp logo

bonakodo-eric / heroku-buildpack-wallarm-node Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wallarm/heroku-buildpack-wallarm-node

0.0 0.0 0.0 6.22 GB

Heroku buildpack for Wallarm

Home Page: https://wallarm.com

Shell 71.09% Makefile 2.23% HTML 25.27% Dockerfile 1.42%

heroku-buildpack-wallarm-node's Introduction

Heroku Buildpack: Wallarm Node

The Wallarm Node buildpack provides Wallarm WAF inside a dyno and connects NGINX to an app server via UNIX domain sockets. This buildpack is based on heroku-buildpack-nginx.

Wallarm Node

Wallarm Node does the following:

  • Blocks malicious requests and filters the valid ones
  • Analyzes the company's entire network traffic
  • Collects the network traffic metrics and uploads the metrics to the Wallarm cloud
  • Downloads fine-tuned resource-specific rules from the Wallarm cloud

Versions

This buildpack updates automatically and installs the latest stable version of Wallarm Node.

Requirements

  • You have a Wallarm account with deploy permissions.
  • Your webserver listens to the socket at /tmp/nginx.socket.
  • You touch /tmp/app-initialized when you are ready for traffic.
  • You can start your web server with a shell command.

Quick start

These are two setup examples. One example is for a new app; another one is for an existing application. In both cases, we are using Ruby & Unicorn. Note: this buildpack is not Ruby specific.

Features

  • Protects your resources from hacker attacks.
  • L2met friendly NGINX log format.
  • Heroku request ids embedded in NGINX logs.
  • Crashes dyno if a NGINX or an app server crashes. Safety first.
  • Language/App Server agnostic.
  • Customizable NGINX configuration.
  • Application coordinated dyno starts.

Language/App Server Agnostic

The Wallarm Node buildpack provides the wallarm/bin/start-wallarm command. This command takes another command as an argument. You must pass your app server's startup command to start-wallarm.

For example, to get Wallarm Node and Unicorn up and running:

$ cat Procfile
web: wallarm/bin/start-wallarm bundle exec unicorn -c config/unicorn.rb

Environment variables

You can use the following environment variables:

  • WALLARM_USER - user at my.wallarm.com with permissions to add new nodes.
  • WALLARM_PASSWORD - user password.
  • WALLARM_MODE - WAF mode: off, monitoring (default; detect but not block), block (detect and block).
  • WALLARM_API_HOST - address of Wallarm API service ("api.wallarm.com" by default)
  • WALLARM_TARANTOOL_MEMORY - amount of memory (in GB) allocated to the postanalytics module (0.5 of total memory by default).
  • WALLARM_ENABLED - Disable all wallarm services if set and has value other then "yes" or "true".

Example: set your WALLARM_MODE to the blocking mode:

$ heroku config:set WALLARM_MODE=block

Example: disable all the Wallarm features for the debug purposes:

$ heroku config:set WALLARM_ENABLED=no

Customizable NGINX configuration

You can provide your own NGINX configuration by creating a file named nginx.conf.erb in the directory wallarm/etc. Start by copying the buildpack's default config file.

Application/Dyno coordination

The buildpack will not start NGINX with the Wallarm module until a file is written to /tmp/app-initialized. Since NGINX binds to the dyno's $PORT and since $PORT determines if the app can receive traffic, you can delay NGINX accepting traffic until your application is ready to handle it. The examples below show how/when you should write the file when working with Unicorn.

License

Copyright (c) 2017 Wallarm, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

heroku-buildpack-wallarm-node's People

Contributors

dfkfhv avatar apogorelovwallarm avatar 0xbf avatar sorc1 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.