Skip to content

Commit

Permalink
Merge pull request #5297 from hashicorp/backport/moduli-fix-vault-tes…
Browse files Browse the repository at this point in the history
…t/largely-key-oriole

This pull request was automerged via backport-assistant
  • Loading branch information
hc-github-team-secure-boundary authored Dec 2, 2024
2 parents ca3e9e7 + febb3d5 commit 71d6bc3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1

cp /ca/ca-key.pub /etc/ssh/ca-key.pub
chown 1000:1000 /etc/ssh/ca-key.pub
chmod 644 /etc/ssh/ca-key.pub
echo TrustedUserCAKeys /etc/ssh/ca-key.pub >> /etc/ssh/sshd_config
echo PermitTTY yes >> /etc/ssh/sshd_config
sed -i 's/X11Forwarding no/X11Forwarding yes/' /etc/ssh/sshd_config
echo "X11UseLocalhost no" >> /etc/ssh/sshd_config
cp /ca/ca-key.pub /config/sshd/ca-key.pub
chown 1000:1000 /config/sshd/ca-key.pub
chmod 644 /config/sshd/ca-key.pub
echo TrustedUserCAKeys /config/sshd/ca-key.pub >> /config/sshd/sshd_config
echo PermitTTY yes >> /config/sshd/sshd_config
sed -i 's/X11Forwarding no/X11Forwarding yes/' /config/sshd/sshd_config
echo "X11UseLocalhost no" >> /config/sshd/sshd_config

apk update
apk add xterm util-linux dbus ttf-freefont xauth firefox
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/with-contenv bash
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1

sed -i 's/AllowTcpForwarding no/AllowTcpForwarding yes/' /config/sshd/sshd_config
10 changes: 8 additions & 2 deletions enos/modules/docker_openssh_server_ca_key/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,14 @@ locals {
ca_public_key = data.tls_public_key.ca_key.public_key_openssh
}

data "docker_registry_image" "openssh" {
name = var.image_name
}

resource "docker_image" "openssh_server" {
name = var.image_name
keep_locally = true
name = var.image_name
keep_locally = true
pull_triggers = [data.docker_registry_image.openssh.sha256_digest]
}

resource "docker_container" "openssh_server" {
Expand All @@ -75,6 +80,7 @@ resource "docker_container" "openssh_server" {
"TZ=US/Eastern",
"USER_NAME=${var.target_user}",
"PUBLIC_KEY=${local.ssh_public_key}",
"SUDO_ACCESS=true",
]
network_mode = "bridge"
dynamic "networks_advanced" {
Expand Down

0 comments on commit 71d6bc3

Please sign in to comment.