From 3351cf2d13a47b2d3471d9e0841d7a7647322b76 Mon Sep 17 00:00:00 2001 From: djalal Date: Tue, 12 Mar 2019 20:38:56 +0100 Subject: [PATCH 1/2] fix macos compat command on macos fails with : "base64: invalid option -- d" --- slides/k8s/authn-authz.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slides/k8s/authn-authz.md b/slides/k8s/authn-authz.md index cee90790..6a32099c 100644 --- a/slides/k8s/authn-authz.md +++ b/slides/k8s/authn-authz.md @@ -108,7 +108,7 @@ class: extra-details --raw \ -o json \ | jq -r .users[0].user[\"client-certificate-data\"] \ - | base64 -d \ + | openssl base64 -d -A \ | openssl x509 -text \ | grep Subject: ``` @@ -127,7 +127,7 @@ class: extra-details - `--raw` includes certificate information (which shows as REDACTED otherwise) - `-o json` outputs the information in JSON format - `| jq ...` extracts the field with the user certificate (in base64) -- `| base64 -d` decodes the base64 format (now we have a PEM file) +- `| openssl base64 -d -A` decodes the base64 format (now we have a PEM file) - `| openssl x509 -text` parses the certificate and outputs it as plain text - `| grep Subject:` shows us the line that interests us From 5977b11f3307320a36cb4a3f47f62f5a1bc4a18b Mon Sep 17 00:00:00 2001 From: djalal Date: Thu, 14 Mar 2019 19:32:37 +0100 Subject: [PATCH 2/2] better compat when decoding base64 --- slides/k8s/authn-authz.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slides/k8s/authn-authz.md b/slides/k8s/authn-authz.md index 6a32099c..c0fb715a 100644 --- a/slides/k8s/authn-authz.md +++ b/slides/k8s/authn-authz.md @@ -260,7 +260,7 @@ class: extra-details - Extract the token and decode it: ```bash TOKEN=$(kubectl get secret $SECRET -o json \ - | jq -r .data.token | base64 -d) + | jq -r .data.token | openssl base64 -d -A) ``` ]