Commit 6a111a15 authored by Lorenzo Faletra's avatar Lorenzo Faletra

Import Upstream version 3.1.1

parents
server/www/script/* linguist-vendored
Please search the [Wiki](https://github.com/infobyte/faraday/wiki) for a solution before posting a ticket. Use the <strong>“New Support Request”</strong> button to the right of the screen to submit a ticket for technical support.
## Issue Type
- Bug Re port
- Feature Idea
- Documentation Report
## Faraday version
Paste the output of the *./faraday.py --version* command
## Component Name
If you know where the problem lays indicate it:
WebGui/GTKGui/Plugin/Console/Continuous Scanning/Etc.
## Steps to reproduce
Provide detailed steps on how the issue happened so we can try to reproduce it. If the issue is random, please provide as much information as possible.
## Expected results
What did you expect to happen when following the steps above?
### Debugging tracebacks (current results)
Try to reproduce the bug with the server and/or gtk client in debug mode and check the logs for the ERROR string.
Add here any errors you find while running in debug mode or, if possible, Faraday’s log files (located at *$HOME/.faraday/logs/*).
If you need help on how to execute in debug mode [click here for more information](https://github.com/infobyte/faraday/wiki/troubleshooting).
Please attach the result of:
pip freeze > requirements_freeze.txt
### Screenshots
If you don't find anything on the logs, please provide screenshots of the error.
## Environment information
### Configuration files
Mention any settings you have changed/added/removed.
### Reports/Extra data
If you are having issues with plugins, please attach relevant files if possible.
(strip your reports of all sensitive information beforehand).
### OS
Provide information on your operating system. Example:
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.10
DISTRIB_CODENAME=yakkety
DISTRIB_DESCRIPTION="Ubuntu 16.10"
*.py[cod]
# C extensions
*.so
# Packages
*.egg
*.egg-info
dist
build
eggs
parts
var
sdist
develop-eggs
.installed.cfg
lib
lib64
__pycache__
# Installer logs
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
nosetests.xml
test_cases/.cache/
test_cases/htmlcov/
# Translations
*.mo
# Mr Developer
.mr.developer.cfg
.project
.pydevproject
pushReports.py
*.swp
# Tests nodejs
node_modules
# Couch
.couchadmin
# Ignore faraday server pid
server/.faraday-server.pid
#Ignore images executive report
reports/executive/images/ease-of-resolution-piechart.png
reports/executive/images/impact-piechart.png
reports/executive/images/vulns-piechart.png
#Ignore visual studio code configs
typings/
jsconfig.json
.vscode/
# PyCharm project files
.idea
# vFeed DB
data/vfeed.db
# Images based on DB Schema
entity_dbschema.png
uml_schema.png
# Documentation builds
doc/_build/
The PRIMARY AUTHORS are:
* Daniel Foguelman
* Esteban Guillardoy
* Ezequiel Tavella
* Facundo de Guzmán
* Federico Kirschbaum
* Francisco Amato
* Franco Linares
* German Riera
* Joaquín López Pereyra
* Leonardo Lazzaro
* Martín Rocha
* Matias Ariel Ré Medina
* Matias Lang
* Micaela Ranea Sánchez
* Sebastian Kulesz
* Eric Horvat
Project contributors
* Alejandro Parodi
* Andrés López Luksenberg
* Andres Tarantini
* Brice Samulenok
* Buanzo
* csk
* dmknght
* Elian Gidoni
* Endrigo Antonini
* Federico Fernandez
* James Jara
* Javier aguinaga
* Jorge Luis Gonzalez Iznaga
* Juan Urbano
* Korantin Auguste
* Martin Tartarelli
* Mike Zhong (go bears)
* Necrose99
* Ronald Iraheta
* Roberto Focke
* Sliim
* Thierry Beauquier
* tsxltjecwb
* Ulisses Albuquerque
* xtr4nge
#!groovy
node (label: "master"){
def ENV_PATH = "$HOME/venv/faraday"
echo "${ENV_PATH}"
stage("Clean virtualenv") {
sh "rm -rf ${ENV_PATH}"
}
stage("Install Python Virtual Enviroment") {
sh "/usr/local/bin/virtualenv --no-site-packages ${ENV_PATH} --python=/usr/local/bin/python"
}
// Get the latest version of our application code.
stage ("Pull Code from SCM") {
checkout scm
}
stage ("Install Application Dependencies") {
sh """
source ${ENV_PATH}/bin/activate
pip install virtualenv responses
pip install -U -r $WORKSPACE/requirements.txt
pip install -U -r $WORKSPACE/requirements_server.txt
pip install -U -r $WORKSPACE/requirements_extras.txt
pip install -U -r $WORKSPACE/requirements_dev.txt
deactivate
"""
}
stage ("Check code style") {
sh """
sloccount --duplicates --wide --details $WORKSPACE | fgrep -v .git > $WORKSPACE/sloccount.sc || :
find $WORKSPACE -name \\"*.py\\" | egrep -v '^./tests/' | xargs pyflakes > $WORKSPACE/pyflakes.log || :
find $WORKSPACE -name \\"*.py\\" | egrep -v '^./tests/' | xargs pylint --output-format=parseable --reports=y > $WORKSPACE/pylint.log || :
eslint -c /home/faraday/.eslintrc.js -f checkstyle $WORKSPACE/server/www/scripts/**/* > eslint.xml || true
"""
warnings canComputeNew: false, canResolveRelativePaths: false, consoleParsers: [[parserName: 'PyFlakes']], defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', messagesPattern: '', parserConfigurations: [[parserName: 'AcuCobol Compiler', pattern: 'pyflakes.log']], unHealthy: ''
}
stage ("Run Unit/Integration Tests") {
def testsError = null
try {
sh """
source ${ENV_PATH}/bin/activate
cd $WORKSPACE && pytest -v --junitxml=$WORKSPACE/xunit.xml || :
deactivate
"""
step([$class: 'CoberturaPublisher', autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: '**/coverage.xml', failNoReports: false, failUnhealthy: false, failUnstable: false, maxNumberOfBuilds: 0, onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false])
}
catch(err) {
testsError = err
currentBuild.result = 'FAILURE'
}
finally {
junit "**/xunit.xml"
notifyBuild(currentBuild.result, "SQLite Build")
if (testsError) {
throw testsError
}
}
}
stage ("Run Unit/Integration Tests (with PostgreSQL)") {
def testsError = null
try {
withCredentials([string(credentialsId: 'postgresql_connection_string', variable: 'CONN_STRING')]) {
sh """
source ${ENV_PATH}/bin/activate
cd $WORKSPACE && pytest -v --junitxml=$WORKSPACE/xunit-postgres.xml --connection-string "$CONN_STRING" || :
deactivate
"""
step([$class: 'CoberturaPublisher', autoUpdateHealth: false, autoUpdateStability: false, coberturaReportFile: '**/coverage.xml', failNoReports: false, failUnhealthy: false, failUnstable: false, maxNumberOfBuilds: 0, onlyStable: false, sourceEncoding: 'ASCII', zoomCoverageChart: false])
}
}
catch(err) {
testsError = err
currentBuild.result = 'FAILURE'
}
finally {
junit "**/xunit-postgres.xml"
notifyBuild(currentBuild.result, "PostgreSQL Build")
if (testsError) {
throw testsError
}
}
}
stage ("Build docs") {
sh """
source ${ENV_PATH}/bin/activate
pip install sphinx
mkdir -p ~/docs
rm -rf ~/docs/jenkins_build
cd $WORKSPACE/doc && make html && cp -r _build/html ~/docs/jenkins_build
"""
}
stage ("Run Closure Compiler") {
try {
sh """
java -jar /home/faraday/closure-compiler-v20180610.jar $WORKSPACE/server/www/scripts
"""