Commit Graph

31 Commits

Author SHA1 Message Date
lhinds 2d2170273b Project Migration to PyCQA
This change rehomes the project to PyCQA[1] as reported to the
openstack-dev mailing list [1]

[0] https://github.com/PyCQA/bandit
[1] http://lists.openstack.org/pipermail/openstack-dev/2018-April/129386.html

Change-Id: I6aad329a60799ea24a3d9bc49e35c3c35ed9dc3b
2018-05-04 06:59:50 +02:00
OpenStack Proposal Bot 2f4b66e138 Updated from global requirements
Change-Id: I413357c415b52ec6e855d22208204b8561d47def
2018-03-15 06:45:25 +00:00
OpenStack Proposal Bot 197073b4d0 Updated from global requirements
Change-Id: Iee64bec569f25ecb66bb6a77f022b1002956cd87
2018-03-13 06:47:08 +00:00
OpenStack Proposal Bot 6a3342eba8 Updated from global requirements
Change-Id: I70bccd9cf8eb9aba9915c5577656af796727c3c9
2018-03-10 13:06:45 +00:00
Eric Brown 6bdc6c0c4e Sort the complete plugin list
Currently the plugin listing found at the link below [1] is unsorted
by bandit ID number, yet the IDs are listed, making it confusing
to look at.

This patch sorts the plugin list by renaming each plugin filename
so that sphinx sorts accordingly.

[1] https://docs.openstack.org/bandit/latest/plugins/index.html#complete-test-plugin-listing

Change-Id: Ib16b85d1025dd667f711e8571dd58a59deb74d29
2018-02-01 14:36:44 -08:00
OpenStack Proposal Bot 1b05566428 Updated from global requirements
Change-Id: If90dae868c2c44277054f39c7a0fd30e39207f0b
2018-01-24 00:49:02 +00:00
OpenStack Proposal Bot 1c2ee30ced Updated from global requirements
Change-Id: I52a00f0d8c6557db08a9f13a61b44afd9bee0ba6
2018-01-17 20:27:55 +00:00
Gage Hugo 13e80ac52c Create doc/requirements.txt
This change migrates the docs building requirements in order to meet
the compliance with the Project Testing Interface[0]. See [1] for
more details.

[0] https://governance.openstack.org/tc/reference/project-testing-interface.html#documentation
[1] http://lists.openstack.org/pipermail/openstack-dev/2017-November/124815.html

Change-Id: I8e31da06b946d18a760bc59b6fee63db25eebdc5
2017-12-19 11:16:06 -06:00
Marek Cermak d159335700 Custom formatter
Implements: custom formatter

Custom formatter can be used to output a machine-readable, easily
parsable and customizable format using set of predefined tags
to suite various needs.

Output string is formatted using python string.format() standards
and therefore provides familiar usage.

Usage: bandit --format custom [--msg-template MSG-TEMPLATE] targets

See bandit --help for additional information and list of available tags

modified:   bandit/cli/main.py
modified:   bandit/core/manager.py
modified:   README.rst
modified:   setup.cfg
new file:   bandit/formatters/custom.py

Change-Id: I900c9689cddb048db58608c443305e05e7a4be14
Signed-off-by: Marek Cermak <macermak@redhat.com>
2017-11-13 13:53:40 +01:00
Eric Brown fbd4e83efe Yet Another Formatter (yaml)
This patch adds a yaml formatter to the output options of bandit.

Change-Id: Ibbe0cff062ce2c11138b746f95109f31de10f5b1
2017-02-27 16:23:17 -08:00
Matthew Edmonds dd76a78339 Fixing B502 and B503 developer docs
The developer docs for B502 and B503 have their titles swapped,
and link to themselves instead of to each other. This fixes that.

Change-Id: I17f8ce00d124f6a88a34710e58084973be2f477f
2016-12-01 10:38:23 -05:00
Eric Brown aae396e9bc Add capability to pipe a file into bandit
Allows someone to feed a file/text into bandit from a pipe rather
than just the 'targets' argument.

Usage example:
   cat examples/imports.py | bandit -

Change-Id: I1566684c0ae5476374960095816cb1720ff465a2
2016-11-28 23:00:45 -08:00
Tim Kelsey 34d28a0756 Adding more plugin config docs
Change-Id: Iaa1cec60ed00ec597a75d48f3eb3cef49e5e0e4d
2016-07-14 15:13:58 +01:00
Travis McPeak aa2c133668 Adding missing section to documentation about gen_config
This commit adds a missing section in the Bandit plugin
documentation for developers that describes how gen_config should
be used to declare and set default values for parameters.

Closes-Bug: #1602002
Change-Id: Iac3135394c9f723f04d9756459a0d5595de07021
2016-07-12 03:23:34 +00:00
Eric Brown 1310d18275 Allow output to default to stdout using argparse
The argparse module already has the capability to default to stdout
at CLI parameter definition time. This patch utilizes this and avoids
the opening of the output file by each formatter.

