Skip to content

Commit c048ffa

Browse files
mnaserclaude
andcommitted
feat: add goss tests for container validation
Add goss-based testing to validate the built container image: - nova user exists with correct uid/gid/home/shell - Required packages installed (openssh-server, openssh-client, iproute2) - Required directories exist with correct ownership - SSH hardening config is present Uses Depot's ephemeral registry to pass the built image between the build and test jobs without pushing to ghcr.io for PRs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Mohammed Naser <mnaser@vexxhost.com>
1 parent be6adfa commit c048ffa

2 files changed

Lines changed: 79 additions & 0 deletions

File tree

.github/workflows/image.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,25 @@ jobs:
1515
id-token: write
1616
packages: write
1717
pull-requests: write
18+
outputs:
19+
build-id: ${{ steps.build.outputs.build-id }}
1820
steps:
1921
- uses: vexxhost/docker-atmosphere/.github/actions/build-image@main
22+
id: build
2023
with:
2124
image-name: nova-ssh
2225
push: ${{ github.event_name != 'pull_request' }}
26+
save: true
27+
28+
test:
29+
needs: build
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
- uses: depot/setup-action@v1
34+
- uses: depot/pull-action@v1
35+
with:
36+
build-id: ${{ needs.build.outputs.build-id }}
37+
tags: nova-ssh:test
38+
- uses: e1himself/goss-installation-action@v1
39+
- run: dgoss run nova-ssh:test sleep infinity

goss.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# SPDX-FileCopyrightText: © 2025 VEXXHOST, Inc.
2+
# SPDX-License-Identifier: GPL-3.0-or-later
3+
4+
user:
5+
nova:
6+
exists: true
7+
uid: 42424
8+
gid: 42424
9+
home: /var/lib/nova
10+
shell: /bin/bash
11+
12+
group:
13+
nova:
14+
exists: true
15+
gid: 42424
16+
17+
package:
18+
openssh-server:
19+
installed: true
20+
openssh-client:
21+
installed: true
22+
iproute2:
23+
installed: true
24+
25+
file:
26+
/var/lib/nova:
27+
exists: true
28+
owner: nova
29+
group: nova
30+
filetype: directory
31+
/etc/nova:
32+
exists: true
33+
owner: nova
34+
group: nova
35+
filetype: directory
36+
/var/log/nova:
37+
exists: true
38+
owner: nova
39+
group: nova
40+
filetype: directory
41+
/var/cache/nova:
42+
exists: true
43+
owner: nova
44+
group: nova
45+
filetype: directory
46+
/etc/ssh:
47+
exists: true
48+
owner: nova
49+
group: nova
50+
filetype: directory
51+
/var/run/sshd:
52+
exists: true
53+
mode: "0755"
54+
filetype: directory
55+
/etc/ssh/sshd_config.d/00-hardening.conf:
56+
exists: true
57+
contains:
58+
- "Ciphers aes256-ctr,aes192-ctr"
59+
- "MACs hmac-sha2-512,hmac-sha2-256"
60+
- "KexAlgorithms diffie-hellman-group-exchange-sha256"
61+
- "HostKeyAlgorithms ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521"
62+
- "MaxAuthTries 3"

0 commit comments

Comments
 (0)