Add passive and active profiles 347384
What does this MR do and why?
Describe in detail what your merge request does and why.
This Merge Request updates the ee/app/models/dast_scanner_profile.rb to use the DAST_API_PROFILE variable as described here.
This Merge Request is related to issue #347384 (closed).
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
How to set up and validate locally
- Open the rails console
rails c
- Create a new DastScannerProfile with scan_type
active
dsp = DastScannerProfile.create(name: "#{FFaker::Product.product_name.truncate(192)} #{SecureRandom.hex(4)} - #{rand(100)}", scan_type: 'active', project: Project.last)
- Check that
DAST_API_PROFILEci variable has the valueQuick-Active
dsp.ci_variables
@errors=nil,
@variables=
[#<Gitlab::Ci::Variables::Collection::Item:0x00007fa111c311d0 @variable={:key=>"DAST_USE_AJAX_SPIDER", :value=>"false", :public=>true, :file=>false, :masked=>false, :raw=>false}>,
#<Gitlab::Ci::Variables::Collection::Item:0x00007fa111c310b8 @variable={:key=>"DAST_DEBUG", :value=>"false", :public=>true, :file=>false, :masked=>false, :raw=>false}>,
#<Gitlab::Ci::Variables::Collection::Item:0x00007fa111c30fa0 @variable={:key=>"DAST_API_PROFILE", :value=>"Quick-Active", :public=>true, :file=>false, :masked=>false, :raw=>false}>],
@variables_by_key=
{"DAST_USE_AJAX_SPIDER"=>[#<Gitlab::Ci::Variables::Collection::Item:0x00007fa111c311d0 @variable={:key=>"DAST_USE_AJAX_SPIDER", :value=>"false", :public=>true, :file=>false, :masked=>false, :raw=>false}>],
"DAST_DEBUG"=>[#<Gitlab::Ci::Variables::Collection::Item:0x00007fa111c310b8 @variable={:key=>"DAST_DEBUG", :value=>"false", :public=>true, :file=>false, :masked=>false, :raw=>false}>],
"DAST_API_PROFILE"=>[#<Gitlab::Ci::Variables::Collection::Item:0x00007fa111c30fa0 @variable={:key=>"DAST_API_PROFILE", :value=>"Quick-Active", :public=>true, :file=>false, :masked=>false, :raw=>false}>]}>
- Create a new DastScannerProfile with scan_type
passive
dsp = DastScannerProfile.create(name: "#{FFaker::Product.product_name.truncate(192)} #{SecureRandom.hex(4)} - #{rand(100)}", scan_type: 'passive', project: Project.last)
- Check that
DAST_API_PROFILEci variable has the valueQuick
dsp.ci_variables
dsp.ci_variables
=> #<Gitlab::Ci::Variables::Collection:0x00007fa112a3db70
@errors=nil,
@variables=
[#<Gitlab::Ci::Variables::Collection::Item:0x00007fa112a3da08 @variable={:key=>"DAST_USE_AJAX_SPIDER", :value=>"false", :public=>true, :file=>false, :masked=>false, :raw=>false}>,
#<Gitlab::Ci::Variables::Collection::Item:0x00007fa112a3d918 @variable={:key=>"DAST_DEBUG", :value=>"false", :public=>true, :file=>false, :masked=>false, :raw=>false}>,
#<Gitlab::Ci::Variables::Collection::Item:0x00007fa112a3d800 @variable={:key=>"DAST_API_PROFILE", :value=>"Quick", :public=>true, :file=>false, :masked=>false, :raw=>false}>],
@variables_by_key=
{"DAST_USE_AJAX_SPIDER"=>[#<Gitlab::Ci::Variables::Collection::Item:0x00007fa112a3da08 @variable={:key=>"DAST_USE_AJAX_SPIDER", :value=>"false", :public=>true, :file=>false, :masked=>false, :raw=>false}>],
"DAST_DEBUG"=>[#<Gitlab::Ci::Variables::Collection::Item:0x00007fa112a3d918 @variable={:key=>"DAST_DEBUG", :value=>"false", :public=>true, :file=>false, :masked=>false, :raw=>false}>],
"DAST_API_PROFILE"=>[#<Gitlab::Ci::Variables::Collection::Item:0x00007fa112a3d800 @variable={:key=>"DAST_API_PROFILE", :value=>"Quick", :public=>true, :file=>false, :masked=>false, :raw=>false}>]}>
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Marcos Rocha