GithubHelp home page GithubHelp logo

isabella232 / providence-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from salesforce/providence

0.0 0.0 0.0 104 KB

Providence is a system for code commit & bug system monitoring. It is deployed within an organization to monitor code commits for security (or other) concerns, via customizable plugins. A plugin performs logic whenever a commit occurs.

License: BSD 3-Clause "New" or "Revised" License

Shell 0.03% Python 67.00% HTML 32.97%

providence-1's Introduction

Providence

Providence is a system for code commit & bug system monitoring. It is deployed within an organization to monitor code commits for security (or other) concerns, via customizable plugins. A plugin performs logic whenever a commit occurs.

Cool Stuff
  • Build plugin to run a something everytime a commit happens
  • Empire contains some useful tools for credential management
  • Find our slides from our AppSec presentation here

Requirements

python2.7
postgresql 9.4+

Steps: Local install with pip and virtualenv

1. OS X Prerequisites

  • Homebrew (http://brew.sh)
  • XCode (once installed, open up and accept license)
  • Xcode Command Line Tools (from Terminal.app) xcode-select --install

2. Setup Postgresql on your server

3. Setup the Database

Create a database named 'providence'

4. Checkout Providence and Submodules

git clone https://github.com/Salesforce/Providence --recursive
cd Providence

5. Install the VirtualEnv in your Providence Directory & Install Dependencies

Linux

sudo apt-get install python-pip python-virtualenv

OS X

sudo easy_install virtualenv
brew install swig postgresql wget 

Configuration On All Systems

virtualenv venv
source venv/bin/activate
pip install -r requirements.txt

For OSX users, you may have issues installing the cryptography dependency. If the above steps fail due to the cryptography module, update your pip to the latest version in virtualenv

pip -V
pip 7.1.2 from /Users/joe_smith/Desktop/Providence/venv/lib/python2.7/site-packages (python 2.7)
(upgrade pip to latest)
pip install --upgrade pip

See https://cryptography.io/en/latest/installation/ if upgrading pip does not solve the problem

If you need to deactivate the virtualenv just type deactivate

If you would like to use Perforce monitoring

(follow steps above, make sure you have run 'source venv/bin/activate')
pip install p4python

6. Configuration

The config.json.example file contains the settings for which to run Providence with.

credentials_file

Name of the credential storage file. There should be no need to modify this.

logging

Format of the Providence.log logging file. Change the loglevel if the log file is too large

postgresql

Edit this section to point to your Postgres server. credential-identifier is the name used in credentials.json for the Postgres username and password.

repos

Edit this section to point to the repositories you want to monitor with Providence. Github (including Enterprise) and Perforce are currently supported.

{
    "type": "(github or perforce)",
    "name": "(name used by Providence, not the actual repo name)",
    "server": "(server URL)",
    "owner": "(github only - owner)",
    "directory": "(directory of the repo)"
  }

cron

watcher_interval sets the time in minutes between each scheduled processing, for watcher plugins.

7. Adjust which plugins you want to run

Enable plugins in your new config.json file, several examples are listed in the example file.

pmd_path

If using the PMD plugin, fill out the full directory to run.sh file for your PMD installation.

8. Generate a Credentials Key

dd if=/dev/urandom bs=32 count=1 2>/dev/null | openssl base64

This key can be stored in the environmental variable $CREDENTIAL_KEY or entered when Providence is first run. It's highly recommended you don't keep the key on the same server as the credentials.json file, and use something like LastPass for keeping it safe.

9. Entering Credentials

When you start up Providence it will try to connect to the repositories set up in config.json, and ask you for credentials that aren't found. Alternatively you can edit the credentials.json file yourself (useful if one github account works for several repositories).

Manually create the credentials file.

You can encrypt a passwords using the command:

python Empire/creds/encrypt-cred.py

copy credentials.json.example to credentials.json and update it as needed:

{    
   "plsqlcreds": {
        "type":"password",
        "username":"<username>",
        "password":"<password or fernet-encrypted password>"
   },
   "github": {
        "type":"password",
        "username":"<myusername>",
        "password":"<my password or fernet-encrypted password>"
    }
}

10. Run Providence!

python providence.py

providence-1's People

Contributors

ezbercih avatar lehanhua avatar lehanhuangsf avatar mfeldman-sfdc avatar svc-scm 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.