summaryrefslogtreecommitdiff
path: root/lib/security
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-06-20 11:10:13 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-06-20 11:10:13 +0000
commit0ea3fcec397b69815975647f5e2aa5fe944a8486 (patch)
tree7979381b89d26011bcf9bdc989a40fcc2f1ed4ff /lib/security
parent72123183a20411a36d607d70b12d57c484394c8e (diff)
downloadgitlab-ce-0ea3fcec397b69815975647f5e2aa5fe944a8486.tar.gz
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
Diffstat (limited to 'lib/security')
-rw-r--r--lib/security/ci_configuration/sast_build_action.rb24
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/security/ci_configuration/sast_build_action.rb b/lib/security/ci_configuration/sast_build_action.rb
index 63f16a1bebe..73298bcd070 100644
--- a/lib/security/ci_configuration/sast_build_action.rb
+++ b/lib/security/ci_configuration/sast_build_action.rb
@@ -13,16 +13,16 @@ module Security
private
def variables(params)
- collect_values(params, 'value')
+ collect_values(params, :value)
end
def default_sast_values(params)
- collect_values(params, 'defaultValue')
+ collect_values(params, :default_value)
end
def collect_values(config, key)
- global_variables = config['global']&.to_h { |k| [k['field'], k[key]] } || {}
- pipeline_variables = config['pipeline']&.to_h { |k| [k['field'], k[key]] } || {}
+ global_variables = config[:global]&.to_h { |k| [k[:field], k[key]] } || {}
+ pipeline_variables = config[:pipeline]&.to_h { |k| [k[:field], k[key]] } || {}
analyzer_variables = collect_analyzer_values(config, key)
@@ -31,10 +31,10 @@ module Security
def collect_analyzer_values(config, key)
analyzer_variables = analyzer_variables_for(config, key)
- analyzer_variables['SAST_EXCLUDED_ANALYZERS'] = if key == 'value'
- config['analyzers']
- &.reject {|a| a['enabled'] }
- &.collect {|a| a['name'] }
+ analyzer_variables['SAST_EXCLUDED_ANALYZERS'] = if key == :value
+ config[:analyzers]
+ &.reject {|a| a[:enabled] }
+ &.collect {|a| a[:name] }
&.sort
&.join(', ')
else
@@ -45,10 +45,10 @@ module Security
end
def analyzer_variables_for(config, key)
- config['analyzers']
- &.select {|a| a['enabled'] && a['variables'] }
- &.flat_map {|a| a['variables'] }
- &.collect {|v| [v['field'], v[key]] }.to_h
+ config[:analyzers]
+ &.select {|a| a[:enabled] && a[:variables] }
+ &.flat_map {|a| a[:variables] }
+ &.collect {|v| [v[:field], v[key]] }.to_h
end
def update_existing_content!