The Runner is an agent that executes tasks on your behalf. No more, no less.
The purpose of the runner is to decouple the execution of tasks from the main application, allowing for greater flexibility and scalability. By using a runner, you can offload resource-intensive operations, manage task execution more efficiently, and improve the overall performance of your system.
Let's first explore the reasons why the runner is decoupled and designed to run on your own environment.
One of the goals of the BountyHub platform is to allow bounty hunters to control the environment from which the scans are executed.
Controlling the environment is crucial for several reasons:
However, running self-hosted does have downsides:
Despite these downsides, the benefits of having full control over the environment often outweigh the challenges, especially for security-conscious users and organizations. If you are serious about security and want to ensure that your scans are executed in a controlled and secure manner, self-hosting the runner is the way to go.
If down the line, multiple users want to use hosted services, we might consider offering hosted runners as an additional option. However, for now, the focus is on providing self-hosted runners to ensure maximum control and security for our users.
Ability to self-host will always be one of top priorities of the platform. It was one of the reason this platform was created in the first place.
If you are curious, check out the Comparison With Other Automation Platforms.
The runner is open-source, allowing users to inspect the code, contribute to its development, and customize it to fit their specific needs.
There are multiple reasons why open-sourcing the runner is beneficial:
You can see the source code of the runner on GitHub. Feel free to explore the code, report issues, and contribute to its development.
By decoupling task execution from the main application, the runner allows for scalable task management. You can deploy multiple runners across different environments, distributing the workload and ensuring that tasks are executed efficiently. This scalability is particularly beneficial for handling large volumes of tasks or resource-intensive operations.
Having multiple runners running in parallel allows for better resource utilization and improved performance. Tasks can be distributed among the available runners, reducing bottlenecks and ensuring that tasks are completed in a timely manner.
The runner operates independently of the main application, providing isolation for task execution. This isolation ensures that any issues or failures in the runner do not impact the overall system. If a runner encounters an error or crashes, it can be restarted or replaced without affecting the main application. This fault tolerance is crucial for maintaining system stability and reliability.
Since tasks are executed in a separate environment, no information is shared between different users. Isolation could be achieved running the runner in a containerized environment, such as Docker. This ensures that each user's tasks are executed in a separate and secure environment, preventing any potential data leaks or cross-contamination.
However, if a malicious user gets access to the container, and is able to escape it, it can potentially do a lateral move and exploit other users' data.
Even though this scenario is highly unlikely, it is still a risk to consider. Therefore, the platform can:
Again, if down the line, the need arises for hosted runners, we might consider offering them as an additional option. However, for now, the focus is on providing self-hosted runners to ensure maximum control and security for our users.
The Runner is designed to be lightweight and easy to deploy. It communicates with the main application via a secure API, receiving tasks to execute and reporting back the results.
Make sure to check the Getting Started guide to learn how to set up your first runner.
In order for the runner to talk to the BountyHub platform, it needs to be registered and configured.
Registration is done by fetching the one-time token. Once the token is used, it cannot be used again.
During registration, you need to configure:
Optionally, you can configure capacity, which is the maximum number of tasks the
runner can handle in parallel. By default, the capacity is set to 1, meaning
that the runner will execute one task at a time. You can increase this value to
allow the runner to handle multiple tasks concurrently, depending on the
resources available on the host machine.
Just keep in mind that increasing the parallelism means that two jobs associated with the same target can land on the same machine. Make sure you always follow the rules of engagement. You can always use proxies to proxy your requests, making sure that you are not violating any rules.
Once configured, the runner will continuously poll the BountyHub platform for new tasks to execute. Once the task is assigned to the runner, it cannot be unassigned. The runner is responsible for executing the task until completion.
To illustrate the flow, let's take a look at the following sequence diagram:
Currently Reading
Runner Overview