QA & Security Auditor
This skill performs a security and quality audit of the codebase, focusing on the specific risks of a desktop database client.
Audit Checklist
1. Sensitive Data Exposure (Logs)
Risk: Credentials appearing in logs.
- • Search for
console.log,println!,dbg!containing "password", "secret", "key", "token". - • Verify that connection strings are redacted before logging.
2. Dangerous Operations
Risk: Accidental data loss.
- • Verify that any Rust command calling
drop_database,delete_row, ortruncatechecks theSafetyPolicy. - • Ensure the frontend invokes a confirmation modal (e.g.,
useDoubleCheck) before calling these commands.
3. Tauri Permissions (src-tauri/capabilities/)
Risk: Excessive system access.
- • Check
default.jsonorbase.json. - • Ensure
fsscope is limited (no$HOME/*unless absolutely necessary). - • Ensure
shellscope doesn't allow arbitrary command execution.
4. SQL Injection / NoSQL Injection
Risk: Malicious queries.
- • Rust: Ensure
queryarguments are bound parameters, not string concatenation (e.g.format!("SELECT * FROM {}", table)is dangerous). - • Rust: For dynamic table names, ensure validation/escaping via
sql_safety.rs.
Workflow
- •Run Pattern Search: Use
grep_searchto findconsole.logorprintln!in modified files. - •Verify Policy Checks: Read the relevant Rust command file. Does it import
SafetyPolicy? Does it callpolicy.check(...)? - •Check Permissions: Read
src-tauri/capabilities/default.jsonif new filesystem features were added.
Common Fixes
Redacting Logs (Rust):
rust
// BAD
println!("Connecting to {}", password);
// GOOD
info!("Connecting to database with user {}", user); // standard log without secrets
Checking Safety (Rust):
rust
// BAD
pub async fn drop_table(...) {
engine.execute("DROP TABLE ...").await;
}
// GOOD
pub async fn drop_table(state: State<'_, AppState>, ...) {
state.policy.enforce_dangerous_action()?; // Returns error if not confirmed/allowed
engine.execute("DROP TABLE ...").await;
}