01.11.2012 Views

iOS Hardening Configuration Guide - DSD

iOS Hardening Configuration Guide - DSD

iOS Hardening Configuration Guide - DSD

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix C<br />

Sample Scripts<br />

This appendix provides sample scripts for iPhone OS deployment tasks. The scripts<br />

in this section should be modified to fit your needs and configurations.<br />

http://developer.apple.com/library/ios/#featuredarticles/FA_iPhone_<strong>Configuration</strong>_Utility/Intro<br />

duction/Introduction.html<br />

Sample C# Script for iPhone <strong>Configuration</strong> Utility<br />

This sample script demonstrates creating configuration files using iPhone <strong>Configuration</strong><br />

Utility for Windows.<br />

using System;<br />

using Com.Apple.iPCUScripting;<br />

public class TestScript : IScript<br />

{<br />

private IApplication _host;<br />

public TestScript()<br />

{<br />

}<br />

public void main (IApplication inHost)<br />

{ _host = inHost;<br />

string msg = string.Format("# of config profiles : {0}",<br />

_host.<strong>Configuration</strong>Profiles.Count);<br />

Console.WriteLine(msg);<br />

I<strong>Configuration</strong>Profile profile = _host.Add<strong>Configuration</strong>Profile();<br />

profile.Name = "Profile Via Script";<br />

profile.Identifier = "com.example.configviascript";<br />

profile.Organization = "Example Org";<br />

profile.Description = "This is a configuration profile created via the new scripting feature in<br />

iPCU";<br />

// passcode<br />

IPasscodePayload passcodePayload = profile.AddPasscodePayload();<br />

passcodePayload.PasscodeRequired = true;<br />

passcodePayload.AllowSimple = true;<br />

// restrictions<br />

IRestrictionsPayload restrictionsPayload = profile.AddRestrictionsPayload();<br />

restrictionsPayload.AllowYouTube = false;<br />

// wi-fi IWiFiPayload<br />

wifiPayload = profile.AddWiFiPayload();<br />

wifiPayload.ServiceSetIdentifier = "Example Wi-Fi";<br />

wifiPayload.EncryptionType = WirelessEncryptionType.WPA;<br />

wifiPayload.Password = "password";<br />

wifiPayload = profile.AddWiFiPayload();<br />

38 | D efence Signals Directorate

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!