Include an X-Request-Id in outgoing requests

Problem

When investigating a vulnerability or a configuration failure, tracing the request can be useful. The x-request-id header is set with a random identifier and used to trace requests through backend services. API Security should include this header with every outbound request and show it in errors.

Proposal

Add an x-request-id header with a unique GUID. When displaying list of operations in job output, include request id.

Tasks:

  1. Have API Security set X-Request-Id on all outbound requests
  2. Update operation output to include x-request-id
    1. Add new guid field to ScannedResources table
    2. Create new migration to create column if it doesn't exist
    3. Update code where ScannedResources is saved to include request id header
    4. Update log output in ci script
  3. Add unit tests
  4. Add integration test to worker-entry
  5. Publish new container