#3043 basic security checks with bandit
Merged by tkopecek. Opened by tkopecek.
tkopecek/koji issue3042  into  master

Download 3043.patch

Fixes: https://pagure.io/koji/issue/3042

rebased onto bf6b4ce618b2bea0708668f1b57a3ea37976da5d

koji.util.rmtree doesn't support GLOB path

1 new commit added

  • fix unlinking

It might be helpful to add banditinto envlist of tox.ini and Makefile.
Otherwise :thumbsup:

rebased onto 8fdd52ca727038df79b3478da9e0b29a0ca82644

pretty please pagure-ci rebuild

it's not called this time

This is different.rm -rf will not raise an error. os.unlink() will raise if the file is already gone (eg. race conditions). I recommend you wrap the unlink() call in try/catch FileNotFoundError.

How about a comment here explaining why we're skipping all of these?

Why are we silencing the warnings here?

Removing code! :rocket:

Actually catching and ignoring parent OSError would be better than FileNotFoundError. The original os.system('rm -rf ...') code would not raise in a variety of cases.

rebased onto 9c505b0072cf613468d8742c5993f3f70d8f8a10

Updated, I've removed most of the skipped tests and replaced them with # nosec.

rebased onto 390e98d14b5e6b181286e1f75d84eeb4b17e19ee

I've replaced urlopen with requests. Anyway, it depends if we don't want to drop koji-shadow completely (#2873)

Metadata Update from @tkopecek:
- Pull-request tagged with: no_qe

1 new commit added

  • remove unused imports

pretty please pagure-ci rebuild

pretty please pagure-ci rebuild

unittest failed now, as it watches os.path.join(rootdir, '/var/lib/rpm/__db*')

1 new commit added

  • fix test

:thumbsup:

Commit a90552af fixes this pull-request

Pull-Request has been merged by tkopecek

Metadata