summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-02-01 09:00:48 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-02-01 09:01:16 +0000
commit33844e18d2b83dec384549802e4efb20ae964223 (patch)
tree6b636d65641155f4541863a29b3bc8b236988712 /lib
parent41b1c0469dba622a1c2c67c17f1f5e491573accf (diff)
downloadgitlab-ce-33844e18d2b83dec384549802e4efb20ae964223.tar.gz
Add latest changes from gitlab-org/security/gitlab@13-8-stable-ee
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/graphql/query_analyzers/logger_analyzer.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/gitlab/graphql/query_analyzers/logger_analyzer.rb b/lib/gitlab/graphql/query_analyzers/logger_analyzer.rb
index 1285365376f..0665ea8b6c9 100644
--- a/lib/gitlab/graphql/query_analyzers/logger_analyzer.rb
+++ b/lib/gitlab/graphql/query_analyzers/logger_analyzer.rb
@@ -49,13 +49,21 @@ module Gitlab
private
def process_variables(variables)
- if variables.respond_to?(:to_s)
- variables.to_s
+ filtered_variables = filter_sensitive_variables(variables)
+
+ if filtered_variables.respond_to?(:to_s)
+ filtered_variables.to_s
else
- variables
+ filtered_variables
end
end
+ def filter_sensitive_variables(variables)
+ ActiveSupport::ParameterFilter
+ .new(::Rails.application.config.filter_parameters)
+ .filter(variables)
+ end
+
def duration(time_started)
Gitlab::Metrics::System.monotonic_time - time_started
end