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

fixed csv containing number of syscalls #53

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
17 changes: 17 additions & 0 deletions infrastructure/data/no_of_syscalls.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Benchmark-(small),System Calls
aurpkg,881299
bio,132714
covid-mts,30258
file-enc,241927
log-analysis,116448888
makeself,2212019
max-temp,1576
media-conv,794398
nlp,1928929
oneliners,1675820
riker,2579121
sklearn,2403510
unix50,48667
vps-audit,362870
vps-audit-negate,362878
web-index,1544549
14 changes: 0 additions & 14 deletions infrastructure/data/sys_summary.csv

This file was deleted.

4 changes: 0 additions & 4 deletions vps-audit-negate/cleanup.sh

This file was deleted.

16 changes: 0 additions & 16 deletions vps-audit-negate/deps.sh

This file was deleted.

2 changes: 0 additions & 2 deletions vps-audit-negate/hash/vps-audit-negate-processed.hash

This file was deleted.

2 changes: 0 additions & 2 deletions vps-audit-negate/input.sh

This file was deleted.

10 changes: 0 additions & 10 deletions vps-audit-negate/run.sh

This file was deleted.

136 changes: 0 additions & 136 deletions vps-audit-negate/verify.py

This file was deleted.

10 changes: 0 additions & 10 deletions vps-audit-negate/verify.sh

This file was deleted.

2 changes: 1 addition & 1 deletion vps-audit/cleanup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

rm *.txt
rm vps-audit-processed.out
rm -r outputs
2 changes: 2 additions & 0 deletions vps-audit/hash/vps-audit-negate-processed.hash
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
6b39550762e5222a83afa2eb0e5ff34f18170a26b09abcd9f6104f3967861d60
dfe41d6c2b3a193e77891cf9235850aea31c4d6acff897c0cf6970da97705497
4 changes: 2 additions & 2 deletions vps-audit/hash/vps-audit-processed.hash
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
05652a7062706f7fcf1a8dd3533968098448c630ed6c56bcfe2bb49ef97a3758
42683cc92e7d5f15eb689c53027a61de2d5249c806787011f0540b768f5325d0
6b39550762e5222a83afa2eb0e5ff34f18170a26b09abcd9f6104f3967861d60
dfe41d6c2b3a193e77891cf9235850aea31c4d6acff897c0cf6970da97705497
8 changes: 6 additions & 2 deletions vps-audit/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ BENCHMARK_SHELL=${BENCHMARK_SHELL:-bash}
REPO_TOP=$(git rev-parse --show-toplevel)
eval_dir="${REPO_TOP}/vps-audit"
scripts_dir="${eval_dir}/scripts"
main_script="${scripts_dir}/vps-audit.sh"
script_1="${scripts_dir}/vps-audit.sh"
script_2="${scripts_dir}/vps-audit-negate.sh"
mkdir -p "${eval_dir}/outputs"
echo "Starting VPS audit..."
${BENCHMARK_SHELL} "${main_script}"
${BENCHMARK_SHELL} "${script_1}" > "${eval_dir}/outputs/vps-audit.log"
echo $?
echo "Starting VPS audit negate..."
${BENCHMARK_SHELL} "${script_2}" > "${eval_dir}/outputs/vps-audit-negate.log"
echo $?
23 changes: 13 additions & 10 deletions vps-audit/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
import sys


input_file = "vps-audit.out"
error_file = "vps-audit.err"
output_file = "vps-audit-processed.out"
output_dir = "outputs"
input_file_1 = "outputs/vps-audit.log"
input_file_2 = "outputs/vps-audit-negate.log"
output_file_1 = "vps-audit-processed.out"
output_file_2 = "vps-audit-negate-processed.out"
hash_folder = "hash"

ansi_escape = re.compile(r'\x1b\[[0-9;]*m')
Expand All @@ -20,10 +22,6 @@
"SSH Root Login",
"SSH Password Auth",
"SSH Port",
"Firewall Status (UFW)",
"Firewall Status (firewalld)",
"Firewall Status (iptables)",
"Firewall Status (nftables)",
"Firewall Status",
"Unattended Upgrades",
"Fail2ban",
Expand Down Expand Up @@ -63,6 +61,8 @@ def clean_line(line):

line = re.sub(r'vps-audit-report-\S+', '', line)

line = re.sub(r'vps-audit-negate-report-\S+', '', line)

if ':' in line and any(marker in line for marker in sys_info_markers):
line = line.split(':', 1)[0] + ':'

Expand Down Expand Up @@ -126,11 +126,14 @@ def compare_hashes(file_path, hash_folder):

os.makedirs(hash_folder, exist_ok=True)

process_file(input_file, output_file)
process_file(input_file_1, output_file_1)
process_file(input_file_2, output_file_2)

if args.generate:
print("Generate mode enabled. Hashes will be generated.")
generate_hash(output_file, hash_folder)
generate_hash(output_file_1, hash_folder)
generate_hash(output_file_2, hash_folder)
else:
print("Comparison mode enabled. Hashes will be compared.")
compare_hashes(output_file, hash_folder)
compare_hashes(output_file_1, hash_folder)
compare_hashes(output_file_2, hash_folder)
Loading