Skip to content

Commit a37da2a

Browse files
committed
add ripgrep
1 parent 4730fa6 commit a37da2a

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

examples/codex/secure_quality_gitlab.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ This repository is a deliberately vulnerable Node.js Express demo app based on [
3636

3737
The code includes common pitfalls such as command injection, path traversal, unsafe `eval`, regex DoS, weak cryptography (MD5), and hardcoded secrets. It’s used to validate that Codex-powered analyzers produce GitLab-native reports (Code Quality and SAST) that render directly in merge requests.
3838

39-
The CI runs on GitLab SaaS runners with `node:24` images and a few extras (`jq`, `curl`, `ca-certificates`, `ajv-cli`). Jobs are hardened with `set -euo pipefail`, schema validation, and strict JSON markers to keep parsing reliable even if Codex output varies.
39+
The CI runs on GitLab SaaS runners with `node:24` images and a few extras (`jq`, `curl`, `ca-certificates`, `ripgrep`, `ajv-cli`). Jobs are hardened with `set -euo pipefail`, schema validation, and strict JSON markers to keep parsing reliable even if Codex output varies.
4040

4141
This pipeline pattern—prompt, JSON marker extraction, schema validation—can be adapted to other stacks, though prompt wording and schema rules may need tweaks. Since Codex runs in a sandbox, some system commands (like `awk` or `nl`) may be restricted.
4242

@@ -94,8 +94,8 @@ codex_review:
9494
- ': > ${CODEX_RAW_LOG}'
9595
- ': > ${CODEX_QA_PATH}'
9696
# Minimal deps + Codex CLI
97-
- apt-get update && apt-get install -y --no-install-recommends curl ca-certificates git lsb-release
98-
- npm -g i @openai/codex@latest
97+
- apt-get update && apt-get install -y --no-install-recommends curl ca-certificates git lsb-release ripgrep
98+
- npm --ignore-scripts -g i @openai/codex@latest
9999
- codex --version && git --version
100100
# Build a real-file allowlist to guide Codex to valid paths/lines
101101
- FILE_LIST="$(git ls-files | sed 's/^/- /')"
@@ -253,8 +253,8 @@ codex_recommendations:
253253
- ": > ${CODEX_RAW_LOG}"
254254
- ": > ${CODEX_SECURITY_MD}"
255255
256-
- apt-get update && apt-get install -y --no-install-recommends curl ca-certificates git lsb-release
257-
- npm -g i @openai/codex@latest
256+
- apt-get update && apt-get install -y --no-install-recommends curl ca-certificates git lsb-release ripgrep
257+
- npm --ignore-scripts -g i @openai/codex@latest
258258
- codex --version && git --version
259259
260260
- |
@@ -424,8 +424,8 @@ codex_resolution:
424424
- mkdir -p "$PATCH_DIR" artifacts
425425

426426
# Deps
427-
- apt-get update && apt-get install -y --no-install-recommends bash git jq curl ca-certificates
428-
- npm -g i @openai/codex@latest
427+
- apt-get update && apt-get install -y --no-install-recommends bash git jq curl ca-certificates ripgrep
428+
- npm --ignore-scripts -g i @openai/codex@latest
429429
- git --version && codex --version || true
430430

431431
# Require SAST report; no-op if missing
@@ -610,4 +610,3 @@ Looking forward, this pattern can be extended to unify all major scan types thro
610610
By merging these into a single Codex-powered post-processing \+ remediation pipeline, teams can get a consistent stream of **actionable guidance, validated patches** across all security domains.
611611

612612
**The broader takeaway:** with prompt engineering, schema validation, and integration into GitLab’s native MR workflow, LLMs evolve from “advisors” into **first-class CI/CD agents** — helping teams ship code that is not only functional, but also secure, maintainable, and automatically remediated where possible.
613-

0 commit comments

Comments
 (0)