Skip to content

Commit d731f2f

Browse files
Update markdown for sidebar, move images to accessible path (#2100)
1 parent 6480e4c commit d731f2f

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

examples/codex/secure_quality_gitlab.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff 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
22

3-
## **Introduction**
3+
## Introduction
44

55
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.
66

@@ -12,7 +12,7 @@ With LLMs, you can add a new layer of intelligence to this process: reasoning ab
1212

1313
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.
1414

15-
## **What is Codex CLI?**
15+
## What is Codex CLI?
1616

1717
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).
1818

@@ -28,7 +28,7 @@ To follow along, you’ll need:
2828
* An **OpenAI API key** (`OPENAI_API_KEY`)
2929
* GitLab CI/CD variables configured under **Settings → CI/CD → Variables**
3030

31-
## **Example \#1 \- Using Codex CLI to Produce a Code Quality Report**
31+
## Example #1 - Using Codex CLI to Produce a Code Quality Report
3232

3333
### Background
3434

@@ -148,11 +148,11 @@ codex_review:
148148

149149
The generated artifacts can be downloaded from the pipeline page
150150

151-
<img src="./images/gitlab_pipelines_success.png" alt="GitLab Pipelines" width="700"/>
151+
<img src="../../images/gitlab-pipelines-success.png" alt="GitLab Pipelines" width="700"/>
152152

153153
Or when running as a merge from a feature to master branch,
154154

155-
<img src="./images/GitLab_MR_Widget.png" alt="GitLab Merge Request Widget" width="700"/>
155+
<img src="../../images/gitlab-mr-widget.png" alt="GitLab Merge Request Widget" width="700"/>
156156

157157
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.
158158

@@ -164,7 +164,7 @@ This approach has several benefits:
164164

165165
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.
166166

167-
## **Example \#2 – Using Codex CLI for Security Remediation**
167+
## Example #2 – Using Codex CLI for Security Remediation
168168

169169
### Background
170170

@@ -304,13 +304,13 @@ codex_recommendations:
304304
```
305305
Here's an example of the output we receive:
306306
307-
# Example Output: Consolidated SAST Findings
307+
### Example Output: Consolidated SAST Findings
308308
309309
Parsed `gl-sast-report.json` and merged overlapping issues.
310310
**Total raw findings:** 5 → **Consolidated into:** 4 representative entries
311311
(duplicated SQL injection patterns across endpoints were merged).
312312

313-
## Summary Table
313+
#### Summary Table
314314

315315
| Rank | CWE | Title | Affected Locations | Likely Exploit Path | Risk | Rationale (1–2 lines) |
316316
|------|----------|--------------------------------------|-------------------|--------------------------------------|----------|--------------------------------------------------------------------------------------------------------|
@@ -319,14 +319,14 @@ Parsed `gl-sast-report.json` and merged overlapping issues.
319319
| 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. |
320320
| 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). |
321321

322-
## Top 5 Immediate Actions
322+
#### Top 5 Immediate Actions
323323
1. Replace hardcoded JWT signing key in `lib/insecurity.ts:23`; load from secret storage, rotate keys, and invalidate existing tokens.
324324
2. Update `routes/login.ts:34` to use parameterized queries; remove raw concatenation; validate and escape inputs.
325325
3. Fix `routes/search.ts:23` by using ORM bind parameters or escaped `LIKE` helpers instead of string concatenation.
326326
4. Refactor `routes/userProfile.ts:55–66`; replace `eval()` with safe templating or a whitelisted evaluator.
327327
5. Harden image import logic: allowlist schemes/hosts, block link-local/metadata IPs, apply timeouts and size limits.
328328

329-
### Deduplicated Findings (Full Details)
329+
##### Deduplicated Findings (Full Details)
330330

331331
##### 1. CWE-798 — Hardcoded JWT private key
332332
- Risk: Critical — Exploitability 98/100
@@ -587,7 +587,7 @@ Using Codex CLI in GitLab CI/CD allows you to augment existing review processes
587587

588588
---
589589

590-
## **Wrapping Up**
590+
## Wrapping Up
591591

592592
In this cookbook, we explored how **Codex CLI** can be embedded into GitLab CI/CD pipelines to make software delivery safer and more maintainable:
593593

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)