forked from thinkst/opencanary
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding automated CI testing via Github Actions (thinkst#175)
* Adds automated CI tests via Github Actions * Updates Jinja2 for python 3.10 * Fixes tests * Disables fail-fast so all parallel jobs complete
- Loading branch information
Showing
5 changed files
with
162 additions
and
5 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: OpenCanary Tests | ||
|
||
on: | ||
- "push" | ||
- "pull_request" | ||
|
||
jobs: | ||
opencanary_tests: | ||
strategy: | ||
matrix: | ||
python-version: ["3.7", "3.8", "3.9", "3.10"] | ||
os: ["ubuntu-18.04", "ubuntu-20.04", "macos-10.15", "macos-11"] | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: "Check out repository code" | ||
uses: "actions/checkout@v2" | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "${{ matrix.python-version }}" | ||
- name: Install required linux dependencies | ||
if: ${{ contains(matrix.os, 'ubuntu') }} | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install python3-setuptools | ||
- name: Install wheel | ||
run: sudo pip3 install wheel | ||
- name: Create package | ||
run: sudo python3 setup.py sdist | ||
- name: Install package | ||
run: sudo pip3 install dist/opencanary-*.tar.gz | ||
- name: Install test dependencies | ||
run: sudo pip3 install -r opencanary/test/requirements.txt | ||
- name: Copy config file | ||
run: cp opencanary/test/opencanary.conf . | ||
- name: Start OpenCanary | ||
run: opencanaryd --start | ||
- name: Run Pytest | ||
run: pytest -s |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
{ | ||
"device.node_id": "opencanary-1", | ||
"ip.ignorelist": [ ], | ||
"git.enabled": true, | ||
"git.port" : 9418, | ||
"ftp.enabled": true, | ||
"ftp.port": 21, | ||
"ftp.banner": "FTP server ready", | ||
"http.banner": "Apache/2.2.22 (Ubuntu)", | ||
"http.enabled": true, | ||
"http.port": 80, | ||
"http.skin": "nasLogin", | ||
"http.skin.list": [ | ||
{ | ||
"desc": "Plain HTML Login", | ||
"name": "basicLogin" | ||
}, | ||
{ | ||
"desc": "Synology NAS Login", | ||
"name": "nasLogin" | ||
} | ||
], | ||
"httpproxy.enabled" : false, | ||
"httpproxy.port": 8080, | ||
"httpproxy.skin": "squid", | ||
"httproxy.skin.list": [ | ||
{ | ||
"desc": "Squid", | ||
"name": "squid" | ||
}, | ||
{ | ||
"desc": "Microsoft ISA Server Web Proxy", | ||
"name": "ms-isa" | ||
} | ||
], | ||
"logger": { | ||
"class": "PyLogger", | ||
"kwargs": { | ||
"formatters": { | ||
"plain": { | ||
"format": "%(message)s" | ||
}, | ||
"syslog_rfc": { | ||
"format": "opencanaryd[%(process)-5s:%(thread)d]: %(name)s %(levelname)-5s %(message)s" | ||
} | ||
}, | ||
"handlers": { | ||
"console": { | ||
"class": "logging.StreamHandler", | ||
"stream": "ext://sys.stdout" | ||
}, | ||
"file": { | ||
"class": "logging.FileHandler", | ||
"filename": "/var/tmp/opencanary.log" | ||
} | ||
} | ||
} | ||
}, | ||
"portscan.enabled": false, | ||
"portscan.ignore_localhost": false, | ||
"portscan.logfile":"/var/log/kern.log", | ||
"portscan.synrate": 5, | ||
"portscan.nmaposrate": 5, | ||
"portscan.lorate": 3, | ||
"smb.auditfile": "/var/log/samba-audit.log", | ||
"smb.enabled": false, | ||
"mysql.enabled": true, | ||
"mysql.port": 3306, | ||
"mysql.banner": "5.5.43-0ubuntu0.14.04.1", | ||
"ssh.enabled": true, | ||
"ssh.port": 2222, | ||
"ssh.version": "SSH-2.0-OpenSSH_5.1p1 Debian-4", | ||
"redis.enabled": false, | ||
"redis.port": 6379, | ||
"rdp.enabled": false, | ||
"rdp.port": 3389, | ||
"sip.enabled": false, | ||
"sip.port": 5060, | ||
"snmp.enabled": false, | ||
"snmp.port": 161, | ||
"ntp.enabled": true, | ||
"ntp.port": 123, | ||
"tftp.enabled": false, | ||
"tftp.port": 69, | ||
"tcpbanner.maxnum":10, | ||
"tcpbanner.enabled": false, | ||
"tcpbanner_1.enabled": false, | ||
"tcpbanner_1.port": 8001, | ||
"tcpbanner_1.datareceivedbanner": "", | ||
"tcpbanner_1.initbanner": "", | ||
"tcpbanner_1.alertstring.enabled": false, | ||
"tcpbanner_1.alertstring": "", | ||
"tcpbanner_1.keep_alive.enabled": false, | ||
"tcpbanner_1.keep_alive_secret": "", | ||
"tcpbanner_1.keep_alive_probes": 11, | ||
"tcpbanner_1.keep_alive_interval":300, | ||
"tcpbanner_1.keep_alive_idle": 300, | ||
"telnet.enabled": false, | ||
"telnet.port": 23, | ||
"telnet.banner": "", | ||
"telnet.honeycreds": [ | ||
{ | ||
"username": "admin", | ||
"password": "$pbkdf2-sha512$19000$bG1NaY3xvjdGyBlj7N37Xw$dGrmBqqWa1okTCpN3QEmeo9j5DuV2u1EuVFD8Di0GxNiM64To5O/Y66f7UASvnQr8.LCzqTm6awC8Kj/aGKvwA" | ||
}, | ||
{ | ||
"username": "admin", | ||
"password": "admin1" | ||
} | ||
], | ||
"mssql.enabled": false, | ||
"mssql.version": "2012", | ||
"mssql.port":1433, | ||
"vnc.enabled": false, | ||
"vnc.port":5000 | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
requests | ||
paramiko | ||
PyMySQL | ||
gitpython | ||
gitpython | ||
pytest |
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