【发布时间】:2017-06-07 01:47:18
【问题描述】:
我的问题是,我如何编辑脚本以使 如果 PASS_MAX_DAYS 等于或小于 14 天,那么它等于“漏洞:否”?
我的脚本
#!/bin/bash
passwordexpiry=`grep "^PASS_MAX_DAYS" /etc/login.defs`
if [[ $(passwordexpiry) == "PASS_MAX_DAYS 99999" ]]
then
isVulnerable="Yes"
else
isVulnerable="No"
fi
echo "Audit criteria: The passowrds expires every 2 weeks"
echo "Vulnerability: ${isVulnerable}"
echo "Details: See below"
echo
echo "Command:"
echo "grep "^PASS_MAX_DAYS" /etc/login.defs"
echo
echo "Output:"
echo ${passwordexpiry}
echo
【问题讨论】:
标签: linux bash scripting audit