Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 44 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# KESE - KISA Enhanced Security Evaluation Kit

주요정보통신기반시설(CII) 취약점 분석평가, AI 보안 평가, 로봇 보안 점검, 우주 보안 점검, 시큐어코딩 가이드, 제로트러스트 보안 평가를 위한 Claude Code 스킬 플러그인입니다.
주요정보통신기반시설(CII) 취약점 분석평가, AI 보안 평가, 로봇 보안 점검, 우주 보안 점검, 시큐어코딩 가이드, 제로트러스트 보안 평가, SW 공급망 보안(SBOM)을 위한 Claude Code 스킬 플러그인입니다.

🌐 [한국어](#빠른-시작) | [English](#english) | [Français](docs/README.fr.md) | [日本語](docs/README.ja.md) | [中文](docs/README.zh.md) | [Русский](docs/README.ru.md) | [Español](docs/README.es.md) | [Deutsch](docs/README.de.md) | [Português](docs/README.pt.md) | [Italiano](docs/README.it.md) | [العربية](docs/README.ar.md) | [हिन्दी](docs/README.hi.md) | [Türkçe](docs/README.tr.md) | [Tiếng Việt](docs/README.vi.md) | [ภาษาไทย](docs/README.th.md) | [Bahasa Indonesia](docs/README.id.md) | [Polski](docs/README.pl.md) | [Nederlands](docs/README.nl.md) | [Svenska](docs/README.sv.md) | [Українська](docs/README.uk.md)

Expand Down Expand Up @@ -73,16 +73,16 @@ Claude Code 프롬프트에 슬래시 명령어를 입력합니다:

## 개요

KESE(KISA Enhanced Security Evaluation Kit)는 KISA(한국인터넷진흥원) 가이드라인에 기반한 보안 취약점 분석평가 기능을 제공하는 Claude Code 플러그인입니다. 주요정보통신기반시설(CII) 취약점 분석평가, AI 보안 평가, 로봇 보안 점검, 우주 보안 점검, 제로트러스트 보안 평가를 지원합니다.
KESE(KISA Enhanced Security Evaluation Kit)는 KISA(한국인터넷진흥원) 가이드라인에 기반한 보안 취약점 분석평가 기능을 제공하는 Claude Code 플러그인입니다. 주요정보통신기반시설(CII) 취약점 분석평가, AI 보안 평가, 로봇 보안 점검, 우주 보안 점검, 제로트러스트 보안 평가, SW 공급망 보안(SBOM)을 지원합니다.

### 기능

| 스킬 | 설명 |
|------|------|
| `/kesekit-start-ko` | 전체 보안 취약점 분석평가 실행 (CII 560+ / AI 보안 / 로봇 보안 / 우주 보안 / 시큐어코딩 / 제로트러스트) |
| `/kesekit-check-ko` | 배포 전 보안 컴플라이언스 체크리스트 (CII / AI / 로봇 / 우주 / 시큐어코딩 / 제로트러스트) |
| `/kesekit-fix-ko` | 하드닝 스크립트 및 보안 수정 자동 생성 (CII / AI / 로봇 / 우주 / 시큐어코딩 / 제로트러스트) |
| `/kesekit-guide-ko` | AI 도구용 시큐어코딩 프롬프트 생성 (CII / AI / 로봇 / 우주 / JS·Python·범용 / 제로트러스트) |
| `/kesekit-start-ko` | 전체 보안 취약점 분석평가 실행 (CII 560+ / AI 보안 / 로봇 보안 / 우주 보안 / 시큐어코딩 / 제로트러스트 / SW 공급망) |
| `/kesekit-check-ko` | 배포 전 보안 컴플라이언스 체크리스트 (CII / AI / 로봇 / 우주 / 시큐어코딩 / 제로트러스트 / SW 공급망) |
| `/kesekit-fix-ko` | 하드닝 스크립트 및 보안 수정 자동 생성 (CII / AI / 로봇 / 우주 / 시큐어코딩 / 제로트러스트 / SW 공급망) |
| `/kesekit-guide-ko` | AI 도구용 시큐어코딩 프롬프트 생성 (CII / AI / 로봇 / 우주 / JS·Python·범용 / 제로트러스트 / SW 공급망) |

### 지원 가이드라인

Expand Down Expand Up @@ -192,6 +192,22 @@ KESE(KISA Enhanced Security Evaluation Kit)는 KISA(한국인터넷진흥원)

대상: 제로트러스트 도입 기업, OT/ICS 환경, 클라우드 전환 조직, 보안 성숙도 평가 담당자

#### 7. SW 공급망 보안 — 29항목

| 단계 | 코드 | 항목 수 | 참조 표준 |
|------|------|:------:|----------|
| 설계 단계 | SC-01~05 | 5 | NIST SP 800-161r1 |
| 개발 단계 | SC-06~16 | 11 | NIST SP 800-218 (SSDF) |
| 공급(유통) 단계 | SC-17~19 | 3 | NTIA SBOM |
| 도입 및 운영 단계 | SC-20~26 | 7 | NIS-SBOM |
| 유지보수 단계 | SC-27~29 | 3 | NIS-SBOM |

**SBOM 표준**: SPDX (ISO/IEC 5962), CycloneDX (OWASP), NIS-SBOM (20개 항목)
**지원 도구**: Syft, Grype, CycloneDX CLI, npm audit, pip-audit, govulncheck
**규제 동향**: 미국 EO 14028 (SBOM 제출 의무화), EU CRA (2026 하반기 시행), NIS-SBOM (공공기관)

대상: SW 개발기업, 공공조달 납품사, 정부과제 개발자, 바이브코딩 개발자

### 원본 문서

본 플러그인은 다음 공식 보안 가이드라인을 기반으로 재구성되었습니다:
Expand All @@ -212,6 +228,8 @@ KESE(KISA Enhanced Security Evaluation Kit)는 KISA(한국인터넷진흥원)
| 12 | **제로트러스트 가이드라인 2.0** | 한국제로트러스트포럼 / KISA | 2024 | 245 | [PDF](문서/제로트러스트_가이드라인_2.0.pdf) / [MD](문서/제로트러스트_가이드라인_2.0.md) |
| 13 | **제로트러스트 성숙도 모델 해설서** | 한국제로트러스트포럼 / KISA | 2024 | 182 | [PDF](문서/제로트러스트_성숙도_모델_해설서.pdf) / [MD](문서/제로트러스트_성숙도_모델_해설서.md) |
| 14 | **OT 환경의 제로트러스트 적용 안내서** | 과기정통부 / KISA | 2025 | 67 | [PDF](문서/OT_환경의_제로트러스트_적용_안내서.pdf) / [MD](문서/OT_환경의_제로트러스트_적용_안내서.md) |
| 15 | **SW 공급망 보안 가이드라인 (요약본)** | 국정원 / 과기정통부 / KISA | 2024 | 22 | [PDF](문서/240513-(요약본)_SW_공급망_보안_가이드라인.pdf) |
| 16 | **SW 공급망 보안 가이드라인 (전체본)** | 국정원 / 과기정통부 / KISA | 2024 | 100 | [PDF](문서/240525-(전체본)_SW_공급망_보안_가이드라인_최종%20수정본.pdf) |

### v2.x에서 마이그레이션

Expand Down Expand Up @@ -330,16 +348,16 @@ Korean versions are also available:

### Overview

KESE (KISA Enhanced Security Evaluation Kit) is a Claude Code plugin that provides comprehensive vulnerability assessment capabilities based on KISA (Korea Internet & Security Agency) guidelines. Supports Critical Information Infrastructure (CII), AI Security, Robot Security, Space Security, Secure Coding, and Zero Trust assessments.
KESE (KISA Enhanced Security Evaluation Kit) is a Claude Code plugin that provides comprehensive vulnerability assessment capabilities based on KISA (Korea Internet & Security Agency) guidelines. Supports Critical Information Infrastructure (CII), AI Security, Robot Security, Space Security, Secure Coding, Zero Trust, and SW Supply Chain Security (SBOM) assessments.

### Features

| Skill | Description |
|-------|-------------|
| `/kesekit-start` | Run full security vulnerability assessment (CII 560+ / AI Security / Robot Security / Space Security) |
| `/kesekit-check` | Pre-deployment security compliance checklist (CII / AI / Robot / Space) |
| `/kesekit-fix` | Auto-generate hardening scripts and security fixes (CII / AI / Robot / Space) |
| `/kesekit-guide` | Generate secure coding prompts for AI, robot, and space-aware secure development |
| `/kesekit-start` | Run full security vulnerability assessment (CII 560+ / AI / Robot / Space / Secure Coding / Zero Trust / Supply Chain) |
| `/kesekit-check` | Pre-deployment security compliance checklist (CII / AI / Robot / Space / Secure Coding / Zero Trust / Supply Chain) |
| `/kesekit-fix` | Auto-generate hardening scripts and security fixes (CII / AI / Robot / Space / Secure Coding / Zero Trust / Supply Chain) |
| `/kesekit-guide` | Generate secure coding prompts for AI, robot, space, zero trust, and supply chain security |

### Source Documents

Expand All @@ -353,6 +371,8 @@ KESE (KISA Enhanced Security Evaluation Kit) is a Claude Code plugin that provid
| 6 | **Space Security Model Part1** | MSIT / KISA | 2024 | 134 |
| 7 | **Space Security Model Part2** (GSaaS/Supply Chain) | MSIT / KISA | 2025 | 223 |
| 8 | **Space Security Explanation Guide** | MSIT / KISA | 2025 | 218 |
| 9 | **SW Supply Chain Security Guideline (Summary)** | NIS / MSIT / KISA | 2024 | 22 |
| 10 | **SW Supply Chain Security Guideline (Full)** | NIS / MSIT / KISA | 2024 | 100 |

---

Expand Down Expand Up @@ -391,6 +411,19 @@ KESE-KIT/

## 변경 이력

### v3.3.0 (2026-04-08)

**새 가이드라인 추가: SW 공급망 보안 (SBOM)**
- 출처: SW 공급망 보안 가이드라인 요약본 22p + 전체본 100p (국정원·과기정통부·KISA, 2024.05)
- 5개 단계(설계/개발/공급/운영/유지보수), 29개 자가점검 항목 (SC-01~SC-29)
- SBOM 표준: SPDX, CycloneDX, NIS-SBOM (20개 기본항목)
- SBOM 생성 스크립트 (Syft, CycloneDX CLI, npm/pip/maven/go)
- 보안취약점 스캔 스크립트 (Grype, npm audit, pip-audit, govulncheck)
- CI/CD 파이프라인 통합 가이드 (GitHub Actions, GitLab CI)
- 규제 동향: 미국 EO 14028, EU CRA (2026 하반기), NIS-SBOM
- 8개 스킬(EN/KO)에 `references/supply-chain/` + `templates/supply-chain/` + `scripts/supply-chain/` 배치
- authorkit: PDF juice → analyze → draft 통합본 작성 완료

### v3.2.0 (2026-04-02)

**새 가이드라인 추가: 시큐어코딩 가이드**
Expand Down
147 changes: 147 additions & 0 deletions authorkit/cleanup_images.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Clean up extracted PDF images: remove duplicates, decorative backgrounds, tiny fragments."""

import os
import hashlib
import re
import sys

def md5(filepath):
with open(filepath, 'rb') as f:
return hashlib.md5(f.read()).hexdigest()

def cleanup_images(ref_dir):
images_dir = os.path.join(ref_dir, "images")
full_md_path = os.path.join(ref_dir, "full.md")

if not os.path.exists(images_dir):
print(f"No images dir: {images_dir}")
return

# 1. Scan all images
all_images = sorted([f for f in os.listdir(images_dir) if f.endswith('.png')])
print(f"Total images before cleanup: {len(all_images)}")

hash_map = {} # hash -> first file
to_delete = set()
reasons = {}

for img in all_images:
img_path = os.path.join(images_dir, img)
size = os.path.getsize(img_path)
h = md5(img_path)

# Rule 1: 0 byte files
if size == 0:
to_delete.add(img)
reasons[img] = "0 bytes"
continue

# Rule 2: Under 5KB - too small to be meaningful (icons, dots, fragments)
if size < 5120:
to_delete.add(img)
reasons[img] = f"too small ({size} bytes)"
continue

# Rule 3: Duplicates - keep first, delete rest
if h in hash_map:
to_delete.add(img)
reasons[img] = f"duplicate of {hash_map[h]}"
continue

hash_map[h] = img

# Rule 4: Identify decorative backgrounds (appear 5+ times = page decoration)
hash_counts = {}
for img in all_images:
if img in to_delete:
continue
img_path = os.path.join(images_dir, img)
h = md5(img_path)
hash_counts[h] = hash_counts.get(h, 0) + 1

# Any remaining hash that appeared many times in the original set is decorative
# Count from ALL images (before dedup) to catch patterns
all_hashes = {}
for img in all_images:
img_path = os.path.join(images_dir, img)
if os.path.getsize(img_path) > 0:
h = md5(img_path)
if h not in all_hashes:
all_hashes[h] = []
all_hashes[h].append(img)

decorative_hashes = set()
for h, files in all_hashes.items():
if len(files) >= 5: # appears 5+ times = page decoration pattern
decorative_hashes.add(h)
for f in files:
if f not in to_delete:
to_delete.add(f)
reasons[f] = f"decorative background (appeared {len(files)}x)"

# Summary
print(f"\nImages to delete: {len(to_delete)}")
reason_counts = {}
for r in reasons.values():
key = r.split('(')[0].strip() if '(' in r else r.split(' of ')[0].strip() if ' of ' in r else r
reason_counts[key] = reason_counts.get(key, 0) + 1
for reason, count in sorted(reason_counts.items(), key=lambda x: -x[1]):
print(f" - {reason}: {count}")

# Delete files
for img in to_delete:
img_path = os.path.join(images_dir, img)
if os.path.exists(img_path):
os.remove(img_path)

remaining = [f for f in os.listdir(images_dir) if f.endswith('.png')]
print(f"\nImages remaining: {len(remaining)}")

# Update full.md - remove references to deleted images
if os.path.exists(full_md_path):
with open(full_md_path, 'r', encoding='utf-8') as f:
content = f.read()

original_len = len(content)
lines = content.split('\n')
cleaned_lines = []
removed_refs = 0

for line in lines:
# Check if line references a deleted image
match = re.search(r'!\[.*?\]\(images/(.+?)\)', line)
if match and match.group(1) in to_delete:
removed_refs += 1
continue # skip this line
cleaned_lines.append(line)

# Remove excessive blank lines (3+ consecutive -> 2)
content = '\n'.join(cleaned_lines)
content = re.sub(r'\n{4,}', '\n\n\n', content)

with open(full_md_path, 'w', encoding='utf-8') as f:
f.write(content)

print(f"Removed {removed_refs} image references from full.md")
print(f"Markdown size: {original_len:,} -> {len(content):,} chars")

# Update conversion log
log_path = os.path.join(ref_dir, "conversion-log.md")
if os.path.exists(log_path):
with open(log_path, 'r', encoding='utf-8') as f:
log = f.read()
log += f"\n## Cleanup ({__import__('datetime').datetime.now().strftime('%Y-%m-%d %H:%M')})\n\n"
log += f"- Deleted: {len(to_delete)} images\n"
log += f"- Remaining: {len(remaining)} images\n"
for reason, count in sorted(reason_counts.items(), key=lambda x: -x[1]):
log += f" - {reason}: {count}\n"
with open(log_path, 'w', encoding='utf-8') as f:
f.write(log)

if __name__ == "__main__":
if len(sys.argv) < 2:
print("Usage: python cleanup_images.py <ref_dir>")
sys.exit(1)
cleanup_images(sys.argv[1])
22 changes: 19 additions & 3 deletions authorkit/convert_pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,15 @@ def extract_pdf_to_markdown(pdf_path, output_dir, ref_id):
xref = img[0]
pix = fitz.Pixmap(doc, xref)

# Convert CMYK to RGB if needed
if pix.n >= 5:
# Convert non-RGB colorspaces to RGB
if pix.colorspace and pix.colorspace.n >= 4:
pix = fitz.Pixmap(fitz.csRGB, pix)
elif pix.n - pix.alpha > 3:
pix = fitz.Pixmap(fitz.csRGB, pix)

# Remove alpha channel if present
if pix.alpha:
pix = fitz.Pixmap(pix, 0)

img_filename = f"p{page_num+1:04d}_img{img_idx}.png"
img_path = os.path.join(images_dir, img_filename)
Expand All @@ -50,7 +56,17 @@ def extract_pdf_to_markdown(pdf_path, output_dir, ref_id):
text += f"\n\n![이미지 {page_num+1}-{img_idx}](images/{img_filename})\n"

except Exception as e:
print(f" Warning: Could not extract image on page {page_num+1}: {e}")
# Fallback: render the page as image
try:
page_pix = page.get_pixmap(dpi=150)
img_filename = f"p{page_num+1:04d}_full.png"
img_path = os.path.join(images_dir, img_filename)
if not os.path.exists(img_path):
page_pix.save(img_path)
image_count += 1
text += f"\n\n![페이지 {page_num+1} 렌더링](images/{img_filename})\n"
except Exception as e2:
print(f" Warning: Could not extract image on page {page_num+1}: {e} / fallback: {e2}")

# Detect headings (lines that are likely headers)
lines = text.split('\n')
Expand Down
20 changes: 20 additions & 0 deletions authorkit/converted/ref-016/conversion-log.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Conversion Log

- **Source**: 240513-(요약본)_SW_공급망_보안_가이드라인.pdf
- **Pages**: 22
- **Converted**: 2026-04-08 16:31
- **Text characters**: 20,056
- **Images extracted**: 67
- **Headings detected**: 13

## Output Files

- `full.md` - Complete converted content
- `images/` - Extracted images (67 files)

## Cleanup (2026-04-08 17:08)

- Deleted: 53 images
- Remaining: 21 images
- too small: 46
- 0 bytes: 7
21 changes: 21 additions & 0 deletions authorkit/converted/ref-017/conversion-log.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Conversion Log

- **Source**: 240525-(전체본)_SW_공급망_보안_가이드라인_최종 수정본.pdf
- **Pages**: 100
- **Converted**: 2026-04-08 16:34
- **Text characters**: 91,393
- **Images extracted**: 216
- **Headings detected**: 92

## Output Files

- `full.md` - Complete converted content
- `images/` - Extracted images (216 files)

## Cleanup (2026-04-08 17:08)

- Deleted: 128 images
- Remaining: 88 images
- too small: 83
- duplicate: 41
- decorative background: 4
Loading
Loading