Giter Site home page Giter Site logo

roliveri / vulnerability-engine Goto Github PK

View Code? Open in Web Editor NEW

This project forked from redhatinsights/vulnerability-engine

0.0 0.0 0.0 4.48 MB

Vulnerability Engine

License: GNU General Public License v2.0

Shell 0.87% Python 91.29% PLpgSQL 7.51% Dockerfile 0.33%

vulnerability-engine's Introduction

Tests codecov GitHub release

vulnerability-engine

Vulnerability Engine

Versioning

This project uses semantic versioning https://semver.org/. This process is automated by using Python Semantic Release. Commits need to use this format.

Requirements

  • VMaaS (Vulnerability Metadata as a Service)

  • Insights Platform

    • Upload service, Inventory, Kafka message queue
    • Mocked Platform service is part of this repository (for development purposes)

Local testing

Build images and start containers:

docker-compose up --build

Building parameters:

PIPENV_CHECK=0 docker-compose up --build # Builds images without performing "pipenv check" command

Engine usage:

# Generate testing Insights archive
echo '{"package_list": ["kernel-3.10.0-862.el7.x86_64"], "repository_list": ["rhel-7-server-rpms"]}' | ./scripts/generate_insights_archive.py -o /tmp/insights-archive.tar.gz -

# Upload Insights archive to Platform mock
./scripts/3scale-mock -a 123456 curl -X POST -F "file=@/tmp/insights-archive.tar.gz" http://localhost:8100/api/v1/upload

# Check systems details
./scripts/3scale-mock -a 123456 curl -X GET http://localhost:8300/api/vulnerability/v1/systems

# Upload Insights archive to Platform mock and send message to Listener 10 times
./scripts/3scale-mock -a 123456 curl -X POST -F "file=@/tmp/insights-archive.tar.gz" -H "x-upload-multiplier: 10" http://localhost:8100/api/v1/upload

# Delete system
curl -X DELETE http://localhost:8100/api/v1/delete/be012439-26ae-456c-99a6-27b402331064

Database

Switch into database container and run database terminal:

docker exec -it vulnerability-engine-database bash -c "psql -d vulnerability"

Run tests

You can run all tests from scratch just after cloning repo using command:

docker-compose -f docker-compose.test.yml up --build --exit-code-from test

Or locally

# install postgresql and pyenv
pyenv install 3.8
cd tests
pyenv shell
pipenv install
cd ..
pytest -vvv tests/

Developing / Debugging

You can tune metrics using Prometheus and Grafana dev containers, see doc/metrics.md.


Structure

vulnerability-engine schema

Detailed structure

vulnerability-engine detailedschema

vulnerability-engine's People

Contributors

blayson avatar brantleyr avatar bsquizz avatar eherget avatar genalt avatar ggainey avatar jdobes avatar jhutar avatar jiridostal avatar lesamo avatar michaelmraka avatar michalslomczynski avatar mischulee avatar mkoura avatar mtclinton avatar psegedy avatar radohanculak avatar romanblanco avatar tkasparek avatar tlestach avatar vkrizan 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.