Skip to content

Create GraphQL mutation to assign security policy project

What does this MR do?

Addresses #329422 (closed)

This MR introduces a new GraphQL mutation to assign security policy project for a given project.

To enable the feature flag:

Feature.enable(:security_orchestration_policies_configuration, Project.find(<project ID>))

Mutation Sample

Mutation
mutation assignProject{
  securityPolicyProjectAssign(input:{
    projectPath:"security/tanuki-app",
    securityPolicyProjectId: "gid://gitlab/Project/<PROJECT_ID>"    
  }) {
    clientMutationId
    errors
  }
} 
Response
{
  "data": {
    "securityPolicyProjectAssign": {
      "clientMutationId": null,
      "errors": []
    }
  }
}

Screenshots (strongly suggested)

Case Screenshot
Success Screenshot_2021-06-24_at_9.49.23_PM
When project or security policy project is not present Screenshot_2021-06-24_at_9.49.33_PM

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

Does this MR contain changes to processing or storing of credentials or tokens, authorization and authentication methods or other items described in the security review guidelines? If not, then delete this Security section.

  • 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
Edited by Sashi Kumar Kumaresan

Merge request reports

Loading