New feature request for the betterment of the code quality driven by static analyzer and security tools.
Bringing in Static analyzers and Security tools for quality and secure code
Proposer
Ramesh Ramanathan B (Tata Elxsi)
Type
Feature (do not modify)
Target MDG/TF
NBI, LCM, RO, MON, POL, DevOp
Supported VIMs
Can be tested against any VIM
Description
The realm of software engineering and quality attributes is necessary to develop and maintain world class software. This includes parameters like Security, Maintainability, Reliability, Performance efficiency and usability. With the help of static analyzer tools we can give a lot of focus and improve these parameters, especially security and maintainability.
Key is to use the right set of tools to get the result as well as a constructive rule set that continues to give the creative freedom to the developer.
Maintainability at a high level can include:
- Analyzability – Ease of navigation to gauge impact of a proposed change
- Modifiability – Easy of making changes without introducing defects or regression
- Modularity – Component level coupling and cohesion to minimize impact of change in one component on other components
- Reusability – Degree to which components can be reused in more than one place in the code base Security
A combination of Static Application Security Testing (SAST) tools and Application security and vulnerability scanner tools can help to identify issues like:
- Injection - Sending un-trusted data to the system
- Broken Authentication - Brute force attacks, dictionary attacks, token based attacks
- Sensitive Data Exposure - Man in the middle attack, stealing clear text from browser
- Access Control - Unauthorized access to resources
- Security (mis)configuration - Exploiting un-patched flaws, accessing default accounts
- XSS - Cross Site Scripting attacks
- Session Management - Allowing only authorized access during a session
OWAP / NIST / SANS security guidelines will be considered overall and the associated tools will be executed.
Demo or definition of done
NOTE: We ran first level pylint and found around 300+ errors, 1000+ warnings and overall around 5000+ issues
- Execute and fix issue for reactive readiness
- Include the tools in the Devops pipelines for proactive correctness
Tools:
- Kali OS for application security testing like Burp suite and ZAP Proxy
- Bandit (formerly a Openstack Community project)
- py-find-injection (SQL Injection Attacks, contributed by Uber)
- Pyt (Detect command injection, SSRF, SQL injection, XSS, directory traversal)
- Radon (Maintainability)
- Pylint (Maintainalbility)
- Safety - Safety checks installed dependencies for known security vulnerabilities
Future Work
Next step can be to drill down further into a static code analysis phase. This can potentially include:
- Vulture - Dead Code
- Pyroma – packaging efficiency
- Cohesion – check the cohesion efficiency of the code