You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Detection of missing rate limiting on database endpoints
106
+
- Security findings inside the GitHub Security tab
107
+
108
+
Learned:
109
+
110
+
- Secure code is not only about preventing SQL Injection.
111
+
- Security tools analyze data flow between application components.
112
+
- API endpoints that access databases should implement rate limiting.
113
+
- Security also includes protecting application availability.
114
+
115
+
---
116
+
117
+
## OWASP Practice: SQL Injection and Rate Limiting
118
+
119
+
Created:
120
+
121
+
```text
122
+
labs/security/owasp-lab/
123
+
```
124
+
125
+
Practiced:
126
+
127
+
- Writing intentionally vulnerable SQL queries
128
+
- Detecting SQL Injection using CodeQL
129
+
- Fixing vulnerabilities using parameterized queries
130
+
- Protecting endpoints with `express-rate-limit`
131
+
132
+
Vulnerable query:
133
+
134
+
```javascript
135
+
constsql=`SELECT * FROM users WHERE name = '${query}'`;
136
+
```
137
+
138
+
Secure query:
139
+
140
+
```javascript
141
+
const [rows] =awaitdb.execute('SELECT * FROM users WHERE name = ?', [query]);
142
+
```
143
+
144
+
Added rate limiting:
145
+
146
+
```javascript
147
+
constrateLimit=require('express-rate-limit');
148
+
149
+
constlimiter=rateLimit({
150
+
windowMs:15*60*1000,
151
+
max:100,
152
+
});
153
+
154
+
app.use(limiter);
155
+
```
156
+
157
+
Learned:
158
+
159
+
- User input should never be directly concatenated into SQL queries.
160
+
- Databases should receive queries and parameters separately.
161
+
- Public endpoints should implement rate limiting to prevent denial-of-service attacks.
104
162
105
163
---
106
164
@@ -110,13 +168,14 @@ Commands:
110
168
111
169
```bash
112
170
trivy image my-first-image
171
+
113
172
trivy image node:24-slim
114
173
```
115
174
116
175
Learned:
117
176
118
-
- Containers inherit vulnerabilities from base images.
119
-
- Smaller images reduce attack surface.
177
+
- Containers inherit vulnerabilities from their base images.
178
+
- Smaller images reduce the attack surface.
120
179
- Security is not only about application code.
121
180
122
181
---
@@ -160,23 +219,25 @@ Security is not a single tool.
160
219
161
220
Modern DevSecOps combines:
162
221
222
+
```text
163
223
Developer
164
-
↓
224
+
↓
165
225
Secrets Management
166
-
↓
226
+
↓
167
227
Dependency Scanning
168
-
↓
228
+
↓
169
229
SAST
170
-
↓
230
+
↓
171
231
CodeQL
172
-
↓
232
+
↓
173
233
Container Security
174
-
↓
234
+
↓
175
235
Secure CI/CD
176
-
↓
236
+
↓
177
237
Branch Protection
178
-
↓
238
+
↓
179
239
Deployment
240
+
```
180
241
181
242
OWASP provides the security model that connects all of these layers.
182
243
@@ -188,28 +249,23 @@ Before this checkpoint, I viewed security as individual tools and isolated vulne
188
249
189
250
After completing Phase 4, I understand that modern application security is a chain of defenses that protects code before it reaches production.
190
251
252
+
I also learned that security is not limited to preventing SQL Injection or protecting secrets. Modern applications must also defend against denial-of-service attacks, insecure dependencies, vulnerable containers, and unsafe deployment pipelines.
0 commit comments