Add audit-logs export commands for S3 export destinations - #214
Merged
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
yummybomb
marked this pull request as ready for review
August 10, 2026 15:00
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit fd522c5. Configure here.
sjmiller609
approved these changes
Aug 10, 2026
sjmiller609
left a comment
Contributor
There was a problem hiding this comment.
reviewed — overall looks good. two low-priority follow-ups:
Nits
cmd/audit_logs_export.go:444-450— nit: truncate by runes or display width; byte slicing can split UTF-8 error messages.
Tests
cmd/audit_logs_export_test.go:319-375— consider exercisingauditLogsExportClient.Listthrough anhttptest.Server; parser and fake tests do not verify SDK response-header capture.
kernel-internal Bot
added a commit
that referenced
this pull request
Aug 10, 2026
Bump github.com/kernel/kernel-go-sdk to v0.87.1-0.20260810163328-5819723ab49d (5819723). The merge of main into this branch had reset go.mod to v0.87.0, so this diff spans v0.87.0. SDK changes in range: - New BrowserProxyConfigParam / BrowserProxyMode on BrowserNewParams and BrowserUpdateParams, plus BrowserProxy / BrowserProxyConfig responses. Already covered by --proxy-id/--proxy-name/--proxy-mode on `browsers create` and `browsers update`. - New ManagedAuthBrowserConfigParam (stealth, proxy, telemetry) on auth connection create, update, and login. Already covered by --stealth, --proxy-*, --telemetry, and --telemetry-export-otlp. - HealthCheckInterval docs now document a Free-plan minimum of 21600 (6h) and a default of 3600 or the plan minimum, whichever is larger. Changes: - Fix a build break inherited from the main merge: cmd/projects.go imported samber/lo but main's header-based pagination rewrite no longer uses it, so `go build ./...` failed on the branch tip. - Reword --health-check-interval help on `auth connections create` and `update` to match the new SDK docs (plan minimums incl. Free 21600, and the max(3600, plan minimum) default). Coverage analysis: full enumeration of all 134 methods in api.md against the CLI command tree found no missing commands. Param-field sweep across all 111 *Params/*RequestParam structs found no missing flags. Investigated and deliberately not added: the SDK exposes Telemetry.Export.Otlp on BrowserUpdateParams and on all three BrowserPool*Params, because every telemetry field is generated from one shared BrowserTelemetryRequestConfig schema. The API does not honor it there -- openapi.yaml states pools reject export and browser update ignores it, and a live `browser-pools create --telemetry-export-otlp` probe returned "telemetry.export is only supported when creating a browser". Export stays on `browsers create` and the managed-auth commands only, as README already documents. Note for reviewers: the 6 audit-logs export-destination endpoints are still marked x-cli-skip in openapi.yaml but were implemented on main in #214, so `kernel audit-logs export *` now covers them. Left as-is; the annotation looks stale. Tested: go build ./..., go vet ./..., go test ./... (all pass). Against the live API: `projects list` (the file with the build fix), `auth connections list`, `browsers list`, and a full proxy-config round trip -- `browsers create --proxy-mode direct --stealth` returned proxy.mode=direct, `browsers update --proxy-mode default` then `browsers get` returned proxy.mode=default, `browsers delete` cleaned up. Verified the reworded --health-check-interval help renders. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Adds a
kernel audit-logs exportcommand group for managing S3 audit log export destinations:create— creates a destination (paused by default) and prints the trust-policy onboarding steps with the Kernel role ARN and external IDlist— paginated table with delivery status per destination (--limit/--offset, more-results hint from pagination headers); JSON output includes anext_offsetcursor when another page is availableget— full detail view including delivery status: status, last success with computed lag, last error and time, consecutive failures, next attemptupdate— partial update of region/bucket/prefix/role ARN/KMS key;--clear-kms-keysends an empty string to remove the key, omitted flags leave fields unchanged; 409 conflicts get a retry-against-fresh-state hintpause/resume— status transitions with notes on in-flight uploads and resume semanticsdelete— removes a destinationtest— runs the destination test and exits non-zero on failure, reporting the failing stage and error codeAll calls go through the generated
AuditLogExportDestinationServicein kernel-go-sdk v0.87.0 (bumped from v0.85.0), following the existingcmd/audit_logs.goservice-interface pattern. A thin adapter remains only to read and validate theX-Has-More/X-Next-Offsetpagination headers viaoption.WithResponseInto, since the SDK pager does not surface them.--clear-kms-keysends{"kms_key_id":""}per the SDK contract (empty string clears; omit/null leaves unchanged), locked in by a wire-contract test. Create, list, get, update, pause, resume, and test support--output json.Testing
make testpasses (unit tests cover output rendering, flag validation, partial-update/clear semantics, pagination headers and JSON cursors, 409 handling, and test-failure exit behavior)Note
Low Risk
CLI-only feature with mocked and httptest coverage; no changes to core auth or runtime paths beyond a dependency bump.
Overview
Adds
kernel audit-logs export, a new subcommand group underaudit-logsfor managing continuous S3 audit log export destinations viakernel-go-sdkv0.87.0 (from v0.85.0).Operators can create paused S3 destinations (with optional KMS), list with
--limit/--offsetand pagination fromX-Has-More/X-Next-Offset, get delivery health, partially update bucket/role/KMS (including--clear-kms-key), pause / resume, delete, and test (non-zero exit on failure). Create prints IAM trust onboarding steps; list/get/update/pause/resume/test support--output json.Implementation mirrors existing audit-logs CLI patterns (service interface + thin SDK adapter for list pagination). Broad unit tests cover rendering, validation, KMS wire contract, 409 hints, and pagination.
Reviewed by Cursor Bugbot for commit 0987661. Bugbot is set up for automated code reviews on this repo. Configure here.