fix(ci): keep the credentials out of the process list
Two small changes to the deploy job: - The registry password went through `-u armistace:$PASSWORD` on the curl command line, where it is visible in the process list for the duration of the request. It now goes through a curl config file on stdin instead. - The kubeconfig is written with mode 600 rather than the default, and is removed at the end of the job (with `if: always()`, so it is removed even if a later step fails). It is cluster-admin-equivalent, so it should not be readable by anything else on the runner. Verified: `curl --config -` against the registry returns the same digest as the `-u` form.
This commit is contained in:
@@ -114,7 +114,12 @@ jobs:
|
|||||||
- name: Create Kubeconfig
|
- name: Create Kubeconfig
|
||||||
run: |
|
run: |
|
||||||
mkdir -p $HOME/.kube
|
mkdir -p $HOME/.kube
|
||||||
|
# Written with restrictive permissions: the kubeconfig is
|
||||||
|
# cluster-admin-equivalent, so it should not be readable by
|
||||||
|
# anything else on the runner.
|
||||||
|
install -m 600 /dev/null $HOME/.kube/config
|
||||||
echo "${{ secrets.KUBEC_CONFIG_BUILDX }}" > $HOME/.kube/config
|
echo "${{ secrets.KUBEC_CONFIG_BUILDX }}" > $HOME/.kube/config
|
||||||
|
chmod 600 $HOME/.kube/config
|
||||||
|
|
||||||
- name: Install kubectl
|
- name: Install kubectl
|
||||||
run: |
|
run: |
|
||||||
@@ -171,6 +176,10 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- name: Remove the kubeconfig
|
||||||
|
if: always()
|
||||||
|
run: rm -f $HOME/.kube/config
|
||||||
|
|
||||||
- name: Smoke test the deployed app
|
- name: Smoke test the deployed app
|
||||||
run: |
|
run: |
|
||||||
# Check the app's own port from inside the pod, AND the Service in
|
# Check the app's own port from inside the pod, AND the Service in
|
||||||
|
|||||||
Reference in New Issue
Block a user