-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.py
More file actions
executable file
·25 lines (20 loc) · 901 Bytes
/
Copy pathcli.py
File metadata and controls
executable file
·25 lines (20 loc) · 901 Bytes
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
#!/usr/bin/env python3
import argparse
import sys
import os
from core.scanner import SASTScanner
def main():
parser = argparse.ArgumentParser(description="ArrowTech-SAST: High-Velocity Static Analysis")
parser.add_argument("path", help="Directory or file to scan", default=".", nargs="?")
parser.add_argument("--git", action="store_true", help="Scan only uncommitted git changes")
args = parser.parse_args()
if not os.path.exists(args.path):
print(f"[-] Error: Path '{args.path}' does not exist.")
sys.exit(1)
# Move to path for proper relative rule loading if running outside
engine_dir = os.path.dirname(os.path.abspath(__file__))
rules_path = os.path.join(engine_dir, "rules", "custom_rules.yaml")
scanner = SASTScanner(target_path=args.path, rules_path=rules_path, scan_git=args.git)
scanner.run()
if __name__ == "__main__":
main()