T09 · Insecure Skill Coding Practices
- Location
lib/agent_dlp.py:1631- Finding
Plaintext audit logging retains raw sensitive input, memory content, and tool parameters
- Content
View full analysis
Dict: result = { "blocked": False, "injection_detected": False, "findings": [], "text": text } ``` ```python class MemoryGuard: def check(self, memory_data: Dict) -> Dict: result = { "blocked": False, "findings": [], "sanitized_data": memory_data } ``` ```python class ToolGuard: def check(self, tool_name: str, params: Dict = None) -> Dict: result = { "blocked": False, "require_approval": False, "tool": tool_name, "params": params } ``` ```python class AuditLogger: def __init__(self, config: DLPConfig): self.config = config self.log_file = os.path.expanduser( config.get("audit.log_file", "~/.openclaw/logs/dlp-audit.log") ) def log(self, event_type: str, data: Dict): if not self.config.get("audit.enabled", True): return os.makedirs(os.path.dirname(self.log_file), exist_ok=True) log_entry = { "timestamp": datetime.now().isoformat(), "type": event_type, "data": data } with open(self.log_file, "a") as f: f.write(json.dumps(log_entry, ensure_ascii=False) + "\n") ``` ```python def check_input(self, text: str) -> Dict: result = self.input_guard.check(text) self.audit_logger.log("input_check", result) return result def check_memory(self, memory_data: Dict) -> Dict: result = self.memory_guard.check(memory_data) self.audit_logger ...[truncated 2352 chars]- Remediation
View remediation
