Skip to content

Add permissions for Security bot

Tetiana Chupryna requested to merge 215669-security-bot-permissions into master

What does this MR do?

Discovery issue: #36500 (closed) Backend issue: #215669 (closed)

Adds permissions needed to the Security bot to create an MR. To simplify the review process, these changes were extracted from !44618 (closed).

Permissions added

  • Security bot has reporter access to projects where auto fix is enabled and additionaly to:
        enable :push_code
        enable :create_merge_request_from
        enable :create_vulnerability_feedback

Those permissions are needed to run services that create MergeRequest and create Vulnerability Feedback.

Security blocks

Even Bot can create MR, branch, and commits, nobody can steal it's identity because of next blocks:

[3] pry(main)> GlobalPolicy.new(User.security_bot, :global).can?(:log_in)
=> false

pry(main)> GlobalPolicy.new(User.security_bot, :global).can?(:access_api)
  User Load (0.6ms)  SELECT "users".* FROM "users" WHERE "users"."user_type" = $1 ORDER BY "users"."id" ASC LIMIT $2  [["user_type", 8], ["LIMIT", 1]]
=> false

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #215669 (closed)

Edited by Tetiana Chupryna

Merge request reports