Commit Graph

934 Commits

Author SHA1 Message Date
OpenDev Sysadmins 7104625499 OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:31:06 +00:00
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
Paul Belanger 209182c3ee
Stop using slave_scripts/install-distro-packages.sh
Migrate the legacy job to start using our bindep role from zuul-jobs.
This will allow openstack-infra to delete
slave_scripts/install-distro-packages.sh in the future.

Change-Id: I6b07be9b7912ff226991552b9be6dc9999416b56
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2018-04-23 15:39:13 -04:00
Paul Belanger 59c66c9100
Add bindep.txt file
Bindep is a tool for checking the presence of binary packages needed
to use an application / library. It started life as a way to make it
easier to set up a development environment for OpenStack projects.

Change-Id: I1a6cfa255a6473febf0fb7b7d4f1bf8ca32d02c2
Depends-On: https://review.openstack.org/563717
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2018-04-23 15:39:00 -04:00
Eric Brown 9d848dd79e Add bandit ID to prefix of more_info link
In a recent commit [1], the names of the plugin doc files changed
to include the bandit ID as a prefix. Unfortunately, the doc_utils
wasn't updated at the time, so it still pointed to the previous
docs, thus resulting in 404 errors when browsing to the link.

This patch modifies doc_utils to properly prefix the bandit ID to
reference the doc for a particular plugin.

[1] https://review.openstack.org/#/c/540170/

Change-Id: Ia4b4c87e880ba39a677a84fc53943bc7a37849ef
Closes-Bug: #1761254
2018-04-04 16:03:56 -07:00
Zuul c5fa5e27d9 Merge "add lower-constraints job" 2018-03-22 20:21:39 +00:00
Zuul 67b6f531a1 Merge "Typo in the name of the YAML formatter test" 2018-03-22 15:44:15 +00:00
Doug Hellmann 5b781f8b7a add lower-constraints job
Create a tox environment for running the unit tests against the lower
bounds of the dependencies.

Create a lower-constraints.txt to be used to enforce the lower bounds
in those tests.

Add openstack-tox-lower-constraints job to the zuul configuration.

See http://lists.openstack.org/pipermail/openstack-dev/2018-March/128352.html
for more details.

Change-Id: Ifb4030c25ebc3342da15c8c903d8fd22fe743586
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-22 09:00:05 -04:00
OpenStack Proposal Bot 2f4b66e138 Updated from global requirements
Change-Id: I413357c415b52ec6e855d22208204b8561d47def
2018-03-15 06:45:25 +00:00
Eric Brown 2fc2732721 Typo in the name of the YAML formatter test
The yaml test class was misnamed as JsonFormatterTests and not
properly as YamlFormatterTests.

Change-Id: Icbbd666f35ec4fc3251015c3f773b8585c5e8b78
2018-03-13 19:32:26 -07: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
OpenStack Proposal Bot e9b9e2f3c6 Updated from global requirements
Change-Id: I4ae52ab3515bf59010b4dff3c15c35d6e42a6ef0
2018-03-04 09:59:08 +00:00
Tin Lam 91a796b805 Fix false positives for pyCrypto
This patch set fixes an issue where modules whose names begin with
string ``Crypto`` are incorrectly flagged for pyCrypto imports.  The
fix will now explicitly calls out pyCrypto module one sub-level to
avoid the false positives.

Change-Id: Iafd3fae2fc7a13a0a93800ee570c4e1354be1391
Closes-Bug: #1749603
Signed-off-by: Tin Lam <tin@irrational.io>
2018-02-18 21:26:48 -06:00
Zuul 6fd7fccf70 Merge "Add pycrypto to blacklist" 2018-02-12 22:45:50 +00:00
Zuul a41f4ecab5 Merge "Fix infinite loop issue" 2018-02-08 16:12:12 +00:00
Zuul deb4773eae Merge "Add more_info URL to the YAML output" 2018-02-06 18:50:14 +00:00
Zuul a5130b10ec Merge "Sort the complete plugin list" 2018-02-06 16:25:04 +00:00
Tin Lam dc3ff2d917 Add pycrypto to blacklist
This patch set adds pyCrypto to bandit's blacklist, so bandit will
strongly advise against using pyCrypto. As mentioned in the bug,
this may cause false positives if people use pyCrytodome, but will be
tracked and addressed in follow up patch set.

