Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1c88c9da
Commit
1c88c9da
authored
Jan 26, 2021
by
Paul Gascou-Vaillancourt
Committed by
Shinya Maeda
Jan 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create API fuzzing configuration page
Adds the basic boilerplate for the new API fuzzing configuration page
parent
f25d75b6
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
119 additions
and
8 deletions
+119
-8
ee/app/controllers/projects/security/api_fuzzing_configuration_controller.rb
...projects/security/api_fuzzing_configuration_controller.rb
+17
-0
ee/app/controllers/projects/security/configuration_controller.rb
...controllers/projects/security/configuration_controller.rb
+1
-0
ee/app/helpers/ee/projects_helper.rb
ee/app/helpers/ee/projects_helper.rb
+2
-0
ee/app/presenters/projects/security/configuration_presenter.rb
...p/presenters/projects/security/configuration_presenter.rb
+2
-1
ee/app/views/projects/security/api_fuzzing_configuration/show.html.haml
...rojects/security/api_fuzzing_configuration/show.html.haml
+5
-0
ee/config/feature_flags/development/api_fuzzing_configuration_ui.yml
...eature_flags/development/api_fuzzing_configuration_ui.yml
+8
-0
ee/config/routes/project.rb
ee/config/routes/project.rb
+1
-0
ee/spec/controllers/projects/security/api_fuzzing_configuration_controller_spec.rb
...cts/security/api_fuzzing_configuration_controller_spec.rb
+73
-0
ee/spec/helpers/projects_helper_spec.rb
ee/spec/helpers/projects_helper_spec.rb
+2
-0
ee/spec/presenters/projects/security/configuration_presenter_spec.rb
...senters/projects/security/configuration_presenter_spec.rb
+5
-7
locale/gitlab.pot
locale/gitlab.pot
+3
-0
No files found.
ee/app/controllers/projects/security/api_fuzzing_configuration_controller.rb
0 → 100644
View file @
1c88c9da
# frozen_string_literal: true
module
Projects
module
Security
class
ApiFuzzingConfigurationController
<
Projects
::
ApplicationController
include
SecurityDashboardsPermissions
alias_method
:vulnerable
,
:project
feature_category
:fuzz_testing
def
show
not_found
unless
Feature
.
enabled?
(
:api_fuzzing_configuration_ui
,
@project
,
default_enabled: :yaml
)
end
end
end
end
ee/app/controllers/projects/security/configuration_controller.rb
View file @
1c88c9da
...
...
@@ -10,6 +10,7 @@ module Projects
before_action
only:
[
:show
]
do
push_frontend_feature_flag
(
:security_auto_fix
,
project
,
default_enabled:
false
)
push_frontend_feature_flag
(
:sast_configuration_ui
,
project
,
default_enabled:
true
)
push_frontend_feature_flag
(
:api_fuzzing_configuration_ui
,
project
,
default_enabled: :yaml
)
end
before_action
only:
[
:auto_fix
]
do
...
...
ee/app/helpers/ee/projects_helper.rb
View file @
1c88c9da
...
...
@@ -162,6 +162,7 @@ module EE
%w[
projects/security/configuration#show
projects/security/sast_configuration#show
projects/security/api_fuzzing_configuration#show
projects/security/vulnerabilities#show
projects/security/vulnerability_report#index
projects/security/dashboard#index
...
...
@@ -200,6 +201,7 @@ module EE
%w[
projects/security/configuration#show
projects/security/sast_configuration#show
projects/security/api_fuzzing_configuration#show
projects/security/dast_profiles#show
projects/security/dast_site_profiles#new
projects/security/dast_site_profiles#edit
...
...
ee/app/presenters/projects/security/configuration_presenter.rb
View file @
1c88c9da
...
...
@@ -183,7 +183,8 @@ module Projects
def
configuration_path
(
type
)
{
sast:
project_security_configuration_sast_path
(
project
),
dast_profiles:
project_security_configuration_dast_profiles_path
(
project
)
dast_profiles:
project_security_configuration_dast_profiles_path
(
project
),
api_fuzzing:
::
Feature
.
enabled?
(
:api_fuzzing_configuration_ui
,
project
,
default_enabled: :yaml
)
?
project_security_configuration_api_fuzzing_path
(
project
)
:
nil
}[
type
]
end
end
...
...
ee/app/views/projects/security/api_fuzzing_configuration/show.html.haml
0 → 100644
View file @
1c88c9da
-
add_to_breadcrumbs
_
(
"Security Configuration"
),
project_security_configuration_path
(
@project
)
-
breadcrumb_title
_
(
"API Fuzzing Configuration"
)
-
page_title
_
(
"API Fuzzing Configuration"
)
%h1
=
"API fuzzing configuration"
ee/config/feature_flags/development/api_fuzzing_configuration_ui.yml
0 → 100644
View file @
1c88c9da
---
name
:
api_fuzzing_configuration_ui
introduced_by_url
:
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/51940
rollout_issue_url
:
https://gitlab.com/gitlab-org/gitlab/-/issues/299234
milestone
:
'
13.9'
type
:
development
group
:
group::fuzz testing
default_enabled
:
false
ee/config/routes/project.rb
View file @
1c88c9da
...
...
@@ -67,6 +67,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
post
:auto_fix
,
on: :collection
resource
:corpus_management
,
only:
[
:show
],
controller: :corpus_management
resource
:sast
,
only:
[
:show
,
:create
],
controller: :sast_configuration
resource
:api_fuzzing
,
only: :show
,
controller: :api_fuzzing_configuration
resource
:dast_profiles
,
only:
[
:show
]
do
resources
:dast_site_profiles
,
only:
[
:new
,
:edit
]
resources
:dast_scanner_profiles
,
only:
[
:new
,
:edit
]
...
...
ee/spec/controllers/projects/security/api_fuzzing_configuration_controller_spec.rb
0 → 100644
View file @
1c88c9da
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Projects
::
Security
::
ApiFuzzingConfigurationController
do
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
let_it_be
(
:developer
)
{
create
(
:user
)
}
let_it_be
(
:guest
)
{
create
(
:user
)
}
before_all
do
group
.
add_developer
(
developer
)
group
.
add_guest
(
guest
)
end
describe
'GET #show'
do
subject
(
:request
)
{
get
:show
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
}
}
render_views
it_behaves_like
SecurityDashboardsPermissions
do
let
(
:vulnerable
)
{
project
}
let
(
:security_dashboard_action
)
{
request
}
end
context
'with authorized user'
do
before
do
stub_licensed_features
(
security_dashboard:
true
)
sign_in
(
developer
)
end
it
'renders the show template'
do
request
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
render_template
(
:show
)
end
it
'renders the side navigation with the correct submenu set as active'
do
request
expect
(
response
.
body
).
to
have_active_sub_navigation
(
'Configuration'
)
end
context
'with feature flag disabled'
do
before
do
stub_feature_flags
(
api_fuzzing_configuration_ui:
false
)
end
it
'returns a 404 for an HTML request'
do
request
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
end
context
'with unauthorized user'
do
before
do
stub_licensed_features
(
security_dashboard:
true
)
sign_in
(
guest
)
end
it
'returns a 403'
do
request
expect
(
response
).
to
have_gitlab_http_status
(
:forbidden
)
end
end
end
end
ee/spec/helpers/projects_helper_spec.rb
View file @
1c88c9da
...
...
@@ -204,6 +204,7 @@ RSpec.describe ProjectsHelper do
%w[
projects/security/configuration#show
projects/security/sast_configuration#show
projects/security/api_fuzzing_configuration#show
projects/security/vulnerabilities#show
projects/security/vulnerability_report#index
projects/security/dashboard#index
...
...
@@ -248,6 +249,7 @@ RSpec.describe ProjectsHelper do
%w[
projects/security/configuration#show
projects/security/sast_configuration#show
projects/security/api_fuzzing_configuration#show
projects/security/dast_profiles#show
projects/security/dast_site_profiles#new
projects/security/dast_site_profiles#edit
...
...
ee/spec/presenters/projects/security/configuration_presenter_spec.rb
View file @
1c88c9da
...
...
@@ -274,13 +274,11 @@ RSpec.describe Projects::Security::ConfigurationPresenter do
end
def
configuration_path
(
type
)
if
type
===
:dast_profiles
project_security_configuration_dast_profiles_path
(
project
)
elsif
type
===
:sast
project_security_configuration_sast_path
(
project
)
else
nil
end
{
dast_profiles:
project_security_configuration_dast_profiles_path
(
project
),
sast:
project_security_configuration_sast_path
(
project
),
api_fuzzing:
project_security_configuration_api_fuzzing_path
(
project
)
}[
type
]
end
def
scan_status
(
type
,
configured
,
auto_dev_ops_enabled
)
...
...
locale/gitlab.pot
View file @
1c88c9da
...
...
@@ -1361,6 +1361,9 @@ msgstr ""
msgid "API Fuzzing"
msgstr ""
msgid "API Fuzzing Configuration"
msgstr ""
msgid "API Help"
msgstr ""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment