Skip to content

Commit 715f80a

Browse files
authored
Merge pull request #1 from ziadhany/add-rules
Add support to collect rules using GitHub Actions
2 parents f1116a7 + 7c5a14b commit 715f80a

14 files changed

Lines changed: 2137 additions & 0 deletions
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: 2 Hour sync for collecting Detection Rules
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 */2 * * *'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
scheduled:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v5
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.10'
23+
24+
- name: Install required packages
25+
run: pip install aboutcode.pipeline==0.2.1 fetchcode==0.8.2 plyara==2.2.8 suricataparser==1.0.0
26+
27+
- name: Run sync
28+
run: python rules_collector.py
29+
30+
- name: Commit and push if it changed
31+
run: |-
32+
git config user.name "AboutCode Automation"
33+
git config user.email "automation@aboutcode.org"
34+
git add -A
35+
timestamp=$(date -u)
36+
git commit -m "$(echo -e "Sync Collecting Detection Rules: $timestamp\n\nSigned-off-by: AboutCode Automation <automation@aboutcode.org>")" || exit 0
37+
git push

.gitignore

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
eggs/
15+
.eggs/
16+
lib/
17+
lib64/
18+
parts/
19+
sdist/
20+
var/
21+
wheels/
22+
*.egg-info/
23+
.installed.cfg
24+
*.egg
25+
26+
27+
# Installer logs
28+
pip-log.txt
29+
pip-delete-this-directory.txt
30+
pip-selfcheck.json
31+
32+
# Unit test / coverage reports
33+
htmlcov/
34+
.tox/
35+
.coverage
36+
.coverage.*
37+
.cache
38+
coverage.xml
39+
*.cover
40+
41+
# Translations
42+
*.mo
43+
*.pot
44+
45+
# Django stuff:
46+
*.log
47+
local_settings.py
48+
49+
# Sphinx
50+
docs/_build
51+
docs/bin
52+
docs/build
53+
docs/include
54+
docs/Lib
55+
doc/pyvenv.cfg
56+
pyvenv.cfg
57+
58+
# PyBuilder
59+
target/
60+
61+
# Jupyter Notebook
62+
.ipynb_checkpoints
63+
64+
# pyenv and pip
65+
.python-version
66+
pyvenv.cfg
67+
bin/
68+
69+
# Environments
70+
.env
71+
.venv
72+
env/
73+
venv/
74+
ENV/
75+
76+
77+
# mypy
78+
.mypy_cache/
79+
80+
81+
# Database
82+
*.sqlite3*
83+
84+
# Staticfiles
85+
staticfiles/
86+
87+
# virtualenv
88+
bin
89+
include
90+
lib64
91+
share
92+
Pipfile
93+
94+
# editors
95+
.vscode
96+
# PyCharm
97+
.idea/
98+
99+
# pytest
100+
.pytest_cache
101+
102+
103+
# Various junk and temp files
104+
.DS_Store
105+
*~
106+
.*.sw[po]
107+
.build
108+
.ve
109+
*.bak
110+
/.cache/
111+
/tmp/
112+
113+
# pyenv
114+
/.python-version
115+
/man/
116+
/.pytest_cache/
117+
lib64
118+
tcl
119+
120+
# Ignore Jupyter Notebook related temp files
121+
.ipynb_checkpoints/

0 commit comments

Comments
 (0)