Skip to content

Commit ea044b0

Browse files
author
GitLab Bot
committed
Add latest changes from gitlab-org/gitlab@master
1 parent 08c02e9 commit ea044b0

File tree

8 files changed

+102
-68
lines changed

8 files changed

+102
-68
lines changed

.gitlab/CODEOWNERS

-17
Original file line numberDiff line numberDiff line change
@@ -1445,23 +1445,6 @@ ee/lib/ee/api/entities/project.rb
14451445
/ee/app/views/shared/icons/_icon_audit_events_purple.svg
14461446
/ee/app/views/shared/promotions/_promote_audit_events.html.haml
14471447
/ee/app/workers/audit_events/audit_event_streaming_worker.rb
1448-
/ee/config/events/1652263097_groups__audit_events__index_click_streams_tab.yml
1449-
/ee/config/events/202108302307_admin_audit_logs_index_click_date_range_button.yml
1450-
/ee/config/events/202108302307_groups__audit_events_controller_search_audit_event.yml
1451-
/ee/config/events/202108302307_profiles_controller_search_audit_event.yml
1452-
/ee/config/events/202108302307_projects__audit_events_controller_search_audit_event.yml
1453-
/ee/config/events/202111041910_admin__audit_logs_controller_search_audit_event.yml
1454-
/ee/config/metrics/counts_28d/20210216183930_g_compliance_audit_events_monthly.yml
1455-
/ee/config/metrics/counts_28d/20210216183934_i_compliance_audit_events_monthly.yml
1456-
/ee/config/metrics/counts_28d/20210216183942_a_compliance_audit_events_api_monthly.yml
1457-
/ee/config/metrics/counts_28d/20211130085433_g_manage_compliance_audit_event_destinations.yml
1458-
/ee/config/metrics/counts_7d/20210216183906_g_compliance_audit_events.yml
1459-
/ee/config/metrics/counts_7d/20210216183908_i_compliance_audit_events.yml
1460-
/ee/config/metrics/counts_7d/20210216183912_a_compliance_audit_events_api.yml
1461-
/ee/config/metrics/counts_7d/20210216183928_g_compliance_audit_events_weekly.yml
1462-
/ee/config/metrics/counts_7d/20210216183932_i_compliance_audit_events_weekly.yml
1463-
/ee/config/metrics/counts_7d/20210216183940_a_compliance_audit_events_api_weekly.yml
1464-
/ee/config/metrics/counts_all/20211130085433_g_manage_compliance_audit_event_destinations.yml
14651448
/ee/lib/api/audit_events.rb
14661449
/ee/lib/audit/
14671450
/ee/lib/ee/api/entities/audit_event.rb

db/docs/activity_pub_releases_subscriptions.yml

+1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ feature_categories:
77
description: Stores subscriptions from external users through ActivityPub for project
88
releases
99
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/132889
10+
milestone: '16.6'
1011
gitlab_schema: gitlab_main

db/docs/p_ci_job_annotations.yml

+1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ feature_categories:
66
- build_artifacts
77
description: Stores user provided annotations for jobs. Currently storing extra information for a given job feed by API.
88
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/117319
9+
milestone: '16.1'
910
gitlab_schema: gitlab_ci

doc/architecture/blueprints/secret_detection/index.md

+72-46
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,22 @@ job logs, and project management features such as issues, epics, and MRs.
2626

2727
### Goals
2828

29-
- Support asynchronous secret detection for the following scan targets:
30-
- push events
31-
- issuable creation
32-
- issuable updates
33-
- issuable comments
29+
- Support platform-wide detection of tokens to avoid secret leaks
30+
- Prevent exposure by rejecting detected secrets
31+
- Provide scalable means of detection without harming end user experience
3432

