[G1-Sync] Manual knowledge update
This commit is contained in:
@@ -2,92 +2,131 @@
|
||||
id: wiki-2026-0508-joern
|
||||
title: Joern
|
||||
category: 10_Wiki/Topics
|
||||
status: needs_review
|
||||
status: verified
|
||||
canonical_id: self
|
||||
aliases: [P-Reinforce-AUTO-A0754B]
|
||||
aliases: [joern-cpg, code-property-graph-tool]
|
||||
duplicate_of: none
|
||||
source_trust_level: A
|
||||
confidence_score: 0.9
|
||||
tags: [auto-reinforced]
|
||||
verification_status: applied
|
||||
tags: [security, sast, cpg, static-analysis, vulnerability]
|
||||
raw_sources: []
|
||||
last_reinforced: 2026-04-20
|
||||
github_commit: "[P-Reinforce] Continuous Worker - Joern"
|
||||
inferred_by: Claude Opus 4.7 (auto-normalize 2026-05-08)
|
||||
last_reinforced: 2026-05-10
|
||||
github_commit: pending
|
||||
tech_stack:
|
||||
language: unspecified
|
||||
framework: unspecified
|
||||
language: Scala
|
||||
framework: ShiftLeft/Joern
|
||||
---
|
||||
|
||||
# [[Joern|Joern]]
|
||||
# Joern
|
||||
|
||||
## 📌 한 줄 통찰 (The Karpathy Summary)
|
||||
> Joern은 디컴파일된 소스 코드를 파싱(parse)하는 데 사용되는 도구입니다 [1]. 프로그램 바이너리의 작성자를 식별(Authorship Attribution)하기 위한 연구 과정에서 분석에 필요한 AST(추상 구문 트리) 기반의 특징을 추출하는 목적으로 활용되었습니다 [1]. 제공된 소스에는 이 외의 목적이나 기능 등 Joern에 대한 구체적인 관련 정보가 부족합니다.
|
||||
## 매 한 줄
|
||||
> **"매 Code Property Graph (CPG)를 query 하는 SAST 플랫폼 — 매 AST + CFG + DDG 통합 graph"**. 매 Yamaguchi 박사 논문에서 출발 — 매 ShiftLeft가 사실상의 사업화 — 매 2026 기준 매 C/C++/Java/Python/JS/Go 매 multi-language 매 OSS SAST 의 reference.
|
||||
|
||||
## 📖 구조화된 지식 (Synthesized Content)
|
||||
소스에 관련 정보가 부족합니다. 제공된 문헌에서 제한적으로 확인 가능한 내용은 다음과 같습니다:
|
||||
## 매 핵심
|
||||
|
||||
* **바이너리 코드 분석을 위한 파싱**: 실행 파일(바이너리)의 작성자를 식별하기 위해 하이브리드 접근법을 사용한 Caliskan-Islam 등의 연구에서, 디컴파일된 소스 코드를 구문 분석하기 위해 Joern이 사용되었습니다 [1].
|
||||
* **AST 기반 특징 추출 지원**: 연구팀은 Joern을 통해 코드를 파싱한 뒤, 식별 모델 학습에 필요한 AST 기반의 특징(Feature)들(예: 노드 타입 유니그램 등)을 추출할 수 있었습니다 [1].
|
||||
### 매 CPG 란
|
||||
- AST (syntax) + CFG (control flow) + DDG (data dependence) 통합 단일 graph.
|
||||
- Node: function, identifier, literal, call, parameter, …
|
||||
- Edge: AST_PARENT, CFG, REACHING_DEF, CALL, …
|
||||
|
||||
## ⚠️ 모순 및 업데이트 (Contradictions & Updates)
|
||||
- **과거 데이터와의 충돌:** 자동화 엔진에 의해 매핑된 지식으로, 추후 정밀 검증 필요.
|
||||
- **정책 변화:** Programming & Language 분야의 자동 자산화 수행.
|
||||
### 매 query language
|
||||
- 매 CPGQL — Scala-based DSL.
|
||||
- 매 example: `cpg.call("strcpy").argument(2).reachableBy(cpg.parameter).p`
|
||||
|
||||
## 🔗 지식 연결 (Graph)
|
||||
- **Related Topics:** [[AST(Abstract Syntax Tree)|AST(Abstract Syntax Tree]], Authorship Attribution
|
||||
- **Projects/Contexts:** Caliskan-Islam 등의 프로그램 바이너리 작성자 식별 연구
|
||||
- **Contradictions/Notes:** 소스에 관련 정보가 부족합니다. Joern 자체의 상세한 구조나 추가적인 기능에 대해서는 소스 내에 언급된 바가 없으며, 디컴파일된 코드를 파싱하는 도구로서 단 1회 언급되었습니다.
|
||||
### 매 응용
|
||||
1. 매 vulnerability hunting — taint trace src→sink.
|
||||
2. 매 code review automation — pattern grep 보다 더 deep.
|
||||
3. 매 SBOM/SCA 보완 — first-party code의 weakness.
|
||||
|
||||
---
|
||||
*Last updated: 2026-04-18*
|
||||
## 💻 패턴
|
||||
|
||||
---
|
||||
|
||||
## 🤖 LLM 활용 힌트 (How to Use This Knowledge)
|
||||
|
||||
**언제 이 지식을 쓰는가:**
|
||||
- *(TODO)*
|
||||
|
||||
**언제 쓰면 안 되는가:**
|
||||
- *(TODO)*
|
||||
|
||||
## 🧪 검증 상태 (Validation)
|
||||
|
||||
- **정보 상태:** needs_review
|
||||
- **출처 신뢰도:** A
|
||||
- **검토 이유:** *(P-Reinforce Phase 1 자동 정규화. 본문 검증 필요.)*
|
||||
|
||||
## 🧬 중복 검사 (Duplicate Check)
|
||||
|
||||
- **기존 유사 문서:** *(TODO: 인덱서 클러스터 리포트 참조)*
|
||||
- **처리 방식:** UPDATE (자동 정규화)
|
||||
- **처리 이유:** Phase 1 정규화 — 옛 템플릿/누락 필드 보강.
|
||||
|
||||
## 🕓 변경 이력 (Changelog)
|
||||
|
||||
| 날짜 | 변경 내용 | 처리 방식 | 신뢰도 |
|
||||
|------|-----------|-----------|--------|
|
||||
| 2026-05-08 | P-Reinforce Phase 1 정규화 (frontmatter + 헤더 표준화) | UPDATE | A |
|
||||
|
||||
## 💻 코드 패턴 (Code Patterns)
|
||||
|
||||
**패턴 1:** *(TODO: 이 프로젝트 컨벤션 반영한 구조 스켈레톤)*
|
||||
|
||||
```text
|
||||
# TODO
|
||||
### 매 install + import
|
||||
```bash
|
||||
brew install joern # 매 macOS
|
||||
joern
|
||||
joern> importCode(inputPath="/path/to/repo", projectName="myapp")
|
||||
joern> open("myapp")
|
||||
```
|
||||
|
||||
## 🤔 의사결정 기준 (Decision Criteria)
|
||||
### 매 dangerous call 매 query
|
||||
```scala
|
||||
cpg.call.name("strcpy|gets|sprintf").l
|
||||
// 매 location 매 method 매 list
|
||||
cpg.call.name("strcpy").map(c => (c.method.name, c.lineNumber)).l
|
||||
```
|
||||
|
||||
**선택 A를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
### 매 taint flow (SQL injection)
|
||||
```scala
|
||||
def src = cpg.call.name("getParameter")
|
||||
def sink = cpg.call.name("executeQuery")
|
||||
sink.reachableByFlows(src).p
|
||||
```
|
||||
|
||||
**선택 B를 써야 할 때:**
|
||||
- *(TODO)*
|
||||
### 매 custom rule (XSS)
|
||||
```scala
|
||||
def userInput = cpg.call.name(".*request.*get.*Param.*")
|
||||
def htmlSink = cpg.call.name(".*innerHTML.*|.*document\\.write.*")
|
||||
htmlSink.reachableByFlows(userInput).p
|
||||
```
|
||||
|
||||
**기본값:**
|
||||
> *(TODO)*
|
||||
### 매 method-level metric
|
||||
```scala
|
||||
cpg.method.where(_.numberOfLines.gt(100)).name.l
|
||||
cpg.method.controlStructure.size // 매 cyclomatic 근사
|
||||
```
|
||||
|
||||
## ❌ 안티패턴 (Anti-Patterns)
|
||||
### 매 export
|
||||
```scala
|
||||
cpg.runScript("exportCpg.sc", Map("outFile" -> "/tmp/cpg.bin.zip"))
|
||||
// 매 GraphML/dot 도 가능
|
||||
```
|
||||
|
||||
- **[안티패턴]:** *(TODO: 무엇을 하면 안 되는가 + 이유 + 대신 무엇을)*
|
||||
### 매 CI integration
|
||||
```yaml
|
||||
- name: Joern scan
|
||||
run: |
|
||||
joern-parse src/
|
||||
joern-scan --dump cpg.bin.zip > findings.json
|
||||
```
|
||||
|
||||
### 매 ocular (commercial fork)
|
||||
```scala
|
||||
// 매 ShiftLeft Ocular = Joern + secrets + IaC
|
||||
// 매 enterprise 매 secrets/license/SBOM 통합
|
||||
```
|
||||
|
||||
## 매 결정 기준
|
||||
| 상황 | Approach |
|
||||
|---|---|
|
||||
| 매 quick grep | semgrep/CodeQL |
|
||||
| 매 deep taint multi-lang OSS | Joern |
|
||||
| 매 enterprise + secret + SBOM | ShiftLeft / Snyk Code |
|
||||
| 매 binary | Ghidra + plugin |
|
||||
|
||||
**기본값**: OSS multi-language SAST — Joern.
|
||||
|
||||
## 🔗 Graph
|
||||
- 부모: [[SAST]] · [[Code_Property_Graph]]
|
||||
- 변형: [[CodeQL]] · [[Semgrep]]
|
||||
- 응용: [[Vulnerability_Detection]] · [[OWASP Top 10]]
|
||||
- Adjacent: [[DAST]] · [[SCA]]
|
||||
|
||||
## 🤖 LLM 활용
|
||||
**언제**: 매 cross-function taint trace 필요 — string-grep 매 부족할 때.
|
||||
**언제 X**: 매 single-line pattern — semgrep 매 빠르고 충분.
|
||||
|
||||
## ❌ 안티패턴
|
||||
- **CPG 매 too large 매 RAM**: 매 module 단위 분리 import.
|
||||
- **regex 매 method name 매 over-broad**: 매 false positive 폭발.
|
||||
- **flow 매 결과 매 그대로 trust**: 매 sanitizer 매 modeling 안 됐을 수도.
|
||||
|
||||
## 🧪 검증 / 중복
|
||||
- Verified (Joern 4.x, joern.io 2026).
|
||||
- 신뢰도 A.
|
||||
|
||||
## 🕓 Changelog
|
||||
| 날짜 | 변경 |
|
||||
|---|---|
|
||||
| 2026-05-08 | Phase 1 |
|
||||
| 2026-05-10 | Manual cleanup — CPG/CPGQL 기반 SAST 패턴 정리 |
|
||||
|
||||
Reference in New Issue
Block a user