Skip to content

SAST mutation now supports analyzers section

rossfuhrman requested to merge rf-sast-mutation-write-analyzers into master

What does this MR do?

Builds on !42173 (merged) to create commit to manage the information about analyzers in .gitlab-ci.yml file.

The GraphQL mutation continues to work as-is when the analyzers section is not passed along. The frontend's usage of the analyzers section is behind the sast_configuration_ui_analyzers feature flag.

Issue: #235799 (closed)

Screenshots

Expand for text of request from screenshot:

Sample request that sends along the analyzers section.

mutation{
  configureSast(
    input: { projectPath: "nu-group/yarnit",
              configuration: {
                global: [
                    { field: "SECURE_ANALYZERS_PREFIX",
                      defaultValue: "registry.gitlab.com/gitlab-org/security-products/analyzers",
                      value: "4"
                    },
                    { field: "SAST_EXCLUDED_PATHS",
                      defaultValue: "spec, test, tests, tmp",
                      value: "44"
                    },
                    { field: "SAST_ANALYZER_IMAGE_TAG",
                      defaultValue: "2",
                      value: "2"
                    }
                ],
                pipeline: [
                  { field: "SEARCH_MAX_DEPTH",
                    defaultValue: "4",
                    value: "4"
                  },
                  { field: "stage",
                    defaultValue: "test",
                    value: ""
                  }
                ],
                analyzers: [
                  { name: "brakeman",
                    enabled: true,
                    variables: [
                      { field: "SAST_BRAKEMAN_LEVEL",
                        defaultValue: "1",
                        value: "2"
                      }
                    ]
                  },
                  {
                    name: "eslint",
                    enabled: false
                  }
                ]
              }
    }
  ){
    status
    successPath
    errors
  }
}
Screen_Shot_2020-09-17_at_1.24.10_PM

Part of resulting commit diff (arrows pointing to analyzer specific additions):

Screen_Shot_2020-09-17_at_1.34.24_PM

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
Edited by Saikat Sarkar

Merge request reports