-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EPIC] Package all local Python boefjes in a container (could be a single container, targeting the specific modules by its arguments) #3593
Comments
About this featureDetailed descriptionCurrently, most boefjes are run in the boefje container as Python code. This has a few disadvantages:
Considerations:
We propose an iterative approach to package all Python boefjes into a single container.
Single containerSeveral decisions on the first step of the implementation:
Feature benefit/User storyAs an expert user, I want to be able to reproduce raw files of the current Python boefjes. To do this, KAT should communicate the run command of the container. Additional informationDesignScreenshotsInclude screenshots of the proposed design changes here. Figma linkLink to the Figma design for further visualization (if applicable) |
Containerizing boefjesThe reason to run all boefjes in a container is to run the boefje in a sandbox. In the future is will be possible to also run boefjes created by others, not only boefjes created by KAT. Running those in a sandbox decreases the risk of doing that. Starting a container for every boefje task results in a lot of overhead, so we want to support running multiple tasks in a single container. For the boefjes containers we need to support two ways of deploing KAT:
This means we need to support for long running boefje containers. This boefje can either pull the tasks from the runner or the runner can push the tasks to the boefje container if the boefje container has a service. Pull-based design
When there isn't any task available, the boefje can either wait on the boefjes runner for a new task to be available using long-polling or just do a new request after some timeout. Push-based design
The pull-based design is how task queues are usually implemented, a process that executes tasks pulls the tasks from the queue. Pushing tasks gives more complications if you want to scale to multiple boefje containers that execute tasks. How will the boefje runner know to which container to push the task? Some boefje tasks might take a very long time to execute, while other tasks might be short. If you want to use things like autoscaling and use a loadbalancer for the boefje HTTP service the question is how the load balancing should work with those very long running tasks. HTTP load balancers usually balance a high number of short duration HTTP requests, not long running tasks. |
Updated by @Donnype with the comment from @noamblitz.
About this feature
Detailed description
Currently, most boefjes are run in the boefje container as Python code. This has a few disadvantages:
Considerations:
We propose an iterative approach to package all Python boefjes into a single container.
HTTP APIworker around this container so it does not have to be stopped every time. Create a boefje worker that can target specific tasks its image has been built for #3861[ ] 4. We create several runner files likeUPDATE from @Donnype: we decided to postpone this as the kubernetes runner would only be needed for installs where we can talk to control planes and need to dynamically start newly created (containerized) boefjes.kubernetes.py
anddocker.py
so OPsers are able to choose how the boefjes will be run.Single container
Several decisions on the first step of the implementation:
boefje.json
we will specify the path to themain.py
so the code around boefje resolving does not have to be added to the new container. This can be done later if needed.boefje_id
or the path to theboefje.json
.Feature benefit/User story
As an expert user, I want to be able to reproduce raw files of the current Python boefjes. To do this, KAT should communicate the run command of the container.
Additional information
Design
Screenshots
Include screenshots of the proposed design changes here.
Figma link
Link to the Figma design for further visualization (if applicable)
The text was updated successfully, but these errors were encountered: