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
Copy file name to clipboardExpand all lines: examples/codex/secure_quality_gitlab.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
-
# **Automating Code Quality and Security Fixes with Codex CLI in GitLab**
1
+
# Automating Code Quality and Security Fixes with Codex CLI in GitLab
2
2
3
-
## **Introduction**
3
+
## Introduction
4
4
5
5
When deploying production code, most teams rely on CI/CD pipelines to validate changes before merging. Reviewers typically look at unit test results, vulnerability scans, and code quality reports. Traditionally, these are produced by rule-based engines that catch known issues but often miss contextual or higher-order problems—while leaving developers with noisy results that are hard to prioritize or act on.
6
6
@@ -12,7 +12,7 @@ With LLMs, you can add a new layer of intelligence to this process: reasoning ab
12
12
13
13
This guide shows how to integrate Codex CLI into a GitLab pipeline for both use cases—delivering structured, machine-readable reports alongside actionable, human-readable guidance.
14
14
15
-
## **What is Codex CLI?**
15
+
## What is Codex CLI?
16
16
17
17
Codex CLI is an open-source command-line tool for bringing OpenAI’s reasoning models into your development workflow. For installation, usage, and full documentation, refer to the official repository: [github.com/openai/codex](https://github.com/openai/codex?utm_source=chatgpt.com).
By embedding Codex CLI into your GitLab CI/CD pipelines, you can **elevate code quality checks beyond static rules**. Instead of only catching syntax errors or style violations, you enable reasoning-based analysis that highlights potential issues in context.
158
158
@@ -164,7 +164,7 @@ This approach has several benefits:
164
164
165
165
As teams adopt this workflow, LLM-powered quality checks can complement traditional linting and vulnerability scanning—helping ensure that code shipped to production is both robust and maintainable.
166
166
167
-
## **Example \#2 – Using Codex CLI for Security Remediation**
167
+
## Example #2 – Using Codex CLI for Security Remediation
168
168
169
169
### Background
170
170
@@ -304,13 +304,13 @@ codex_recommendations:
304
304
```
305
305
Here's an example of the output we receive:
306
306
307
-
# Example Output: Consolidated SAST Findings
307
+
### Example Output: Consolidated SAST Findings
308
308
309
309
Parsed `gl-sast-report.json` and merged overlapping issues.
310
310
**Total raw findings:** 5 → **Consolidated into:** 4 representative entries
311
311
(duplicated SQL injection patterns across endpoints were merged).
@@ -319,14 +319,14 @@ Parsed `gl-sast-report.json` and merged overlapping issues.
319
319
| 3 | CWE-94 | Server-side code injection via eval | 1 | User profile update handler | High | `eval()` on user input allows RCE; conditionally enabled but still high-impact when reachable. |
320
320
| 4 | — (SSRF) | SSRF via arbitrary image URL fetch | 1 | Image URL fetch/write flow | High | Outbound fetch of unvalidated URLs enables internal service / metadata access (e.g., AWS metadata). |
321
321
322
-
## Top 5 Immediate Actions
322
+
#### Top 5 Immediate Actions
323
323
1. Replace hardcoded JWT signing key in `lib/insecurity.ts:23`; load from secret storage, rotate keys, and invalidate existing tokens.
324
324
2. Update `routes/login.ts:34` to use parameterized queries; remove raw concatenation; validate and escape inputs.
325
325
3. Fix `routes/search.ts:23` by using ORM bind parameters or escaped `LIKE` helpers instead of string concatenation.
326
326
4. Refactor `routes/userProfile.ts:55–66`; replace `eval()` with safe templating or a whitelisted evaluator.
0 commit comments