Update resources database #991
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/Bo0oM/fuzz.txt/master/fuzz.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 "ghost" | |
git add . | |
git commit -m "${COMMIT_MSG}" | |
git push origin master |