Skip to content
Snippets Groups Projects
Commit 1a46c8c1 authored by Max Woolf's avatar Max Woolf Committed by GitLab Release Tools Bot
Browse files

Remove access to local requests via cube query service

Merge branch 'security-product-analytics-ssrf-cube-localhost-17-2' into '17-2-stable-ee'

See merge request gitlab-org/security/gitlab!4494

Changelog: security
parent 5e02069e
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -32,7 +32,7 @@ def cannot_query_data?
 
def query_data
options = {
allow_local_requests: true,
allow_local_requests: false,
headers: cube_security_headers
}
 
Loading
Loading
Loading
Loading
@@ -25,7 +25,7 @@ def perform(project_id)
response = Gitlab::HTTP.post(
URI.join(::ProductAnalytics::Settings.for_project(@project).product_analytics_configurator_connection_string,
"setup-project/gitlab_project_#{project_id}"),
allow_local_requests: true,
allow_local_requests: false,
timeout: 10
)
 
Loading
Loading
Loading
Loading
@@ -20,7 +20,7 @@ def perform(project_id, previous_custom_project_id, new_custom_project_id)
"#{ ::ProductAnalytics::Settings.for_project(@project)
.product_analytics_configurator_connection_string }/funnel-schemas",
body: build_payload.to_json,
allow_local_requests: true
allow_local_requests: false
)
end
 
Loading
Loading
Loading
Loading
@@ -23,7 +23,7 @@ def perform(project_id, newrev, user_id)
project_ids: project_ids.map { |id| "gitlab_project_#{id}" },
funnels: funnels
}.to_json,
allow_local_requests: true
allow_local_requests: false
)
end
end
Loading
Loading
Loading
Loading
@@ -19,7 +19,7 @@
url_to_projects_regex.each do |url, projects_regex|
expect(Gitlab::HTTP).to receive(:post)
.with(URI.parse(url.to_s), {
allow_local_requests: true,
allow_local_requests: false,
body: Regexp.new(projects_regex.source + /.*\"state\":\"created\"/.source)
}).once
.and_return(instance_double("HTTParty::Response", body: { result: 'success' }))
Loading
Loading
@@ -59,7 +59,7 @@
url_to_projects_regex.each do |url, projects_regex|
expect(Gitlab::HTTP).to receive(:post)
.with(URI.parse(url.to_s), {
allow_local_requests: true,
allow_local_requests: false,
body: Regexp.new(projects_regex.source + /.*\"state\":\"updated\"/.source)
}).once.and_return(instance_double("HTTParty::Response",
body: { result: 'success' }))
Loading
Loading
@@ -100,7 +100,7 @@
url_to_projects_regex.each do |url, _projects_regex|
expect(Gitlab::HTTP).to receive(:post)
.with(URI.parse(url.to_s), {
allow_local_requests: true,
allow_local_requests: false,
body: /\"previous_name\":\"example1\"/
}).once
.and_return(instance_double("HTTParty::Response", body: { result: 'success' }))
Loading
Loading
@@ -137,7 +137,7 @@
url_to_projects_regex.each do |url, projects_regex|
expect(Gitlab::HTTP).to receive(:post)
.with(URI.parse(url.to_s), {
allow_local_requests: true,
allow_local_requests: false,
body: Regexp.new(projects_regex.source + /.*\"state\":\"deleted\"/.source)
}).once
.and_return(instance_double("HTTParty::Response", body: { result: 'success' }))
Loading
Loading
@@ -156,7 +156,7 @@
url_to_projects_regex.each do |url, projects_regex|
expect(Gitlab::HTTP).to receive(:post)
.with(URI.parse(url.to_s), {
allow_local_requests: true,
allow_local_requests: false,
body: Regexp.new(projects_regex.source + /.*\"state\":\"deleted\"/.source)
}).once
.and_return(instance_double("HTTParty::Response", body: { result: 'success' }))
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment