Skip to content
Snippets Groups Projects

Set a limit of 255 characters for security policy names

Merged Sam White requested to merge sam-add-fullname-approval-rule into master
1 unresolved thread

What does this MR do and why?

This MR makes the following changes to address the behavior reported in !88679 (comment 1002820788)

  • Removes the previous backend truncation of the security policy name at 25 characters
  • Introduces a schema limit of 255 characters for security policy names.

Screenshots or screen recordings

Previous behavior

Screen_Shot_2022-06-29_at_3.02.11_PM

Screen_Shot_2022-06-29_at_3.02.43_PM

Screen_Shot_2022-06-29_at_3.03.16_PM

Current behaviour

Existing policies (with name length longer than the new limit)

Screen_Shot_2022-06-29_at_3.20.47_PM

Screen_Shot_2022-06-29_at_3.14.50_PM

Screen_Shot_2022-06-29_at_3.14.58_PM

New policies

Screen_Shot_2022-06-29_at_3.40.34_PM

How to set up and validate locally

  1. Create a group where you are the group owner. This requires a GitLab Ultimate license.
  2. Create a project in the group "Development Project"
  3. Navigate to the project -> Security & Compliance -> Policies page
  4. Create a new Scan Result policy with a long name
  5. Click "Configure with a merge request". This will create a new "Security Policy Project" in the same group and will open a merge request in that newly created project.
  6. Merge in the auto-generated merge request
  7. Navigate back to your "Development Project" and open a merge request in that project
  8. View the security approval rule on the MR page

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Sam White

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • added 1 commit

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • Michael Fangman approved this merge request

    approved this merge request

  • :wave: @mfangman, thanks for approving this merge request.

    This is the first time the merge request is approved. To ensure full test coverage, a new pipeline has been started.

    For more info, please refer to the following links:

  • Clayton Cornell approved this merge request

    approved this merge request

  • Allen Cook
  • Sam White added 1 commit

    added 1 commit

    • 1ee172b4 - Remove length limit for all approval rules

    Compare with previous version

  • Sam White changed title from Set a limit of 255 characters for approval rule names to Set a limit of 255 characters for security policy names

    changed title from Set a limit of 255 characters for approval rule names to Set a limit of 255 characters for security policy names

  • Sam White changed the description

    changed the description

  • mentioned in issue #366669 (closed)

  • Allen Cook requested review from @dskim_gitlab and removed review request for @acook.gitlab

    requested review from @dskim_gitlab and removed review request for @acook.gitlab

  • Allen Cook approved this merge request

    approved this merge request

  • Sam White added 1 commit

    added 1 commit

    Compare with previous version

  • Sam White resolved all threads

    resolved all threads

  • Sincheol (David) Kim approved this merge request

    approved this merge request

  • Sincheol (David) Kim enabled an automatic merge when the pipeline for 5d001b07 succeeds

    enabled an automatic merge when the pipeline for 5d001b07 succeeds

  • mentioned in commit 2e69038c

  • added workflowstaging label and removed workflowcanary label

    • @sam.white is this change live on gitlab.com now? I think from the production workflow label that means yes but I don't fully understand the promotion process. If it is live is there anything we need to do so it takes effect on our MRs? I see in the diffs that a background service was modified, do we need to reapply policies or anything like that?

    • @dominic.bishop :wave:

      @sam.white is this change live on gitlab.com now? I think from the production workflow label that means yes but I don't fully understand the promotion process.

      Yes it is live in gitlab.com !

      If it is live is there anything we need to do so it takes effect on our MRs? I see in the diffs that a background service was modified, do we need to reapply policies or anything like that?

      As this change involves truncation on a DB level, it will be applicable to scan result policies that have been either created or updated after this MR has made into production.

      Note that although this MR addressed all approval rules initially, it has been updated to only affect scan result policies related rules.

    • Author Contributor

      If it is live is there anything we need to do so it takes effect on our MRs? I see in the diffs that a background service was modified, do we need to reapply policies or anything like that?

      @dominic.bishop yes, you will need to reapply your policy. This can be done by creating any change to the policy, such as first disabling and then re-enabling the policy - or even just by changing one letter of the title or description.

    • thanks @sam.white

      @dominic.bishop yes, you will need to reapply your policy. This can be done by creating any change to the policy, such as first disabling and then re-enabling the policy - or even just by changing one letter of the title or description.

      I have made a change to our policy YAML and I can confirm that on MRs created after pushing the change the full titles are now shown for our scan result policy rules. :tada:

      Thanks @sam.white and @zmartins for your help in getting this one resolved.

    • Please register or sign in to reply
  • Please register or sign in to reply
    Loading