GithubHelp home page GithubHelp logo

mrblacyk / boxer Goto Github PK

View Code? Open in Web Editor NEW
17.0 17.0 5.0 15.94 MB

Boxer is a self-hosted platform for managing boxes (VMs). Some say it's open-source HackTheBox platform.

License: Apache License 2.0

Python 0.47% HTML 13.10% JavaScript 72.57% CSS 13.71% Dockerfile 0.01% Shell 0.01% Less 0.13%

boxer's People

Contributors

dependabot[bot] avatar kolokokop avatar mrblacyk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

kolokokop skybulk

boxer's Issues

News form

There is a news section but the only place for adding a news is django admin. Would be cool to have a button for admins Add news with a django form to add it.

Setup page on fresh install

Make a setup page when there are no users nor settings in the database. So when a user (or in the future - a Dockerfile) does:

# migrate DB
./manage.py migrate

# start the app
./manage.py runserver 0:80

# or other more production deployment like apache2 with mod wsgi

..they are greeted with setup page. Probably this needs to be done as the last issue to contain the most settings.

Deployment rewrite

Rewrite deployment code to utilise libvirt-python instead of callCmd and virsh.

Snapshot creation and revert are already defined in aplibvirt.py so definitely make use of those.

def createSnapshot(
        virt_conn: libvirt.virConnect,
        domain_name: str, snapshot_name: str) -> bool:
    """ Make a snapshot of shutoff VM """

# (..)

def revertSnapshot(
        virt_conn: libvirt.virConnect,
        domain_name: str, snapshot_name: str) -> bool:
    """ Revert a snapshot of shutoff VM """

The initial snapshot name should be fixed. I make INIT snapshots with virsh but I'm open to other names if it will be fixed.

Configurable libvirt URI

Right now code in aplibvirt.py is:

def connect(URI: str = "qemu:///system") -> libvirt.virConnect:
    """ Simple libvirt connect function """

    return libvirt.open(URI)

So it's ready to consume different URI.

What needs to be done:

  1. Make it dependant on some configuration from database
  2. Create proper webpage for it under sysadmin tools (maybe a general settings page which will include this particular settings?)

Celery + RabbitMQ => Stop/Reset schedule

Create a Celery + RabbitMQ + PostgreSQL setup and integration with the project.

This must provide a robust scheduling system which can be cancelled. All the edgy cases should be handled (trying to cancel a task in a queue which was already cancelled, etc).

The idea is to provide a functionality to:

  • Schedule a reset of a box with the ability to cancel the reset within 2 minutes.
  • Schedule a shutoff of a box with the ability to cancel the shutdown within 2 minutes.

The code should call resetMachine and stopMachine from aplibvirt.py accordingly. The former is not yet defined and needs to be created (but in the worst case it can be similar to stopMachine), the latter is with the code of:

def stopMachine(
        virt_conn: libvirt.virConnect, domain_name: str) -> [int, bool]:
    """ Stop a domain by name
    Returns a list with:
    * an integer return code,
    * a boolean saying if the machine was already stopped.
"""

    virt_conn = reassureConnection(virt_conn)

    return _machineOperation(virt_conn, domain_name, "stop")

Rewrite network deployment

Right now, network deployment uses callCmd method. It needs to be rewritten to utilise libvirt-python instead. All the libvirt logic should be put into aplibvirt.py.

Access VPN - OpenVPN?

As of now, the platform is capable of starting and stopping the machines but there is no easy access to boxes. OpenVPN integration is the first thing which comes to my mind but I had no prior experience with it so if anybody has a better solution to this problem - you are more than welcome.

This is a big issue as it requires not only a research on the subject, PoC but also an actual implementation and integration.

Stop/Reset functions rewrite

As of now, only the stop functionality is implemented and it is implemented in a way that the hypervisor sends a graceful shutdown signal. This should be a force ACPI shutoff with the revert to the initial snapshot afterwards.

The reset function should do the stop (defined above) and then a start.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.