Skip to content

Add new columns to DAST scanner profile

Craig Smith requested to merge add_options_to_dast_scanner_profile_254626 into master

What does this MR do?

To allow DAST on-demand scan users to further configure their scans, this MR adds three new fields to DastScannerProfile.

  • scanType can be either PASSIVE or ACTIVE
  • ajax_spider which is a boolean value
  • show_debug_messages which is a boolean value

These new fields will be used in the GraphQL queries.

Create Dast Scanner Profile

mutation{
  dastScannerProfileCreate(
    input: {
      fullPath: "namespace/project"
      profileName: "test"
      spiderTimeout: 123
      targetTimeout: 123
+     useAjaxSpider: true
+     scanType: ACTIVE
+     showDebugMessages: true
    }
  ) {
    id
    errors
  }
}

Update Dast Scanner Profile

mutation{
  dastScannerProfileUpdate(
    input: {
      id: "gid://gitlab/DastScannerProfile/1"
      fullPath: "namespace/project"
      profileName: "test"
      spiderTimeout: 123
      targetTimeout: 123
+     useAjaxSpider: true
+     scanType: ACTIVE
+     showDebugMessages: true
    }
  ) {
    errors
  }
}

Query Dast Scanner Profile

query{
  project(fullPath: "namespace/project"){
    dastScannerProfiles{
      nodes{
        globalId
        profileName
        spiderTimeout
        targetTimeout
+       useAjaxSpider
+       showDebugMessages
+       scanType
      }
    }
  }
}

Migration output

Migrating:

== 20200924035825 AddOptionsToDastScannerProfile: migrating ===================
-- add_column(:dast_scanner_profiles, :scan_type, :integer, {:limit=>2, :default=>1, :null=>false})
   -> 0.0016s
-- add_column(:dast_scanner_profiles, :use_ajax_spider, :boolean, {:default=>false, :null=>false})
   -> 0.0005s
-- add_column(:dast_scanner_profiles, :show_debug_messages, :boolean, {:default=>false, :null=>false})
   -> 0.0006s
== 20200924035825 AddOptionsToDastScannerProfile: migrated (0.0029s) ==========

Rolling back:

== 20200924035825 AddOptionsToDastScannerProfile: reverting ===================
-- remove_column(:dast_scanner_profiles, :show_debug_messages, :boolean, {:default=>false, :null=>false})
   -> 0.0005s
-- remove_column(:dast_scanner_profiles, :use_ajax_spider, :boolean, {:default=>false, :null=>false})
   -> 0.0002s
-- remove_column(:dast_scanner_profiles, :scan_type, :integer, {:limit=>2, :default=>1, :null=>false})
   -> 0.0003s
== 20200924035825 AddOptionsToDastScannerProfile: reverted (0.0011s) ==========

This MR relates to #254626 (closed)

Screenshots

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 Craig Smith

Merge request reports