시큐어코딩 (SW 개발보안)
I. 사이버 위협의 선제적 대응, SW 개발보안의 개요
- SDLC 초기 단계에서 보안취약점을 소스코드 레벨에서 제거하여 소프트웨어를 개발하는 기법.
II. SW 개발보안의 적용 메커니즘 및 7대 구성요소
가. SW 개발보안의 적용 메커니즘
<!-- SDLC Steps (Top) -->
<rect x="10" y="20" width="100" height="38" class="step-box"/>
<text x="60" y="39" class="step-text">요구분석</text>
<line x1="110" y1="39" x2="135" y2="39" class="flow-line"/>
<rect x="140" y="20" width="100" height="38" class="step-box"/>
<text x="190" y="39" class="step-text">설계</text>
<line x1="240" y1="39" x2="265" y2="39" class="flow-line"/>
<rect x="270" y="20" width="100" height="38" class="step-box"/>
<text x="320" y="39" class="step-text">구현</text>
<line x1="370" y1="39" x2="395" y2="39" class="flow-line"/>
<rect x="400" y="20" width="100" height="38" class="step-box"/>
<text x="450" y="39" class="step-text">테스트</text>
<line x1="500" y1="39" x2="525" y2="39" class="flow-line"/>
<rect x="530" y="20" width="100" height="38" class="step-box"/>
<text x="580" y="39" class="step-text">유지보수</text>
<!-- Down Arrows -->
<line x1="60" y1="58" x2="60" y2="82" class="flow-line"/>
<line x1="190" y1="58" x2="190" y2="82" class="flow-line"/>
<line x1="320" y1="58" x2="320" y2="82" class="flow-line"/>
<line x1="450" y1="58" x2="450" y2="82" class="flow-line"/>
<line x1="580" y1="58" x2="580" y2="82" class="flow-line"/>
<!-- Details (Bottom) -->
<rect x="10" y="85" width="100" height="50" class="detail-box"/>
<text x="60" y="103" class="detail-text">보안 요구사항</text>
<text x="60" y="119" class="detail-text">분석</text>
<rect x="140" y="85" width="100" height="50" class="detail-box"/>
<text x="190" y="111" class="detail-text" font-weight="600">STRIDE</text>
<rect x="270" y="85" width="100" height="50" class="detail-box"/>
<text x="320" y="103" class="detail-text">시큐어코딩</text>
<text x="320" y="119" class="detail-text">47개 항목</text>
<rect x="400" y="85" width="100" height="50" class="detail-box"/>
<text x="450" y="103" class="detail-text">보안 테스트</text>
<text x="450" y="119" class="detail-text">DAST / SAST</text>
<rect x="530" y="85" width="100" height="50" class="detail-box"/>
<text x="580" y="103" class="detail-text">패치관리</text>
<text x="580" y="119" class="detail-text">취약점 모니터링</text>
- Shift-Left를 하면 출시 후 비용 대비 30배 절감 가능.
나. SW 개발보안의 7대 구성요소
| 구분 | 주요 보안 약점 항목 | 대응 방법 |
|---|
| 입력데이터 검증 및 표현 | SQL Injection, XSS | Prepared Statement 사용 |
| 보안기능 | 하드코딩된 비밀번호 | 인증 및 접근제어 강화 |
| 시간 및 상태 | TOCTOU (Time of Check to Time of Use) | 동기화 처리 |
| 에러처리 | 오류 메시지 정보 노출 | 사용자 정의 에러 Page 제공 |
| 코드 오류 방지 | Null Pointer 역참조 | Null 체크 로직 추가 |
| 캡슐화 | 잘못된 세션관리 | Private 접근제어자 활용 |
| API 오용 방지 | DNS lookup 보안 결함 | 신뢰할 수 있는 변수/검증 라이브러리 사용 |
III. SW 개발보안 활용 및 발전 방향
- 행안부 「SW 개발보안 가이드」 의무 적용: 감리대상 정보화 사업(40억 이상), 47개 보안 약점 진단 의무화
- 자동화 및 지능화 연계: SAST / DAST 자동화 도구의 CI/CD 파이프라인 통합, AI 기반 코드 취약점 자동 탐지로 Shift-Left 가속화