Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes the risk of sending decrypted EJSON secrets to output. #431

Merged
merged 1 commit into from
Feb 27, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/kubernetes-deploy/ejson_secret_provisioner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def prune_managed_secrets
prune_count += 1
out, err, st = @kubectl.run("delete", "secret", secret_name)
@logger.debug(out)
raise EjsonSecretError, err unless st.success?
raise EjsonSecretError, "Failed to prune secrets" unless st.success?
end
@logger.summary.add_action("pruned #{prune_count} #{'secret'.pluralize(prune_count)}") if prune_count > 0
end
Expand Down Expand Up @@ -121,7 +121,7 @@ def create_or_update_secret(secret_name, secret_type, data)

out, err, st = @kubectl.run("apply", "--filename=#{file.path}")
@logger.debug(out)
raise EjsonSecretError, err unless st.success?
raise EjsonSecretError, "Failed to create or update secrets" unless st.success?
ensure
file&.unlink
end
Expand Down Expand Up @@ -181,7 +181,7 @@ def decrypt_ejson(key_dir)
raise EjsonSecretError, out_err unless st.success?
JSON.parse(out_err)
rescue JSON::ParserError => e
raise EjsonSecretError, "Failed to parse decrypted ejson:\n #{e}"
raise EjsonSecretError, "Failed to parse decrypted ejson"
end

def fetch_private_key_from_secret
Expand Down