Technical implementation planning

Implementation plan:

  1. Add "source" string column to ci_builds table that defaults to null Add ci_builds_sources table or similar that refers the source value to SEP-initiated builds
  2. Add source property to Ci::Build that returns above column when present; otherwise, return the pipeline's source value
  3. When an SEP job is created, set the source value to scan_execution_policy (open question on where in the code this happens - currently SEP jobs are identified by name)
  4. Add new claims to Gitlab::Ci::Jwt.custom_claims method based on the build's source property:
    1. job_source: same as build source property; may be null
    2. job_policy_ref_uri: for SEP jobs, points to the security policy project file that defined the scan policy, in the format gitlab.example.com/my-group/my-project//.gitlab-ci.yml@refs/heads/main
    3. job_policy_ref_sha: for SEP jobs, the git commit SHA for the file above that introduced the policy
  5. Add "source" property to result in Job API (Ci::JobEntity)
  6. [FE] Add source filtering to Build > Jobs

Issue for items 1+2: #458803 (closed)

Issue for item 3: #459000 (closed)

Issue for item 4: #459001 (closed)

Issue for item 5: #459015 (closed)

Edited by Aaron Huntsman