-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test_section_03_level1.yml: update to Ubuntu 20.04
- Loading branch information
1 parent
74e76c1
commit 5fd2079
Showing
3 changed files
with
250 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
# | ||
# 3.1.2 Ensure wireless interfaces are disabled (Automated) | ||
# | ||
# Description: | ||
# Wireless networking is used when wired networks are unavailable. Ubuntu | ||
# contains a wireless tool kit to allow system administrators to configure | ||
# and use wireless networks. | ||
# | ||
# Rationale: | ||
# If wireless is not to be used, wireless devices can be disabled to reduce | ||
# the potential attack surface. | ||
|
||
set -o errexit | ||
set -o nounset | ||
|
||
dm="" | ||
driverdir="" | ||
drivers="" | ||
status="0" | ||
t="0" | ||
|
||
command -v nmcli >/dev/null 2>&1 || status="1" | ||
|
||
if [[ "${status}" -eq 0 ]]; then | ||
nmcli radio all | grep -Eq '\s*\S+\s+disabled\s+\S+\s+disabled\b' || status="1" | ||
if [[ "${status}" -eq 1 ]]; then | ||
echo "Wireless is not enabled" | ||
fi | ||
elif [[ -n "$(find /sys/class/net/*/ -type d -name wireless)" ]]; then | ||
drivers=$(for driverdir in $(find /sys/class/net/*/ -type d -name wireless | xargs -0 dirname); do basename "$(readlink -f "${driverdir}"/device/driver)"; done | sort -u) | ||
for dm in ${drivers}; do | ||
if grep -Eq "^\s*install\s+${dm}\s+/bin/(true|false)" /etc/modprobe.d/*.conf; then | ||
/bin/true | ||
else | ||
echo "${dm} is not disabled" | ||
t="1" | ||
fi | ||
done | ||
if [[ "${t}" -eq 0 ]]; then | ||
echo "Wireless is not enabled" | ||
fi | ||
else | ||
echo "Wireless is not enabled" | ||
fi |
Oops, something went wrong.