Part 4: Setting Up the MDM Server and Enrolling Devices
Part 4: Setting Up the MDM Server and Enrolling Devices
Server Setup
Install Required Software on Your Server:
- Ensure
Openssl
is installed and configured correctly. Prefer compiling from source to include all necessary features. - Install the required Python libraries:bash
pip install web.py M2Crypto PyOpenSSL
- Ensure
Modify APNSWrapper for TLS Compatibility:
- Edit
connections.py
in APNSWrapper and change:python# Original code uses SSLv3 which is no longer supported ssl_version = self.ssl_module.PROTOCOL_TLSv1
- Edit
Network Settings
- Configure Ports and Access:
- Ensure the server can access
gateway.push.apple.com:2195
for outbound communications. - Open inbound access on port 8080 for device check-ins.
- Devices must also access
gateway.push.apple.com:5223
.
- Ensure the server can access
Run the MDM Server
Start the Server:
- Navigate to the
/server
directory and run:bashpython server.py
- Navigate to the
Enroll Devices:
- On your device, go to
https://YOUR_HOST:8080/
and install the CA certificate. - Complete enrollment by installing the
Enroll.mobileconfig
file.
- On your device, go to
Testing and Managing Devices
Send Test Commands:
- Use the server interface to send commands like
DeviceLock
to test server-device communication.
- Use the server interface to send commands like
Troubleshooting:
- Check server logs for errors.
- If commands fail, review the server settings, network configuration, and device logs.
Maintaining the MDM Server
Updating Certificates:
- Regularly update certificates to avoid expiration and maintain security.
Device Management:
- Use the MDM server’s REST endpoints for reporting issues, managing geolocation, and integrating with security apps.
Additional Resources
- Apple Developer Documentation
- OpenSSL Documentation
- Python M2Crypto Library
Join the conversation