feat(ssh): support ssh known hosts file (#6263)

This commit is contained in:
Louis Ruch authored and GitHub committed 2025-11-19 16:24:20 -08:00
1 parent 6533c8bdb3
commit 4bae4f23f5
7 files changed
+281 -2

No files matched your search

+8
View File
@@ -113,6 +113,7 @@ type Command struct {
flagWorkerAuthCaCertificateLifetime time.Duration
flagWorkerAuthDebuggingEnabled bool
flagWorkerRecordingStorageDir string
flagSshKnownHostsPath string
flagWorkerRecordingStorageMinimumAvailableCapacity string
flagBsrKey string
}
@@ -427,6 +428,12 @@ func (c *Command) Flags() *base.FlagSets {
Usage: "Specifies the directory to store worker session recordings in dev mode. If not provided a temp directory will be created. Session recording is an Enterprise-only feature.",
})
f.StringVar(&base.StringVar{
Name: "worker-ssh-known-hosts-path",
Target: &c.flagSshKnownHostsPath,
Usage: "Specifies the path of the known_hosts file to be used by the worker for SSH host key verification of an SSH target in dev mode. SSH targets and SSH credential injection are Enterprise-only features.",
})
f.StringVar(&base.StringVar{
Name: "worker-recording-storage-minimum-available-capacity",
Target: &c.flagWorkerRecordingStorageMinimumAvailableCapacity,
@@ -533,6 +540,7 @@ func (c *Command) Run(args []string) int {
c.Config.Plugins.ExecutionDir = c.flagPluginExecutionDir
if !c.flagControllerOnly {
c.Config.Worker.SshKnownHostsPath = c.flagSshKnownHostsPath
c.Config.Worker.AuthStoragePath = c.flagWorkerAuthStorageDir
c.Config.Worker.RecordingStoragePath = c.flagWorkerRecordingStorageDir
c.Config.Worker.RecordingStorageMinimumAvailableCapacity = c.flagWorkerRecordingStorageMinimumAvailableCapacity
+5
View File
@@ -393,6 +393,11 @@ type Worker struct {
// they are sync'ed to the corresponding storage bucket. The path must already exist.
RecordingStoragePath string `hcl:"recording_storage_path"`
// SshKnownHostsPath represents the location of the known_hosts file to be used by the worker
// for SSH host key verification when connecting to ssh targets. The path must already exist.
// If not provided the worker will skip host key verification.
SshKnownHostsPath string `hcl:"ssh_known_hosts_path"`
// RecordingStorageMinimumAvailableCapacity represents the minimum amount of available
// disk space a worker needs in the path defined by RecordingStoragePath for processing
// sessions with recording enabled. The expected input value for this field is a