mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2025-12-06 09:12:45 +01:00
Drop password requirement for sudo access during automated tests
This commit is contained in:
@@ -2200,6 +2200,13 @@ mark_version() {
|
||||
echo "$SOVERSION" > /etc/soversion
|
||||
}
|
||||
|
||||
update_sudoers_for_testing() {
|
||||
if [ -n "$TESTING" ]; then
|
||||
info "Ensuring $INSTALLUSERNAME has password-less sudo access for automated testing purposes."
|
||||
sed -i "s/^$INSTALLUSERNAME ALL=(ALL) ALL/^$INSTALLUSERNAME ALL=(ALL) NOPASSWD:ALL/" /etc/sudoers
|
||||
fi
|
||||
}
|
||||
|
||||
update_sudoers() {
|
||||
|
||||
if ! grep -qE '^soremote\ ALL=\(ALL\)\ NOPASSWD:(\/usr\/bin\/salt\-key|\/opt\/so\/saltstack)' /etc/sudoers; then
|
||||
|
||||
@@ -594,6 +594,7 @@ set_redirect >> $setup_log 2>&1
|
||||
|
||||
set_progress_str 10 'Updating sudoers file for soremote user'
|
||||
update_sudoers >> $setup_log 2>&1
|
||||
update_sudoers_for_testing >> $setup_log 2>&1
|
||||
|
||||
set_progress_str 11 'Generating manager global pillar'
|
||||
#minio_generate_keys
|
||||
|
||||
Reference in New Issue
Block a user