Skip to content

Commit 418464b

Browse files
abrightwellwill
authored andcommitted
Ensure cb scope uses SCRAM with channel binding.
In an effort to improve security around `cb scope` connections, we've updated the action to only utilize and accept SCRAM with channel binding connections.
1 parent 54b0d56 commit 418464b

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
### Added
99
- Added `--full` option to `cb restart` to restart the entire server.
1010

11+
### Changed
12+
- Updated `cb scope` connections to utilize SCRAM with channel binding only.
13+
1114
## [1.3.0] - 2022-05-03
1215
### Added
1316
- Fully respect the [XDG Base Directory Specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html)

src/cb/scope.cr

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ class CB::Scope < CB::Action
1313
uri = client.get_role(cluster_id, "default").uri
1414
raise Error.new "null uri" if uri.nil?
1515

16+
# Accept only SCRAM with Channel Binding.
17+
#
18+
# https://github.com/will/crystal-pg#authentication-methods
19+
uri.query = "auth_methods=scram-sha-256-plus"
20+
1621
if database.presence
1722
uri.path = database.to_s
1823
end

0 commit comments

Comments
 (0)