-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathrun_audit.sh
More file actions
executable file
·49 lines (40 loc) · 1.32 KB
/
run_audit.sh
File metadata and controls
executable file
·49 lines (40 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
# SPDX-FileCopyrightText: GitHub, Inc.
# SPDX-License-Identifier: MIT
set -e
USE_ADVISORY=false
# Parse flags
while [[ "$1" == --* ]]; do
case "$1" in
--advisory)
USE_ADVISORY=true
shift
;;
*)
echo "Unknown option: $1"
exit 1
;;
esac
done
if [ -z "$1" ]; then
echo "Usage: $0 [--advisory] <repo>";
exit 1;
fi
python -m seclab_taskflow_agent -t seclab_taskflows.taskflows.audit.fetch_source_code -g repo="$1"
python -m seclab_taskflow_agent -t seclab_taskflows.taskflows.audit.identify_applications -g repo="$1"
python -m seclab_taskflow_agent -t seclab_taskflows.taskflows.audit.gather_web_entry_point_info -g repo="$1"
if [ "$USE_ADVISORY" = true ]; then
python -m seclab_taskflow_agent -t seclab_taskflows.taskflows.audit.fetch_security_advisories -g repo="$1"
fi
python -m seclab_taskflow_agent -t seclab_taskflows.taskflows.audit.classify_application_local -g repo="$1"
python -m seclab_taskflow_agent -t seclab_taskflows.taskflows.audit.audit_issue_local_iter -g repo="$1"
set +e
# If in codespaces, open the results database.
if [ -v CODESPACES ]; then
RESULTS_DB=~/.local/share/seclab-taskflow-agent/seclab-taskflows/repo_context/repo_context.db
if [ -f "$RESULTS_DB" ]; then
if command -v code >/dev/null 2>&1; then
code "$RESULTS_DB"
fi
fi
fi