-
Notifications
You must be signed in to change notification settings - Fork 485
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Marcos Yacob <[email protected]>
- Loading branch information
Showing
9 changed files
with
61 additions
and
89 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
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
4 changes: 0 additions & 4 deletions
4
test/integration/suites/force-rotation-upstream-authority/06-prepare-x509-authority
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
21 changes: 9 additions & 12 deletions
21
test/integration/suites/force-rotation-upstream-authority/10-revoke-upstream-authority
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,38 +1,35 @@ | ||
#!/bin/bash | ||
|
||
MAX_RETRIES=10 | ||
RETRY_DELAY=1 # seconds between retries | ||
|
||
get-x509-authorities-count() { | ||
local server=$1 | ||
} | ||
|
||
oldUpstreamAuthority=$(docker compose exec -T -e SPIRE_SERVER_FFLAGS=forced_rotation spire-server \ | ||
old_upstream_authority=$(docker compose exec -T -e SPIRE_SERVER_FFLAGS=forced_rotation spire-server \ | ||
/opt/spire/bin/spire-server \ | ||
localauthority x509 show -output json | jq -r .old.upstream_authority_subject_key_id) || fail-now "Failed to fetch old upstrem authority ID" | ||
|
||
log-debug "Old authority: $oldUpstreamAuthority" | ||
log-debug "Old authority: $old_upstream_authority" | ||
|
||
|
||
x509AuthoritiesCount=$(docker compose exec -T spire-server \ | ||
x509_authorities_count=$(docker compose exec -T spire-server \ | ||
/opt/spire/bin/spire-server bundle \ | ||
show -output json | jq '.x509_authorities | length') | ||
|
||
if [ $x509AuthoritiesCount -eq 2 ]; then | ||
if [ $x509_authorities_count -eq 2 ]; then | ||
log-debug "Two X.509 Authorities found" | ||
else | ||
fail-now "Expected to be two X.509 Authorities. Found $x509AuthoritiesCount." | ||
fail-now "Expected to be two X.509 Authorities. Found $x509_authorities_count." | ||
fi | ||
|
||
taintedFound=$(docker compose exec -T spire-server /opt/spire/bin/spire-server bundle show -output json | jq '.x509_authorities[] | select(.tainted == true)') | ||
tainted_found=$(docker compose exec -T spire-server /opt/spire/bin/spire-server bundle show -output json | jq '.x509_authorities[] | select(.tainted == true)') | ||
|
||
if [[ -z "$taintedFound" ]]; then | ||
if [[ -z "$tainted_found" ]]; then | ||
fail-now "Tainted authority expected" | ||
fi | ||
|
||
docker compose exec -T -e SPIRE_SERVER_FFLAGS=forced_rotation spire-server \ | ||
/opt/spire/bin/spire-server upstreamauthority \ | ||
revoke -subjectKeyID $oldUpstreamAuthority -output json || fail-now "Failed to revoke upstream authority" | ||
revoke -subjectKeyID $old_upstream_authority -output json || fail-now "Failed to revoke upstream authority" | ||
|
||
check-log-line spire-server "X\.509 upstream authority successfully revoked|subject_key_id=$oldUpstreamAuthority" | ||
check-log-line spire-server "X\.509 upstream authority successfully revoked|subject_key_id=$old_upstream_authority" | ||
|
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