Package: py-openkat
OpenkatAn experimental sandbox environment to easily experiment with (some) functionality ofopenkat.
This version of openkat runs all services in a single process and replaces services such asBytes, Rabbitmq and Celery with an in-memory implementation.
As a consequence, the current version does not guarantee persistence beyond the lifetime of the process.
It speaks for itself that this libraryshould not be used in a production environment.
To properly deploy an openkat instance,
please refer to theofficial documentationon Github.OverviewFeaturesThese features of openkat are currently present in this packageThe Rocky interface: UI around reporting on FindingsThe Octopoes models: for modelling the Objects Of Interest (OOIs)The Boefjes/Normalizers: the python scripts that find OOIs (excluding the containerized versions)The Scheduler: dispatching Boefjes and Normalizers automaticallyBenefitsThe benefits and extra features of this package are:Lightweight: a single process for the app, reducing overhead of the official services and installation timesA default superuser and development organizationOTP disabled to optimize for restarting the service even after an updateAdding plugins by creating plugins in a custompluginsfolderMissing FeaturesHowever, some features are excluded from this version on purpose:Audit trailing using BytesMiscellaneous functionality in the interface, such as specifying a depth of an OOI tree and custom images in the KATalogusDeletion Propagation: you have to manually delete every single OOIScanProfile inheritance: you have to manually add scan profiles to observed OOIsValid times: you cannot browse the OOI history through timeComing FeaturesSome missing features are still to be added:BitsObject persistence beyond server lifetimeInstallation$pipinstallpy-openkatDependenciesTo use the Dockerized boefjes, you must have Docker installed on your machine.UsageTo start the instance, run$python-mopenkatand navigate tohttp://localhost:8000.
Login with emailsuper@user.comand passwordsuperuser.
You can start adding your objects now (see the official documentation).
Note: restarting the service clears your object database.Adding your own pluginsTo extend the functionality of openkat with custom Boefjes create a file (e.gkat.py)
with the following contents:importopenkatopenkat.start(plugin_dir="plugins")Then, create a directory in your current working directory calledpluginsand copyan internal Boefje(starting withkat_) into thepluginsfolder.If you are like me and just want a one-liner:$mkdirplugins&&\mkdirplugins/kat_dns2&&\forfilein"__init__.py""boefje.py""description.md""main.py""normalizer.py""requirements.txt";\docurlhttps://raw.githubusercontent.com/Donnype/nl-kat-boefjes/869167d1b723a1a58c044d45f668fbade33cf372/boefjes/plugins/kat_dns/$file>plugins/kat_dns2/$file;\doneChange the folder name, and at least theid, andnameof theBoefjemodel definition inboefje.py, together with
thenameandmodule(this should be"{the folder name}.{module name}") of theNormalizermodel definition.
Be careful not to use an existing folder name or this will overwrite an existing boefje (and require re-installation).Have I told you I like one-liners? (Note:sedbehaves differently on OS X)$sed-i-e"s/id\=\"dns-records\"/id\=\"my-id\"/g"\-e"s/module\=\"kat_dns\.normalize\"/module\=\"kat_dns2.normalize\"/g"\-e"s/name\=\"DnsRecords\"/name\=\"MyBoefje\"/g"\-e"s/name\=\"kat_dns_normalize\"/name\=\"kat_dns2_normalize\"/g"\plugins/kat_dns2/boefje.pyStart the service by running$python-mkatand you should be able to use it as usual, but with the added functionality.ContributingDependencies:poetryyarnTo setup a development environment, run$makeinitTo build, run$makebuild