-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM smallstep/step-cli:0.15.3 | ||
|
||
USER root | ||
ENV USER_KEY="/var/run/autocert.step.sm/ssh_user_key" | ||
ENV USER_CA="/var/run/autocert.step.sm/ssh_user_ca.pub" | ||
ENV HOST_KEY="/var/run/autocert.step.sm/ssh_host_key" | ||
ENV HOST_CA="/var/run/autocert.step.sm/ssh_host_ca.pub" | ||
|
||
COPY bootstrapper/ssh/bootstrapper.sh /home/step/ | ||
RUN chmod +x /home/step/bootstrapper.sh | ||
CMD ["/home/step/bootstrapper.sh"] |
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,23 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
# Download the root certificate and set permissions | ||
if [ "$STEP_HOST" == "" ]; | ||
then | ||
KEY=$USER_KEY | ||
else | ||
KEY=$HOST_KEY | ||
fi | ||
|
||
step ca bootstrap -f | ||
|
||
step ssh certificate $KEY_ID $KEY --insecure --no-password -f | ||
chmod 644 $KEY $KEY.pub $KEY-cert.pub | ||
|
||
unset STEP_TOKEN | ||
unset STEP_HOST | ||
|
||
STEP_HOST=false step ssh config --roots > $USER_CA | ||
STEP_HOST=true step ssh config --roots > $HOST_CA | ||
chmod 644 $USER_CA $HOST_CA |