Disclaimer
Introduction
0 Why should you care?
- 1 Importance & Risk to the Data:
1 Data
- 1.0 Data classification:
- 1.0.1 Why Data classification?
- 1.0.1 Legal implications/ compliance to regulations:
- 1.1 Step 1: Data classification:
- 1.2 Step 2: Security at the database server level:
2 Database(SQL/NoSQL) Injection:
- 2.1 Categories of SQL Injection
- 2.2 In-band and Out-of-band attacks
- 2.3 In-band Error based SQL Injection
- 2.4 In-band Union Based SQL Injection
- 2.5 Inferential SQL Injection - Boolean based SQL Injection
- 2.6 Inferential SQL Injection - Time-based SQL injection- Potential DOS attack
- 2.7 Out-of-band SQL Injection
- 2.8 Second Order SQL Injection
- 2.9 Prevention of SQL Injection
3 SQL Injection Examples
- 3.1 Insecure Query Example
- 3.2 Output from Insecure Query from Hibernate
- 3.3 How it goes to database
- 3.4 Few points on display of SQL
- 3.5 Dissecting the insecure query output:
- 3.6 Secure Query - Named parameter query
- 3.7 Output from Secure Named parameter Query from Hibernate
- 3.8 How Secure Query - Named parameter query goes to database
- 3.9 Dissecting the output of Secure Query - Named parameter query
- 3.10 Few more secure query samples
- 3.11 SecuredPositionalParameterQuery
- 3.12 Output from SecuredPositionalParameterQuery from Hibernate
- 3.13 SecureSqlQuery
- 3.14 Output from SecureSqlQuery from Hibernate
- 3.15 Deciphering presence of SQL Injection in medium/ complex queries
- 3.16 Why Hibernate displays bind parameters separately
- 3.17 Other Mechanisms to display SQL output
- 3.18 Recommendation on when to display SQL output
- 3.19 What else can cause SQL Injection and how to mitigate- Stored procedures and other database entities
- 3.20 Other mechanisms to mitigate SQL Injection -WAF/NG Firewall
4 Detection of SQL Injection
- 4.1 Detection of SQL Injection by review
- 4.2 Review of code By Developers, Architects
- 4.3 By Non/Semi Technical Staff/Managers
- 4.4 By DBAs
- 4.5 Static code analysis tools
- 4.6 Runtime Detection of SQL Injection
5 Five new steps in CI/CD Process
- 5.1 Review the code
- 5.2 DB/Hibernate/P6Spy query output
- 5.3 Analyze
- 5.4 Store
- 5.5 Repeat the steps - either manually or in an automated fashion for every release/during SDLC process
6 Resources
- 6.1 Google dorks / The Exploit Database
- 6.2 Open Web Application Security Project(OWASP) cheatsheet series
- 6.3 Open Web Application Security Project速 (OWASP) ASVS
- 6.4 Open Web Application Security Project速 (OWASP) Juiceshop