OWASP Requiremnets
- 1 Introduction
- 2 List of key requirements for OWASP TOP 10:2021
- 2.1 A01:2021-Broken Access Control
- 2.2 A02:2021-Cryptographic Failures
- 2.3 A03:2021-Injection
- 2.4 A04:2021-Insecure Design
- 2.5 A05:2021-Security Misconfiguration
- 2.6 A06:2021-Vulnerable and Outdated Components
- 2.7 A07:2021-Identification and Authentication Failures
- 2.8 A08:2021-Software and Data Integrity Failures
- 2.9 A09:2021-Security Logging and Monitoring Failures
- 2.10 A10:2021-Server-Side Request Forgery
- 3 List of Python sonar security rules categorized by OWASP TOP 10:2021
- 3.1 A01:2021-Broken Access Control
- 3.2 A02:2021-Cryptographic Failures
- 3.3 A03:2021-Injection
- 3.4 A04:2021-Insecure Design
- 3.5 A05:2021-Security Misconfiguration
- 3.6 A06:2021-Vulnerable and Outdated Components
- 3.7 A07:2021-Identification and Authentication Failures
- 3.8 A08:2021-Software and Data Integrity Failures
- 3.9 A09:2021-Security Logging and Monitoring Failures
- 3.10 A10:2021-Server-Side Request Forgery
- 4 List of JavaScript sonar security rules categorized by OWASP TOP 10:2021
- 4.1 A01:2021-Broken Access Control
- 4.2 A02:2021-Cryptographic Failures
- 4.3 A03:2021-Injection
- 4.4 A04:2021-Insecure Design
- 4.5 A05:2021-Security Misconfiguration
- 4.6 A06:2021-Vulnerable and Outdated Components
- 4.7 A07:2021-Identification and Authentication Failures
- 4.8 A08:2021-Software and Data Integrity Failures
- 4.9 A09:2021-Security Logging and Monitoring Failures
- 4.10 A10:2021-Server-Side Request Forgery
- 5 List of Docker sonar security rules categorized by OWASP TOP 10:2021
- 5.1 A01:2021-Broken Access Control
- 5.2 A02:2021-Cryptographic Failures
- 5.3 A03:2021-Injection
- 5.4 A04:2021-Insecure Design
- 5.5 A05:2021-Security Misconfiguration
- 5.6 A06:2021-Vulnerable and Outdated Components
- 5.7 A07:2021-Identification and Authentication Failures
- 5.8 A08:2021-Software and Data Integrity Failures
- 5.9 A09:2021-Security Logging and Monitoring Failures
- 5.10 A10:2021-Server-Side Request Forgery
- 6 Note: Understanding the Limitations of Sonar in OWASP Security Analysis
Introduction
This document provides a focused analysis of the OWASP TOP 10:2021 guidelines, specifically mapped to the technologies used in our project. It provides:
Insights into Python code vulnerabilities and rules used for checking compliance with OWASP Standards, especially those related to server-side request forgeries.
Guidelines for Docker configurations, emphasizing the importance of SSL/TLS certificate verifications and their implications across multiple OWASP categories.
A detailed look into JavaScript security checks and potential threats, centered around server-side request vulnerabilities.
While there are comprehensive OWASP summaries available, this document stands out by aligning those guidelines directly with our project's technological stack. It serves as a practical guide for developers aiming to bolster their code's security based on our specific tech environment.
All checks are integrated into the CI/CD pipeline and are using SonarCloud Security Rules to find vulnerabilities.
List of potential vulnerabilities was prepared on 11th October 2023.
List of key requirements for OWASP TOP 10:2021
A01:2021-Broken Access Control
Enforce authorization and implement appropriate access constraints.
Make sure users can only access resources and carry out approved actions.
Apply security regulations uniformly throughout the application.
A02:2021-Cryptographic Failures
To protect sensitive data, use cryptographic algorithms and robust encryption.
Make sure to use safe key management procedures.
Defend against known vulnerabilities and cryptographic flaws.
A03:2021-Injection
To stop injection threats (such as SQL injection and OS command injection), implement input validation and output encoding.
For database queries, use prepared statements or parameterized queries.
Avoid dynamic commands or searches built from user input.
A04:2021-Insecure Design
Beginning with the application's design, consider security.
To find potential security issues early in the development process, use threat modeling.
Implement appropriate access controls and security architecture.
A05:2021-Security Misconfiguration
Implement secure default settings.
Review and update configurations frequently to reduce security flaws.
Keep sensitive information from being displayed in error messages or by improperly configured permissions.
A06:2021-Vulnerable and Outdated Components
Update all of the components (libraries, frameworks, and dependencies).
To find known weaknesses in components, use a dependency checker (like OWASP Dependency-Check).
Components having known vulnerabilities should be removed or changed.
A07:2021-Identification and Authentication Failures
Set up reliable user identification and authentication systems.
When necessary, employ multi-factor authentication (MFA).
Avoid typical flaws that allow for authentication bypass.
A08:2021-Software and Data Integrity Failures
Implement secure data transmission (like HTTPS) to ensure data integrity.
Ensure that data is not altered while it is in transit or at rest and take precautions against data manipulation.
Use cryptographic hashes to check the accuracy of your data.
A09:2021-Security Logging and Monitoring Failures
Implement efficient security incident and event logging.
Make proactive arrangements for monitoring and alerting for atypical or suspicious activity.
Keep logs in a secure location and check them frequently for security flaws.
A10:2021-Server-Side Request Forgery
To stop harmful input, validate and sanitize user input.
Avoid enabling direct requests from user-supplied URLs to internal resources.
Use allowlists or particular whitelists to manage accessible external resources.
List of Python sonar security rules categorized by OWASP TOP 10:2021
A01:2021-Broken Access Control
Vulnerability:
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-5146/
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-2083/ (also A03)
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-6317/
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-5445/
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-6321/
Security Hotspot:
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6333/
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6329/
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6304/
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6302/
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6270/
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6265/
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6281/ (also A05)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-5443/
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-5042/ (also A05)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-4502/
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6463/
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-2612/ (also A04)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-3752/ (also A04)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-1313/
A02:2021-Cryptographic Failures
Vulnerability:
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-5659/
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-5547/
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-5542/
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-5527/ (also A05 and A07)
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-4830/ (also A05 and A07)
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-4426/
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-4423/
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-3329/
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-2053/
Security Hotspot:
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-5332/
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-4790/
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-2257/
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-2245/
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6332/ (also A04 and A05)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6330/ (also A04 and A05)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6327/ (also A04 and A05)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6319/ (also A04 and A05)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6308/ (also A04 and A05)
A03:2021-Injection
Vulnerability:
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-5496/
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-5334/
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-5147/
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-5131/ https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-3649/
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-2091/
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-2083/ (also A01)
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-2078/
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-2076/
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-2631/
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-6287/
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-5145/ (also A09)
Security Hotspot:
A04:2021-Insecure Design
Vulnerability:
Security Hotspot:
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6332/ (also A02 and A05)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6330/ (also A02 and A05)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6327/ (also A02 and A05)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6319/ (also A02 and A05)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6308/ (also A02 and A05)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6275/ (also A05)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-2612/ (also A01)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6245/ (also A05)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-3752/ (also A01)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-2092/ (also A05)
A05:2021-Security Misconfiguration
Vulnerability:
Security Hotspot:
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6281/ (also A01)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-5042/ (also A01)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6332/ (also A02 and A04)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6330/ (also A02 and A04)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6327/ (also A02 and A05)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6319/ (also A02 and A05)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6308/ (also A02 and A05)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6275/ (also A04)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6252/
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-6245/ (also A04)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-5122/ (also A07)
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-4507/
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-3330/
https://rules.sonarsource.com/python/type/Security%20Hotspot/RSPEC-2092/ (also A04)
A06:2021-Vulnerable and Outdated Components
Sonar doesn’t have an ability to detect this. There is a tool available on OWASP site to check dependencies.
https://owasp.org/www-project-dependency-check/
Vulnerability:
Security Hotspot
A07:2021-Identification and Authentication Failures
Vulnerability:
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-6437/
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-2115/
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-5527/ (also A02 and A05)
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-4830/ (also A02 and A05)
https://rules.sonarsource.com/python/type/Vulnerability/RSPEC-4433/
Security Hotspot:
A08:2021-Software and Data Integrity Failures
Vulnerability:
Security Hotspot
A09:2021-Security Logging and Monitoring Failures
Vulnerability:
Security Hotspot:
A10:2021-Server-Side Request Forgery
Vulnerability:
Security Hotspot
List of JavaScript sonar security rules categorized by OWASP TOP 10:2021
A01:2021-Broken Access Control
Vulnerability:
https://rules.sonarsource.com/javascript/type/Vulnerability/RSPEC-6105/
https://rules.sonarsource.com/javascript/type/Vulnerability/RSPEC-6096/
https://rules.sonarsource.com/javascript/type/Vulnerability/RSPEC-5146/
https://rules.sonarsource.com/javascript/type/Vulnerability/RSPEC-2083/ (also A03)
https://rules.sonarsource.com/javascript/type/Vulnerability/RSPEC-6317/
https://rules.sonarsource.com/javascript/type/Vulnerability/RSPEC-2819/
https://rules.sonarsource.com/javascript/type/Vulnerability/RSPEC-6321/
Security Hotspot:
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-6333/
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-6329/
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-6302/
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-6270/
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-6265/
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-6281/ (also A05)
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-5443/
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-5042/ (also A05)
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-4502/
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-5604/
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-2612/ (also A04)
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-5736/
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-1313/
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-6304/
A02:2021-Cryptographic Failures
Vulnerability:
https://rules.sonarsource.com/javascript/type/Vulnerability/RSPEC-5659/
https://rules.sonarsource.com/javascript/type/Vulnerability/RSPEC-5547/
https://rules.sonarsource.com/javascript/type/Vulnerability/RSPEC-5542/
https://rules.sonarsource.com/javascript/type/Vulnerability/RSPEC-5527/ (also A05 and A07)
https://rules.sonarsource.com/javascript/type/Vulnerability/RSPEC-4830/ (also A05 and A07)
https://rules.sonarsource.com/javascript/type/Vulnerability/RSPEC-4426/
https://rules.sonarsource.com/javascript/type/Vulnerability/RSPEC-4423/
Security Hotspot:
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-6249/ (also A05)
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-5332/
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-4790/
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-2245/
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-6332/ (also A04 and A05)
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-6330/ (also A04 and A05)
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-6327/ (also A04 and A05)
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-6319/ (also A04 and A05)
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-6308/ (also A04 and A05)
A03:2021-Injection
Vulnerability:
https://rules.sonarsource.com/javascript/type/Vulnerability/RSPEC-5696/
https://rules.sonarsource.com/javascript/type/Vulnerability/RSPEC-5334/
https://rules.sonarsource.com/javascript/type/Vulnerability/RSPEC-5147/
https://rules.sonarsource.com/javascript/type/Vulnerability/RSPEC-5131/
https://rules.sonarsource.com/javascript/type/Vulnerability/RSPEC-3649/
https://rules.sonarsource.com/javascript/type/Vulnerability/RSPEC-2083/ (also A01)
https://rules.sonarsource.com/javascript/type/Vulnerability/RSPEC-2076/
https://rules.sonarsource.com/javascript/type/Vulnerability/RSPEC-2631/
https://rules.sonarsource.com/javascript/type/Vulnerability/RSPEC-6287/
https://rules.sonarsource.com/javascript/type/Vulnerability/RSPEC-5883/
Security Hotspot:
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-6299/
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-6268/
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-5852/
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-1523/
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-6350/
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-5247/
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-4721/
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-2077/
A04:2021-Insecure Design
Vulnerability:
Security Hotspot:
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-6332/ (also A02 and A05)
https://rules.sonarsource.com/javascript/type/Security%20Hotspot/RSPEC-6330/ (also A02 and A05)
(also A02 and A05)
(also A02 and A05)
(also A02 and A05)
(also A05)
(also A01)
(also A05)
(also A05)
(also A05)
A05:2021-Security Misconfiguration
Vulnerability:
(also A02 and A07)
(also A02 and A07)
Security Hotspot:
(also A01)
(also A02)
(also A01)
(also A02 and A04)
(also A02 and A04)
(also A02 and A04)
(also A02 and A04)
(also A02 and A04)
(also A04)
(also A04)
(also A04)
(also A07)
(also A04)
A06:2021-Vulnerable and Outdated Components
Sonar doesn’t have an ability to detect this. There is a tool available on OWASP site to check dependencies.
Vulnerability:
Security Hotspot
A07:2021-Identification and Authentication Failures
Vulnerability:
(also A02 and A05)
(also A02 and A05)
Security Hotspot:
(also A05)
A08:2021-Software and Data Integrity Failures
Vulnerability:
Security Hotspot:
A09:2021-Security Logging and Monitoring Failures
Vulnerability:
Security Hotspot:
A10:2021-Server-Side Request Forgery
Vulnerability:
Security Hotspot
List of Docker sonar security rules categorized by OWASP TOP 10:2021
A01:2021-Broken Access Control
Vulnerability:
Security Hotspot:
A02:2021-Cryptographic Failures
Vulnerability:
(also A05 and A07)
Security Hotspot:
A03:2021-Injection
Vulnerability:
Security Hotspot:
A04:2021-Insecure Design
Vulnerability:
Security Hotspot:
A05:2021-Security Misconfiguration
Vulnerability:
(also A02 and A07)
Security Hotspot:
A06:2021-Vulnerable and Outdated Components
Sonar doesn’t have an ability to detect this. There is a tool available on OWASP site to check dependencies.
Vulnerability:
Security Hotspot
A07:2021-Identification and Authentication Failures
Vulnerability:
(also A02 and A05)
Security Hotspot:
A08:2021-Software and Data Integrity Failures
Vulnerability:
Security Hotspot:
A09:2021-Security Logging and Monitoring Failures
Vulnerability:
Security Hotspot:
A10:2021-Server-Side Request Forgery
Vulnerability:
Security Hotspot
Note: Understanding the Limitations of Sonar in OWASP Security Analysis
Sonar is generally effective at detecting many OWASP-related security issues. However, there may be certain limitations and aspects that Sonar might not effectively detect or address:
False Positives: Like many automated code analysis tools, Sonar can sometimes produce false positives, flagging code as vulnerable when it is not. This can lead to noise in the results and require manual validation.
Contextual Understanding: Sonar primarily relies on static analysis, which means it may not fully understand the context in which the code operates. This can lead to issues with detecting some complex vulnerabilities or providing false negatives.
Business Logic Flaws: Sonar is primarily focused on identifying common security vulnerabilities rather than business logic flaws, which may require manual testing or specialized tools.
Zero-Day Vulnerabilities: Sonar's rules and plugins are based on known vulnerabilities and attack patterns. It may not detect brand new or zero-day vulnerabilities until they are documented and added to its rule sets.
Non-Code Security Issues: Sonar primarily focuses on code-level vulnerabilities. It may not detect other security issues related to server configuration, network architecture, or deployment environments.
To ensure that the project is thoroughly secure, it's recommended to consider the following:
OWASP Application Security Verification Standard (ASVS): To achieve a comprehensive level of security, the project should aim to pass the official OWASP ASVS. This standard provides a detailed checklist of security controls and verification requirements.
OWASP Web Security Testing Guide: Refer to the OWASP Web Security Testing Guide for guidance on performing security testing and assessments beyond what automated tools like Sonar can offer. It provides insights into various testing techniques and methodologies.
Vulnerable and Outdated Components (A06:2021-Vulnerable and Outdated Components): Note that Sonar may not effectively detect this category of vulnerabilities. To address it, consider using the OWASP Dependency-Check tool, available on the OWASP website. This tool helps identify and manage vulnerable components and libraries in your project's dependencies.
By combining the capabilities of Sonar with these additional measures and tools, you can enhance the security of the project and minimize the risk of OWASP-related vulnerabilities going undetected.
Did you encounter a problem or do you have a suggestion?
Please contact our Service Desk
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. https://creativecommons.org/licenses/by-sa/4.0/