Change-Id: Ib1e89492558fe1fc06966711b6014bd5b86b84c8
2016-06-15 11:23:53 -07:00
Eric Brown 5e72d254d1 Add man page for bandit command line
This patch adds a man page for bandit using sphinx framework.

Change-Id: Ie76f67e6e70904318dd37cc628c27d9b3d908e80
2016-06-07 14:59:07 -07:00
ZhiQiang Fan 90c52715d3 [Trivial] Remove unnecessary executable privilege
bandit/core/node_visitor.py is a module rather than a script.
doc/source/conf.py is a configuration file rather than a script.

Change-Id: I08d855da5adab6c722ce63d120dc437c1ca81f6b
2016-04-29 21:11:06 +08:00
Tim Kelsey d653e969ae Adding accurate docs for new bandit config
Change-Id: I19d810dfeb6cae422938465c370d015832eeb0e6
2016-04-04 16:14:52 +01:00
Christopher J Schaefer cac2f22dee Added try_except_continue plugin
Along with a 'try, except, pass' check, we should also check for the
similar existance of 'try, except, continue', which raises the same
type of security implications, given the similar type of functionality.
Using 'continue' in place of 'pass' (inside a loop) currently allows
code to bypass the 'try, except, pass' warning.

Change-Id: I3e7ce037518875c5f5e46e26e1d72ef878f78a2f
2016-03-24 12:09:12 -05:00
Tim Kelsey 731e0ed393 Adding test IDs to test doc titles
Change-Id: If51e0f0519a102c4fd22375275bb5a6992a0c4ff
2016-03-23 16:29:00 +00:00
Tim Kelsey 24eba90cce Fixing documentation for hardcoded password tests
The docs for these tests were very out of date. This fixes them
and also removes the old wordlist, as its not used by anything.

Change-Id: I28c047dfd0041824e08e28e1239ccbae8c7141a0
2016-03-23 16:28:56 +00:00
Tim Kelsey 0b7574f5bf Adding docs for new style blacklist calls
Implements: blueprint bandit-docs
Change-Id: I243652e60752234dfc569dbaa1f7f5cc5eabc083
2016-02-10 10:17:17 +00:00
Henry Yamauchi ea7f781243 Misspelling in file plugins/index.rst
This fixes the misspelling in the Plugin ID Groupings section of
page plugins/index.html. It says 'miss-configuration' when it
should say 'misconfiguration'.

Change-Id: I243da1062ddcb164c4049b725b52f684eeb020c7
Closes-Bug: #1537119
2016-01-22 10:10:15 -06:00
Henry Yamauchi c0e33112e6 Misspelling in main developers doc title
This fixes the extra letter 's' in the title of the main page for
the developers documentation. It shows:

Welcome to Bandits’s developer documentation!

when it should be:

Welcome to Bandit’s developer documentation!

Change-Id: Ib16f0c9ee43f3a3adbf4592bb4e1a8b126c06b24
Closes-Bug: #1536804
2016-01-21 16:13:03 -06:00
Henry Yamauchi 0130bded14 Broken link to plugin list in file config.rst
The link to the plugin list currently points to tests/index.html
 which does not exist so clicking on it returns a page not found.

Change-Id: I45e2a77dca9438ee201f095e3c24f3471efbb6a0
Closes-Bug: #1536347
2016-01-20 14:46:53 -06:00
Eric Brown ce8530b3b6 Pretty up the formatter docs
* The formatter docs should use same sphinx tags as the plugins
* The screen formatter was missing docs

Change-Id: I8031644df5dc8469a00bdf7308f995810660744a
2016-01-16 00:58:15 -08:00
Eric Brown d3824efebf Add missing automodule doc for yaml_load
A previous commit added a test plugin for yaml_load, but missed
the associated doc file.

Change-Id: I5574303197bfbcdfca80f841febd25224556eede
2016-01-14 14:09:49 -08:00
Eric Brown 0ff55f1e2b Pretty up the plugin documentation
* Add test IDs in the title of the plugin
* Make use of proper sphinx tags
* Add new Plugin ID Groupings section to plugins index

Change-Id: Ic0015da7fc9648564ea11250ba30ef301f3cd6bd
2016-01-14 08:34:33 -08:00
Eric Brown 4c603c7087 Remove old docs
No more used

Change-Id: I1eb0b4250a68d90c126a51917326d64f84002459
2016-01-13 13:32:57 -08:00
Eric Brown a829f94650 Add docs for formatters
Add some documentation around the available formatters and how
a user might want to plugin their own. Uses the sphinx autodoc
feature.

Change-Id: Ic90fbc3928de9149220209d6bd3b3be35b8a2f9a
2015-12-16 15:18:32 -08:00
Eric Brown 222c0809b3 Use sphinx autodoc to generate docs from docstring
Rather than having separate rst documentation files, this patch auto
generates the docs from the docstrings in the modules. Should
make it easier to maintain.

Also renamed directory docs to doc to be consistent with all other
OpenStack projects.

Change-Id: Iaed77f8358ccb6edaf2627fbabdcc855272b4ea2
2015-12-15 16:57:57 -08:00