A bite of Python
access.redhat.com
A bite of Python
1–10 of 168 posts
Re: A bite of Python
#2So, basically, I can write such a list for every language I know.
Re: A bite of Python
#3It will actually pick up a number of security issues listed in the post. It's useful in real world too - led to a number of CVEs being reported.
Re: A bite of Python
#4I wouldn't call it 'traps'. I would call it 'read and understand documentation before writing code' like: what is 'is' operator, or how floats behave in EVERY programming language, or why you should sanitize EVERY user input. So, basically, I can write such a list for every language I know.
Re: A bite of Python
#5If you're interested in reviewing Python code for potential security issues, here's a related project: https://github.com/openstack/bandit (I'm one of the devs) It will actually pick up a number of security issues listed in the post. It's useful in real world too - led to a number of CVEs being reported.
Don't suppose you know if that's gotten better?
Re: A bite of Python
#6"Contract conditions should never be violated during execution of a bug-free program. Contracts are therefore typically only checked in debug mode during software development. Later at release, the contract checks are disabled to maximize performance." - https://en.wikipedia.org/wiki/Design_by_contract
Re: A bite of Python
#7Re: A bite of Python
#8I wouldn't call it 'traps'. I would call it 'read and understand documentation before writing code' like: what is 'is' operator, or how floats behave in EVERY programming language, or why you should sanitize EVERY user input. So, basically, I can write such a list for every language I know.
https://stackoverflow.com/questions/tagged/hidden-features?s...
Re: A bite of Python
#9I wouldn't call it 'traps'. I would call it 'read and understand documentation before writing code' like: what is 'is' operator, or how floats behave in EVERY programming language, or why you should sanitize EVERY user input. So, basically, I can write such a list for every language I know.
Re: A bite of Python
#10If you're interested in reviewing Python code for potential security issues, here's a related project: https://github.com/openstack/bandit (I'm one of the devs) It will actually pick up a number of security issues listed in the post. It's useful in real world too - led to a number of CVEs being reported.
I looked at Bandit earlier this year, but had to put it down when I discovered it didn't have a way to fill in default config -- the instant I specified anything in the config file, I had to supply a complete config, including literally every single check it's capable of doing, because Bandit would discard all its defaults on encountering that single line of custom config. Don't suppose you know if that's gotten bett…
- `bandit-config-generator` will give you a file filled with the current/default configuration, so it's a simple way to start with the defaults and modify just what you need
- if you just need to enable/disable tests rather than reconfigure, you can do that in command line options
- if you want to get rid of specific warning, you can mark the line with "# nosec" in the source
Merging various configs is possible, but rather complex to implement considering we aim for the config to be a complete description that won't ever need to change between versions.
If none of the above workarounds solve your use case, feel free to report an issue. (https://bugs.launchpad.net/bandit) I can't guarantee how/whether we'll fix this, but we'd definitely like to know what the problem is and how you're trying to use Bandit.