-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (49 loc) · 1.75 KB
/
pia.yml
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
59
60
61
62
63
name: PIA IP Updater
on:
schedule:
- cron: '0 */3 * * *' # Runs every 2 hours
workflow_dispatch: # Allows manual trigger
jobs:
update-iocs:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies and zmap
run: |
python -m pip install --upgrade pip
pip install dnspython
pip install requests
sudo apt install zmap
- name: Gather PIA subnets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python pia.py
- name: Generate custom blocklist
run: python blocklist_generator.py
- name: PIA scan
run: sudo zmap -M udp -p 1198 --probe-args=file:openvpn_1194.pkt -w pia_subnet.txt -b custom_blocklist.txt -r 128 -O csv --output-filter="success = 1" -o 'pia_ips_temp.csv'
- name: Clean up zmap output(P)
run: python pia_ip_cleanup.py
- name: Express Subnet detail Generation
run: python PIA_subnet_CSV.py
- name: Configure Git
run: |
git config --local user.email "sudesh@sudesh.com"
git config --local user.name "github-actions[bot]"
- name: Commit changes
run: |
git add pia_ips.csv new_pia_ips.csv pia_subnet.csv
git diff-index --quiet HEAD || git commit -m "[AUTO] update PIA IPs $(date '+%Y-%m-%d %H:%M:%S')"
- name: Push changes
id: push
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}