Depends-On: I0b1a90c3a47ad6d3b18597e5315e9f017854a146
Change-Id: I81f695cd31dee393ab4530dbcdb20dd925bbece2
Closes-Bug: #1655973
2018-02-05 01:00:33 -06:00
Zuul c0ec276c1e Merge "Zuul: Remove project name" 2018-02-03 00:58:07 +00:00
James E. Blair 13850aa1d4 Zuul: Remove project name
Zuul no longer requires the project-name for in-repo configuration.
Omitting it makes forking or renaming projects easier.

Change-Id: I33e07a13e581fc86c8e16ed4677f7b795e4523d5
2018-02-02 04:09:02 -08:00
Eric Brown ab4b04fc6d Add more_info URL to the YAML output
Currently, outputting bandit findings as YAML does not put the
``more_info`` URL in the output as it would if the output format
is HTML or JSON.  This patch set updates the YAML formatter to
include the ``more_info`` URL to be inline with the HTML and JSON
formatters.

Change-Id: Ice134e3bbf67c59feb7a88b299e60838b6ad80d5
Closes-Bug: #1746827
2018-02-01 15:16:39 -08: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
Tin Lam 90f031c973 Fix infinite loop issue
Running bandit using relative paths inside a subdirectory when the current
directory contains __init__.py causes bandit to be stuck in an infinite
loop.

Co-Authored-By: Calvin Li
Closes-Bug: #1743042
Change-Id: I247108c1365847134ee561073ea0eb43c57b54cc
2018-02-01 13:10:16 -06:00
Gage Hugo 2fc7dda850 Update docs links
The links for more_info were pointing to the old location for
bandit's documents, which would redirect to an index.html page.

This change updates the docs to the new location in order to
allow the "more info" link to point to the correct page.

Change-Id: I950ea4601248065dce68a5d21b144703817cf675
Closes-Bug: #1745006
2018-01-25 19:17:49 -06: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
OpenStack Proposal Bot 3a7aef6a68 Updated from global requirements
Change-Id: Icce30f996421c3dcc90e003c720d132c87810b25
2018-01-16 04:02:15 +00:00
Zuul d22d76c9da Merge "Update documentation" 2018-01-12 17:35:34 +00:00
Tin Lam 5cf8589bf7 Update hacking requirement
This patch set updates test-requirements.txt to use the latest versions
of hacking. There is no reason to cap the hacking version to 0.14, as
other OpenStack project such as ironic [0] has brought the minimum
hacking version to 1.0.0.

Closes-Bug: #174100

[0] 3700e7c6d5

Change-Id: I5254613678a096a5b8730cdb42af3545a63fe1a9
Signed-off-by: Tin Lam <tin@irrational.io>
2018-01-11 22:55:53 -06:00
Zuul 4090f97e13 Merge "Create doc/requirements.txt" 2018-01-12 02:30:16 +00:00
Tin Lam 32c27bdcdf Update documentation
In patch [0], B605 no longer will return a MEDIUM severity, instead
it will return a LOW severity. However, the documentation was never
updated to match the change [1]. This patch set updates the
documentation to match the update.

[0] 8f74c51935 (diff-5abc40c6b98a9c677ed95d1ffec0ad66L41)
[1] https://docs.openstack.org/bandit/latest/plugins/start_process_with_a_shell.html

Closes-Bug: #1742493

Change-Id: I201c259313aef09b3d68cca54380dc47033a5b26
Signed-off-by: Tin Lam <tin@irrational.io>
2018-01-11 12:49:13 -06:00
Zuul 71f4df31b6 Merge "Add more_info URL to the JSON output" 2018-01-09 17:46:30 +00:00
Tin Lam 185a2a8a42 Add more_info URL to the JSON output
Currently, outputting bandit findings as JSON does not put the ``more_info``
URL in the output as it would if the output format is HTML.  This patch
set updates the JSON formatter to include the ``more_info`` URL to be inline
with the HTML display.

