FRosner / cluster-broccoli

Self service for Nomad based on templates.
Apache License 2.0
60 stars 22 forks source link

API allows getting log information for Nomad jobs not managed by Broccoli #346

Closed FRosner closed 6 years ago

FRosner commented 6 years ago

Problem

When sending a GET request to get allocation logs, you can specify any nomad job ID and allocation ID as payload. As long as your user instance regex matches the payload, you will receive the logs about that allocation, independent of whether a corresponding instance exists in Broccoli.

How to Reproduce

  1. Start a nomad job called my-http
  2. Start Broccoli, and send a GET to http://localhost:9000/downloads/instances/my-http/allocations/65517f7c-1d77-4250-c10d-8992ca7703ec/tasks/http-task/logs/stdout?offset=500KiB
  3. Receive log

Expected Response

404

Solution

Validate that the requested instance is really an instance and do not just forward to Nomad.