고성능 비밀 정보 스캐너. CLI, Go 라이브러리, Burp Suite 확장 기능 및 Chrome 확장 프로그램. 실시간 자격 증명 검증이 포함된 487개의 탐지 규칙.
<img width="1200" height="628" alt="Titus - 소스 코드, git 이력 및 바이너리 파일을 위한 고성능 시크릿 스캐너" src="https://assets.kitploit.com/production/public/readmes/11969/d2f6b99d686a073185db1b7299fa5f033067b057000062cf592a4ae15a796034.png" />
# Titus: 고성능 시크릿 스캐너
[](https://go.dev)
[](LICENSE)
[](https://github.com/praetorian-inc/titus/actions)
**Titus**는 소스 코드, 파일, git 이력에서 자격 증명, API 키, 토큰을 탐지하는 고성능 시크릿 스캐너입니다. 수백 개의 서비스와 자격 증명 유형을 아우르는 487개의 탐지 규칙이 포함되어 있으며, 이 규칙들은 [NoseyParker](https://github.com/praetorian-inc/noseyparker)와 [Kingfisher](https://github.com/mongodb/kingfisher)에서 가져왔습니다. Titus는 CLI, Go 라이브러리, Burp Suite 확장, Chrome 브라우저 확장으로 실행되며, 모두 동일한 탐지 엔진과 규칙 세트를 공유합니다.
보안 엔지니어, 침투 테스터, DevSecOps 팀을 위해 설계된 Titus는 [Hyperscan](https://github.com/intel/hyperscan)/[Vectorscan](https://github.com/VectorCamp/vectorscan) 가속 정규식 매칭과 실시간 자격 증명 검증을 결합하여 전체 코드베이스에서 유출된 시크릿을 찾아내고 검증합니다.
## 목차
- [Titus를 선택하는 이유](#why-titus)
- [설치](#installation)
- [빠른 시작](#quick-start)
- [스캔 옵션](#scanning-options)
- [발견 항목 점수 산정](#finding-scoring)
- [Go 라이브러리](#go-library-for-secrets-detection)
- [Burp Suite 확장](#burp-suite-extension-for-secret-scanning)
- [브라우저 확장](#chrome-browser-extension-for-secret-scanning)
- [소스에서 빌드하기](#building-from-source)
- [기여하기](#contributing)
- [라이선스](#license)
## Titus를 선택하는 이유
- **빠른 시크릿 스캔**: 사용 가능한 경우 [Hyperscan](https://github.com/intel/hyperscan)/[Vectorscan](https://github.com/VectorCamp/vectorscan)으로 가속되는 정규식 매칭을 제공하며, 모든 플랫폼에서의 이식성을 위해 순수 Go 폴백을 제공합니다.
- **폭넓은 자격 증명 탐지 범위**: 487개의 규칙이 AWS, GCP, Azure, GitHub, Slack, 데이터베이스, CI/CD 시스템 및 수백 개 이상의 서비스에 대한 API 키, 토큰, 자격 증명을 탐지합니다.
- **실시간 시크릿 검증**: 탐지된 시크릿을 원본 API에 대조하여 활성 상태인지 확인함으로써 오탐을 줄이고 교정 작업의 우선순위를 정합니다.
- **위험 기반 심각도 점수 산정**: 모든 발견 항목은 숫자 점수(0–100)와 심각도 등급(info → critical)을 받습니다. 점수는 정적 규칙 메타데이터, 코드 접근성 컨텍스트, 그리고 자격 증명의 실제 영향 범위를 측정하는 실시간 API 호출에 의해 조정되므로, 가장 위험한 발견 항목이 항상 먼저 드러납니다.
- **컨테이너 이미지 스캔**: Docker 데몬이나 바이너리 없이도 모든 레지스트리, tarball, OCI 레이아웃 디렉터리에서 Docker 및 OCI 이미지를 직접 스캔합니다.
- **모든 워크플로를 위한 다양한 인터페이스**: CLI에서 스캔하거나, Go 라이브러리로 임베드하거나, Burp Suite에서 HTTP 트래픽을 수동적으로 스캔하거나, 애플리케이션 보안 테스트 중에 Chrome에서 웹 페이지를 스캔할 수 있습니다.
- **바이너리 파일 추출**: Office 문서, PDF, 아카이브(zip, tar, 7z), 모바일 앱(APK, IPA), 브라우저 확장 등에서 시크릿을 추출하고 스캔합니다.
## 설치
[Releases](../../releases) 페이지에서 미리 빌드된 바이너리를 다운로드하거나, 소스에서 빌드하세요:
```bash
make build
```
바이너리는 `dist/titus`에 위치합니다.
## 빠른 시작
```bash
# Scan a file for secrets
titus scan path/to/file.txt
# Scan a directory for leaked credentials
titus scan path/to/directory
# Scan a public GitHub repository (no token needed)
titus scan github.com/org/repo
# Scan a public GitLab project (no token needed)
titus scan gitlab.com/namespace/project
# Scan git history for secrets in past commits
titus scan --git path/to/repo
# Scan a Docker / OCI image (pulled from a registry — no docker daemon required)
titus scan --docker alpine:latest
# Validate detected secrets against source APIs
titus scan path/to/code --validate
```
결과는 데이터스토어(기본값 `titus.ds`)에 기록되고 콘솔에 출력됩니다.
### 하위 명령어
<!-- BEGIN generated: cli-subcommands -->
Titus는 기능을 다음과 같은 집중된 하위 명령어로 구성합니다:
```bash
titus analyze # Analyze a credential on demand — detect type, validate, score, and enumerate resources
titus enum # Enumerate remote services for secrets
titus explore # Interactively explore scan results
titus report # Generate a report from scan results
titus rules # Manage detection rules
titus scan # Scan a target for secrets
titus serve # Run as streaming server for Burp extension integration
titus version # Show version information
```
<!-- END generated: cli-subcommands -->
모든 하위 명령은 자체 플래그에 대해 `--help`를 받습니다. `titus enum <provider>` 이전에 존재했던 최상위 `titus <provider>` 형식은 여전히 작동하지만, 별칭이 아니라 숨겨지고 더 이상 권장되지 않는(deprecated) 형식이므로 여기 대신 생성된 참조 문서에 나열됩니다.
<!-- BEGIN generated: cli-aliases -->
`--help`에서 숨겨진 항목을 포함한 모든 하위 명령, 별칭 및 플래그에 대한 전체 참조는 [docs/CLI.md](https://github.com/praetorian-inc/titus/blob/main/docs/CLI.md)에 생성됩니다.
<!-- END generated: cli-aliases -->
## 스캔 옵션
### GitHub 및 GitLab 스캔
API 토큰 없이 URL로 공개 저장소를 직접 스캔하세요:
```bash
# Scan a GitHub repository
titus scan github.com/kubernetes/kubernetes
# Scan a GitLab project
titus scan gitlab.com/gitlab-org/cli
# Full URLs work too
titus scan https://github.com/org/repo
titus scan https://gitlab.com/namespace/project.git
```
조직 전체 또는 사용자 전체 스캔에는 전용 하위 명령을 사용하십시오:
```bash
# Scan all public repos in a GitHub org
titus github --org kubernetes
# Scan all repos in a GitHub org with a token (private repos + higher rate limits)
titus github --org kubernetes --token $GITHUB_TOKEN
# Scan all repos for a GitHub user
titus github --user octocat
# Scan all projects in a GitLab group
titus gitlab scan --group mygroup --token $GITLAB_TOKEN
# Scan a single repo with git history (finds deleted secrets)
titus github scan owner/repo --git
```
토큰은 공개 저장소의 경우 선택 사항입니다. 비공개 저장소 접근과 더 높은 API 속도 제한을 위해 `GITHUB_TOKEN` 또는 `GITLAB_TOKEN`을 설정하세요(또는 `--token` 사용).
### Docker / OCI 이미지 스캔
컨테이너 이미지를 직접 스캔합니다 — docker 데몬도, `docker` 바이너리도 필요하지 않습니다. Titus는 HTTPS를 통해 모든 OCI 레지스트리에서 이미지를 바로 가져오거나(`~/.docker/config.json`의 자격 증명 사용), 로컬 `docker save` tarball 또는 OCI 이미지 레이아웃 디렉터리에서 이미지를 읽습니다. 그런 다음 이미지 매니페스트/구성 메타데이터와 모든 레이어의 모든 일반 파일을 스캔하며, 이후 레이어에서 삭제된 하위 레이어 파일도 포함합니다(이미지 기록에서 시크릿이 복구 가능한 상태로 남을 수 있기 때문입니다).
```bash
# Pull from a registry and scan
titus scan --docker alpine:latest
titus scan docker://ghcr.io/owner/repo:tag
# Scan an image saved to a tarball:
# docker save my-app:latest -o my-app.tar
# podman save my-app:latest -o my-app.tar
titus scan --docker ./my-app.tar
# Scan an OCI image layout directory:
# docker buildx build --output type=oci,dest=./img/ .
# skopeo copy docker://my-app:latest oci:./img:latest
titus scan --docker ./img/
```
인증은 기존 Docker / Podman 구성(`~/.docker/config.json`, `${XDG_RUNTIME_DIR}/containers/auth.json`)을 사용합니다. 새로 로그인이 필요한 프라이빗 레지스트리는 먼저 `docker login`(또는 `podman login`, 또는 `crane auth login`)으로 인증해야 합니다. titus는 자격 증명을 묻는 프롬프트를 표시하지 않습니다.
### 스캔 결과 보기
`report`를 사용하여 이전 스캔의 발견 사항을 다시 읽습니다:
```bash
# Human-readable summary of detected secrets
titus report
# JSON output for programmatic processing
titus report --format json
# SARIF output for CI/CD integration with GitHub Advanced Security
titus report --format sarif
# Report from a specific datastore
titus report --datastore path/to/titus.ds
# Only findings from one repository (host-qualified as recorded, or without the host)
titus report --repo github.com/acme/api
# Repeat a selector, or combine selectors; a location matching any value is kept
titus report --namespace github.com/acme --namespace gitlab.example.com/acme --path src/config.yaml
# List the repository, namespace and path values that select current findings
titus report sources
# List every recorded source, including sources with no findings
titus report sources all
```
스캔 시 `--format`을 사용하여 출력 형식을 제어할 수도 있습니다:
```bash
titus scan path/to/code --format json
```
### 탐지된 시크릿 검증
스캔 중 `--validate`를 전달하면 탐지된 시크릿을 해당 소스 API에 대해 검증합니다:
```bash
titus scan path/to/code --validate
```
검증은 동시에 실행되며(기본적으로 4개의 워커, `--validate-workers`로 구성 가능) 각 발견 사항을 확인됨, 부인됨 또는 알 수 없음으로 표시합니다.
### 필터링 탐지 규칙
```bash
# List all available detection rules
titus rules list
# Scan with only specific rules (e.g., AWS and GCP credentials)
titus scan path/to/code --rules-include "aws,gcp"
# Exclude rules by pattern
titus scan path/to/code --rules-exclude "kingfisher.generic"
# Use a custom rules file for organization-specific secrets
titus scan path/to/code --rules path/to/custom-rules.yaml
# Opt in to rules marked noisy: true (high false-positive rate, off by default)
titus scan path/to/code --include-noisy
```
`visible: false`로 표시된 규칙은 클라이언트 ID, 계정 이름 또는 호스트와 같이 다른 규칙에 컨텍스트를 제공하기 위해 캡처하는 헬퍼 규칙이며, 비밀 값 자체는 아닙니다. 해당 패턴은 여전히 실행되지만, 규칙이 명시적으로 선택된 경우에도 CLI나 Go 라이브러리에서 일치 항목이 보고되지 않습니다.
### 바이너리 파일에서 비밀 추출하기
Titus는 바이너리 파일 형식에서 텍스트를 추출하고 그 내용에서 비밀을 스캔할 수 있습니다:
```bash
# Extract and scan all supported binary formats
titus scan path/to/files --extract=all
# Target specific formats
titus scan path/to/files --extract=xlsx,docx,pdf,zip
```
지원되는 형식에는 Office 문서(xlsx, docx, pptx, odp, ods, odt), PDF, Jupyter 노트북, SQLite 데이터베이스, 이메일(eml, rtf), 아카이브(zip, tar, tar.gz, jar, war, ear, apk, ipa, crx, xpi, 7z)가 포함됩니다. 아카이브는 구성 가능한 깊이 및 크기 제한까지 재귀적으로 추출됩니다.
```bash
# Tune extraction limits for large codebases
titus scan path/to/files --extract=all \
--extract-max-size 10MB \
--extract-max-total 100MB \
--extract-max-depth 5
```
SQLite 데이터베이스의 경우, Titus는 모든 테이블에서 텍스트를 추출합니다(기본적으로 테이블당 1000행). 조정하려면 `--sqlite-row-limit`을 사용하세요:
```bash
# Full dump of all SQLite tables (no row limit)
titus scan path/to/files --extract=all --sqlite-row-limit 0
# Custom row limit per table
titus scan path/to/files --extract=all --sqlite-row-limit 5000
```
## 발견 항목 점수 산정
Titus가 생성하는 모든 발견 항목은 0–100 범위의 숫자 점수와 심각도 등급을 함께 가집니다:
| 점수 | 심각도 |
|-------|----------|
| 0–20 | info |
| 21–40 | low |
| 41–60 | medium |
| 61–80 | high |
| 81–100 | critical |
점수는 규칙의 `base_score`에서 시작하며, 자격 증명에 대해 알려진 정보를 바탕으로 점수를 높이거나 낮추는 조건인 **수정자(modifier)** 에 의해 조정됩니다:
```bash
# Score findings using static rule metadata only (no network calls)
titus scan path/to/code
# Score findings AND make live API calls to verify credential blast radius
# (calls AWS STS/IAM and GitHub API for supported credential types)
titus scan path/to/code --score-scope
# Override the accessibility context (default: auto-detected from git remote)
titus scan path/to/code --accessibility public # no penalty for public repos
titus scan path/to/code --accessibility private # -25 penalty (default for local scans)
```
Titus는 AWS 자격 증명, GitHub PAT, Slack 토큰을 위한 YAML 스코어러와 함께 제공되며, `--score-scope`가 활성화된 경우 실시간 IAM 정책 열거(AWS)와 저장소 권한 확인(GitHub 세분화된 PAT)을 수행하는 Go 기반 SDK 스코어러도 제공합니다.
심각도 등급, 수정자 종류, 내장 스코어러 세부 정보, 그리고 자체 YAML 또는 Go 스코어러를 작성하는 방법에 대한 전체 참조는 [docs/scoring.md](https://github.com/praetorian-inc/titus/blob/main/docs/scoring.md)를 참조하세요.
## 시크릿 탐지를 위한 Go 라이브러리
Titus는 자체 도구와 파이프라인에 시크릿 탐지를 추가하기 위해 Go 라이브러리로 임포트할 수 있습니다.
```bash
go get github.com/praetorian-inc/titus
```
```go
package main
import (
"fmt"
"log"
"github.com/praetorian-inc/titus"
)
func main() {
// Initialize the secrets scanner with default rules
scanner, err := titus.NewScanner()
if err != nil {
log.Fatal(err)
}
defer scanner.Close()
// Scan a string for API keys, tokens, and credentials
matches, err := scanner.ScanString(`aws_access_key_id = AKIADEADBEEFDEADBEEF`)
if err != nil {
log.Fatal(err)
}
for _, match := range matches {
fmt.Printf("%s (rule: %s) at line %d\n",
match.RuleName, match.RuleID,
match.Location.SourceSpan.Start.Line,
)
}
}
```
라이브러리는 또한 바이트와 파일 스캔, 탐지된 시크릿 검증, 사용자 정의 규칙 로딩을 지원합니다:
```go
// Scan a file for leaked credentials
matches, err := scanner.ScanFile("/path/to/config.json")
// Enable validation to check if detected secrets are live
scanner, err := titus.NewScanner(titus.WithValidation())
// Load custom detection rules for organization-specific secrets
rules, err := titus.LoadRulesFromFile("/path/to/rules.yaml")
scanner, err := titus.NewScanner(titus.WithRules(rules))
```
전체 API 레퍼런스, 동시성 패턴 및 더 많은 예제는 [docs/library-usage.md](https://github.com/praetorian-inc/titus/blob/main/docs/library-usage.md)를 참조하세요.
## 시크릿 스캐닝을 위한 Burp Suite 확장
Burp 확장은 프록시 트래픽 및 능동 침투 테스트 중에 HTTP 응답에서 시크릿을 스캔합니다.
### 설정
#### Linux / macOS (소스에서 빌드)
```bash
# Build the CLI and Burp extension JAR, install CLI to ~/.titus/
make install-burp
```
그런 다음 Burp Suite의 Extensions > Add에서 `dist/titus-burp-1.0.0-all.jar`를 로드합니다.
#### Windows (Releases에서 다운로드)
1. [Releases](../../releases)에서 `titus-windows-amd64.exe`와 `titus-burp-<version>.jar`를 다운로드합니다
2. Titus 디렉터리를 생성하고 바이너리를 설치합니다:
```powershell
mkdir %USERPROFILE%\.titus
copy titus-windows-amd64.exe %USERPROFILE%\.titus\titus.exe
```
3. Burp Suite에서 Extensions > Add로 이동하여 JAR을 로드합니다
#### Linux / macOS (Releases에서 다운로드)
1. 플랫폼에 맞는 바이너리와 `titus-burp-<version>.jar`를 [Releases](../../releases)에서 다운로드합니다:
- Linux의 경우 `titus-linux-amd64` 또는 `titus-linux-arm64`
- macOS의 경우 `titus-darwin-amd64` 또는 `titus-darwin-arm64`
2. 바이너리를 설치합니다:
```bash
mkdir -p ~/.titus
cp titus-<platform> ~/.titus/titus
chmod +x ~/.titus/titus
```
3. Burp Suite의 Extensions > Add에서 JAR을 로드합니다
이 확장은 백그라운드에서 `titus serve` 프로세스를 실행하고 NDJSON을 사용하여 stdin/stdout으로 통신합니다. 탐지 규칙은 시작 시 한 번 로드됩니다.
### Burp 확장 기능
- **수동 시크릿 스캔**: Burp를 통해 흐르는 프록시 트래픽을 자동으로 스캔합니다
- **능동 시크릿 스캔**: 마우스 오른쪽 버튼 컨텍스트 메뉴로 선택한 요청을 스캔합니다
- **중복 제거**: 동일한 시크릿은 참여(engagement)당 한 번만 보고됩니다
- **고속 경로 필터링**: 바이너리 콘텐츠, 이미지, 비텍스트 응답은 건너뜁니다
- **실시간 자격 증명 검증**: 탐지된 시크릿을 소스 API에 대조하여 활성 상태인지 확인합니다
- **오탐 관리**: 발견 항목을 오탐으로 표시하여 노이즈를 필터링합니다
- **심각도 분류**: 발견 항목은 위험도(높음/중간/낮음)에 따라 색상으로 구분됩니다
- **내보내기**: 발견 항목을 보고용으로 JSON에 저장합니다
### Burp 확장 인터페이스
이 확장은 Burp에 **Titus** 탭을 추가하며, 세 개의 하위 탭이 있습니다:
**Secrets**: 유형, 호스트, 검증 상태별 필터링이 가능한 모든 탐지된 시크릿입니다.
Titus Burp Suite extension secrets tab showing detected API keys and credentials with validation status
- **검증 상태**: 시크릿이 확인되었는지 여부를 표시합니다(Active/Inactive/Unknown)
- **필터링**: Type, Host, Status 버튼을 클릭하여 특정 값으로 필터링하고, 검색 상자를 사용하여 텍스트 및 정규식 매칭을 수행합니다
- **일괄 작업**: 여러 행을 선택하여 일괄로 검증하거나 오탐으로 표시합니다
- **Secret Details 패널**: 발견 항목을 선택하여 다음을 확인합니다:
- **Details**: 규칙 정보, 카테고리, 전체 시크릿 값, 최초 발견 타임스탬프
- **URLs**: 이 시크릿이 발견된 모든 위치
- **Validation**: 세부 정보가 포함된 검증 결과(예: AWS 계정 ID, ARN)
- **Request/Response**: 시크릿이 강조 표시된 전체 HTTP 트래픽
**Statistics**: 유형 및 호스트별로 그룹화된 시크릿의 집계 보기입니다.
<img width="1964" height="848" alt="Titus Burp Suite extension statistics tab showing secrets by type and host" src="https://assets.kitploit.com/production/public/readmes/11969/4a3d6f997049bb8bba621ceb8511b9a41c63867a5c1e8add6065c483706ac36a.png" />
- **요약**: 총 고유 시크릿 수, 스캔된 호스트, 검증 분석(활성 대 비활성), 오탐 수
- **유형별 시크릿**: 카테고리 분류와 함께 각 시크릿 유형의 개수
- **호스트별 시크릿**: 호스트당 발견된 시크릿 수
**Settings**: 스캔 옵션, 검증, 심각도 매핑을 구성합니다.
Titus Burp Suite extension settings tab with scan configuration options
- **스캔 설정**:
- *수동 스캔*: 모든 프록시 트래픽을 자동으로 스캔합니다(기본적으로 활성화됨)
- *요청 본문 스캔*: 애플리케이션이 전송하는 요청 본문에서도 시크릿을 스캔합니다
- *검증*: 시크릿을 소스 API에 대조하여 확인합니다(외부 요청을 발생시키며 경고를 트리거할 수 있음)
- **스캔 매개변수**: 작업자 스레드, 최대 파일 크기, 컨텍스트 스니펫 길이
- **심각도 구성**: 시크릿 카테고리별로 심각도 수준을 사용자 지정합니다
- **작업**: 캐시 지우기, 설정 초기화, 발견 항목을 JSON으로 저장/내보내기
Burp에서 요청을 볼 때 시크릿이 탐지되면 응답 검사기에 **Titus** 탭이 나타나, 메인 Titus 탭으로 전환하지 않고도 발견 항목에 빠르게 접근할 수 있습니다.
Titus tab in Burp Suite response inspector highlighting detected secrets in HTTP responses
## 시크릿 스캔을 위한 Chrome 브라우저 확장
Chrome 확장은 웹 애플리케이션 보안 평가 중에 웹 페이지에서 시크릿을 스캔합니다.
### 설정
```bash
make build-extension
```
1. `chrome://extensions/`로 이동합니다
2. **개발자 모드**를 활성화합니다
3. **압축해제된 확장 프로그램을 로드합니다**를 클릭하고 `extension/` 디렉터리를 선택합니다
### 브라우저 확장 프로그램 기능
- 인라인 및 외부 JavaScript와 스타일시트에서 API 키와 토큰을 스캔합니다
- localStorage와 sessionStorage에서 유출된 자격 증명을 스캔합니다
- 포괄적인 시크릿 탐지를 위한 선택적 네트워크 응답 캡처
- 결과는 팝업과 대시보드에 표시됩니다
<img width="1719" height="958" alt="웹 페이지에서 탐지된 시크릿을 보여주는 Titus Chrome 확장 프로그램 팝업" src="https://assets.kitploit.com/production/public/readmes/11969/057a24e2746412ceabe1aac0292a2de463de1efee5bca2489ca34b59d8b0dc2c.png" />
<img width="1744" height="827" alt="집계된 시크릿 탐지 결과를 보여주는 Titus Chrome 확장 프로그램 대시보드" src="https://assets.kitploit.com/production/public/readmes/11969/265d972fadcc7f212944d7a1d8fd58a43446e7199d1209900e83b96a546ffb00.png" />
### 보안 공지
브라우저 확장 프로그램은 외부 리소스를 스캔하기 위해 방문한 페이지에서 Content Security Policy 및 CORS 헤더를 제거합니다. 이는 확장 프로그램이 활성화된 동안 방문하는 사이트의 보안 상태를 약화시킵니다. **활성 보안 테스트 중에만 활성화하십시오.**
## 소스에서 빌드하기
### 표준 빌드 (Vectorscan 가속)
기본적으로 Titus는 SIMD 가속 정규식 매칭을 위해 [Vectorscan](https://github.com/VectorCamp/vectorscan)(ARM) / [Hyperscan](https://github.com/intel/hyperscan)(x86)과 함께 컴파일됩니다. 이를 위해서는 CGO, C 라이브러리, 그리고 `pkg-config`(cgo가 라이브러리를 찾는 데 사용)가 필요합니다. `make build`는 이를 확인하고 Homebrew / apt / dnf를 통해 누락된 항목을 설치하려고 시도합니다:
```bash
# Build the CLI binary with vectorscan acceleration (outputs to dist/titus)
make build
# Build the Burp Suite extension JAR
make build-burp
# Build the Chrome browser extension
make build-extension
# Run unit tests
make test
# Run integration tests
make integration-test
```
시작 시 `[vectorscan] N/N rules compiled for Hyperscan`가 표시되면 가속 엔진이 활성화된 것입니다.
자동 설치에 의존하지 않고 C 라이브러리를 직접 설치하려면:
```bash
# macOS (Homebrew)
brew install pkg-config vectorscan
# Ubuntu/Debian
sudo apt-get install pkg-config libhyperscan-dev
# Fedora/RHEL
sudo dnf install pkgconf-pkg-config vectorscan-devel
# Or build vectorscan from source:
git clone --depth 1 --branch vectorscan/5.4.11 https://github.com/VectorCamp/vectorscan.git
cd vectorscan && cmake -B build -DCMAKE_INSTALL_PREFIX=/usr/local && cmake --build build && sudo cmake --install build
```
`go build`를 직접 호출하는 경우(예: Titus 임베드 시) 태그를 전달하고 CGO를 활성화하세요:
```bash
# macOS (Homebrew) — adjust PKG_CONFIG_PATH to your installed version
CGO_ENABLED=1 PKG_CONFIG_PATH="$(brew --prefix vectorscan)/lib/pkgconfig" \
go build -tags vectorscan -o dist/titus ./cmd/titus
# Linux (system-installed)
CGO_ENABLED=1 go build -tags vectorscan -o dist/titus ./cmd/titus
```
### 순수 Go 빌드 (C 의존성 없음)
C 라이브러리를 설치할 수 없거나 완전히 이식 가능한 정적 바이너리를 원한다면, 대신 순수 Go 엔진으로 빌드하세요. Titus는 vectorscan이 컴파일되어 있지 않을 때마다 런타임에 자동으로 이 엔진으로 폴백합니다:
```bash
# Portable pure-Go binary (no CGO, no vectorscan)
make build-pure
# Fully static binary
make build-static
```
#### 자동 Hyperscan 데이터베이스 캐시
Titus는 성공적으로 컴파일된 각 Hyperscan 데이터베이스를 표준 사용자 캐시에 자동으로 직렬화합니다. 이후에 동일한 순서의 규칙과 플래그를 가진 스캐너 인스턴스는 해당 데이터베이스를 다시 컴파일하지 않고 로드합니다. 캐시 파일은 Hyperscan의 `hs_serialize_database`가 생성한 수정되지 않은 바이트 스트림이며, Titus는 `hs_deserialize_database`로 이를 로드합니다.
`TITUS_CACHE_DIR`로 캐시 위치를 재정의할 수 있습니다. 캐시 쓰기는 원자적이며 최선 노력 방식으로 수행됩니다. 캐시를 사용할 수 없거나 읽기 전용이더라도 스캔은 차단되지 않습니다. 데이터베이스가 없거나, 손상되었거나, 호환되지 않거나, 지문이 다른 경우에는 정상 컴파일이 트리거되고 가능한 경우 캐시가 갱신됩니다.
직렬화된 데이터베이스는 아키텍처, CPU 기능, Hyperscan 버전에 따라 달라집니다. Titus는 역직렬화 중에 호환되지 않는 항목을 감지하고 현재 런타임용으로 컴파일된 데이터베이스로 교체합니다.
## 기여
기여를 환영합니다! Titus에 기여하는 방법에 대한 지침은 [CONTRIBUTING.md](https://github.com/praetorian-inc/titus/blob/main/CONTRIBUTING.md)를 참조하세요.
## 라이선스
Apache License 2.0 — [LICENSE](https://github.com/praetorian-inc/titus/blob/main/LICENSE)를 참조하세요.
탐지 규칙은 [NoseyParker](https://github.com/praetorian-inc/noseyparker)(Praetorian Security, Inc.)와 [Kingfisher](https://github.com/mongodb/kingfisher)(MongoDB, Inc.)에서 파생되었으며, 두 프로젝트 모두 Apache 2.0에 따라 라이선스가 부여됩니다. 전체 출처 표시는 [NOTICE](https://github.com/praetorian-inc/titus/blob/main/NOTICE)를 참조하세요.