LoginSignup
1
2

More than 5 years have passed since last update.

Macを管理する。その① USBを抹殺する(ストレージのみ)

Posted at

背景

当社では、ほぼ全社員がMacを使っている。
Windowsと違い、Macでは管理する上で必要な色々な事ができない(ハードルがある)
実現までに四苦八苦したので、経緯を書き留めておきます。

目次

  • USBを抹殺する(ストレージのみ) ←今回はコレ
  • FWを強制する
  • Bluetooth共有を抹殺する
  • プリンタを制御する
  • パスワードポリシーを設定する
  • 特定のWebサイトへのアクセスを禁止する

などなど。

やること

Macにストレージを接続できないようにし、データの流出を防ぐ

*今回のお題を実現するには、Macへプロファイルを配布できる環境が必要です。

やってみる

今回色々やりました。

  • 導入しているMDMで設定を試みる(そもそもUSB制御する項目がなかった)
  • Macを直接イジってできないか試みる(できた所で運用回らないから止めた)
  • Mac Serverを導入(結果これでできたが、細かな制御ができなかった)
  • プロファイルを手で書く ←今回はコレ

では、書く。

mobileconfig

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>PayloadContent</key>
    <array>
        <dict>
            <key>PayloadEnabled</key>
            <true/>
            <key>PayloadDisplayName</key>
            <string>Restrictions</string>
            <key>PayloadIdentifier</key>
            <string>com.apple.systemuiserver</string>
            <key>PayloadType</key>
            <string>com.apple.systemuiserver</string>
            <key>PayloadUUID</key>
            <string>XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX</string>
            <key>PayloadVersion</key>
            <integer>1</integer>
            <key>mount-controls</key>
            <dict>
                <key>harddisk-external</key>
                <array>
                    <string>eject</string>
                    <string>alert</string>
                </array>
            </dict>
        </dict>
    </array>
    <key>PayloadDescription</key>
    <string>Mac_Disable storage</string>
    <key>PayloadDisplayName</key>
    <string>Mac_Disable storage</string>
    <key>PayloadIdentifier</key>
    <string>com.apple.systemuiserver</string>
    <key>PayloadOrganization</key>
    <string>COMPANY Name</string>
    <key>PayloadScope</key>
    <string>system</string>
    <key>PayloadType</key>
    <string>Configuration</string>
    <key>PayloadUUID</key>
    <string>XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX</string>
    <key>PayloadVersion</key>
    <integer>1</integer>    
    <key>PayloadRemovalDisallowed</key>
    <true/>
</dict>
</plist>

上記プロファイルは、おおよそ3段構成になっている。
上から順に先ず、

ヘッダー(お約束みたいなやつ)

mobileconfig

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">

実際に制御をかける箇所

mobileconfig

    <key>PayloadContent</key>
    <array>
        <dict>
            <key>PayloadEnabled</key>
            <true/>
            <key>PayloadDisplayName</key>
            <string>Restrictions</string>
            <key>PayloadIdentifier</key>
            <!-- 何の制御をかけたいかを記載。今回は下記。-->
            <string>com.apple.systemuiserver</string> 
            <key>PayloadType</key>
            <!-- 何の制御をかけたいかを記載。今回は下記。-->
            <string>com.apple.systemuiserver</string>
            <key>PayloadUUID</key>
            <!-- 色々プロファイル当てる場合は一意になるUUIDを記載 -->
            <string>XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX</string>
            <key>PayloadVersion</key>
            <integer>1</integer>
            <!-- ここから下が制御をかける箇所 -->
            <key>mount-controls</key>
            <dict>
                <!-- 外付けストレージ禁止 -->
                <key>harddisk-external</key>
                <array>
                    <string>eject</string>
                    <string>alert</string>
                </array>
            </dict>
        </dict>
    </array>

プロファイル自体の基本設定のような箇所

mobileconfig

    <key>PayloadDescription</key>
    <string>Mac_Disable storage</string>
    <key>PayloadDisplayName</key>
    <string>Mac_Disable storage</string>
    <key>PayloadIdentifier</key>
    <!-- 何の制御をかけたいかを記載。今回は下記。-->
    <string>com.apple.systemuiserver</string>
    <key>PayloadOrganization</key>
    <string>COMPANY Name </string>
    <key>PayloadScope</key>
    <!-- Windowsで言う所のユーザーポリシーかコンピューターか -->
    <string>system</string>
    <key>PayloadType</key>
    <string>Configuration</string>
    <key>PayloadUUID</key>
    <string>XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX</string>
    <key>PayloadVersion</key>
    <integer>1</integer>    

あとは、できたプロファイルを配布すれば完了です。

まとめ

調べる過程で、Macでもプロファイル書けば色々制御できる事がわかった。
これは活用できそうだ!

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2