multiwoven-integrations 0.43.14 → 0.43.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/multiwoven/integrations/core/network_egress_guard.rb +13 -11
- data/lib/multiwoven/integrations/rollout.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9618db7b11f17436e8afeb245fe6b0f1fadabb007e6c71853ce0a49aec2dd9c0
|
|
4
|
+
data.tar.gz: 57205afb09b1a0dd207a50e8bdb58a279040c280c01cc8c589213a19582b5f12
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4a36b1bb37177df28a9326823838ef2723204fb550e63c06c0b091df0cd1526c1d30fd155c495db92f45b486e592d349cefdff1741785b32e4fc3ad53d42127a
|
|
7
|
+
data.tar.gz: 488345a181eb411111219dde4ebd2c3d90f210f9fefbd511e61795ace0815a6d52e02b142b7562138be9dc53a5e7e8a6b4c44b284f5fa63aab0dba832d74bb9a
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
### [0.43.15]
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* Postgres connectors reach the hosted data store host only on `HOSTED_VECTOR_DB_PORT` with a per-schema read or write role (`hds_<database>_<schema>_read` or `_write`) and a password. The server's own hosted login, any other user name on that host, a blank password, any other port, and a schema role on any other private host are blocked
|
|
9
|
+
|
|
3
10
|
### [0.43.14]
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require "active_support/security_utils"
|
|
4
3
|
require "ipaddr"
|
|
5
4
|
require "socket"
|
|
6
5
|
|
|
@@ -39,8 +38,8 @@ module Multiwoven
|
|
|
39
38
|
ALLOW_PRIVATE_NETWORK_ENV = "CONNECTOR_ALLOW_PRIVATE_NETWORK"
|
|
40
39
|
PRIVATE_NETWORK_ALLOWLIST_ENV = "CONNECTOR_PRIVATE_NETWORK_ALLOWLIST"
|
|
41
40
|
HOSTED_DATABASE_HOST_ENV = "HOSTED_VECTOR_DB_HOST"
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
HOSTED_DATABASE_PORT_ENV = "HOSTED_VECTOR_DB_PORT"
|
|
42
|
+
HOSTED_SCHEMA_ROLE = /\Ahds_\w+_(?:read|write)\z/.freeze
|
|
44
43
|
BLOCKED_HOST_ERROR = "This host points to a private or internal network address, which connectors cannot reach. " \
|
|
45
44
|
"Self-hosted deployments can allow it with #{ALLOW_PRIVATE_NETWORK_ENV} or #{PRIVATE_NETWORK_ALLOWLIST_ENV}"
|
|
46
45
|
UNRESOLVED_HOST_ERROR = "This host name could not be resolved"
|
|
@@ -93,7 +92,8 @@ module Multiwoven
|
|
|
93
92
|
ensure_allowed_host!("#{bucket.to_s.strip}.#{url_host(endpoint.to_s.strip)}")
|
|
94
93
|
end
|
|
95
94
|
|
|
96
|
-
# Hosted data store connectors carry the server's own database host and
|
|
95
|
+
# Hosted data store connectors carry the server's own database host and port, which are private by design,
|
|
96
|
+
# with a per-schema role. Postgres still checks the role's password.
|
|
97
97
|
def ensure_allowed_database_host!(connection_config)
|
|
98
98
|
return if hosted_database_connection?(connection_config)
|
|
99
99
|
|
|
@@ -101,17 +101,19 @@ module Multiwoven
|
|
|
101
101
|
end
|
|
102
102
|
|
|
103
103
|
def hosted_database_connection?(connection_config)
|
|
104
|
-
hosted_host,
|
|
105
|
-
|
|
106
|
-
return false if [hosted_host, hosted_username, hosted_password].any? { |value| value.strip.empty? }
|
|
104
|
+
hosted_host, hosted_port = [HOSTED_DATABASE_HOST_ENV, HOSTED_DATABASE_PORT_ENV].map { |name| ENV.fetch(name, "").strip }
|
|
105
|
+
return false if hosted_host.empty? || hosted_port.empty?
|
|
107
106
|
|
|
108
107
|
host = connection_config[:host].to_s.strip.downcase
|
|
109
108
|
return false if host.match?(COMPOUND_HOST_CHARACTERS)
|
|
109
|
+
return false unless host.delete_suffix(".") == hosted_host.downcase.delete_suffix(".")
|
|
110
|
+
return false unless connection_config[:port].to_s.strip == hosted_port
|
|
110
111
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
hosted_schema_role?(connection_config[:credentials] || {})
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def hosted_schema_role?(credentials)
|
|
116
|
+
credentials[:username].to_s.match?(HOSTED_SCHEMA_ROLE) && !credentials[:password].to_s.strip.empty?
|
|
115
117
|
end
|
|
116
118
|
|
|
117
119
|
def ensure_valid_port!(port)
|