Repository navigation
sec(auth): implement byte-level secret handling and memory scrubbing - #24
Merged
Merged
Conversation
- Add SecretBytes and APIKeyBytes to Credentials with deferred zeroing - Implement AuthenticateWithSecretBytes for mutable OAuth basic auth - Add PasswordBytes, PassphraseBytes, and .Zero() to bigip.Client, SCPOptions, GeoIPOptions, and TransferOptions - Implement .Zero() across downloads, cases, and ihealth clients - Harden proxy CONNECT tunnel auth buffer scrubbing with runtime.KeepAlive - Wire secret scrubbing across all command entry points in cmd/myf5/main.go
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
Implements comprehensive zero-secret memory scrubbing and byte-level secret isolation across API credentials, OAuth tokens, appliance basic auth (iControl REST and SSH/SCP), and HTTP CONNECT proxy tunnels.
Changes
pkg/auth:SecretBytes []byteandAPIKeyBytes []bytetoCredentialswith deferred memory scrubbing in file readers.Credentials.Zero()usingauth.ZeroByteswithruntime.KeepAlive.AuthenticateWithSecretBytesto format Basic Auth credentials in mutable byte slices and immediately zero them post-base64 encoding.pkg/bigip:PasswordBytes []byteandPassphraseBytes []byteacrossClient,SCPOptions,GeoIPOptions, andTransferOptions..Zero()across all option structs andbigip.Client.setAuth.BuildSSHClientConfig..Zero()cleanup to failover methods.pkg/downloads,pkg/cases,pkg/ihealth:Client.Zero()to scrub cached OAuth tokens and API usage keys from heap.pkg/client:zeroBytesinproxy.goandtls.gowithruntime.KeepAliveto guarantee anti-dead-store elimination.cmd/myf5:.Zero()across all command flows (downloads,cases,ihealth,doctor,bigip ready/push/download/qkview/geoip/info).Verification
make all(fmt, vet, test -race, build) passes cleanly.go test -v -race -count=1 ./...all pass.go test -v -race ./internal_docs/oas/...all pass.