Correct background flow enforcement and document a tool rule limit

What does this MR do?

Setting Run Command to Always Deny to block some shell commands also stops the Developer Flow from creating its branch. A tool rule covers a whole tool and cannot match the command a call runs. The page does not say so.

flowchart LR
    A["Run Command set to Always Deny"] --> B["Tool removed from the Developer Flow"]
    B --> C["No shell, so no glab or Git commands"]
    C --> D["Flow ends with no branch and no merge request"]

The page says background flows, such as the Developer Flow, are governed if the duo_workflow_background_tool_governance feature flag is on. Background access applies only to the Developer Flow, and only when it starts in the web or ambient environment. Other background flows, and a REST start that leaves out environment, read Cloud access even with the flag on. With the flag off, the default, the Developer Flow reads Cloud access and a rule set only for Background access has no effect on it.

This corrects the page's enforcement sentence and adds the whole-tool point to the Known issues in the tool governance docs.

Evidence
  • On a GitLab 19.5.3 Self-Managed test instance, a Developer Flow started through the REST API with Run Command set to Always Deny for Cloud access ran without the run_commands privilege and left no branch. The same flow with no rule had the privilege and created its branch. The flow still started in both cases.
  • A Run Command rule with tool_arguments set to {"command":"git push*"} behaved as the same rule without it, on the same instance.
  • With the feature flag off and a Run Command rule set to Always Deny only for Background access, the flow kept every privilege and created its branch. A Cloud access rule set to Always Deny removed the privilege with the flag off.
  • The shipped Developer Flow toolset has run_command and no other shell or Git tool (developer/3.0.0.yml:31-40). Workspace agent templates can add tools.
  • Resolution indexes rules by tool name (resolution_service.rb:156-165, :94-95 in 19.5.3).
  • Creating a flow through the REST API or GraphQL intersects its privileges with what the rules allow and does not refuse it (create_workflow_service.rb:704-716, :630-642 in 19.5.3). The refusal check on master is behind duo_workflow_block_start_on_denied_group, off by default (create_workflow_service.rb:734-737), and 19.5.3 has no such check.
  • With the flag on, a Developer Flow started with environment set to web ran without the run_commands privilege when Run Command was Always Deny for Background access. The same flow started through the REST API with no environment kept the privilege and ran the shell command.
  • Background access is allowlisted for the developer flow only (:22,27, :18,23 in 19.5.3), and needs environment to be web or ambient (:72-80, :38-46 in 19.5.3).
  • The background surface needs the flag (governance_surface.rb:79, :45 in 19.5.3). Only that surface reads background_access, and web and ambient read web_access (tool_rule.rb:65-68, :50-53 in 19.5.3). With the flag off, ambient and web starts route to web_access (create_workflow_service.rb:794-796, :821-822).
  • The Cloud access label is web_access in the UI (ai_tool_rules_table.vue:182-184).

Author's checklist

If you are a GitLab team member and only adding documentation, do not add any of the following labels:

  • ~"frontend"
  • ~"backend"
  • ~"type::bug"
  • ~"database"

These labels cause the MR to be added to code verification QA issues.

Reviewer's checklist

Documentation-related MRs should be reviewed by a Technical Writer for a non-blocking review, based on Documentation Guidelines and the Style Guide.

If you aren't sure which tech writer to ask, use roulette or ask in the #docs Slack channel.

  • If the content requires it, ensure the information is reviewed by a subject matter expert.
  • Technical writer review items:
    • Ensure docs metadata is present and up-to-date.
    • Ensure the appropriate labels are added to this MR.
    • Ensure a release milestone is set.
    • If relevant to this MR, ensure content topic type principles are in use, including:
      • The headings should be something you'd do a Google search for. Instead of Default behavior, say something like Default behavior when you close an issue.
      • The headings (other than the page title) should be active. Instead of Configuring GDK, say something like Configure GDK.
      • Any task steps should be written as a numbered list.
      • If the content still needs to be edited for topic types, you can create a follow-up issue with the docs-technical-debt label.
  • Review by assigned maintainer, who can always request/require the reviews above. Maintainer's review can occur before or after a technical writer review.

An AI coding assistant wrote this change. The assistant also checked each claim against the source files linked above and ran Vale and markdownlint on the changed page. It ran the Developer Flow on a GitLab 19.5.3 Self-Managed test instance with and without each rule described.

Merge request reports

Loading
Loading