From e3ea4ee44ed129ab4fb9e4f93a0a373e0417a025 Mon Sep 17 00:00:00 2001 From: Jacob Torrey Date: Tue, 31 Oct 2023 17:13:31 -0600 Subject: [PATCH] +(opencanaryd) (#3898) * +(opencanaryd) Signed-off-by: Jacob Torrey * Improve packaging and documentation for opencanary Signed-off-by: Jacob Torrey * Move to a more idiomatic, version-agnostic packaging Signed-off-by: Jacob Torrey * Trying to diagnose aarch64 build issue Signed-off-by: Jacob Torrey * Add libffi to the build deps Signed-off-by: Jacob Torrey * Bump to python 3.8 Signed-off-by: Jacob Torrey * Bump to python 3.9 Signed-off-by: Jacob Torrey * Reverting to the previously building version Signed-off-by: Jacob Torrey --------- Signed-off-by: Jacob Torrey --- .../github.com/thinkst/opencanary/README.md | 27 ++++++++++++++ .../github.com/thinkst/opencanary/package.yml | 37 +++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 projects/github.com/thinkst/opencanary/README.md create mode 100644 projects/github.com/thinkst/opencanary/package.yml diff --git a/projects/github.com/thinkst/opencanary/README.md b/projects/github.com/thinkst/opencanary/README.md new file mode 100644 index 00000000..7eea124f4 --- /dev/null +++ b/projects/github.com/thinkst/opencanary/README.md @@ -0,0 +1,27 @@ +# Running OpenCanary via pkgx + +## Configuring OpenCanary + +When OpenCanary starts it looks for config files in the following locations and will stop when the first configuration is found: + +1. `./opencanary.conf` (i.e. the directory where OpenCanary is installed) +2. `~/.opencanary.conf` (i.e. the home directory of the user, usually this will be `root` so `/root/.opencanary.conf`) +3. `/etc/opencanaryd/opencanary.conf` + +To create an initial configuration, run as `root` (you may be prompted for a `sudo` password): +``` +$ pkgx opencanaryd --copyconfig +[*] A sample config file is ready /etc/opencanaryd/opencanary.conf + +[*] Edit your configuration, then launch with "pkgx opencanaryd --start" +``` + +This creates the path and file `/etc/opencanaryd/opencanary.conf`. You must now edit the config file to determine which services and logging options you want to enable. + +# Launching OpenCanary + +Start OpenCanary by running the following as root (or with `sudo -E`): + +``` +$ pkgx opencanaryd --start +``` diff --git a/projects/github.com/thinkst/opencanary/package.yml b/projects/github.com/thinkst/opencanary/package.yml new file mode 100644 index 00000000..54af41be --- /dev/null +++ b/projects/github.com/thinkst/opencanary/package.yml @@ -0,0 +1,37 @@ +distributable: + url: https://github.com/thinkst/opencanary/archive/refs/tags/v{{version}}.tar.gz + strip-components: 1 + +versions: + github: thinkst/opencanary + +dependencies: + python.org: ^3.10 + tcpdump.org: '*' + openssl.org: '*' + +runtime: + env: + PYTHONPATH: "$PYTHONPATH:{{prefix}}/lib/python{{deps.python.org.version.major}}/site-packages" + +build: + dependencies: + pip.pypa.io: '*' + + script: + - run: | + pip install setuptools + cat setup.py | sed -e 's/requirements = \[/requirements = \["scapy","pcapy-ng",/' > setup.py.mod + mv setup.py.mod setup.py + python setup.py sdist + python -m pip install --prefix={{prefix}} dist/opencanary-{{version}}.tar.gz + + - run: ln -s python{{deps.python.org.version.marketing}} python{{deps.python.org.version.major}} + working-directory: ${{prefix}}/lib/ + +provides: + - bin/opencanaryd + +test: + script: test "$(opencanaryd --version)" = "{{version}}" + \ No newline at end of file