go/internal/cmd
Snider b819b9432a
Add logging for security events (authentication, access) (#320)
* feat(log): add security events logging for authentication and access control

- Added `Security` method to `log.Logger` with `[SEC]` prefix at `LevelWarn`.
- Added `SecurityStyle` (purple) to `pkg/cli` and `LogSecurity` helper.
- Added security logging for GitHub CLI authentication checks.
- Added security logging for Agentic configuration loading and token validation.
- Added security logging for sandbox escape detection in `local.Medium`.
- Updated MCP service to support logger injection and log tool executions and connections.
- Ensured all security logs include `user` context for better auditability.

* feat(log): add security events logging for authentication and access control

- Added `Security` method to `log.Logger` with `[SEC]` prefix at `LevelWarn`.
- Added `SecurityStyle` (purple) to `pkg/cli` and `LogSecurity` helper.
- Added security logging for GitHub CLI authentication checks.
- Added security logging for Agentic configuration loading and token validation.
- Added security logging for sandbox escape detection in `local.Medium`.
- Updated MCP service to support logger injection and log tool executions and connections.
- Ensured all security logs include `user` context for better auditability.
- Fixed code formatting issues identified by CI.

* feat(log): refine security logging and fix auto-merge CI

- Moved `Security` log level to `LevelError` for better visibility.
- Added robust `log.Username()` helper using `os/user`.
- Differentiated high-risk (Security) and low-risk (Info) MCP tool executions.
- Ensured consistent `user` context in all security-related logs.
- Fixed merge conflict and missing repository context in `auto-merge` CI.
- Fixed comment positioning in `pkg/mcp/mcp.go`.
- Downgraded MCP TCP accept errors to standard `Error` log level.
- Fixed code formatting in `internal/cmd/setup/cmd_github.go`.

* feat(log): finalize security logging and address CI/CodeQL alerts

- Refined `Security` logging: moved to `LevelError` and consistently include `user` context using `os/user`.
- Differentiated MCP tool executions: write/delete are `Security` level, others are `Info`.
- Fixed CodeQL alert: made UniFi TLS verification configurable (defaults to verify).
- Updated UniFi CLI with `--verify-tls` flag and config support.
- Fixed `auto-merge` CI failure by setting `GH_REPO` env var.
- Fixed formatting and unused imports.
- Added tests for UniFi config resolution.

* fix: handle MustServiceFor return values correctly

MustServiceFor returns (T, error), not just T. This was causing build
failures after the rebase.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude <developers@lethean.io>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-05 10:26:48 +00:00
..
ai feat: wire release command, add tar.xz support, unified installers (#277) 2026-02-04 00:49:57 +00:00
ci Migrate pkg/release to io.Medium abstraction (#290) 2026-02-04 15:07:13 +00:00
collect feat: infrastructure packages and lint cleanup (#281) 2026-02-04 11:34:43 +00:00
config feat: infrastructure packages and lint cleanup (#281) 2026-02-04 11:34:43 +00:00
crypt feat: infrastructure packages and lint cleanup (#281) 2026-02-04 11:34:43 +00:00
deploy feat: wire release command, add tar.xz support, unified installers (#277) 2026-02-04 00:49:57 +00:00
dev Implement Background Goroutines for Long-Running Operations (#309) 2026-02-05 10:26:45 +00:00
docs Migrate pkg/repos to Medium abstraction (#291) 2026-02-04 18:03:54 +00:00
doctor Migrate pkg/repos to Medium abstraction (#291) 2026-02-04 18:03:54 +00:00
gitcmd feat(mcp): add workspace root validation to prevent path traversal (#100) 2026-02-01 21:59:34 +00:00
gitea feat(gitea): add Gitea Go SDK integration and CLI commands (#324) 2026-02-04 21:12:12 +00:00
go Configure branch coverage measurement in test tooling (#317) 2026-02-05 10:05:56 +00:00
help feat(help): Implement full-text search (#294) 2026-02-05 10:26:16 +00:00
monitor Migrate pkg/repos to Medium abstraction (#291) 2026-02-04 18:03:54 +00:00
php Standardize CLI Error Handling (#318) 2026-02-05 06:55:49 +00:00
pkgcmd Migrate pkg/repos to Medium abstraction (#291) 2026-02-04 18:03:54 +00:00
plugin feat: infrastructure packages and lint cleanup (#281) 2026-02-04 11:34:43 +00:00
qa Standardize CLI Error Handling (#318) 2026-02-05 06:55:49 +00:00
rag feat: infrastructure packages and lint cleanup (#281) 2026-02-04 11:34:43 +00:00
sdk Standardize CLI Error Handling (#318) 2026-02-05 06:55:49 +00:00
security Migrate pkg/repos to Medium abstraction (#291) 2026-02-04 18:03:54 +00:00
setup Add logging for security events (authentication, access) (#320) 2026-02-05 10:26:48 +00:00
test Configure branch coverage measurement in test tooling (#317) 2026-02-05 10:05:56 +00:00
unifi feat: add tests for edge cases, error paths, and integration scenarios (#308) 2026-02-05 10:10:07 +00:00
updater Standardize CLI Error Handling (#318) 2026-02-05 06:55:49 +00:00
vm Remove StrictHostKeyChecking=no from SSH commands (#315) 2026-02-05 07:09:34 +00:00
workspace feat: Batch implementation of Gemini issues (#176) 2026-02-02 04:20:18 +00:00