코드 감사 및 보고서 생성
IBM Bob을 사용하여 재사용 가능한 보안 감사 스킬을 생성하고, OWASP ASVS 요구사항에 대해 애플리케이션을 스캔하며, 개발자와 AI 에이전트가 조치할 수 있는 SARIF 및 OSCAL 보고서를 생성합니다.
IBM Bob은 기존 워크플로를 강화하는 AI 소프트웨어 개발 수명 주기(SDLC) 파트너입니다. 이 튜토리얼에서는 Bob을 사용하여 다음을 수행합니다.
- 스킬 생성: Bob에게 전문적이고 반복 가능한 워크플로를 가르치는 재사용 가능한 명령 세트 구축
- 작업별 권한 범위 지정: 각 작업에서 Bob이 수행할 수 있는 작업 제어
- 컨텍스트 멘션 사용:
@를 사용하여 Bob이 중요한 부분에 분석을 집중하도록 특정 파일 지정 - 모드 선택: Agent, Ask, Plan 모드 중에서 선택하여 Bob의 추론 스타일 최적화
이러한 Bob 기능을 사용하여 Galaxium Travels 애플리케이션을 OWASP Application Security Verification Standard(ASVS) 요구사항의 하위 집합에 대해 스캔하고 두 가지 구조화된 산출물을 생성합니다.
- SARIF(Static Analysis Results Interchange Format) 파일: IDE, GitHub Advanced Security 및 CI/CD 파이프라인과 호환되는 기계 판독 가능한 발견 사항 보고서
- Open Security Controls Assessment Language(OSCAL) Plan of Action and Milestones(POA&M): AI 에이전트가 체계적으로 수정을 진행하는 데 사용할 수 있는 구조화된 개선 맵
IBM Bob이나 일반적인 AI 지원 워크플로 개념에 익숙하지 않은 경우 IBM Bob 시작 튜토리얼을 검토하세요.
전제 조건
시나리오
Galaxium Travels 애플리케이션은 수년에 걸쳐 성장하여 복잡한 코드베이스가 되었습니다. 전체 수동 보안 검토는 시간이 많이 걸리고 팀 구성원 간에 일관성이 없습니다. 개발자가 즉시 조치할 수 있고 자동화된 개선 파이프라인에 공급할 수 있는 구조화된 출력을 생성하는 반복 가능한 프로세스가 필요합니다.
이 튜토리얼에서는 IBM Bob을 사용하여 OWASP ASVS 검증 요구사항을 기반으로 보안 감사 스킬을 생성하고, Galaxium Travels 코드베이스에 대해 실행하며, SARIF 발견 사항 보고서를 생성하고, Bob이 개선을 추진하는 데 사용할 수 있는 OSCAL Plan of Action and Milestones를 생성합니다.
이 튜토리얼은 ASVS Level 1 액세스 제어(V4), 입력 검증(V5), API 보안(V13) 및 구성(V14) 요구사항에 대해 감사합니다. 이 집중된 범위는 전체 규정 준수 감사를 요구하지 않고 의미 있는 발견 사항을 보여줍니다. 동일한 스킬 패턴은 모든 보안 표준에서 작동합니다. ASVS 제어를 CWE Top 25, 조직의 내부 체크리스트 또는 기타 프레임워크로 교체하세요.
랩 설정
-
Galaxium Travels 리포지토리를 복제합니다.
git clone -b bob-learning-path-branch https://github.com/IBM/galaxium-travels -
File을 클릭한 다음 Open Folder를 클릭합니다.
-
복제한
galaxium-travels디렉토리로 이동하여 엽니다. -
탐색 모음 옆의 Bob 아이콘을 클릭하거나 단축키 Option + Command + B(macOS) 또는 Ctrl + Alt + B(Windows)를 사용하여 Bob 채팅 인터페이스를 엽니다.
-
채팅 입력 필드에서
/init을 실행하여 개발 환경을 초기화하고 Bob용 AGENTS.md 파일을 생성합니다. 메시지가 표시되면 Approve todo tools for task를 클릭합니다.
감사 스킬 생성
스킬을 생성합니다. 이는 Bob이 특정 작업을 수행하는 데 사용하는 재사용 가능한 명령 세트입니다.
다음 스킬은 OWASP ASVS Level 1 요구사항에 대해 Galaxium Travels 코드베이스를 감사합니다.
스킬은 다음 제어를 확인합니다.
| 카테고리 | 제어 | 설명 |
|---|---|---|
| V4.1 일반 액세스 제어 | V4.1.3 | 사용자는 자신의 리소스에만 액세스할 수 있으며 다른 사용자의 데이터에는 액세스할 수 없음 |
| V4.1.5 | 액세스 제어는 기본적으로 거부 — 인증되지 않은 요청은 거부됨 | |
| V4.2 작업 수준 액세스 제어 | V4.2.1 | 예측 가능한 객체 ID를 조작하여 민감한 리소스에 액세스할 수 없으며, 안전하지 않은 직접 객체 참조(IDOR) 공격으로부터 보호됨 |
| V5.1 입력 검증 | V5.1.1 | 모든 문자열 입력에 정의된 최대 길이 제약이 있음 |
| V13.1 일반 웹 서비스 보안 | V13.1.3 | API 엔드포인트는 URL 쿼리 매개변수에서 자격 증명이나 개인 식별 정보(PII)를 허용하지 않음 |
| V14.4 HTTP 보안 헤더 | V14.4.1 | HTTP 응답에 Content-Security-Policy, X-Frame-Options, X-Content-Type-Options와 같은 적절한 보안 헤더가 포함됨 |
| V14.5 HTTP 요청 헤더 검증 | V14.5.3 | CORS 원본이 명시적 허용 목록에 대해 검증됨 — 와일드카드 원본은 허용되지 않음 |
-
채팅 인터페이스 아래에서 Bob - Settings를 클릭한 다음 Bob Settings를 클릭합니다.
-
왼쪽 사이드바에서 Skills를 클릭합니다.
-
+ 버튼을 클릭하여 새 스킬을 생성합니다.
-
Skill Name 필드에
asvs-audit을 입력합니다. 이것은 채팅에서/asvs-audit을 사용하여 스킬을 호출하는 데 사용되는 이름입니다. -
Description 필드에 짧은 설명을 입력합니다.
Audits a codebase against OWASP ASVS Level 1 access control, input validation, API security, and configuration requirements. -
Allow Bob to use this skill 토글이 켜져 있는지 확인합니다.
토글이 켜져 있으면 프롬프트나 계획이 호출할 때 Bob이 자체적으로 스킬을 활성화할 수 있습니다. 이 튜토리얼에서 나중에 생성할 감사 계획이 정확히 그렇게 합니다.
-
Scope & Location을
galaxium-travels로 변경합니다.이렇게 하면 스킬이 프로젝트의
.bob/skills/디렉토리에 저장되므로 이 프로젝트에서만 사용할 수 있으며 팀이 코드베이스와 함께 버전 관리할 수 있습니다. 전역 위치(~/.bob/skills/)를 사용하면 컴퓨터의 모든 프로젝트에서 스킬을 사용할 수 있습니다. -
Skill Instructions 텍스트 상자에 다음 스킬을 입력합니다.
--- name: asvs-audit description: Audit a codebase against OWASP ASVS Level 1 access control, input validation, API security, and configuration requirements and produce structured findings ready for SARIF and OSCAL export. user-invocable: true --- Perform a structured security audit of this codebase. Work through the following phases in order. Do not skip phases or combine them. ## Phase 1: Discover Read and understand the application before auditing. Focus on: - Entry points: main files, route definitions, controllers - Authentication and session handling code - Input validation and sanitization code - Database query code - Any files flagged as high-risk in earlier analysis Summarize what you find before proceeding to Phase 2. ## Phase 2: Audit Check each control below. For each one record: PASS, FAIL, or N/A. For every FAIL, record the file path and line number. ### V4.1 General Access Control - V4.1.3 — Users can only access their own resources; other users' data is not accessible - V4.1.5 — Access control denies by default — unauthenticated requests are rejected ### V4.2 Operation Level Access Control - V4.2.1 — Sensitive resources cannot be accessed by manipulating a predictable object ID (IDOR protection) ### V5.1 Input Validation - V5.1.1 — All string inputs have defined maximum length constraints ### V13.1 Generic Web Service Security - V13.1.3 — API endpoints do not accept credentials or PII in URL query parameters ### V14.4 HTTP Security Headers - V14.4.1 — HTTP responses include appropriate security headers such as Content-Security-Policy, X-Frame-Options, and X-Content-Type-Options ### V14.5 HTTP Request Header Validation - V14.5.3 — CORS origin is validated against an explicit allowlist — wildcard origins are not permitted ## Phase 3: Generate Findings For each FAIL, produce a finding in this format: **Finding [N]:** - Rule: ASVS [control number] - Severity: Critical / High / Medium / Low - File: [path] - Line: [number or range, if identifiable] - Issue: [one sentence describing what was found] - Fix: [one sentence describing the recommended change] ## Phase 4: Summary Produce a short summary: - Total controls checked - Pass / Fail / N/A counts - Two-sentence overall security posture assessment Save the findings to the location specified by the plan or prompt that invoked this skill. Do not generate SARIF, OSCAL, or other report files — report generation is a separate task. Report that the audit is complete and wait for the next instruction.이것은 감사 중에 Bob이 따르는 완전한 명령 세트입니다.
-
Create를 클릭합니다.
감사할 고위험 영역 찾기
토큰을 절약하기 위해 Bob에게 보안과 가장 관련이 있는 파일과 폴더를 식별하도록 요청합니다. 이러한 영역에서 감사 스킬을 실행합니다.
-
채팅 패널이 아직 열려 있지 않으면 Option + Command + B(macOS) 또는 Ctrl + Alt + B(Windows)로 엽니다.
-
모드 선택기에서 Ask를 선택합니다.
각 모드에는 다른 기능과 추론 스타일이 있습니다. Ask 모드는 질문과 분석에 가장 적합하지만 Ask 모드에서는 파일을 작성하거나 편집할 수 없습니다.
-
채팅 입력 필드에 다음 프롬프트를 입력하여 코드베이스를 탐색하고 가장 높은 보안 위험 영역을 찾습니다.
Explore this codebase as a Senior Security Analyst. Give me a short summary covering: 1. The primary tech stack and framework 2. Identify the files and folders most relevant to security Make sure to also review: 1. How authentication and session management are handled 2. How user input is accepted and validated 3. Where database queries are made 4. Any API endpoints that accept external input I want to understand the highest security risk areas before running an audit.Bob은 파일을 읽고 애플리케이션 구조의 요약을 반환합니다.
고위험 영역 감사를 위한 계획 생성
고위험 영역을 감사할 때 Bob이 따를 계획을 생성합니다.
-
Plan 모드로 전환합니다.
-
Bob에게 고위험 영역을 감사하기 위한 계획을 생성하도록 요청합니다. 메시지가 표시되면 Approve todo tools for task를 클릭합니다.
Create a plan for auditing the high-risk areas found in the previous exploration. When auditing, use the asvs-audit skill to guide the process. When the plan runs, create the security/ directory if it does not exist and save the findings to security/audit-findings.md Save the plan to plan/audit-plan.md -
Bob은 감사 범위나 집중할 특정 영역을 명확히 하기 위해 후속 질문을 할 수 있습니다. 답변하거나 Bob에게
use your recommendation이라고 말할 수 있습니다. -
계획 파일을 열어 감사 접근 방식과 Bob이 실행할 때 수행할 작업을 이해합니다.
코드베이스 감사
-
+ 버튼을 클릭하여 새 작업을 시작합니다.
-
채팅 인터페이스에서 Agent 모드인지 확인합니다.
Agent 모드는 파일 쓰기 및 실행을 포함한 전체 기능을 Bob에게 제공합니다. 이는 감사 및 보고서 생성 단계에 필요합니다.
-
채팅 인터페이스에서 Permissions 선택기를 클릭하고 Read, Edit, Execute, Skill 체크박스를 선택합니다. 이 작업에서는 다른 모든 토글을 선택 해제된 상태로 둡니다.
권한 상태 이유 Read ✅ 켜짐 Bob은 코드베이스, 감사 계획 및 스킬을 읽음 Edit ✅ 켜짐 Bob은 발견 사항을 security/audit-findings.md에 작성함Execute ✅ 켜짐 Bob은 경로를 확인하거나 파일 구조를 확인하기 위해 셸 명령을 실행할 수 있음 Skill ✅ 켜짐 감사 계획이 asvs-audit스킬을 호출함MCP ❌ 꺼짐 로컬 코드 분석에 필요하지 않음 -
Bob에게 감사 계획을 구현하도록 요청합니다.
Implement the @plan/audit-plan.md -
security/audit-findings.md에서 발견 사항을 검토합니다.계획은 Bob에게
security/디렉토리가 아직 존재하지 않으면 생성하고 발견 사항을security/audit-findings.md에 저장하도록 지시합니다.발견 사항을 저장하면 새로운 컨텍스트 창을 사용하여 모델로 새 채팅을 시작할 수 있습니다. 전체 코드베이스와 스킬 지침을 다시 읽지 않고도 발견 사항 파일을 Bob에게 지시하여 보고서를 생성할 수 있으므로 보고서 생성을 위한 컨텍스트 창이 보존됩니다.
컨텍스트 창 참고: 모든 모델에는 설정된 컨텍스트 창이 있습니다. 대규모 코드베이스를 감사할 때 모델의 컨텍스트 창을 초과할 수 있습니다. 대규모 코드베이스의 경우 한 번에 하나의 ASVS 카테고리를 감사해 보세요. 먼저 V4를 실행한 다음 V5, V13, V14를 실행하고 마지막에 Bob에게 발견 사항을 통합하도록 요청합니다. 이것은 또한
SKILL.md를 간결하게 유지하고 전체 리포지토리를 한 번에 Bob에게 지시하는 대신 집중된@컨텍스트 멘션을 사용하는 좋은 이유입니다.
보안 보고서 생성
SARIF는 정적 분석 결과의 표준 교환 형식입니다. Bob을 포함한 IDE, GitHub Advanced Security 및 대부분의 CI/CD 파이프라인은 SARIF 파일을 직접 사용할 수 있습니다.
-
+ 버튼을 클릭하여 새 작업을 시작합니다.
-
Agent 모드를 사용하고 있는지 확인합니다.
-
채팅 패널에서 Permissions를 클릭하고 Read, Edit, Execute 체크박스를 선택합니다. 이 작업에서는 다른 모든 토글을 선택 해제된 상태로 둡니다.
권한 상태 이유 Read ✅ 켜짐 Bob은 security/audit-findings.md의 발견 사항을 읽음Edit ✅ 켜짐 Bob은 SARIF 보고서를 security/디렉토리에 작성함Execute ✅ 켜짐 Bob은 경로를 확인하거나 파일 구조를 확인하기 위해 셸 명령을 실행할 수 있음 Skill ❌ 꺼짐 보고서 생성에 필요하지 않음. 스킬은 이미 에이전트가 필요로 하는 발견 사항을 생성함 MCP ❌ 꺼짐 로컬 코드 분석에 필요하지 않음 -
@컨텍스트 멘션을 사용하여 Bob에게 SARIF 보고서를 생성하도록 요청합니다.@security/audit-findings.md Generate a SARIF 2.1.0 report from the audit findings. Save it to `security/audit-results.sarif`. Include: - Tool name: "ASVS Security Audit" - A rule entry for each ASVS control that was checked, with the control ID and description - A result entry for each finding, with severity level, file path, line number, and the fix recommendation in the message fieldBob은 파일을 생성하고
security/audit-results.sarif에 저장합니다. 파일에 발견 사항당 하나의results항목이 있는runs배열이 포함되어 있는지 확인합니다.Bob은 또한 채팅에서 수행한 매핑 결정을 보고합니다.
출력 예:
Severity mapping used: Critical/High → SARIF error; Medium/Low → SARIF warning. The message.text for each result contains the full issue description and the fix recommendation in one field, so tooling that renders SARIF (GitHub Code Scanning, VS Code SARIF Viewer, etc.) will surface the remediation guidance inline. -
Bob에서
security/audit-results.sarif를 열어 발견 사항을 검토합니다. 이 파일을 GitHub Advanced Security 또는 CI/CD 파이프라인과 같은 다른 도구에서 사용하여 감사 발견 사항을 표시할 수 있습니다.
OSCAL 개선 계획(POA&M) 생성
OSCAL POA&M은 각 발견 사항을 위험 정보, 구현 지침 및 마일스톤 할당이 포함된 구조화된 개선 작업에 매핑하는 기계 판독 가능한 JSON 문서입니다. Bob은 이 파일을 작업 대기열로 읽을 수 있습니다. 각 항목을 처리하고 수정 사항을 적용하며 진행에 따라 마일스톤을 완료로 표시합니다.
-
+ 버튼을 클릭하여 새 작업을 시작합니다.
-
채팅 패널에서 모드 메뉴를 클릭하고 Agent를 선택합니다.
-
채팅 패널에서 Permissions를 클릭하고 Read, Edit, Execute 체크박스를 선택합니다. 이 작업에서는 다른 모든 토글을 선택 해제된 상태로 둡니다.
권한 상태 이유 Read ✅ 켜짐 Bob은 security/audit-findings.md의 발견 사항을 읽음Edit ✅ 켜짐 Bob은 OSCAL POA&M을 security/디렉토리에 작성함Execute ✅ 켜짐 Bob은 경로를 확인하거나 파일 구조를 확인하기 위해 셸 명령을 실행할 수 있음 Skill ❌ 꺼짐 보고서 생성에 필요하지 않음. 스킬은 이미 에이전트가 필요로 하는 발견 사항을 생성함 MCP ❌ 꺼짐 로컬 코드 분석에 필요하지 않음 -
@컨텍스트 멘션을 사용하여 Bob에게 OSCAL POA&M 보고서를 생성하도록 요청합니다.@security/audit-findings.md Generate an OSCAL Plan of Action and Milestones (POA&M) from the audit findings. Save it to `security/poam.json`. For each finding include: - A unique UUID - The ASVS control ID as the finding reference - Severity and a one-sentence risk description - A concrete remediation task with enough detail for an AI agent to implement it without additional context — include file path, line reference, and the specific change required - A milestone label based on severity: Critical and High findings get "sprint-1", Medium and Low get "sprint-2" Use OSCAL version 1.1.2 structure.Bob은 파일을 생성하고
security/poam.json에 저장합니다.출력 예:
Each poam-item contains: props — severity, asvs-control, and milestone label risks[] — one risk with a uuid, title, one-sentence risk description, and status: "open" remediations[] — one remediation with a lifecycle: "planned" flag, a title, and a description that is specific enough for an AI agent to implement without additional context (includes exact file paths, line numbers, and the concrete code change required) tasks[] — one or more discrete action tasks under each remediation (e.g. the IDOR finding breaks out the short-term ownership check and the long-term UUID migration as separate tasks)
이제 security/ 디렉토리에 두 가지 산출물이 있습니다.
audit-results.sarif— 개발자 도구 및 CI/CD 통합을 위한 구조화된 발견 사항poam.json— AI 지원 또는 사람 주도 개선을 위한 개선 작업 대기열
발견 사항 검토
POA&M이 생성되면 발견 사항을 검토하고 먼저 수정할 항목의 우선순위를 지정합니다.
-
+ 버튼을 클릭하여 새 작업을 시작합니다.
-
채팅 패널에서 모드 메뉴를 클릭하고 Ask를 선택합니다.
-
@컨텍스트 멘션을 사용하여 Bob에게 POA&M에서 가장 중요한 항목을 강조 표시하도록 요청합니다.@security/poam.json Review this remediation plan and identify the 3 most critical items to fix first. For each one include: - What the vulnerability is and why it is the highest priority - Which file and line to look at - What the fix involves and roughly how long it would take a developer to implementBob은 파일을 읽고 우선순위가 지정된 요약을 반환합니다.
출력 예:
#1 — No Authentication on Any Endpoint (Finding 1 · ASVS V4.1.5 · critical) Why it's the highest priority: This is the foundational flaw that makes every other vulnerability worse. With zero authentication in place, any anonymous caller on the network can execute all booking operations — book flights, read all user records, cancel any booking, register accounts. Until this is fixed, findings 2 and 3 also have no meaningful barrier. ...snip... #3 — PII in URL Query Parameters on GET /user (Finding 5 · ASVS V13.1.3 · high) Why it's third: Email addresses (PII) appearing in GET /user query strings are passively and silently leaked into server access logs, reverse-proxy logs, CDN caches, and browser history — a persistent, silent data breach that can violate GDPR. Unlike findings 2 and 3, this is an architectural leak that accumulates over time; every request compounds the exposure. Sprint-1 Fix Order Summary Priority Finding Severity Effort Dependency 1 Auth on all endpoints (V4.1.5) Critical 2–4 h None — fix first 2 Wildcard CORS (V14.5.3) High 30 min Independent — fix in parallel 3 PII in query string (V13.1.3) High 1–2 h Independent — fix in parallel Findings 2 and 3 are blockers in the ownership-check fixes (Findings 2 and 3 in the POAM) that come afterward, since those require a known caller identity — which only exists once authentication (Finding 1) is in place.또한 Model Context Protocol(MCP) 서버를 감사 워크플로에 통합하고 Bob에게 각 발견 사항에 대한 티켓을 생성하고 관련 코드에 연결하며 POA&M의 개선 지침을 포함하도록 요청할 수도 있습니다.
정리
이 튜토리얼에서 생성한 파일을 제거하려면:
- Bob Settings에서 Skills를 클릭하고
asvs-audit스킬을 삭제합니다. - Set up the lab에서 복제한
galaxium-travels디렉토리를 삭제합니다.
다음 단계
이 튜토리얼에서는 IBM Bob을 사용하여 다음을 수행했습니다.
- Galaxium Travels 코드베이스를 탐색하여 감사 전에 고위험 영역 식별
- 팀이 버전 관리하고 모든 프로젝트에서 실행할 수 있는 재사용 가능한
asvs-audit스킬 생성 - 작업 범위 기능 토글을 사용하여 OWASP ASVS 액세스 제어, 입력 검증, API 보안 및 구성 요구사항에 대해 코드베이스 감사
- 개발자 도구 및 CI/CD 통합을 위한 SARIF 보고서 생성
- AI 에이전트가 개선을 추진하는 데 사용할 수 있는 OSCAL POA&M 생성
- 가장 중요한 3가지 발견 사항을 검토하고 우선순위 지정
actor-critic 워크플로로 보안 코드 생성으로 계속 진행하여 이 감사에서 발견된 문제 클래스를 다시 도입하지 않고 새로운 기능을 구축하세요.