-
Notifications
You must be signed in to change notification settings - Fork 11
52 lines (42 loc) · 2.03 KB
/
update-db.yaml
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
name: "Update resources database"
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@master
- name: Install dependencies
run: |
sudo apt install zstd tar wget -y
- name: Downloading latest nuclei-templates
run: |
wget -q https://github.com/projectdiscovery/nuclei-templates/archive/refs/heads/main.zip
unzip main.zip
working-directory: "/tmp"
- name: Downloading other resources
run: |
mkdir -p db
wget -q "https://raw.githubusercontent.com/dwisiswant0/cwa-filter-rules/master/dist/filters.json" -O "db/common-web-attacks.json" &
wget -q "https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/_generator_lists/bad-ip-addresses.list" -O "db/bad-ip-addresses.txt" &
wget -q "https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/_generator_lists/bad-referrers.list" -O "db/bad-referrers.txt" &
wget -q "https://raw.githubusercontent.com/JayBizzle/Crawler-Detect/master/raw/Crawlers.txt" -O "db/bad-crawlers.txt" &
wget -q "https://raw.githubusercontent.com/maurosoria/dirsearch/master/db/dicc.txt" -O "db/directory-bruteforces.txt" &
wait
- name: Convert CVEs resources
run: python .github/scripts/convert-cves.py
- name: Push resources
run: |
[[ "$(git status -s | wc -l)" == 0 ]] && exit 0
cd db/; rm -f *.zst MD5SUMS; tar -cf - * | zstd -o "db.tar.zst"; md5sum * > MD5SUMS
COMMIT_MSG="db: "
[[ "${{ github.event_name }}" == "workflow_dispatch" ]] && COMMIT_MSG+="[force] "
COMMIT_MSG+="Update resources [$(date)] :robot:"
git config --local user.email "[email protected]"
git config --local user.name "Dwi Siswanto"
git add .
git commit -m "${COMMIT_MSG}"
git push origin master