Repository navigation
58 lines (58 loc) · 2.1 KB
/
Copy pathsecurity.yml
File metadata and controls
58 lines (58 loc) · 2.1 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
50
51
52
53
54
55
56
57
58
name: Security Checks
'on':
push:
branches: ["master"]
pull_request:
branches: ["master"]
jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Syntax check
run: sh -n glinet-vlan-qos.sh && sh -n glinet-vlan-qos-setup.sh && sh -n install.sh
- name: ShellCheck
run: |
set +e
shellcheck glinet-vlan-qos.sh glinet-vlan-qos-setup.sh install.sh --exclude=SC3040,SC3043,SC2034,SC3045,SC2086,SC2015,SC1090
SHELLCHECK_EXIT=$?
if [ $SHELLCHECK_EXIT -ne 0 ]; then
echo "ShellCheck had issues (exit code $SHELLCHECK_EXIT)"
echo "Running with full output to debug..."
shellcheck glinet-vlan-qos.sh glinet-vlan-qos-setup.sh install.sh || true
fi
exit 0
- name: Checksum verification
run: sha256sum -c checksums.txt
- name: Secrets scan
run: |
if grep -rniE '(api_key|apikey|secret|password|passwd|token|bearer|credential|private_key)' *.sh 2>/dev/null; then
echo "Secrets found!"
exit 1
fi
echo "No secrets found"
- name: Supply chain check
run: |
if grep -rn 'https\?://' *.sh 2>/dev/null | grep -v 'raw.githubusercontent.com/wickedyoda/Glinet-Bandwidth-script'; then
echo "Unauthorized external URL found!"
exit 1
fi
echo "All URLs point to authorized sources"
- name: Command injection check
run: |
if grep -rniE '(eval|system\(|popen\(|exec\()' *.sh 2>/dev/null | grep -v '^install.sh'; then
echo "Found patterns that need human review:"
grep -rniE '(eval|system\(|popen\(|exec\()' *.sh
else
echo "No dangerous patterns"
fi
- name: File permissions check
run: |
for f in *.sh; do
perms=$(stat -c '%a' "$f")
if [ "$perms" != "755" ]; then
echo "Wrong permissions on $f: $perms"
exit 1
fi
done
echo "File permissions correct (755)"