GithubHelp home page GithubHelp logo

bugsnag / license-audit Goto Github PK

View Code? Open in Web Editor NEW
3.0 23.0 0.0 114 KB

Performs a licensing audit on named repositories to check for compliance with company policy

Ruby 16.91% HTML 82.44% Dockerfile 0.65%
platforms bugsnag

license-audit's Introduction

License Audit

Build status

Internal audit tool to check our repositories for compliance of open source licensing with company policy.

This Ruby script runs through a list of repositories to audit and runs the LicenseFinder tool against them. With appropriate permitted licenses and pre-approved packages checked-in and maintained in this repository, this audit should succeed with no unexpected licenses.

Local Usage

Checkout the code and run:

bundle install

Check the content of config/license_audit.yml for the repositories to clone, checkout, build and audit.

Run the tool on all repositories in the file:

bundle exec license_audit

Or all the repositories in a build environment:

bundle exec license_audit audit --env=js

Or just an individual one:

bundle exec license_audit audit --app=bugsnag-js

Each repo will be cloned into the apps directory and LicenseFinder is run from this location.

Build output from stdout/stderr is stored in build and audit report files are in report.

For full options usage see:

bundle exec license_audit audit --help

Docker Usage

The audit can be run with docker-compose which creates an image for each build environment and allows them to be executed individually:

docker-compose build
docker-compose run ruby
docker-compose run java
docker-compose run js
docker-compose run php
docker-compose run python
docker-compose down -v

The docker-compose.yml file parameterises the base image and APK's required. It also volumes the apps, build and reports directories so they are shared by each run and produce a single report. Most builds use a single Dockerfile in the dockerfiles directory, but more complex environments (e.g. Android) can use a custom Dockerfile by putting the path into the docker-compoose.yml.

You can pass in options to the tool using environment variables:

docker-compose run -e app=bugsnag-python -e wait=after python

The above command runs just bugsnag-python and waits without terminating afterwards. This allows you to SSH to the running container to diagnosing issues:

docker exec -it license-audit_python_run_e341c453727e /bin/sh

(The container name can be obtained using docker ps.)

Approving Packages & Permitted Licensing

See the LicenseFinder documentation for instructions on adding packages approvals or permitted licenses.

These decisions are stored (by default) in doc/dependency_decisions.yml in the repo. This script makes a temporary file in the cloned repository in /apps that is concatenated from a company-wide file at /config/decision_files/global.yml and a repository-specific file at /config/decision_files/<repo_name>.yml. This means the decisions are maintained in one place and is kept private from the public repositories.

license-audit's People

Contributors

cawllec avatar fractalwrench avatar renovate-bot avatar tomlongridge avatar twometresteve avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

license-audit's Issues

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.