infobyte / faraday

Open Source Vulnerability Management Platform

Home Page:https://www.faradaysec.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

custom_plugins_folder directive ignored by faraday_server

jbauernberger opened this issue · comments

Faraday version

Faraday v3.18.1

Component Name

If you know where the problem lays indicate it:

custom plugins

Steps to reproduce

Hi there :)

been working on a custom plugin for syft/grype.
The faraday-plugin list-plugins -cpf ~/.faraday/custom_plugins/ will load my plugin correctly:

...
Grype JSON Plugin                     grype            No         Yes
Loaded Plugins: 88

(although my plugin isn't loaded without using the -cpf option, but I assume faraday-plugins doesn't care about server.ini?)

Running the plugin from the command (process-report) line works and the following produces a JSON without errors:

faraday-plugins process-report --custom-plugins-folder ~/.faraday/custom_plugins ~/Downloads/grype-report-host.json

The directive in settings.ini (section [faraday_server]) is:

....
custom_plugins_folder = /home/joachim/.faraday/custom_plugins

Yet when I run faraday-server --debug I see that it only loads the built-in plugins and then throws an error when trying to detect the report:

2021-12-14T10:31:49+0100 - faraday.faraday_plugins.plugins.manager - DEBUG {PoolThread-twisted.internet.reactor-0} [pid:202536] [manager.py:37 - get_plugin()]  Plugin by file not found
2021-12-14T10:31:49+0100 - faraday.faraday_plugins.plugins.manager - DEBUG {PoolThread-twisted.internet.reactor-0} [pid:202536] [manager.py:39 - get_plugin()]  Plugin for file (/home/joachim/.faraday/uploaded_reports/MHRAABKEWBVU_grype-report-host.json) not found
2021-12-14T10:31:49+0100 - faraday.server.api.modules.upload_reports - INFO {PoolThread-twisted.internet.reactor-0} [pid:202536] [upload_reports.py:105 - file_upload()]  Could not get plugin for file

pip freeze:

alembic==1.7.5
anyascii==0.3.0
apispec==5.1.1
apispec-webframeworks==0.5.2
attrs==21.2.0
autobahn==21.11.1
Automat==20.2.0
bcrypt==3.2.0
beautifulsoup4==4.10.0
bidict==0.21.4
bleach==4.1.0
blinker==1.4
certifi==2021.10.8
cffi==1.15.0
charset-normalizer==2.0.8
cli-helpers==2.2.0
click==8.0.3
colorama==0.4.4
configobj==5.0.6
constantly==15.1.0
cryptography==36.0.0
distro==1.6.0
dnspython==2.1.0
email-validator==1.1.3
faraday-agent-parameters-types==1.0.2
faraday-plugins==1.5.7
faradaysec @ file:///home/joachim/src/faraday
filedepot==0.8.0
filteralchemy-fork==0.1.0
Flask==2.0.2
Flask-Classful==0.14.2
Flask-KVSession-fork==0.6.3
Flask-Limiter==1.4
Flask-Login==0.5.0
Flask-Mail==0.9.1
Flask-Principal==0.4.0
Flask-Security-Too==4.1.2
Flask-SocketIO==5.1.1
Flask-SQLAlchemy==2.5.1
Flask-WTF==1.0.0
html2text==2020.1.16
hyperlink==21.0.0
idna==3.3
incremental==21.3.0
itsdangerous==2.0.1
Jinja2==3.0.3
limits==1.5.1
lxml==4.6.4
Mako==1.1.6
MarkupSafe==2.0.1
marshmallow==3.12.2
marshmallow-sqlalchemy==0.26.1
nplusone==1.0.0
packaging==21.3
passlib==1.7.4
pendulum==2.1.2
pgcli==3.2.0
pgspecial==1.13.0
Pillow==8.4.0
prompt-toolkit==3.0.22
psycopg2==2.9.2
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycparser==2.21
Pygments==2.10.0
pyOpenSSL==21.0.0
pyotp==2.6.0
pyparsing==3.0.6
python-dateutil==2.8.2
python-engineio==4.3.0
python-socketio==5.5.0
pytz==2021.3
pytzdata==2020.1
PyYAML==6.0
requests==2.26.0
service-identity==21.1.0
setproctitle==1.2.2
simplejson==3.17.6
simplekv==0.14.1
six==1.16.0
soupsieve==2.3.1
SQLAlchemy==1.3.24
sqlparse==0.4.2
syslog-rfc5424-formatter==1.2.2
tabulate==0.8.9
tqdm==4.62.3
Twisted==21.7.0
txaio==21.2.1
typing-extensions==4.0.0
urllib3==1.26.7
wcwidth==0.2.5
webargs==8.0.1
webencodings==0.5.1
Werkzeug==2.0.2
WTForms==3.0.0
zope.interface==5.4.0

OS

cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux bookworm/sid"
NAME="Debian GNU/Linux"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

thanks :)

Hello @jbauernberger the problem is that our documentation is outdated.
The custom plugins folder is not done anymore in the server.ini

you need to run this command:

faraday-manage settings -a update reports

@jbauernberger also you are welcome to make a PR with your plugin in our faraday-plugins repository

https://github.com/infobyte/faraday_plugins

@aenima-x thanks for the heads-up on docs.