-
Notifications
You must be signed in to change notification settings - Fork 63
Fix: Fix the false fail checks in Azure Linux 3 v1.0.0 #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
cfg/Azure_linux_3/definitions.yaml
Outdated
| CRON_DAILY="/etc/cron.daily" | ||
| if [ ! -f "$CRON_DAILY" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC /etc/cron.daily is a folder. maybe I miss something
so do we need to use -d flag here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it is file, I have checked it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, it's a bit strange:
$ docker run -it ubuntu:latest
root@d5af9ad306bf:/# ls -l /etc/ | grep cron
drwxr-xr-x 2 root root 4096 Sep 10 02:20 cron.d
drwxr-xr-x 2 root root 4096 Sep 10 02:20 cron.daily
root@d5af9ad306bf:/# ls /etc/cron.daily/
apt-compat dpkg
cfg/Azure_linux_3/definitions.yaml
Outdated
| if [ ! -f "$CRON_DAILY" ]; then | ||
| echo "cron_daily_missing" | ||
| elif stat -L "$CRON_DAILY" | grep -qE 'Access:\s+\(0700/drwx------\)\s+Uid:\s+\(\s*0/\s*root\)\s+Gid:\s+\(\s*0/\s*root\)'; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe is it make sense to convert permission checks to the numeric stat -Lc style used in 5.1.5–5.1.7 for consistency?
cfg/Azure_linux_3/definitions.yaml
Outdated
| if [ ! -f "$CRON_HOURLY" ]; then | ||
| echo "cron_hourly_missing" | ||
| elif stat -L "$CRON_HOURLY" | grep -qE 'Access:\s+\(0700/drwx------\)\s+Uid:\s+\(\s*0/\s*root\)\s+Gid:\s+\(\s*0/\s*root\)'; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
cfg/Azure_linux_3/definitions.yaml
Outdated
| echo "cron_weekly_permission_ok" | ||
| CRON_WEEKLY="/etc/cron.weekly" | ||
| if [ ! -f "$CRON_WEEKLY" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
cfg/Azure_linux_3/definitions.yaml
Outdated
| CRON_DAILY="/etc/cron.daily" | ||
| if [ ! -f "$CRON_DAILY" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, it's a bit strange:
$ docker run -it ubuntu:latest
root@d5af9ad306bf:/# ls -l /etc/ | grep cron
drwxr-xr-x 2 root root 4096 Sep 10 02:20 cron.d
drwxr-xr-x 2 root root 4096 Sep 10 02:20 cron.daily
root@d5af9ad306bf:/# ls /etc/cron.daily/
apt-compat dpkg
Summary
This PR fixes test expectations and handling for several CIS checks to improve accuracy and reduce false failures.
Changes
Rationale
Results:

Check 2.2.18
Check 4.1.1

Check 5.1.2-5.1.7
