Skip to content

Commit 2394b0d

Browse files
committed
fix: ubuntu user path
1 parent 40552d8 commit 2394b0d

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

ansible/files/cis_baseline_check.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
# This script validates that the machine matches the committed baseline
55
# specifications using supascan (pre-installed via nix profile for ubuntu user).
66
#
7-
# Must be run as ubuntu user with sudo access (supascan calls sudo goss internally).
8-
#
97
# Usage: cis_baseline_check.sh [baselines-dir]
108

119
set -euo pipefail
@@ -25,9 +23,8 @@ if [[ ! -d $BASELINES_DIR ]]; then
2523
exit 1
2624
fi
2725

28-
# Source nix environment (for ubuntu user's profile)
29-
# shellcheck source=/dev/null
30-
. /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
26+
# Add ubuntu user's nix profile to PATH
27+
export PATH="/home/ubuntu/.nix-profile/bin:$PATH"
3128

3229
# Verify supascan is available
3330
if ! command -v supascan &>/dev/null; then

ansible/playbook.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@
222222

223223
- name: Run CIS baseline validation
224224
become: yes
225-
become_user: ubuntu
226225
shell: |
227226
/bin/bash /tmp/ansible-playbook/ansible/files/cis_baseline_check.sh /tmp/ansible-playbook/audit-specs/baselines
228227
when: stage2_nix

0 commit comments

Comments
 (0)