-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reject jobs that are submitted by other jobs
Now that we have networking, it is possible for networked jobs to run Bacalhau themselves and trigger new jobs. Whilst this is a powerful feature, it can also lead to a “fork bomb”-style exhaustion attack as jobs could clone themselves with ever increasing concurrency. This is particularly dangerous as it would require taking down a majority of the nodes on the network to prevent the jobs from respawning. Now, we append a header to all outbound HTTP requests made by a job using HTTP networking that signals that the HTTP request is coming from a running job. We configure the submission endpoint to reject any job creation request that contains this header. In this way, we now prevent jobs from creating other jobs. When we have paid jobs, this is less of an issue as the payment channel will eventually exhaust. We can later selectively add the header only for unpaid jobs, but for now it covers all jobs.
- Loading branch information
Showing
4 changed files
with
80 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters