Skip to content

feat: implement dynamic gitleaks severity mapping (#1)#13

Merged
pureliture merged 1 commit into
mainfrom
codex/issue-1-gitleaks-severity-mapping
Jun 12, 2026
Merged

feat: implement dynamic gitleaks severity mapping (#1)#13
pureliture merged 1 commit into
mainfrom
codex/issue-1-gitleaks-severity-mapping

Conversation

@pureliture

@pureliture pureliture commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Purpose & Motivation

Gitleaks finding이 모든 룰을 HIGH/MEDIUM으로 저장하던 문제를 고쳐, RuleIDTags 기반으로 Finding.severity / Finding.confidence를 동적으로 매핑합니다.

Resolves #1.

Context

구현 범위는 Gitleaks report item을 core Finding으로 변환하는 mapper 계층에 한정했습니다.

  • Tagsseverity:<level> / confidence:<level> 값을 우선 적용합니다.
  • 명시 태그가 없으면 RuleID 기반 mapping table과 aws- prefix rule을 적용합니다.
  • 매핑되지 않는 룰은 기존 default인 HIGH / MEDIUM으로 fallback합니다.
  • report path normalization과 invalid path guard도 mapper 책임 안에서 보강했습니다.
  • tests/test_gitleaks_mapper.pytests/test_dynamic_mapping_e2e.py에 public-safe synthetic fixture 기반 검증을 추가했습니다.

Note

리뷰 시 특히 아래를 봐주세요.

  • Tags override → RuleID mapping → default fallback 우선순위가 의도와 맞는지
  • path normalization이 repo root escape를 막으면서 기존 relative path 동작을 깨지 않는지
  • synthetic test fixture가 public repo policy를 지키는지

검증:

  • uv run pytest398 passed
  • git diff --check → clean

Dependency

Checklist

  • 이 PR에 포함된 Commit에는 Secret Value가 포함되지 않았음을 확인했습니다.

Comment thread src/security_scanner/scanners/gitleaks/mapper.py Fixed
Comment thread src/security_scanner/scanners/gitleaks/mapper.py Fixed
Comment thread src/security_scanner/scanners/gitleaks/mapper.py Fixed
Comment thread tests/test_dynamic_mapping_e2e.py Fixed
Comment thread tests/test_dynamic_mapping_e2e.py Fixed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces dynamic severity and confidence mapping for Gitleaks findings based on tags and rule IDs, improves path normalization to prevent repository root escapes, and adds comprehensive E2E and unit tests. The review feedback suggests optimizing performance by defining valid severities and confidences as module-level constants, and fixing a path normalization issue where the computed relative path was ignored in favor of the unnormalized path.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/security_scanner/scanners/gitleaks/mapper.py
Comment thread src/security_scanner/scanners/gitleaks/mapper.py Outdated
Comment thread src/security_scanner/scanners/gitleaks/mapper.py
Comment thread src/security_scanner/scanners/gitleaks/mapper.py Outdated
Resolves #1.

Co-Authored-By: Gemini 3.1 Pro (High) <noreply@google.com>

Co-Authored-By: Codex GPT-5 <noreply@openai.com>
@pureliture pureliture force-pushed the codex/issue-1-gitleaks-severity-mapping branch from bbe9b17 to f2b4e46 Compare June 12, 2026 05:20
@pureliture pureliture merged commit 0144fc3 into main Jun 12, 2026
2 checks passed
@pureliture pureliture deleted the codex/issue-1-gitleaks-severity-mapping branch June 12, 2026 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gitleaks 룰 메타데이터를 Finding severity/confidence에 매핑

2 participants