-
Notifications
You must be signed in to change notification settings - Fork 0
Remove HMAC shared-secret authentication from docker-runner #15
Copy link
Copy link
Closed
Description
User Request
Remove HMAC shared-secret authentication (DOCKER_RUNNER_SHARED_SECRET) from the docker-runner server. Per the updated architecture (gaps/runner-hmac-removal.md), OpenZiti mTLS is now the sole authentication mechanism for Orchestrator ↔ Runner communication. The client-side (platform) was already cleaned up in agynio/platform#1401.
Specification
Scope
All changes are within agynio/docker-runner.
Files & Changes
1. Delete src/contracts/auth.ts and src/contracts/json.ts (HMAC modules)
- Delete
src/contracts/auth.ts— entire HMAC signing/verification module (buildAuthHeaders,verifyAuthHeaders,signPayload,hashBody,NonceCache,extractHeader, etc.) - Delete
src/contracts/json.ts— canonical JSON serialization helper used only byauth.ts
2. src/index.ts — Remove re-exports
- Remove
export * from './contracts/auth.ts' - Remove
export * from './contracts/json.ts'
3. src/service/config.ts — Remove HMAC config fields
- Remove
sharedSecretfrom therunnerConfigSchemaZod schema - Remove
signatureTtlMsfrom the schema (it controls HMAC nonce TTL, no longer needed) - Remove
sharedSecret: env.DOCKER_RUNNER_SHARED_SECRETfromloadRunnerConfig() - Remove
signatureTtlMs: env.DOCKER_RUNNER_SIGNATURE_TTL_MSfromloadRunnerConfig()
4. src/service/grpc/server.ts — Remove HMAC verification from all RPC handlers
- Remove
import { verifyAuthHeaders } from '../../index.ts' - Remove
NonceCachefrom the import and from theRunnerGrpcOptionstype - Remove the
verifyGrpcAuth()helper function entirely - Remove the
metadataToHeaders()helper function (only used byverifyGrpcAuth) - Remove every
verifyGrpcAuth(...)call and the associatedif (!verification.ok)auth guard block from all RPC handlers:ready,startWorkload,stopWorkload,removeWorkload,inspectWorkload,getWorkloadLabels,findWorkloadsByLabels,listWorkloadsByVolume,removeVolume,touchWorkload,putArchive,streamWorkloadLogs,streamEvents,exec,cancelExecution - Remove
nonceCachefrom theRunnerGrpcOptionstype and usages - Remove
opts.config.sharedSecretreferences
5. src/service/main.ts — Remove NonceCache instantiation
- Remove
NonceCacheimport - Remove
const nonceCache = new NonceCache(...)line - Remove
nonceCachefromcreateRunnerGrpcServer()call
6. Test files — Remove HMAC references
__tests__/helpers/grpc-test-client.ts: RemovebuildAuthHeadersimport andsecretfromcreateGrpcTestClientoptions. ThemetadataFor()helper should return an emptyMetadata(). Removesecretparameter.__tests__/containers.docker.integration.test.ts: RemoveNonceCacheimport,RUNNER_SECRETconstant,sharedSecret/signatureTtlMsfrom config object,nonceCachecreation and usage, andsecret: RUNNER_SECRETfromcreateGrpcTestClientcall.test/e2e/docker-runner.e2e.test.ts: RemoveDOCKER_RUNNER_SHARED_SECRETenv check/guard andsecret: sharedSecretfromcreateGrpcTestClientcall.
Key Constraints
- The gRPC server and test client should continue to function without any auth middleware — OpenZiti mTLS handles auth at the transport layer
- All existing tests must pass after cleanup
- No new authentication logic needs to be added
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels