관리자 권능이 탐색기로 침투하였습니다.
우회 스크립트 가동.
local RoleManager = {} RoleManager.__index = RoleManager
-- 구성: 소유자 ID, 다중승인 임계값, 로그파일 경로(파일 쓰기 불가 환경에서는 nil) function RoleManager.new(config) assert(config and config.owner_id, "owner_id 필요") local self = setmetatable({}, RoleManager) self.owner_id = config.owner_id self.threshold = config.threshold or 2 -- 기본 다중승인 수 self.log_path = config.log_path or "audit.log" -- 파일 쓰기 가능 환경에서 사용 self.users = {} -- users[id] = {roles = {["admin"]=true}, disabled = {["admin"]=false}} self.pending = {} -- pending[action_id] = {action=fn, approvals=set, meta} self._next_action_id = 0 return self end
-- 내부: 감사 로그 기록 (파일 또는 콘솔) function RoleManager:_log(entry) local timestamp = os.date("%Y-%m-%d %H:%M:%S") local line = string.format("[%s] %s\n", timestamp, entry) if self.log_path then local ok, err = pcall(function() local f = io.open(self.log_path, "a") if f then f:write(line) f:close() end end) if not ok then -- 파일 쓰기 실패: 콘솔 출력으로 대체 print("LOG FAIL:", err or "unknown", line) end else print(line) end end
-- 사용자 초기화(없으면 새로 생성) function RoleManager:_ensure_user(user_id) if not self.users[user_id] then self.users[user_id] = { roles = {}, disabled = {} } end end
⚠️관리자 워크스페이스 가동을 실패하였습니다. 탐색기 스크립트룰 재가동합니다.
대화하는 용도 X
출시일 2025.12.03 / 수정일 2026.01.26