Skip to content
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

Simplify generated augen bash expressions #8254

Merged
merged 1 commit into from
Feb 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion shared/macros-bash.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,14 @@ do
# searched all of the files from /etc/audit/rules.d/*.rules location (since that audit rule can be defined
# in any of those files and if not, we want it to be inserted only once into /etc/audit/rules.d/privileged.rules file)
#
elif [ "{{{ tool }}}" == "auditctl" ] || [[ "{{{ tool }}}" == "augenrules" && $count_of_inspected_files -eq "${#files_to_inspect[@]}" ]]
{{% if tool in ("augenrules", "auditctl") -%}}
{{% if tool == "augenrules" -%}}
elif [[ $count_of_inspected_files -eq "${#files_to_inspect[@]}" ]]
then
{{%- endif %}}
{{% if tool == "auditctl" -%}}
else
{{%- endif %}}
# Check if this sbinary wasn't already handled in some of the previous afile iterations
# Return match only if whole sbinary definition matched (not in the case just prefix matched!!!)
if [[ ! $(sed -ne "\|${sbinary}|p" <<< "${sbinaries_to_skip[*]}") ]]
Expand All @@ -286,6 +292,7 @@ do
echo "$expected_rule" >> "$output_audit_file"
fi
continue
{{%- endif %}}
fi
done
done
Expand Down