35-
### Non-Goals
33+
See [target types](#target-types) for scan target priorities.
3634

37-
The current proposal is limited to asynchronous detection and alerting only.
35+
### Non-Goals
3836

39-
**Blocking** secrets on push events is high-risk to a critical path and
40-
would require extensive performance profiling before implementing. See
41-
[a recent example](https://gitlab.com/gitlab-org/gitlab/-/issues/246819#note_1164411983)
42-
of a customer incident where this was attempted.
37+
Initial proposal is limited to detection and alerting across plaform, with rejection only
38+
during preceive Git interactions.
4339

4440
Secret revocation and rotation is also beyond the scope of this new capability.
4541

4642
Scanned object types beyond the scope of this MVC include:
4743

48-
- Media types (JPEGs, PDFs,...)
49-
- Snippets
50-
- Wikis
44+
See [target types](#target-types) for scan target priorities.
5145

5246
#### Management UI
5347

@@ -69,7 +63,13 @@ which remain focused on active detection.
6963

7064
## Proposal
7165

72-
To achieve scalable secret detection for a variety of domain objects a dedicated
66+
The first iteration of the experimental capability will feature a blocking
67+
pre-receive hook implemented within the Rails application. This iteration
68+
will be released in an experimental state to select users and provide
69+
opportunity for the team to profile the capability before considering extraction
70+
into a dedicated service.
71+
72+
In the future state, to achieve scalable secret detection for a variety of domain objects a dedicated
7373
scanning service must be created and deployed alongside the GitLab distribution.
7474
This is referred to as the `SecretScanningService`.
7575

@@ -94,10 +94,10 @@ as self-managed instances.
9494
The critical paths as outlined under [goals above](#goals) cover two major object
9595
types: Git blobs (corresponding to push events) and arbitrary text blobs.
9696

97-
The detection flow for push events relies on subscribing to the PostReceive hook
98-
to enqueue Sidekiq requests to the `SecretScanningService`. The `SecretScanningService`
99-
service fetches enqueued refs, queries Gitaly for the ref blob contents, scans
100-
the commit contents, and notifies the Rails application when a secret is detected.
97+
The detection flow for push events relies on subscribing to the PreReceive hook
98+
to scan commit data using the [PushCheck interface](https://gitlab.com/gitlab-org/gitlab/blob/3f1653f5706cd0e7bbd60ed7155010c0a32c681d/lib/gitlab/checks/push_check.rb). This `SecretScanningService`
99+
service fetches the specified blob contents from Gitaly, scans
100+
the commit contents, and rejects the push when a secret is detected.
101101
See [Push event detection flow](#push-event-detection-flow) for sequence.
102102

103103
The detection flow for arbitrary text blobs, such as issue comments, relies on
@@ -112,13 +112,33 @@ storage. See discussion [in this issue](https://gitlab.com/groups/gitlab-org/-/e
112112
around scanning during streaming and the added complexity in buffering lookbacks
113113
for arbitrary trace chunks.
114114

115-
In any case of detection, the Rails application manually creates a vulnerability
115+
In the case of a push detection, the commit is rejected and error returned to the end user.
116+
In any other case of detection, the Rails application manually creates a vulnerability
116117
using the `Vulnerabilities::ManuallyCreateService` to surface the finding in the
117118
existing Vulnerability Management UI.
118119

119120
See [technical discovery](https://gitlab.com/gitlab-org/gitlab/-/issues/376716)
120121
for further background exploration.
121122

123+
### Target types
124+
125+
Target object types refer to the scanning targets prioritized for detection of leaked secrets.
126+
127+
In order of priority this includes:
128+
129+
1. non-binary Git blobs
130+
1. job logs
131+
1. issuable creation (issues, MRs, epics)
132+
1. issuable updates (issues, MRs, epics)
133+
1. issuable comments (issues, MRs, epics)
134+
135+
Targets out of scope for the initial phases include:
136+
137+
- Media types (JPEGs, PDFs,...)
138+
- Snippets
139+
- Wikis
140+
- Container images
141+
122142
### Token types
123143

124144
The existing Secret Detection configuration covers ~100 rules across a variety
@@ -140,9 +160,10 @@ for all secret scanning in pipeline contexts. By using its `--no-git` configurat
140160
we can scan arbitrary text blobs outside of a repository context and continue to
141161
utilize it for non-pipeline scanning.
142162

143-
Given our existing familiarity with the tool and its extensibility, it should
144-
remain our engine of choice. Changes to the detection engine are out of scope
145-
unless benchmarking unveils performance concerns.
163+
In the case of prereceive detection, we rely on a combination of keyword/substring matches
164+
for prefiltering and `re2` for regex detections. See [spike issue](https://gitlab.com/gitlab-org/gitlab/-/issues/423832) for initial benchmarks
165+
166+
Changes to the detection engine are out of scope until benchmarking unveils performance concerns.
146167

147168
Notable alternatives include high-performance regex engines such as [hyperscan](https://github.com/intel/hyperscan) or it's portable fork [vectorscan](https://github.com/VectorCamp/vectorscan).
148169

@@ -167,37 +188,42 @@ for past discussion around scaling approaches.
167188
sequenceDiagram
168189
autonumber
169190
actor User
170-
User->>+Workhorse: git push
191+
User->>+Workhorse: git push with-secret
171192
Workhorse->>+Gitaly: tcp
172-
Gitaly->>+Rails: grpc
173-
Sidekiq->>+Rails: poll job
174-
Rails->>-Sidekiq: PostReceive worker
175-
Sidekiq-->>+Sidekiq: enqueue PostReceiveSecretScanWorker
176-
177-
Sidekiq->>+Rails: poll job
178-
loop PostReceiveSecretScanWorker
179-
Rails->>-Sidekiq: PostReceiveSecretScanWorker
180-
Sidekiq->>+SecretScanningSvc: ScanBlob(ref)
181-
SecretScanningSvc->>+Sidekiq: accepted
182-
Note right of SecretScanningSvc: Scanning job enqueued
183-
Sidekiq-->>+Rails: done
184-
SecretScanningSvc->>+Gitaly: retrieve blob
185-
SecretScanningSvc->>+SecretScanningSvc: scan blob
186-
SecretScanningSvc->>+Rails: secret found
187-
end
193+
Gitaly->>+Rails: PreReceive
194+
Rails->>-Gitaly: ListAllBlobs
195+
Gitaly->>-Rails: ListAllBlobsResponse
196+
197+
Rails->>+GitLabSecretDetection: Scan(blob)
198+
GitLabSecretDetection->>-Rails: found
199+
200+
Rails->>User: rejected: secret found
201+
202+
User->>+Workhorse: git push without-secret
203+
Workhorse->>+Gitaly: tcp
204+
Gitaly->>+Rails: PreReceive
205+
Rails->>-Gitaly: ListAllBlobs
206+
Gitaly->>-Rails: ListAllBlobsResponse
207+
208+
Rails->>+GitLabSecretDetection: Scan(blob)
209+
GitLabSecretDetection->>-Rails: not_found
210+
211+
Rails->>User: OK
188212
```
189213

190214
## Iterations
191215

192216
- ✓ Define [requirements for detection coverage and actions](https://gitlab.com/gitlab-org/gitlab/-/issues/376716)
193-
- ✓ Implement [Clientside detection of GitLab tokens in comments/issues](https://gitlab.com/gitlab-org/gitlab/-/issues/368434)
194-
- PoC of secret scanning service
195-
- Benchmarking of issuables, comments, job logs and blobs to gain confidence that the total costs will be viable
196-
- Capacity planning for addition of service component to Reference Architectures headroom
197-
- Service capabilities
217+
- ✓ Implement [Browser-based detection of GitLab tokens in comments/issues](https://gitlab.com/gitlab-org/gitlab/-/issues/368434)
218+
-[PoC of secret scanning service](https://gitlab.com/gitlab-org/secure/pocs/secret-detection-go-poc/)
219+
-[PoC of secret scanning gem](https://gitlab.com/gitlab-org/gitlab/-/issues/426823)
220+
- [Pre Production Performance Profiling for pre-receive PoCs](https://gitlab.com/gitlab-org/gitlab/-/issues/428499)
221+
- Profiling service capabilities
222+
-[Benchmarking regex performance between Ruby and Go approaches](https://gitlab.com/gitlab-org/gitlab/-/issues/423832)
198223
- gRPC commit retrieval from Gitaly
199-
- blob scanning
224+
- transfer latency, CPU, and memory footprint
200225
- Implementation of secret scanning service MVC (targeting individual commits)
226+
- Capacity planning for addition of service component to Reference Architectures headroom
201227
- Security and readiness review
202228
- Deployment and monitoring
203229
- Implementation of secret scanning service MVC (targeting arbitrary text blobs)

doc/user/application_security/vulnerabilities/index.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,13 @@ When dismissing a vulnerability, one of the following reasons must be chosen to
104104
- **Used in tests**: The finding is not a vulnerability because it is part of a test or is test data.
105105
- **Not applicable**: The vulnerability is known, and has not been remediated or mitigated, but is considered to be in a part of the application that will not be updated.
106106

107-
## Change status of a vulnerability
107+
## Change the status of a vulnerability
108+
109+
> In GitLab 16.4 the ability for `Developers` to change the status of a vulnerability (`admin_vulnerability`) was [deprecated](../../../update/deprecations.md#deprecate-change-vulnerability-status-from-the-developer-role). The `admin_vulnerability` permission will be removed, by default, from all `Developer` roles in GitLab 17.0.
110+
111+
Prerequisites:
112+
113+
- You must have at least the Developer role for the project.
108114

109115
To change a vulnerability's status from its Vulnerability Page:
110116

doc/user/permissions.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,10 @@ The following table lists project permissions available for each role:
201201
| [Requirements Management](project/requirements/index.md):<br>Import / export | |||||
202202
| [Security dashboard](application_security/security_dashboard/index.md):<br>Create issue from vulnerability finding | | ||||
203203
| [Security dashboard](application_security/security_dashboard/index.md):<br>Create vulnerability from vulnerability finding | | ||||
204-
| [Security dashboard](application_security/security_dashboard/index.md):<br>Dismiss vulnerability | | ||||
205-
| [Security dashboard](application_security/security_dashboard/index.md):<br>Dismiss vulnerability finding | | ||||
206-
| [Security dashboard](application_security/security_dashboard/index.md):<br>Resolve vulnerability | | ||||
207-
| [Security dashboard](application_security/security_dashboard/index.md):<br>Revert vulnerability to detected state | | ||||
204+
| [Security dashboard](application_security/security_dashboard/index.md):<br>Dismiss vulnerability | | |(24) |||
205+
| [Security dashboard](application_security/security_dashboard/index.md):<br>Dismiss vulnerability finding | | ||(24) ||
206+
| [Security dashboard](application_security/security_dashboard/index.md):<br>Resolve vulnerability | | |(24) |||
207+
| [Security dashboard](application_security/security_dashboard/index.md):<br>Revert vulnerability to detected state | | |(24) |||
208208
| [Security dashboard](application_security/security_dashboard/index.md):<br>Use security dashboard | | ||||
209209
| [Security dashboard](application_security/security_dashboard/index.md):<br>View vulnerability | | ||||
210210
| [Security dashboard](application_security/security_dashboard/index.md):<br>View vulnerability findings in [dependency list](application_security/dependency_list/index.md) | | ||||
@@ -249,6 +249,7 @@ The following table lists project permissions available for each role:
249249
21. Authors of tasks can delete them even if they don't have the Owner role, but they have to have at least the Guest role for the project.
250250
22. You must have permission to [view the epic](group/epics/manage_epics.md#who-can-view-an-epic).
251251
23. In GitLab 15.9 and later, users with the Guest role and an Ultimate license can view private repository content if an administrator (on self-managed) or group owner (on GitLab.com) gives those users permission. The administrator or group owner can create a [custom role](custom_roles.md) through the API and assign that role to the users.
252+
24. In GitLab 16.4 the ability for `Developers` to change the status of a vulnerability (`admin_vulnerability`) was [deprecated](../update/deprecations.md#deprecate-change-vulnerability-status-from-the-developer-role). The `admin_vulnerability` permission will be removed, by default, from all `Developer` roles in GitLab 17.0.
252253

253254
<!-- markdownlint-enable MD029 -->
254255

locale/gitlab.pot

+3
Original file line numberDiff line numberDiff line change
@@ -56920,6 +56920,9 @@ msgstr ""
5692056920
msgid "is not in the group enforcing Group Managed Account"
5692156921
msgstr ""
5692256922

56923+
msgid "is not linked to a SAML account or has an inactive SCIM identity. For information on how to resolve this error, see the %{troubleshoot_link_start}troubleshooting SCIM documentation%{troubleshoot_link_end}."
56924+
msgstr ""
56925+
5692356926
msgid "is not one of"
5692456927
msgstr ""
5692556928

qa/qa/specs/features/api/1_manage/migration/gitlab_migration_large_project_spec.rb

+13
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,19 @@ module QA
4848
create(:sandbox, api_client: admin_api_client, path: "qa-sandbox-#{SecureRandom.hex(4)}")
4949
end
5050

51+
let!(:api_client) do
52+
Runtime::API::Client.new(
53+
user: user,
54+
is_new_session: false,
55+
personal_access_token: Resource::PersonalAccessToken.fabricate_via_api! do |pat|
56+
pat.user = user
57+
# importing very large project can take multiple days
58+
# token must not expire while we still poll for import result
59+
pat.expires_at = (Time.now.to_date + 5)
60+
end.token
61+
)
62+
end
63+
5164
# Source objects
5265
#
5366
let(:source_project) { source_group.projects(auto_paginate: true).find { |project| project.name == gitlab_source_project }.reload! }

0 commit comments

Comments
 (0)