Skip to content
No description, website, or topics provided.
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
ex1.py
ex2.py
example.py
journal-example.py
oqubes-logging
oqubeslogging.py

README.md

OQubes Logging

This is a PoC logging service based on Qubes buildlog.

How to use/try this?

In our example, we will use a vm named logging for storing logs, and we will use workvm to send in logs to the logging vm.

In dom0

  • Create a file /etc/qubes-rpc/policy/oqubes.Logging in dom0 with the following content.
workvm logging allow
@anyvm @anyvm deny

In logging vm

Add the following content to /etc/qubes-rpc/oqubes.Logging

/usr/sbin/oqubes-logging

and then place oqubes-logging script to /usr/sbin/ directory and make sure that it is executable.

To use from any Python code in workvm

Here is an example code using Python logging

import logging
from oqubeslogging import OQubesLog

def main():
    handler = OQubesLog("workvm", "proxy-debian")
    logging.basicConfig(level=logging.DEBUG, handlers=[handler])
    logger = logging.getLogger("example")

    logger.info("kushal says it works")


if __name__ == "__main__":
    main()

The journalctl example

You will need python3-systemd package for the same.

The code is in journal-example.py file.

You can’t perform that action at this time.