-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (53 loc) · 1.72 KB
/
main.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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
name: MISP Warning List
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
workflow:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"
steps:
- uses: actions/checkout@v2
- name: Create header of warning list
run: |
cat > MISP/scanning-projects.json <<EOF
{
"description": "List of known SLDs that are known to perform enumeration or active testing/scanning",
"list": [
EOF
- name: Create individual entries in the warning list
run: |
while read line; do
if ! [ -z "$lastline" ]; then
echo " \"$line\"," >> MISP/scanning-projects.json
fi
lastline=$line
done <ptrb-domains.txt
# Hey, don't judge me!
sed -i '$ d' MISP/scanning-projects.json
echo " \"$lastline\"" >> MISP/scanning-projects.json
- name: Create footer of warning list
run: |
cat >> MISP/scanning-projects.json <<EOF
],
"matching_attributes": [
"domain",
"hostname"
],
"name": "3CORESec PTR Bouncer Community List",
"type": "substring",
"version": "$(date +%d%m%Y%H%M)"
}
EOF
- name: Commit generated layer file to local repository
run: |
git config --global user.name 'Github Actions'
git config --global user.email 'robot@noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/3CORESec/PTRB
git add MISP/scanning-projects.json
git commit -m "New MISP Warning List by CI/CD"
git push