Life is fun and easy!
不正IP報告数
Okan Sensor
ページへ戻る
− Links
印刷
macOS/Gatekeeper
の編集 ::
UJP
tech_regist2
:
macOS
/
Gatekeeper
の編集
macOS/Gatekeeper の編集
詳細な入力項目を表示
ページタイトル
( 空白で自動設定 )
:
ページ並び順
( 0-9 小数可 標準:1 )
:
ページ別名
(複数は[
改行
]で区切る)
:
ページ内容:
*macOS Getekeeper考察 [#e75ad5e4] **はじめに [#zf03369b] macOSにて,ダウンロードしたアプリケーションを実行しようとした時に「開発元を確認できないため、開けませんでした。」と表示される.ネットを検索すると,この時の会場方法について指南するサイトは多くあるけれど,仕組みについて説明されたものがなかったので,まとめてみる. **現象の確認 High Sierraを利用[#v1adb1dc] ダウンロードしたアプリのインストーラ(.pkg方式)を実行しようとすると,次のようなダイアログが出る. #ref(site://modules/xelfinder/index.php?page=view&file=7181&macOSgatekeeper01.png,center) これはマルウェア(ウイルスなどの悪意のあるソフトウェアの総称)を誤ってダウンロードしても意図せずに実行しないように制御しているのだが,この機能がmacOSのGatekeeper. このようにブロックされたアプリは,[システム環境設定]の[セキュリティとプライバシー]を開くと確認できる. #ref(site://modules/xelfinder/index.php?page=view&file=7180&macOSgatekeeper02.png,center,mw:600,mh:600) ここで[このまま開く]ボタンを押下すると,次のようなダイアログが表示される. #ref(site://modules/xelfinder/index.php?page=view&file=7183&macOSgatekeeper03.png,center) 先ほどとはメッセージが変わった.一度許可すると,「常に許可」される. 今回の場合はインストーラなので,いくらでもインストールが可能.(普通は何度もインストールしないか) これで[開く]を選択すると,プログラムが実行される. #ref(site://modules/xelfinder/index.php?page=view&file=7182&macOSgatekeeper04.png,center,mw:600,mh:600) 今回の場合,pkgファイルなのでインストールが実行できる. **macOS 10.14 Mojaveでの動作 [#qa0b3e48] macOSはバージョンアップの都度,デフォルト設定を強化していて,MojaveでのmacOS Gatekeeperのダウンロードしたアプリケーションの実行許可は,次のようにApp Storeから限定とされている. #ref(site://modules/xelfinder/index.php?page=view&file=7189&macOSgatekeeper05mojave.jpg,center,mw:600,mh:600) この状態でアプリケーションの実行を行う. #ref(site://modules/xelfinder/index.php?page=view&file=7186&macOSgatekeeper06mojave.png,center) ダイアログにも,控えめにApp Storeのみと書かれている. #ref(site://modules/xelfinder/index.php?page=view&file=7190&macOSgatekeeper07mojave.jpg,center,mw:600,mh:600) このまま実行する. #ref(site://modules/xelfinder/index.php?page=view&file=7184&macOSgatekeeper08mojave.png,center) ダウンロードしたアプリケーションを開こうとすると,管理者権限が必要になる. **High SierraからMojaveへバージョンアップした時のデフォルトの違い [#u2f6a20d] Mojave(10.14)ではダウンロードしたアプリケーションの実行許可は,App Storeになっている. #ref(site://modules/xelfinder/index.php?page=view&file=7191&macOSgatekeeper09mojave.png,center,mw:600,mh:600) 以前のHigh Sierra(10.13)では,「確認済みの開発元からのアプリケーションを許可」がデフォルトになっていたが,Mojaveへバージョンアップした場合は,デフォルトはHigh Sierraの設定が継承される. **確認済みの開発元とはなんなのか [#h81fb637] Appleが承認したアプリケーションベンダを「確認済みの開発元」というが,これはDeverloperに登録し,Developer IDを取得している事が求められている. このDeveloper IDで署名したアプリに限り,Cloudkit,Apple Push Notificationsという機能を実装できるという飴と鞭戦略もある模様. **ダウンロードしたpkgの証明書を確認する [#uae23c1c] ダウンロードしたpkgが持っている証明書は,pkgutilを使うことで確認できる. 次の例では,MicrosoftのサイトからダウンロードしたMicrosoft Teamsのパッケージファイルを確認. $ pkgutil --check-signature Downloads/Teams_osx.pkg🆑 Package "Teams_osx.pkg": Status: signed by a certificate trusted by Mac OS X Certificate Chain: 1. Developer ID Installer: Microsoft Corporation (UBF8T346G9) SHA1 fingerprint: F3 13 36 F7 FF AC 5E 8B 2E 9B 1C 7A 88 84 B0 96 02 0A 4C 19 ----------------------------------------------------------------------------- 2. Developer ID Certification Authority SHA1 fingerprint: 3B 16 6C 3B 7D C4 B7 51 C9 FE 2A FA B9 13 56 41 E3 88 E1 86 ----------------------------------------------------------------------------- 3. Apple Root CA SHA1 fingerprint: 61 1E 5B 66 2C 59 3A 08 FF 58 D1 4A E2 24 52 D1 98 DF 6C 60 $ MicrosoftのDeveloper IDが登録されている. **ダウンロードしたDMGファイルをspctlコマンドで確認する [#y46b3409] DMGファイルは,Disk Imageファイル.昔のフロッピーディスクを貸そうかしていた頃から使われているけれど,macOS用のアプリを入手した際に,DMGファイル形式でダウンロードされるものも多い. このDMGファイルの署名を確認する. DMGファイルは,spctlコマンドを用いる. まずは,コマンドの使い方の確認. $ spctl🆑 System Policy Basic Usage: spctl --assess [--type type] [-v] path ... # assessment spctl --add [--type type] [--path|--requirement|--anchor|--hash] spec ... # add rule(s) spctl [--enable|--disable|--remove] [--type type] [--path|--requirement|--anchor|--hash|--rule] spec # change rule(s) spctl --status | --master-enable | --master-disable # system master switch Kernel Extension User Consent Usage: spctl kext-consent <action> ** Modifications only available in Recovery OS ** status Print whether kernel extension user consent is enabled or disabled. enable Enable requiring user consent for kernel extensions. disable Disable requiring user consent for kernel extensions. add <team-id> Insert a new Team Identifier into the list allowed to load kernel extensions without user consent. list Print the list of Team Identifiers allowed to load without user consent. remove <team-id> Remove a Team Identifier from the list allowed to load kernel extensions without user consent. $ 今回は,Microsoft Office互換ソフトのLibreOfficeをダウンロードしたものを使って検証する. $ spctl -a -t open --context context:primary-signature -v Downloads/LibreOffice_6.4.4_MacOS_x86-64.dmg🆑 Downloads/LibreOffice_6.4.4_MacOS_x86-64.dmg: rejected source=no usable signature🈁 $ 有効な署名は無いと表示された. 次のサンプル. $ spctl -a -t open --context context:primary-signature -v Downloads/IINA.v1.0.4.dmg🆑 Downloads/IINA.v1.0.4.dmg: rejected source=Developer ID🈁 $ これはDeveloper IDで署名されていると **インストールしたMac Appの開発元を確認する [#r40c365e] すでにインストールされているアプリが,Appleに証明されているか確認する. 調べたいアプリを,codesignコマンドで指定する. まずは,App Storeからインストールした,Monosnapを. $ codesign --display -vvv /Applications/Monosnap.app🆑 Executable=/Applications/Monosnap.app/Contents/MacOS/Monosnap Identifier=com.monosnap.monosnap Format=app bundle with Mach-O thin (x86_64) CodeDirectory v=20200 size=58133 flags=0x200(kill) hashes=1809+5 location=embedded Hash type=sha256 size=32 CandidateCDHash sha256=03bb860ec5dfca4c5b75e649edf9554c60587adc Hash choices=sha256 CDHash=03bb860ec5dfca4c5b75e649edf9554c60587adc Signature size=4617 Authority=Apple Mac OS Application Signing🈁 Authority=Apple Worldwide Developer Relations Certification Authority Authority=Apple Root CA Info.plist entries=36 TeamIdentifier=8DEE75ARD7 Sealed Resources version=2 rules=13 files=427 Internal requirements count=1 size=224 $ 次に,pkgファイルをダウンロードしてインストールしたMicrosoft Teamsを確認. $ codesign --display -vvv /Applications/Microsoft\ Teams.app🆑 Executable=/Applications/Microsoft Teams.app/Contents/MacOS/Teams Identifier=com.microsoft.teams Format=app bundle with Mach-O thin (x86_64) CodeDirectory v=20500 size=383 flags=0x10000(runtime) hashes=3+5 location=embedded Hash type=sha256 size=32 CandidateCDHash sha1=de20994eafa3411c1c5e35679925ca09ec1a94c7 CandidateCDHash sha256=ef8f97a75abc383dff7936fdd5d8e395aefbf3a8 Hash choices=sha1,sha256 CDHash=ef8f97a75abc383dff7936fdd5d8e395aefbf3a8 Signature size=9061 Authority=Developer ID Application: Microsoft Corporation (UBF8T346G9)🈁 Authority=Developer ID Certification Authority Authority=Apple Root CA Timestamp=2020/04/02 7:48:09 Info.plist entries=18 TeamIdentifier=UBF8T346G9 Runtime Version=10.12.0 Sealed Resources version=2 rules=13 files=129 Internal requirements count=1 size=180 $ 次に,OSに付属しているSafariを確認. $ codesign --display -vvv /Applications/Safari.app🆑 Executable=/Applications/Safari.app/Contents/MacOS/Safari Identifier=com.apple.Safari Format=app bundle with Mach-O thin (x86_64) CodeDirectory v=20100 size=321 flags=0x2000(library-validation) hashes=3+5 location=embedded Hash type=sha256 size=32 CandidateCDHash sha256=ab20751f33bbb1371b91a81ea316e297901bcc3e Hash choices=sha256 CDHash=ab20751f33bbb1371b91a81ea316e297901bcc3e Signature size=4485 Authority=Software Signing Authority=Apple Code Signing Certification Authority🈁 Authority=Apple Root CA Info.plist entries=40 TeamIdentifier=not set Sealed Resources version=2 rules=13 files=1932 Internal requirements count=1 size=64 $ んー.どこ見れば良いのかよくわからん.今日はここまで.
編集の要約:
Q & A 認証:
ページ更新時は次の質問にお答えください。(プレビュー時は必要ありません)
Q:
「名古屋」の読みがな?(ひらがなで)
A:
お名前:
タイムスタンプを変更しない
テキスト整形のルールを表示する
[1]
添付ファイル
[2]
:
Links list
(This host) = http://www.ujp.jp
(This host)
/modules/tech_regist2/?cmd=edit&help=true&page=macOS%2FGatekeeper
(This host)
/modules/tech_regist2/?plugin=attach&pcmd=list&refer=macOS%2FGatekeeper