diff options
author | Thong Kuah <tkuah@gitlab.com> | 2019-02-12 23:46:59 +0300 |
---|---|---|
committer | Thong Kuah <tkuah@gitlab.com> | 2019-02-21 13:24:21 +0300 |
commit | 0e53c34f669fd6449d8ce636e31a5f85c7082300 (patch) | |
tree | 72ffa8561a65da660c262386c8c14215a6f8b972 /app | |
parent | c5b5b18b3f1c5b683ceb4471e667d675de9200eb (diff) |
Do not allow local urls in Kubernetes form
Use existing `public_url` validation to block various local urls. Note
that this validation will allow local urls if the "Allow requests to the
local network from hooks and services" admin setting is enabled.
Block KubeClient from using local addresses
It will also respect `allow_local_requests_from_hooks_and_services` so
if that is enabled KubeClinet will allow local addresses
Diffstat (limited to 'app')
-rw-r--r-- | app/models/clusters/platforms/kubernetes.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/clusters/platforms/kubernetes.rb b/app/models/clusters/platforms/kubernetes.rb index 1cc170c8c4d..c8484923502 100644 --- a/app/models/clusters/platforms/kubernetes.rb +++ b/app/models/clusters/platforms/kubernetes.rb @@ -41,7 +41,7 @@ module Clusters validate :no_namespace, unless: :allow_user_defined_namespace? # We expect to be `active?` only when enabled and cluster is created (the api_url is assigned) - validates :api_url, url: true, presence: true + validates :api_url, public_url: true, presence: true validates :token, presence: true validate :prevent_modification, on: :update |