Skip to content

feat: Security page — permissions, secrets vault, audit log#23

Merged
siracusa5 merged 2 commits intomainfrom
feat/security-page
Mar 16, 2026
Merged

feat: Security page — permissions, secrets vault, audit log#23
siracusa5 merged 2 commits intomainfrom
feat/security-page

Conversation

@siracusa5
Copy link
Collaborator

Summary

Adds a Security section to the desktop app with three sub-pages for managing permissions, secrets, and an audit trail. Gives engineers visibility into tool access rules, centralized secret management via macOS Keychain, and a log of all security-related changes.

Changes

  • Permissions page: Read/write ~/.claude/settings.json permissions with three hardcoded presets (Strict, Standard, Permissive), editable tool allow/deny/ask columns with contextual suggestion dropdowns, path and network host management, and a confirmation dialog for preset application
  • Secrets page: macOS Keychain integration for sensitive env vars via the security CLI, non-sensitive env config editor for ~/.harness-kit/env.json, status badges for set/missing secrets
  • Audit Log page: SQLite-backed event log (reuses existing Db struct) with category filter pills, expandable JSON details, pagination, and clear-old-entries action
  • Rust backend: security.rs (9 commands) + security_db.rs (2 commands) — settings.json backup before every write, secret values never logged
  • Capabilities: Added fs:allow-write-text-file, expanded fs:scope to include ~/.harness-kit, added security CLI to shell allow-execute
  • Shared types: PermissionsState, SecurityPreset, KeychainSecretInfo, EnvConfigEntry, AuditEntry

Test Plan

  • cargo check — Rust compiles cleanly
  • tsc --noEmit — no new TypeScript errors
  • pnpm dev:desktop — app launches, Security section appears in sidebar
  • Permissions page loads current settings.json; presets apply correctly
  • CI checks pass

Notes

  • Built on top of feat/comparator-phase-2 (needs that branch merged first for Db struct, shell plugin, SQLite infrastructure)
  • Keychain operations are macOS-only via the security CLI — cross-platform support is a future follow-up
  • Suggestion dropdowns cover known Claude Code tools, common paths, and popular API hosts

🤖 Generated with Claude Code

siracusa5 and others added 2 commits March 15, 2026 23:50
Add a Security section to the desktop app with three sub-pages:

- Permissions: read/write ~/.claude/settings.json with preset profiles
  (Strict, Standard, Permissive), tool allow/deny/ask columns, path
  and network host management, and contextual suggestion dropdowns
- Secrets: macOS Keychain integration for sensitive env vars via the
  `security` CLI, plus non-sensitive env config in ~/.harness-kit/env.json
- Audit Log: SQLite-backed event log for permission changes, secret
  operations, and preset applications with category filters and pagination

Backend: security.rs (9 commands) + security_db.rs (2 commands)
Frontend: 3 pages, tauri bridge, nav + routing integration

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…or handling

- Validate secret names against strict alphanumeric pattern before
  passing to macOS `security` CLI (prevents special char injection)
- Actually check keychain for each secret via `find-generic-password`
  so the is_set status badge reflects reality
- Replace panicking unwrap() in apply_permissions_to_settings with
  proper Result propagation
- Record audit entry when clearing old audit log entries
- Add category index on audit_log table for filter query performance
- Only auto-save env config on blur when values have actually changed

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@siracusa5 siracusa5 force-pushed the feat/security-page branch from e908eb9 to a645cf8 Compare March 16, 2026 03:50
@siracusa5 siracusa5 merged commit cdba28d into main Mar 16, 2026
3 checks passed
siracusa5 added a commit that referenced this pull request Mar 16, 2026
The security feature merge (#23) lost the mod.rs declarations for
security and security_db during conflict resolution — files existed
but weren't wired up, breaking desktop compilation.

Adds cargo check to the desktop-build-test CI job so Rust compilation
errors are caught before merge.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
siracusa5 added a commit that referenced this pull request Mar 16, 2026
The security feature merge (#23) lost the mod.rs declarations for
security and security_db during conflict resolution — files existed
but weren't wired up, breaking desktop compilation.

Adds cargo check to the desktop-build-test CI job so Rust compilation
errors are caught before merge.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant