권한남용
2026년 10월 27일 09:30분
사무엘하 11장에서 다윗은 우리아의 아내 밧세바를 불러들이고 우리아를 전사하게 만듭니다. 최고 권한자의 권한 남용은 시스템 전체를 오염시킵니다. 나는 권한 남용 탐지 감사 로그를 구현했습니다.
package com.jesusbornd.samuel2;
public class Samuel2_11_Chapter_Lv2 {
record AuditEvent(String actor, String action, String target, boolean authorized) {}
static void audit(AuditEvent e) {
String flag = e.authorized() ? "✅ 정상" : "🚨 권한남용";
System.out.printf("[%s] %s → %s (대상: %s)%n", flag, e.actor(), e.action(), e.target());
}
public static void main(String[] args) {
audit(new AuditEvent("다윗", "소환", "밧세바", false));
audit(new AuditEvent("다윗", "배치명령", "우리아", false));
audit(new AuditEvent("다윗", "전투보고", "전선", true));
}
}
def audit(actor: str, action: str, target: str, authorized: bool):
flag = "✅ 정상" if authorized else "🚨 권한남용"
print(f"[{flag}] {actor} → {action} (대상: {target})")
audit("다윗", "소환", "밧세바", False)
audit("다윗", "배치명령", "우리아", False)
audit("다윗", "전투보고", "전선", True)
Search
Categories
← 목록으로
Comments
권한이 클수록 남용의 피해도 큽니다.