Add new columns to DAST scanner profile
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 eitherPASSIVE
orACTIVE
-
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
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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