feat(apple): 設定プロファイルを sops から生成するスクリプト - #377
Open
gapul wants to merge 2 commits into
Open
Conversation
Mac と iPhone に CalDAV / CardDAV / メールを入れるための .mobileconfig を、 値を書き込まずに組み立てる。秘密は実行時に sops から取るので、スクリプト本体は リポジトリに置ける。 生成物は平文の資格情報を含むので使い捨て。インストールしたら消す前提で、 出力先も既定で ~/tmp にしてある。 Radicale のパスワードを sops に追加した。これまで homeserver の /var/lib/secrets にしか無く、生成のたびに ssh で取りに行く必要があった。 学校と会社のアプリパスワードはまだ無いので、その 2 つは初回接続時に本人が 入れる形になる。sops に gmail_app_password_school / _work を足せば自動で 埋め込まれるようにしてある。
署名すると端末に「検証済み」で入る。無署名でもインストールはできるが赤字で 「未検証」と出る。 TLS 証明書では署名できない。Let's Encrypt の証明書は用途が serverAuth に 限定されていて、実際に試すと unsuitable certificate purpose で弾かれた。 Developer ID Application なら Apple のルートに繋がるので通る。 証明書が無い環境では無署名のまま出す。
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
なぜ
Mac と iPhone に CalDAV / CardDAV / メールのアカウントを入れるのに、これまで手で
.mobileconfigを作っていた。あれは平文の資格情報を含む plist なので、置き場所を間違えると事故になる。
値を書き込まず、実行時に sops から取る形にした。スクリプト本体には秘密が無いので
リポジトリに置ける。 生成物は使い捨てで、出力先も既定で
~/tmp。入るもの
3 つとも Google Workspace だったので (MX を引いて確認)、サーバは
imap.gmail.com/smtp.gmail.comで共通。学校と会社のアプリパスワードはまだ無いので初回接続時に本人が入れる。
pii.gmail_app_password_school/_workを sops に足せば自動で埋め込まれる。secrets の変更
radicale.username/radicale.passwordを追加した。これまで homeserver の/var/lib/secrets/radicale-gapul.plaintextにしか無く、生成のたびに ssh で取りに行く必要があった。
公開範囲について
生成物に平文で入るのは CalDAV/CardDAV のパスワードと Gmail のアプリパスワードの計 2 値。
それ以外 (ドメイン、IMAP/SMTP のホスト名とポート、メールアドレス、Radicale の URL) は
MX を引けば分かる程度の情報なので、隠す意味がない。