Skip to content

Commit f7f40a0

Browse files
authored
Merge pull request #8 from cdppcorp/develop
Develop
2 parents 16ab5a4 + d3e5edf commit f7f40a0

58 files changed

Lines changed: 3774 additions & 173 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎README.md‎

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# KESE - KISA Enhanced Security Evaluation Kit
22

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

55
🌐 [한국어](#빠른-시작) | [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)
66

@@ -73,16 +73,16 @@ Claude Code 프롬프트에 슬래시 명령어를 입력합니다:
7373
7474
## 개요
7575
76-
KESE(KISA Enhanced Security Evaluation Kit)는 KISA(한국인터넷진흥원) 가이드라인에 기반한 보안 취약점 분석평가 기능을 제공하는 Claude Code 플러그인입니다. 주요정보통신기반시설(CII) 취약점 분석평가, AI 보안 평가, 로봇 보안 점검, 우주 보안 점검, 제로트러스트 보안 평가를 지원합니다.
76+
KESE(KISA Enhanced Security Evaluation Kit)는 KISA(한국인터넷진흥원) 가이드라인에 기반한 보안 취약점 분석평가 기능을 제공하는 Claude Code 플러그인입니다. 주요정보통신기반시설(CII) 취약점 분석평가, AI 보안 평가, 로봇 보안 점검, 우주 보안 점검, 제로트러스트 보안 평가, SW 공급망 보안(SBOM)을 지원합니다.
7777
7878
### 기능
7979
8080
| 스킬 | 설명 |
8181
|------|------|
82-
| `/kesekit-start-ko` | 전체 보안 취약점 분석평가 실행 (CII 560+ / AI 보안 / 로봇 보안 / 우주 보안 / 시큐어코딩 / 제로트러스트) |
83-
| `/kesekit-check-ko` | 배포 전 보안 컴플라이언스 체크리스트 (CII / AI / 로봇 / 우주 / 시큐어코딩 / 제로트러스트) |
84-
| `/kesekit-fix-ko` | 하드닝 스크립트 및 보안 수정 자동 생성 (CII / AI / 로봇 / 우주 / 시큐어코딩 / 제로트러스트) |
85-
| `/kesekit-guide-ko` | AI 도구용 시큐어코딩 프롬프트 생성 (CII / AI / 로봇 / 우주 / JS·Python·범용 / 제로트러스트) |
82+
| `/kesekit-start-ko` | 전체 보안 취약점 분석평가 실행 (CII 560+ / AI 보안 / 로봇 보안 / 우주 보안 / 시큐어코딩 / 제로트러스트 / SW 공급망) |
83+
| `/kesekit-check-ko` | 배포 전 보안 컴플라이언스 체크리스트 (CII / AI / 로봇 / 우주 / 시큐어코딩 / 제로트러스트 / SW 공급망) |
84+
| `/kesekit-fix-ko` | 하드닝 스크립트 및 보안 수정 자동 생성 (CII / AI / 로봇 / 우주 / 시큐어코딩 / 제로트러스트 / SW 공급망) |
85+
| `/kesekit-guide-ko` | AI 도구용 시큐어코딩 프롬프트 생성 (CII / AI / 로봇 / 우주 / JS·Python·범용 / 제로트러스트 / SW 공급망) |
8686
8787
### 지원 가이드라인
8888
@@ -192,6 +192,22 @@ KESE(KISA Enhanced Security Evaluation Kit)는 KISA(한국인터넷진흥원)
192192
193193
대상: 제로트러스트 도입 기업, OT/ICS 환경, 클라우드 전환 조직, 보안 성숙도 평가 담당자
194194
195+
#### 7. SW 공급망 보안 — 29항목
196+
197+
| 단계 | 코드 | 항목 수 | 참조 표준 |
198+
|------|------|:------:|----------|
199+
| 설계 단계 | SC-01~05 | 5 | NIST SP 800-161r1 |
200+
| 개발 단계 | SC-06~16 | 11 | NIST SP 800-218 (SSDF) |
201+
| 공급(유통) 단계 | SC-17~19 | 3 | NTIA SBOM |
202+
| 도입 및 운영 단계 | SC-20~26 | 7 | NIS-SBOM |
203+
| 유지보수 단계 | SC-27~29 | 3 | NIS-SBOM |
204+
205+
**SBOM 표준**: SPDX (ISO/IEC 5962), CycloneDX (OWASP), NIS-SBOM (20개 항목)
206+
**지원 도구**: Syft, Grype, CycloneDX CLI, npm audit, pip-audit, govulncheck
207+
**규제 동향**: 미국 EO 14028 (SBOM 제출 의무화), EU CRA (2026 하반기 시행), NIS-SBOM (공공기관)
208+
209+
대상: SW 개발기업, 공공조달 납품사, 정부과제 개발자, 바이브코딩 개발자
210+
195211
### 원본 문서
196212
197213
본 플러그인은 다음 공식 보안 가이드라인을 기반으로 재구성되었습니다:
@@ -212,6 +228,8 @@ KESE(KISA Enhanced Security Evaluation Kit)는 KISA(한국인터넷진흥원)
212228
| 12 | **제로트러스트 가이드라인 2.0** | 한국제로트러스트포럼 / KISA | 2024 | 245 | [PDF](문서/제로트러스트_가이드라인_2.0.pdf) / [MD](문서/제로트러스트_가이드라인_2.0.md) |
213229
| 13 | **제로트러스트 성숙도 모델 해설서** | 한국제로트러스트포럼 / KISA | 2024 | 182 | [PDF](문서/제로트러스트_성숙도_모델_해설서.pdf) / [MD](문서/제로트러스트_성숙도_모델_해설서.md) |
214230
| 14 | **OT 환경의 제로트러스트 적용 안내서** | 과기정통부 / KISA | 2025 | 67 | [PDF](문서/OT_환경의_제로트러스트_적용_안내서.pdf) / [MD](문서/OT_환경의_제로트러스트_적용_안내서.md) |
231+
| 15 | **SW 공급망 보안 가이드라인 (요약본)** | 국정원 / 과기정통부 / KISA | 2024 | 22 | [PDF](문서/240513-(요약본)_SW_공급망_보안_가이드라인.pdf) |
232+
| 16 | **SW 공급망 보안 가이드라인 (전체본)** | 국정원 / 과기정통부 / KISA | 2024 | 100 | [PDF](문서/240525-(전체본)_SW_공급망_보안_가이드라인_최종%20수정본.pdf) |
215233
216234
### v2.x에서 마이그레이션
217235
@@ -330,16 +348,16 @@ Korean versions are also available:
330348
331349
### Overview
332350
333-
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.
351+
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.
334352
335353
### Features
336354
337355
| Skill | Description |
338356
|-------|-------------|
339-
| `/kesekit-start` | Run full security vulnerability assessment (CII 560+ / AI Security / Robot Security / Space Security) |
340-
| `/kesekit-check` | Pre-deployment security compliance checklist (CII / AI / Robot / Space) |
341-
| `/kesekit-fix` | Auto-generate hardening scripts and security fixes (CII / AI / Robot / Space) |
342-
| `/kesekit-guide` | Generate secure coding prompts for AI, robot, and space-aware secure development |
357+
| `/kesekit-start` | Run full security vulnerability assessment (CII 560+ / AI / Robot / Space / Secure Coding / Zero Trust / Supply Chain) |
358+
| `/kesekit-check` | Pre-deployment security compliance checklist (CII / AI / Robot / Space / Secure Coding / Zero Trust / Supply Chain) |
359+
| `/kesekit-fix` | Auto-generate hardening scripts and security fixes (CII / AI / Robot / Space / Secure Coding / Zero Trust / Supply Chain) |
360+
| `/kesekit-guide` | Generate secure coding prompts for AI, robot, space, zero trust, and supply chain security |
343361
344362
### Source Documents
345363
@@ -353,6 +371,8 @@ KESE (KISA Enhanced Security Evaluation Kit) is a Claude Code plugin that provid
353371
| 6 | **Space Security Model Part1** | MSIT / KISA | 2024 | 134 |
354372
| 7 | **Space Security Model Part2** (GSaaS/Supply Chain) | MSIT / KISA | 2025 | 223 |
355373
| 8 | **Space Security Explanation Guide** | MSIT / KISA | 2025 | 218 |
374+
| 9 | **SW Supply Chain Security Guideline (Summary)** | NIS / MSIT / KISA | 2024 | 22 |
375+
| 10 | **SW Supply Chain Security Guideline (Full)** | NIS / MSIT / KISA | 2024 | 100 |
356376
357377
---
358378
@@ -391,6 +411,19 @@ KESE-KIT/
391411
392412
## 변경 이력
393413
414+
### v3.3.0 (2026-04-08)
415+
416+
**새 가이드라인 추가: SW 공급망 보안 (SBOM)**
417+
- 출처: SW 공급망 보안 가이드라인 요약본 22p + 전체본 100p (국정원·과기정통부·KISA, 2024.05)
418+
- 5개 단계(설계/개발/공급/운영/유지보수), 29개 자가점검 항목 (SC-01~SC-29)
419+
- SBOM 표준: SPDX, CycloneDX, NIS-SBOM (20개 기본항목)
420+
- SBOM 생성 스크립트 (Syft, CycloneDX CLI, npm/pip/maven/go)
421+
- 보안취약점 스캔 스크립트 (Grype, npm audit, pip-audit, govulncheck)
422+
- CI/CD 파이프라인 통합 가이드 (GitHub Actions, GitLab CI)
423+
- 규제 동향: 미국 EO 14028, EU CRA (2026 하반기), NIS-SBOM
424+
- 8개 스킬(EN/KO)에 `references/supply-chain/` + `templates/supply-chain/` + `scripts/supply-chain/` 배치
425+
- authorkit: PDF juice → analyze → draft 통합본 작성 완료
426+
394427
### v3.2.0 (2026-04-02)
395428
396429
**새 가이드라인 추가: 시큐어코딩 가이드**

‎authorkit/cleanup_images.py‎

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
"""Clean up extracted PDF images: remove duplicates, decorative backgrounds, tiny fragments."""
4+
5+
import os
6+
import hashlib
7+
import re
8+
import sys
9+
10+
def md5(filepath):
11+
with open(filepath, 'rb') as f:
12+
return hashlib.md5(f.read()).hexdigest()
13+
14+
def cleanup_images(ref_dir):
15+
images_dir = os.path.join(ref_dir, "images")
16+
full_md_path = os.path.join(ref_dir, "full.md")
17+
18+
if not os.path.exists(images_dir):
19+
print(f"No images dir: {images_dir}")
20+
return
21+
22+
# 1. Scan all images
23+
all_images = sorted([f for f in os.listdir(images_dir) if f.endswith('.png')])
24+
print(f"Total images before cleanup: {len(all_images)}")
25+
26+
hash_map = {} # hash -> first file
27+
to_delete = set()
28+
reasons = {}
29+
30+
for img in all_images:
31+
img_path = os.path.join(images_dir, img)
32+
size = os.path.getsize(img_path)
33+
h = md5(img_path)
34+
35+
# Rule 1: 0 byte files
36+
if size == 0:
37+
to_delete.add(img)
38+
reasons[img] = "0 bytes"
39+
continue
40+
41+
# Rule 2: Under 5KB - too small to be meaningful (icons, dots, fragments)
42+
if size < 5120:
43+
to_delete.add(img)
44+
reasons[img] = f"too small ({size} bytes)"
45+
continue
46+
47+
# Rule 3: Duplicates - keep first, delete rest
48+
if h in hash_map:
49+
to_delete.add(img)
50+
reasons[img] = f"duplicate of {hash_map[h]}"
51+
continue
52+
53+
hash_map[h] = img
54+
55+
# Rule 4: Identify decorative backgrounds (appear 5+ times = page decoration)
56+
hash_counts = {}
57+
for img in all_images:
58+
if img in to_delete:
59+
continue
60+
img_path = os.path.join(images_dir, img)
61+
h = md5(img_path)
62+
hash_counts[h] = hash_counts.get(h, 0) + 1
63+
64+
# Any remaining hash that appeared many times in the original set is decorative
65+
# Count from ALL images (before dedup) to catch patterns
66+
all_hashes = {}
67+
for img in all_images:
68+
img_path = os.path.join(images_dir, img)
69+
if os.path.getsize(img_path) > 0:
70+
h = md5(img_path)
71+
if h not in all_hashes:
72+
all_hashes[h] = []
73+
all_hashes[h].append(img)
74+
75+
decorative_hashes = set()
76+
for h, files in all_hashes.items():
77+
if len(files) >= 5: # appears 5+ times = page decoration pattern
78+
decorative_hashes.add(h)
79+
for f in files:
80+
if f not in to_delete:
81+
to_delete.add(f)
82+
reasons[f] = f"decorative background (appeared {len(files)}x)"
83+
84+
# Summary
85+
print(f"\nImages to delete: {len(to_delete)}")
86+
reason_counts = {}
87+
for r in reasons.values():
88+
key = r.split('(')[0].strip() if '(' in r else r.split(' of ')[0].strip() if ' of ' in r else r
89+
reason_counts[key] = reason_counts.get(key, 0) + 1
90+
for reason, count in sorted(reason_counts.items(), key=lambda x: -x[1]):
91+
print(f" - {reason}: {count}")
92+
93+
# Delete files
94+
for img in to_delete:
95+
img_path = os.path.join(images_dir, img)
96+
if os.path.exists(img_path):
97+
os.remove(img_path)
98+
99+
remaining = [f for f in os.listdir(images_dir) if f.endswith('.png')]
100+
print(f"\nImages remaining: {len(remaining)}")
101+
102+
# Update full.md - remove references to deleted images
103+
if os.path.exists(full_md_path):
104+
with open(full_md_path, 'r', encoding='utf-8') as f:
105+
content = f.read()
106+
107+
original_len = len(content)
108+
lines = content.split('\n')
109+
cleaned_lines = []
110+
removed_refs = 0
111+
112+
for line in lines:
113+
# Check if line references a deleted image
114+
match = re.search(r'!\[.*?\]\(images/(.+?)\)', line)
115+
if match and match.group(1) in to_delete:
116+
removed_refs += 1
117+
continue # skip this line
118+
cleaned_lines.append(line)
119+
120+
# Remove excessive blank lines (3+ consecutive -> 2)
121+
content = '\n'.join(cleaned_lines)
122+
content = re.sub(r'\n{4,}', '\n\n\n', content)
123+
124+
with open(full_md_path, 'w', encoding='utf-8') as f:
125+
f.write(content)
126+
127+
print(f"Removed {removed_refs} image references from full.md")
128+
print(f"Markdown size: {original_len:,} -> {len(content):,} chars")
129+
130+
# Update conversion log
131+
log_path = os.path.join(ref_dir, "conversion-log.md")
132+
if os.path.exists(log_path):
133+
with open(log_path, 'r', encoding='utf-8') as f:
134+
log = f.read()
135+
log += f"\n## Cleanup ({__import__('datetime').datetime.now().strftime('%Y-%m-%d %H:%M')})\n\n"
136+
log += f"- Deleted: {len(to_delete)} images\n"
137+
log += f"- Remaining: {len(remaining)} images\n"
138+
for reason, count in sorted(reason_counts.items(), key=lambda x: -x[1]):
139+
log += f" - {reason}: {count}\n"
140+
with open(log_path, 'w', encoding='utf-8') as f:
141+
f.write(log)
142+
143+
if __name__ == "__main__":
144+
if len(sys.argv) < 2:
145+
print("Usage: python cleanup_images.py <ref_dir>")
146+
sys.exit(1)
147+
cleanup_images(sys.argv[1])

‎authorkit/convert_pdf.py‎

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,15 @@ def extract_pdf_to_markdown(pdf_path, output_dir, ref_id):
3737
xref = img[0]
3838
pix = fitz.Pixmap(doc, xref)
3939

40-
# Convert CMYK to RGB if needed
41-
if pix.n >= 5:
40+
# Convert non-RGB colorspaces to RGB
41+
if pix.colorspace and pix.colorspace.n >= 4:
4242
pix = fitz.Pixmap(fitz.csRGB, pix)
43+
elif pix.n - pix.alpha > 3:
44+
pix = fitz.Pixmap(fitz.csRGB, pix)
45+
46+
# Remove alpha channel if present
47+
if pix.alpha:
48+
pix = fitz.Pixmap(pix, 0)
4349

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

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

5571
# Detect headings (lines that are likely headers)
5672
lines = text.split('\n')
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Conversion Log
2+
3+
- **Source**: 240513-(요약본)_SW_공급망_보안_가이드라인.pdf
4+
- **Pages**: 22
5+
- **Converted**: 2026-04-08 16:31
6+
- **Text characters**: 20,056
7+
- **Images extracted**: 67
8+
- **Headings detected**: 13
9+
10+
## Output Files
11+
12+
- `full.md` - Complete converted content
13+
- `images/` - Extracted images (67 files)
14+
15+
## Cleanup (2026-04-08 17:08)
16+
17+
- Deleted: 53 images
18+
- Remaining: 21 images
19+
- too small: 46
20+
- 0 bytes: 7
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Conversion Log
2+
3+
- **Source**: 240525-(전체본)_SW_공급망_보안_가이드라인_최종 수정본.pdf
4+
- **Pages**: 100
5+
- **Converted**: 2026-04-08 16:34
6+
- **Text characters**: 91,393
7+
- **Images extracted**: 216
8+
- **Headings detected**: 92
9+
10+
## Output Files
11+
12+
- `full.md` - Complete converted content
13+
- `images/` - Extracted images (216 files)
14+
15+
## Cleanup (2026-04-08 17:08)
16+
17+
- Deleted: 128 images
18+
- Remaining: 88 images
19+
- too small: 83
20+
- duplicate: 41
21+
- decorative background: 4

0 commit comments

Comments
 (0)