mirror of
https://github.com/usnistgov/macos_security.git
synced 2026-02-03 14:03:24 +00:00
This commit is contained in:
@@ -5,12 +5,24 @@ discussion: |
|
||||
|
||||
NOTE: The built in web server service is disabled at startup by default macOS.
|
||||
check: |
|
||||
/bin/launchctl print-disabled system | /usr/bin/grep -c '"org.apache.httpd" => disabled'
|
||||
result="FAIL"
|
||||
enabled=$(/bin/launchctl print-disabled system | /usr/bin/grep '"org.apache.httpd" => enabled')
|
||||
running=$(/bin/launchctl print system/org.apache.httpd 2>/dev/null)
|
||||
|
||||
if [[ -z "$running" ]] && [[ -z "$enabled" ]]; then
|
||||
result="PASS"
|
||||
elif [[ -n "$running" ]]; then
|
||||
result=result+" RUNNING"
|
||||
elif [[ -n "$enabled" ]]; then
|
||||
result=result+" ENABLED"
|
||||
fi
|
||||
echo $result
|
||||
result:
|
||||
integer: 1
|
||||
string: PASS
|
||||
fix: |
|
||||
[source,bash]
|
||||
----
|
||||
/usr/sbin/apachectl stop 2>/dev/null
|
||||
/bin/launchctl disable system/org.apache.httpd
|
||||
----
|
||||
references:
|
||||
|
||||
Reference in New Issue
Block a user