검색 상세

구성 유효성 검증 피드백 기반 대규모 언어 모델을 활용한 코드형 인프라 보안 설정 위반 교정

LLM-Based Remediation of Security Misconfigurations in Infrastructure as Code Using Configuration-Validation Feedback

초록(요약문)

클라우드 인프라를 코드로 정의하고 관리하는 코드형 인프라(Infrastructure as Code, IaC)에서 보안 설정 위반을 교정하는 작업에 대규모 언어 모델(Large Language Model, LLM)이 활용되고 있다. 그러나 기존 연구에는 두 가지 문제가 남아 있다. 첫째, 교정 시스템에 입력되는 코드에는 보안 위반이 있는 취약한 구성과 위반이 없는 정상 구성이 구분 없이 섞여 있어, 시스템은 취약한 구성을 복구하면서 정상 구성을 보존하는 두 역할을 동시에 수행해야 한다. 둘째, 보안 스캐너의 통과가 Terraform 코드의 문법과 스키마 유효성을 보장하지 못하여, 스캐너는 통과하지만 구성 유효성 검증에 실패하는 환각 수정(hallucinated fix)이 성공으로 집계될 수 있다. 본 논문은 이를 해결하기 위해 ValidRepair 를 제안한다. ValidRepair 는 보안 스캐너의 위반 정보를 반복적으로 제공하는 교정 위에 terraform validate 를 두 가지 역할로 결합한다. 하나는 구성 유효성 검증에 실패한 수정을 성공에서 배제하는 검증 게이트이고, 다른 하나는 검증 오류를 다음 반복의 단서로 제공하여 유효하지 않던 수정을 다시 개선하도록 유도하는 교정 피드백이다. 또한 보안 위반 제거 여부와 Terraform 문법과 스키마 유효성을 함께 요구하는 유효 교정 Pass@1 을 평가 지표로 사용한다. 정상 구성과 취약 구성을 같은 수로 포함하는 블라인드 벤치마크에서 서로 다른 세 등급의 대규모 언어 모델인 Claude Haiku 4.5, Claude Sonnet 4.6, Claude Opus 4.8 로 실험한 결과, ValidRepair 는 스캐너는 통과하지만 검증에 실패하는 환각 수정이 모든 등급에서 성공으로 집계되지 않도록 하였다. 또한 검증 통합을 제거한 비교 기법보다 취약 구성의 복구율을 Haiku 에서 28.2%p, Opus 에서 43.9%p 향상시켰으며, 정상 구성의 보존율은 높게 유지하였다. 블라인드 입력 전체에 대한 정확도는 Haiku 74.5%, Sonnet 83.2%, Opus 85.7%로 상위 모델일수록 높았으나 비용은 가파르게 증가하여, 성능과 비용의 균형 측면에서 Sonnet 이 가장 실용적인 선택으로 나타났다. 아울러 보안 스캐너 통과만을 성공으로 보는 평가가 교정 성능을 과대평가할 수 있음을 실증하였다. 본 연구는 구성 유효성 검증을 사후 판정이 아니라 반복 교정의 능동적 피드백으로 통합함으로써, 블라인드 입력에서 복구와 보존을 함께 달성하면서 환각 수정이 성공으로 집계되지 않도록 차단하는 대규모 언어 모델 기반 IaC 보안 교정 방법을 제시한다.

more

초록(요약문)

Large language models (LLMs) are increasingly applied to remediating security misconfigurations in Infrastructure as Code (IaC). However, two problems remain. First, the code given to a remediation system mixes vulnerable configurations that contain security violations with clean configurations that do not, without any label distinguishing them; the system must therefore both recover vulnerable configurations and preserve clean ones. Second, passing a security scanner does not guarantee the syntactic and schema validity of the Terraform code, so a modification that passes the scanner but fails configuration validation—a hallucinated fix—can be counted as a success. This thesis proposes ValidRepair to address these problems. On top of iterative repair that feeds back scanner violations, ValidRepair integrates terraform validate in two roles: a validation gate that excludes scanner- passing but invalid modifications from being counted as successes, and a repair feedback that returns the validation error as a cue for the next iteration so that an invalid modification can be improved into a valid one. ValidRepair is evaluated with valid-remediation Pass@1, which requires both the removal of security violations and Terraform syntactic and schema validity. On a blind benchmark containing equal numbers of clean and vulnerable configurations, experiments with three tiers of Claude models (Haiku 4.5, Sonnet 4.6, and Opus 4.8) show that ValidRepair prevents hallucinated fixes— scanner-passing but validation-failing modifications—from being counted as successes across all tiers, improves the recovery rate of vulnerable configurations over a comparison without the terraform validate integration (by +28.2 and +43.9 percentage points on Haiku and Opus, respectively), and keeps the preservation rate of clean configurations high. Accuracy over the full blind input increases with model tier (74.5%, 83.2%, 85.7%) but cost rises steeply, so Sonnet is the most practical choice in the performance–cost trade- off. The thesis also empirically shows that judging success by scanner pass alone can overestimate remediation performance. By integrating configuration validation as an active feedback signal in iterative repair rather than as a post hoc filter, ValidRepair achieves recovery and preservation together on blind inputs while suppressing hallucinated fixes.

more

목차

제 1 장 서 론 1
제 1 절 연구 배경 1
제 2 절 연구 목적 및 기여 3
제 3 절 논문 구성 5
제 2 장 이론적 배경 및 선행 연구 6
제 1 절 이론적 배경 6
제 2 절 대규모 언어 모델 기반 코드형 인프라 교정 9
제 3 절 기존 연구의 한계 및 본 연구의 차별점. 11
제 3 장 문제 정의 및 제안 기법 14
제 1 절 문제 정의 14
제 2 절 평가 지표 16
제 3 절 제안 기법 개요 18
제 4 절 스캐너 피드백 기반 최소 수정 반복 20
제 5 절 terraform validate 의 두 가지 역할 21
제 6 절 ValidRepair 알고리즘 23
제 4 장 실 험 25
제 1 절 실험 환경 25
제 2 절 주요 비교 실험 34
제 3 절 검증 통합의 효과 분석 40
제 4 절 환각 수정과 스캐너 중심 평가의 과대평가 44
제 5 절 모델 등급에 따른 성능과 비용 효율성 48
제 6 절 타당성 검토 및 한계 50
제 5 장 결 론 54
제 1 절 연구 요약 54
제 2 절 한계점 및 향후 연구 55
참 고 문 헌 58

more