python server.py
.
161 |
162 | On the device navigate to: **https://YOUR_HOST:8080/**
163 | Once there you need to, in order:
164 | 1. Tap *here* to install the CA Cert (for Server/Identity)
165 | 2. Tap *here* to enroll in MDM (the device should appear after this step)
166 | 3. Select Command (DeviceLock is a good one to test) and check your device. Click Submit to send the command.
167 | 4. If everything works, the device should lock and you're good to go! As of right now some of the commands aren't fully implemented. Feel free to experiment with different commands!
168 |
169 | ---
170 | 
171 | ---
172 |
173 | You can now run those commands from any web browser, a successfull command will often looks something like the following:
174 |
175 | ---
176 | 
177 | ---
178 |
179 | Click the "Response" button to see the plist response from apple. Click the pencil to edit the device name, device owner, and device location.
180 |
181 |
182 | When stopping the server, the standard control-c doesn't usually work. Instead use control-z to suspend the process and then use a kill command to end the process.
183 |
184 | ^z
185 | [1]+ Stopped python server.py
186 | user:~/mdm-server/server$ kill %1
187 | [1]+ Terminated python server.py
188 | user:~/mdm-server/server$
189 |
190 | The server uses the pickle library to save devices. When the device class is updated, the pickle format may be invalidated, causing the server to error. In order to fix this, remove the devicelist.pickle file (make a backup just in case!) and re-enroll all devices.
191 |
192 | # Client Reporting
193 |
194 | The MDM server also has REST endpoints for reporting issues and geolocation data from the enrolled clients. This functionality may be used at a later point in time by a security app. The API can be imported into any project as follows:
195 |
196 | * Click on the top level Project item and add files ("option-command-a")
197 | * Navigate to client-reporting/
198 | * Highlight the client-reporting subdirectory
199 | * Click the Add button
200 |
201 | The library provides the following functions:
202 |
203 | +(void) setHostAddress: (NSString*) host; // Set where the MDM server lives
204 | +(void) setPause : (BOOL) toggle; // Toggle whether to add a thread execution pause to allow requests to finish
205 | +(void) reportJailbreak; // Report that the device has been jailbroken
206 | +(void) reportDebugger; // Report that the application has a debugger attached
207 | +(void) reportLocation : (CLLocationCoordinate2D*) coords; // Report the lat/lon location of the device
208 |
209 | "setHostAddress" and "setPause" are meant to be set once only, and effect all "report" calls. An example usage may look like:
210 |
211 | // Code in application init
212 | [client_reporting setHostAddress:@"192.168.0.0"];
213 | [client_reporting setPause:YES];
214 |
215 | // Later code during execution
216 | [client_reporting reportDebugger]
217 |
218 | This client API can be coupled with the [iMAS security-check controls](git@github.com:project-imas/security-check.git) to provide accurate reporting of jailbreak and debugger detection.
219 |
220 |
221 | Apologies for the long and complex setup, we hope to eventually make things easier and simpler. Please post questions to github if you get stuck and we'll do our best to help. Enjoy!
222 |
223 |
224 |
225 | # LICENSE AND ATTRIBUTION
226 |
227 | Copyright 2013-2014 The MITRE Corporation, All Rights Reserved.
228 |
229 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License at
230 |
231 | http://www.apache.org/licenses/LICENSE-2.0
232 |
233 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
234 |
235 |
236 | This project also uses code from various sources under various licenses.
237 |
238 | [The original code from the Intrepidus Group's python server is under the BSD License found here.](server/LICENSE)
239 |
240 | [The python vendor signing code is located here and is under the MIT license.](https://github.com/grinich/mdmvendorsign)
241 |
242 | [The Softhinker certificate signing code is under the Apache License found here.](vendor-signing/LICENSE)
243 |
244 | [The website's Bootstrap code is under the MIT License found here.](server/static/dist/LICENSE)
245 |
246 | The certificate setup instructions were based on [this blog post](http://www.blueboxmoon.com/wordpress/?p=877). Our thanks to Daniel.
247 |
248 | Finally we use some free [glyphicons](http://glyphicons.com/) that are included with bootstrap.
249 |
--------------------------------------------------------------------------------
/client-reporting/client-reporting.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 3E90E01D1864F60400155CB7 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3E90E01C1864F60400155CB7 /* Foundation.framework */; };
11 | 3E90E0221864F60400155CB7 /* client_reporting.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 3E90E0211864F60400155CB7 /* client_reporting.h */; };
12 | 3E90E0241864F60400155CB7 /* client_reporting.m in Sources */ = {isa = PBXBuildFile; fileRef = 3E90E0231864F60400155CB7 /* client_reporting.m */; };
13 | /* End PBXBuildFile section */
14 |
15 | /* Begin PBXCopyFilesBuildPhase section */
16 | 3E90E0171864F60400155CB7 /* CopyFiles */ = {
17 | isa = PBXCopyFilesBuildPhase;
18 | buildActionMask = 2147483647;
19 | dstPath = "include/${PRODUCT_NAME}";
20 | dstSubfolderSpec = 16;
21 | files = (
22 | 3E90E0221864F60400155CB7 /* client_reporting.h in CopyFiles */,
23 | );
24 | runOnlyForDeploymentPostprocessing = 0;
25 | };
26 | /* End PBXCopyFilesBuildPhase section */
27 |
28 | /* Begin PBXFileReference section */
29 | 3E90E0191864F60400155CB7 /* libclient-reporting.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libclient-reporting.a"; sourceTree = BUILT_PRODUCTS_DIR; };
30 | 3E90E01C1864F60400155CB7 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
31 | 3E90E0201864F60400155CB7 /* client-reporting-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "client-reporting-Prefix.pch"; sourceTree = "Status | 46 |Command | 47 |Options | 48 |
---|---|---|
54 | | {{cmd.Command.RequestType}} | 55 |56 | |