Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address bandit-flagged security issues. #2872

Closed
hjoliver opened this issue Nov 19, 2018 · 7 comments
Closed

Address bandit-flagged security issues. #2872

hjoliver opened this issue Nov 19, 2018 · 7 comments
Assignees
Milestone

Comments

@hjoliver
Copy link
Member

hjoliver commented Nov 19, 2018

Codacy runs the bandit static analysis tool to flag potential security issues. Most - maybe all - of these need to be ignored non-gratuitously. Bandit supports a special #nosec in-source comment for this purpose.

We should:

  • check that codacy respects the #nosec comment

and if it does:

  • analyze each flagged security issue and add an appropriate #nosec comment

@jarich also suggested, in some cases we may also be able to add a regex character-range test (say) to enforce the presumed content of subprocess (say) string arguments, e.g. to disallow shell $ chars etc.

@hjoliver hjoliver added this to the later milestone Nov 19, 2018
@hjoliver
Copy link
Member Author

@MartinRyan - please assign yourself to this issue once you've accepted the Cylc org invite.

@MartinRyan
Copy link
Contributor

I've accepted the invite Hilary, but it looks like I don't have permissions to assign myself to the issue

@hjoliver hjoliver assigned hjoliver and MartinRyan and unassigned hjoliver Nov 19, 2018
@hjoliver
Copy link
Member Author

OK, not sure why that is, but I've assigned you now! (And thanks for taking this on).

@hjoliver
Copy link
Member Author

(note that to play around with this stuff you can tell codacy to analyze your own cylc fork ... as well as use bandit yourself, of course).

@kinow
Copy link
Member

kinow commented Nov 21, 2018

FWIW, I tried something similar some time ago, but I think I never got to wait for Codacy's feedback (which may take several minutes or hours depending on their resources available I think).

https://github.com/kinow/cylc/commits/codacy-exclusions

It was tricky finding where the # nosec had to go when you had commands in multiple lines (e.g. line too long for pep8/pycodestyle, so we break line and use \).

Using Codacy from your own branch is definitely the way to go, as you can log in to Codacy and poke around in your own account/space too.

@matthewrmshin
Copy link
Contributor

Fixed by #2998.

@matthewrmshin matthewrmshin modified the milestones: later, cylc-8.0a1 Aug 28, 2019
@kinow
Copy link
Member

kinow commented Aug 28, 2019

Thanks @matthewrmshin !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants