Commit 82d6547b authored by Ash McKenzie's avatar Ash McKenzie

Merge branch 'default-on-demand-dast-scan-feature-to-true-235105' into 'master'

Enable on-demand DAST scan feature flag by default

See merge request gitlab-org/gitlab!39411
parents bb7b2a0b 50770766
...@@ -17,7 +17,7 @@ module EE ...@@ -17,7 +17,7 @@ module EE
null: true, null: true,
description: 'The DAST scanner profiles associated with the project', description: 'The DAST scanner profiles associated with the project',
resolve: -> (project, _args, _ctx) do resolve: -> (project, _args, _ctx) do
return DastScannerProfile.none unless ::Feature.enabled?(:security_on_demand_scans_feature_flag, project) return DastScannerProfile.none unless ::Feature.enabled?(:security_on_demand_scans_feature_flag, project, default_enabled: true)
project.dast_scanner_profiles project.dast_scanner_profiles
end end
......
...@@ -25,7 +25,7 @@ module Mutations ...@@ -25,7 +25,7 @@ module Mutations
def resolve(full_path:, dast_site_profile_id:) def resolve(full_path:, dast_site_profile_id:)
project = authorized_find!(full_path: full_path) project = authorized_find!(full_path: full_path)
raise_resource_not_available_error! unless Feature.enabled?(:security_on_demand_scans_feature_flag, project) raise_resource_not_available_error! unless Feature.enabled?(:security_on_demand_scans_feature_flag, project, default_enabled: true)
dast_site_profile = find_dast_site_profile(project: project, dast_site_profile_id: dast_site_profile_id) dast_site_profile = find_dast_site_profile(project: project, dast_site_profile_id: dast_site_profile_id)
dast_site = dast_site_profile.dast_site dast_site = dast_site_profile.dast_site
......
...@@ -31,7 +31,7 @@ module Mutations ...@@ -31,7 +31,7 @@ module Mutations
def resolve(full_path:, profile_name:, spider_timeout: nil, target_timeout: nil) def resolve(full_path:, profile_name:, spider_timeout: nil, target_timeout: nil)
project = authorized_find!(full_path: full_path) project = authorized_find!(full_path: full_path)
raise_resource_not_available_error! unless Feature.enabled?(:security_on_demand_scans_feature_flag, project) raise_resource_not_available_error! unless Feature.enabled?(:security_on_demand_scans_feature_flag, project, default_enabled: true)
service = ::DastScannerProfiles::CreateService.new(project, current_user) service = ::DastScannerProfiles::CreateService.new(project, current_user)
result = service.execute(name: profile_name, spider_timeout: spider_timeout, target_timeout: target_timeout) result = service.execute(name: profile_name, spider_timeout: spider_timeout, target_timeout: target_timeout)
......
...@@ -27,7 +27,7 @@ module Mutations ...@@ -27,7 +27,7 @@ module Mutations
def resolve(full_path:, profile_name:, target_url: nil) def resolve(full_path:, profile_name:, target_url: nil)
project = authorized_find!(full_path: full_path) project = authorized_find!(full_path: full_path)
raise_resource_not_available_error! unless Feature.enabled?(:security_on_demand_scans_feature_flag, project) raise_resource_not_available_error! unless Feature.enabled?(:security_on_demand_scans_feature_flag, project, default_enabled: true)
service = ::DastSiteProfiles::CreateService.new(project, current_user) service = ::DastSiteProfiles::CreateService.new(project, current_user)
result = service.execute(name: profile_name, target_url: target_url) result = service.execute(name: profile_name, target_url: target_url)
......
...@@ -19,7 +19,7 @@ module Mutations ...@@ -19,7 +19,7 @@ module Mutations
def resolve(full_path:, id:) def resolve(full_path:, id:)
project = authorized_find!(full_path: full_path) project = authorized_find!(full_path: full_path)
raise_resource_not_available_error! unless Feature.enabled?(:security_on_demand_scans_feature_flag, project) raise_resource_not_available_error! unless Feature.enabled?(:security_on_demand_scans_feature_flag, project, default_enabled: true)
dast_site_profile = find_dast_site_profile(project: project, global_id: id) dast_site_profile = find_dast_site_profile(project: project, global_id: id)
return { errors: dast_site_profile.errors.full_messages } unless dast_site_profile.destroy return { errors: dast_site_profile.errors.full_messages } unless dast_site_profile.destroy
......
...@@ -31,7 +31,7 @@ module Mutations ...@@ -31,7 +31,7 @@ module Mutations
def resolve(full_path:, **service_args) def resolve(full_path:, **service_args)
project = authorized_find!(full_path: full_path) project = authorized_find!(full_path: full_path)
raise_resource_not_available_error! unless Feature.enabled?(:security_on_demand_scans_feature_flag, project) raise_resource_not_available_error! unless Feature.enabled?(:security_on_demand_scans_feature_flag, project, default_enabled: true)
service = ::DastSiteProfiles::UpdateService.new(project, current_user) service = ::DastSiteProfiles::UpdateService.new(project, current_user)
result = service.execute(service_args) result = service.execute(service_args)
......
...@@ -31,7 +31,7 @@ module Mutations ...@@ -31,7 +31,7 @@ module Mutations
def resolve(project_path:, target_url:, branch:, scan_type:) def resolve(project_path:, target_url:, branch:, scan_type:)
project = authorized_find!(full_path: project_path) project = authorized_find!(full_path: project_path)
raise_resource_not_available_error! unless Feature.enabled?(:security_on_demand_scans_feature_flag, project) raise_resource_not_available_error! unless Feature.enabled?(:security_on_demand_scans_feature_flag, project, default_enabled: true)
service = Ci::RunDastScanService.new(project, current_user) service = Ci::RunDastScanService.new(project, current_user)
result = service.execute(branch: branch, target_url: target_url) result = service.execute(branch: branch, target_url: target_url)
......
...@@ -137,7 +137,7 @@ module EE ...@@ -137,7 +137,7 @@ module EE
with_scope :subject with_scope :subject
condition(:on_demand_scans_enabled) do condition(:on_demand_scans_enabled) do
::Feature.enabled?(:security_on_demand_scans_feature_flag, project) && ::Feature.enabled?(:security_on_demand_scans_feature_flag, project, default_enabled: true) &&
@subject.feature_available?(:security_on_demand_scans) @subject.feature_available?(:security_on_demand_scans)
end end
......
---
title: Enable on-demand DAST scan feature flag by default
merge_request: 39411
author:
type: added
---
name: security_on_demand_scans_feature_flag
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/32994
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/237796
group: group::dynamic analysis
type: development
default_enabled: true
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment