Skip to content

Commit

Permalink
ci: add readonly bind mount option
Browse files Browse the repository at this point in the history
Signed-off-by: Boris Glimcher <[email protected]>
  • Loading branch information
glimchb committed Jun 19, 2024
1 parent f969315 commit 5e0bd35
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/run_agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ ls -l /mnt/
DHCLIENT_LEASE_FILE=/var/lib/NetworkManager/dhclient-eth0.lease
docker run --rm -it --network=host -v /mnt/:/mnt \
--mount type=bind,source=/etc/ssh,target=/etc/ssh,readonly \
--mount type=bind,source=/etc/os-release,target=/etc/os-release \
--mount type=bind,source=${DHCLIENT_LEASE_FILE},target=/var/lib/dhclient/dhclient.leases \
--mount type=bind,source=/etc/os-release,target=/etc/os-release,readonly \
--mount type=bind,source=${DHCLIENT_LEASE_FILE},target=/var/lib/dhclient/dhclient.leases,readonly \
${DOCKER_SZTP_IMAGE} \
/opi-sztp-agent daemon \
--bootstrap-trust-anchor-cert /mnt/opi.pem \
Expand Down
1 change: 1 addition & 0 deletions sztp-agent/pkg/secureagent/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ func readSSHHostKeyPublicFiles(pattern string) []publicKey {
for _, f := range files {
// nolint:gosec
data, _ := os.ReadFile(f)
// TODO: consider switching to https://pkg.go.dev/golang.org/x/crypto/ssh#ParseAuthorizedKey
parts := strings.Fields(string(data))
// [type-name] [base64-encoded-ssh-public-key] [comment]
if len(parts) < 2 {
Expand Down

0 comments on commit 5e0bd35

Please sign in to comment.