mosen 397087a800 Installed application list (#18)
* Add table `applications` and `devices_applications` for tracking installed applications per device and total installed application count.

(cherry picked from commit fba935d)

* Define new datastore for retrieving installed applications by device uuid
Add InstalledApps method to management service
Add endpoint for installed applications at /management/v1/devices/uuid/applications

(cherry picked from commit 07b2deb)

* REMOVED: Flesh out implementation of acknowledging InstalledApplicationList response.
Additional tags on Application for database.
Applications datastore supports select with arbitrary where clauses
Changed the signatures of all the ack handlers in connect service.

(cherry picked from commit f16b776)

* Revert acknowledge handlers code.
Add stub for acknowledging installed applications list.

(cherry picked from commit 82f7e3a)

* Fix some error strings in application datastore which still referred to devices.
Add method SaveApplicationByDeviceUUID to add rows to `devices_applications` for the specified device uuid
Add method NewDatastore since NewDB was untestable using mocks.
Connect service now takes an applications datastore as one of its parameters.
ackInstalledApplicationList implemented but not tested for InstallApplicationList responses.

(cherry picked from commit 97a97d9)

* Further comments on applications datastore.
Attempt to make some where clause helper functions.
Expand test suites to cover many different type of installed applications.
All tests passing.

(cherry picked from commit be99fcd)

* Additional comments
Fix methods which returned a pointer to a slice which is pointless.
Moved statement building functions in applications package to statement.go.
Fixed acknowledge handler if device UDID does not match any enrolled device (happens a lot in test cases).
Preliminary re-implementation of ackInstalledApplicationList
Added tests for the connect service.

(cherry picked from commit 92f253c)

* Add basic test for ackInstalledApplicationList

(cherry picked from commit 66ec74c)

* Fix wrong positional parameters.
Add handler for InstalledApplicationList request type.
installed applications are inserted but their relationship to the current device is not yet recorded. work in progress.

(cherry picked from commit e90c78d)

* Fixed slices which used make() showing the wrong capacity.
Removed a bunch of debug print statements.
Further enhanced connect service test with sql mocking.

(cherry picked from commit 0913934)

* Add regression test for bundle with size that is too large for int field.
Change applications table migration to use bigint field for `bundle_size`

(cherry picked from commit 3038d17)

* Note about difference between iOS and macOS Responses in comments.
Handle iOS response to InstalledApplicationList
Empty test for duplicate applications regression
Update management service test to fit new signature for NewService()

(cherry picked from commit db7c431)

* Changed application response storage to devices_applications, similar to certificates. Every time the device reports a new list, the application list gets replaced.
Add PayloadScope to enroll endpoint because interactive enrollment always seems to try to use the User scope.

(cherry picked from commit 0b0a01d)

* Merge change that removes NewDatastore() from applications/datastore.

* Add setup and teardown to application datastore test.
Remove existing tests because they were using the old Datastore interface.

* Remove invalid imports whoops

* Removed commented code.
Imported name device clashed with variable name device, renamed.

* Fix applications datastore New method in connect service test suite.

* Pull all vars out of global scope in connect service test.
2016-10-07 10:55:12 +11:00
2016-05-17 09:46:01 -04:00
2016-10-07 10:55:12 +11:00
2016-10-07 10:00:00 +11:00
2016-10-07 10:55:12 +11:00
2016-06-23 08:29:52 -04:00
2016-06-18 15:21:37 +10:00
2016-06-07 15:18:07 -04:00
2016-05-18 09:51:18 -04:00
2016-05-23 20:30:49 -04:00
2016-05-18 09:51:18 -04:00
2016-06-23 08:29:52 -04:00
2016-06-20 09:41:20 -04:00
2016-04-24 15:53:11 -04:00
2016-10-07 10:55:12 +11:00
2016-05-18 09:51:18 -04:00
2016-05-19 22:30:09 -04:00
2016-05-23 20:21:00 -04:00

mircomdm is a Mobile Device Management server for Apple Devices(primarily OS X macs).

While I intend to implement all the commands defined by Apple in the spec, the current focus is on implementing the features necessary to fit Apple's new(er) management tools (MDM, VPP, DEP) into existing enterprise environments.

This project now has a website with updated documentation - https://micromdm.io/

Overview

This repo is under heavy development. The current release is only for developers and expert users

Current status

  • Fetch devices from DEP
  • Supports InstallApplication and InstallProfile commands
  • Accepts a variety of other MDM payloads such as OSUpdateStatus and DeviceInformation but just dumps the response from the device to standard output.
  • Push notificatioins are supported.
  • Configuration profiles and applications can be grouped into a "workflow". The workflow can be assigned to a device.
    Currently the DEP enrollment step will check for a workflow but ignore it. I'll be adding this feature next.
  • No SCEP/individual enrollment profiles yet. Need to have an enrollment profile on disk and pass it as a flag.

I set up a public trello board to manage what is currently worked on and make notes.

Getting started

Installation and configuration instructions will be maintained on the website.

Notes on architecture

  • micromdm is an open source project written as an http server in Go
  • deployed as a single binary.
  • almost everything in the project is a separate library/service. main just wraps these together and provides configuratioin flags
  • PostgreSQL for long lived data(devices, users, profiles, workflows)
  • uses redis to queue MDM Commands
  • API driven - there will be an admin cli and a web ui, but the server itself is build as a RESTful API.
  • exposes metrics data in Prometheus format.

Workflows

An administrator can group a DEP enrollment profile, a list of applications and a list of configuration profiles into a workflow and assign the workflow to a device.
If a device has an assigned workflow, micromdm will configure the device according to the workflow. If you're familiar with Munki's manifest feature, workflows work in a similar way.

Build instructions

If you know Go

  1. go get github.com/micromdm/micromdm
  2. cd $GOPATH/src/github.com/micromdm/micromdm
  3. glide install install the necessary dependencies into /vendor folder
  4. go build or go install

If you're new to Go

Go is a bit different from other languages in its requirements for how it expects its programmers to organize Go code on a system. First, Go expects you to choose a folder, called a workspace(you can name it anything you'd like). The path to this folder must always be set in an environment variable - GOPATH(example: GOPATH=/Users/groob/code/go)
Your GOPATH must have thee subfolders - bin, pkg and src, and any code you create must live inside the src folder. It's also helpful to add $GOPATH/bin to your environment's PATH as that is where go install will place go binaries that you build.

A few helpful resources for getting started with Go.

To build MicroMDM you will need to:

  1. Download and install Go
  2. Install glide
  3. Set the GOPATH as explained above.
  4. mkdir -p $GOPATH/src/github.com/micromdm
  5. git clone the project into the above folder.
    The repo must always be in the folder $GOPATH/src/github.com/micromdm/micromdm even if you forked the project. Add a git remote to your fork.
  6. glide install The glide command will download and install all necessary dependencies for the project to compile.
  7. go build or go install
  8. File an issue or a pull request if the instructions were unclear.

Makefile

The project has a Makefile and will build the project for you assuming you have GOPATH set correctly.

  • run make to create a new build.
  • make deps will install the necessary dependencies. after that you can use go build, go test etc.
  • run make docker to build a docker container from the local source.

Docker container for Redis and PostgreSQL

If you want to run locally for testing/development, an easy way to run PostgreSQL and Redis is by using docker-compose docker-compose -f compose-pg.yml up

Dockerfiles for development and release.

  • Dockerfile will build the latest release(by downloading the binaries.
    This is equivalent to docker pull micromdm/micromdm:latest

  • Dockerfile.dev builds the latest version from the local source. docker build -f Dockerfile.dev -t micromdm .

docker pull micromdm/micromdm:dev to get the latest version built from master.

Description
No description provided
Readme MIT 16 MiB
Languages
Go 96.3%
Shell 3.1%
Makefile 0.5%