-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce Cucumber Tests for Rotators (#581)
This refactor brings integration tests and some refactoring to improve modularity and flexibility for the PostgreSQL rotator.
- Loading branch information
1 parent
a40fb01
commit 17848f0
Showing
19 changed files
with
340 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,3 +39,4 @@ api.html | |
|
||
brakeman-output.* | ||
.idea | ||
TEMP_NOTES.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
require 'aruba' | ||
require 'aruba/cucumber' | ||
require 'conjur-api' | ||
require_relative './world.rb' | ||
|
||
Conjur.configuration.appliance_url = ENV['CONJUR_APPLIANCE_URL'] || 'http://conjur' | ||
Conjur.configuration.account = ENV['CONJUR_ACCOUNT'] || 'cucumber' | ||
World(PossumWorld) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
Feature: Postgres password rotation | ||
|
||
Background: Configure a postgres rotator | ||
Given I reset my root policy | ||
And I have the root policy: | ||
""" | ||
- !policy | ||
id: db-reports | ||
body: | ||
- &variables | ||
- !variable url | ||
- !variable username | ||
- !variable | ||
id: password | ||
annotations: | ||
rotation/rotator: postgresql/password | ||
rotation/ttl: PT1S | ||
rotation/postgresql/password/length: 32 | ||
""" | ||
And I create a db user "test" with password "secret" | ||
And I add the value "testdb" to variable "db-reports/url" | ||
And I add the value "test" to variable "db-reports/username" | ||
And I add the value "secret" to variable "db-reports/password" | ||
|
||
# NOTE: To make these tests robust on unreliable Jenkins servers that may | ||
# not be able to respect `sleep` times exactly, we give ourselves | ||
# some leeway, waiting for 3 rotations but allowing for more than | ||
# 3 seconds of time. | ||
# | ||
Scenario: Values are rotated according to the policy | ||
Given I poll "db-reports/password" and db user "test" for 3 rotations in 20 seconds | ||
Then the first 3 db and conjur passwords match | ||
Then the first 3 conjur passwords are distinct | ||
And the generated passwords have length 32 |
Oops, something went wrong.