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

Remove Okta enrollment token from Google instance template #27

Merged
merged 1 commit into from
Feb 29, 2024
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
9 changes: 0 additions & 9 deletions google/compute/template/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,10 @@ resource "google_compute_instance_template" "default" {
"http://metadata.google.internal/computeMetadata/v1/instance/$${1}"
}

if [[ ! -e /var/lib/sftd/device.token ]]; then
mkdir -p /var/lib/sftd
gcloud secrets versions access latest \
--secret=okta-enrollment-token \
>/var/lib/sftd/enrollment.token
chmod 0600 /var/lib/sftd/enrollment.token
fi

if [[ ! -e /etc/sft/sftd.yaml ]]; then
mkdir -p /etc/sft
cat >/etc/sft/sftd.yaml <<EOF
---
EnrollmentTokenFile: /var/lib/sftd/enrollment.token
AccessAddress: "$(metadata network-interfaces/0/ip)"
CanonicalName: "$(metadata hostname)"
EOF
Expand Down