Change-Id: I58a8490b427fe146d517a8aff124f4443562f48b
Closes-Bug: #1695890
Signed-off-by: Tin Lam <tin@irrational.io>
2018-01-03 19:32:39 -06:00
Tin Lam bb1bf81856 Add module loaded through importlib
Bandit only checks if imports is done using keyword ``import`` or
``__import__()`` and does not check for blacklisted module loaded
via importlib.  This patch set adds additional check for blacklisted
modules loaded via importlib.

Change-Id: I97ed93af1066fa39dfc5be0868ab814c8eadd147
Closes-Bug: #1718516
Signed-off-by: Tin Lam <tin@irrational.io>
2017-12-28 04:12:35 -06: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
Zuul 03b390b59b Merge "Allow specifying targets in ini file" 2017-12-07 17:41:28 +00:00
Andreas Jaeger 3977c673e0 Avoid tox_install.sh for constraints support
We do not need tox_install.sh, pip can handle constraints itself
and install the project correctly. Thus update tox.ini and remove
the now obsolete tools/tox_install.sh file.

This follows https://review.openstack.org/#/c/508061 to remove
tools/tox_install.sh.

Change-Id: I85d256e9e66bbf940f5b645c4a887b1f2a3707de
2017-12-02 17:06:26 +00:00
Zuul 0c82a02530 Merge "Migrate to zuul V3" 2017-11-28 10:59:05 +00:00
Zuul 3831b79051 Merge "Remove extra section from README.rst" 2017-11-27 05:34:27 +00:00
rajat29 5d3ca79312 Migrate to zuul V3
Migrate all functional jobs and gate to zuul v3.

Needed-By: Id391e505300c43a532241696d063c4eacbdd34a2
Needed-By: Ief7e88ae1cc8fa0a690ffb04b4174914cc870ed9
Change-Id: Ie44a0193c9f98d12f146207a9f2afd7eff534e87
2017-11-27 10:01:08 +05:30
Marek Cermak 0b3cd391c1 Remove extra section from README.rst
Follow up patch for review/marek_cermak/formatter-custom.

Adressing comment by Gage Hugo: remove extra section from README.rst

Change-Id: I177861d404592ba4b9d7b953bbb983963d53b653
modified:   README.rst
2017-11-25 08:18:36 +00:00
Zuul f7ad5eb799 Merge "Updated from global requirements" 2017-11-25 05:27:49 +00:00
Zuul 8f09d8b208 Merge "Custom formatter" 2017-11-24 16:25:22 +00:00
OpenStack Proposal Bot e907ddd94e Updated from global requirements
Change-Id: Ic98daa2b0750da0240ac1d4f9f4e4bc504a7ac07
2017-11-23 18:40:40 +00:00
Zuul aa0863f5c0 Merge "Remove setting of version/release from releasenotes" 2017-11-22 11:39:31 +00:00
Andreas Jaeger a7a8070426 Remove setting of version/release from releasenotes
Release notes are version independent, so remove version/release
values. We've found that projects now require the service package
to be installed in order to build release notes, and this is entirely
due to the current convention of pulling in the version information.

Release notes should not need installation in order to build, so this
unnecessary version setting needs to be removed.

This is needed for new release notes publishing, see
I56909152975f731a9d2c21b2825b972195e48ee8 and the discussion starting
at
http://lists.openstack.org/pipermail/openstack-dev/2017-November/124480.html
.

Change-Id: I096e956fa44f0dfa9b8210a221bcbe5afb385634
2017-11-17 10:07:29 +01:00
Gage Hugo ce108f0eda Migrate to stestr
This change migrates the testing suite from using ostestr and testr
to using stester. Also cleaned up a missing space from tox.ini.

Change-Id: I886401a1efce6cb617a4db7a90ec9454bbea1d71
2017-11-16 20:53:48 +00: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
Pavlo Shchelokovskyy 446e7f7249 Allow specifying targets in ini file
this patch makes 'targets' args optional and allows to specify them
in the ini file.
This makes it possible to keep most of bandit configuration right in
the ini file.
OpenStack projects can now populate their tox.ini with [bandit] section
and do 'bandit --ini {toxinidir}/tox.ini -r' almost uniformly
accross all projects.

Change-Id: Ia0153e0aaa602171690ca8f66635fbea69b1cfab
Closes-Bug: #1730307
2017-11-06 12:10:06 +02:00