krypted.com

Tiny Deathstars of Foulness

There are a lot of Apple developers out there these days. And it often seems like few groups like to share information more than those who work in the Apple space. So where can you go to learn more about Apple development? There are a lots of websites and code camps, but what about annual conferences?
  • WWDC: San Jose, CA – This is the grandaddy of them all. Hear from the people who build the frameworks and IDEs directly! But registration is limited and no everyone can go to that one place at that one date and time of the year. Also, different conferences can give different perspectives, so even if you go to WWDC every year, it’s worth looking at some of these other conferences as a +1!
  • AltConf: San Jose – Everything from iBeacons to how to name a product. The big thing is that it’s held alongside WWDC so I mention it first. By developers for developers – but not really connected to Apple’s developer relations. 
  • Mac Admin & Developer Conference UK: MacADUK is a great intersection between administration and development. A little bit of everything and a lot of smart. Grows every year. 
  • DevWorld: 
  • MacTech: This is more of an 
  • Appdevcon: Amsterdam – I like conferences for and by developers. And I like Amsterdam. 
  • Objective By The Sea: Hawaii!!! – Who doesn’t love a conference in Hawaii?!?! But more importantly, some of the top security minds in the Apple world have signed up for the inaugural conference to 
  • dot Swift: Paris – A Swift conference in Paris. I prefer how to write code type of conferences, or why pick a framework. So there ya’ go. In Paris.
  • RWdevCon: Washington, DC – I love the format of a tutorial-driven conference (and will likely emulate that in the future. Nothing gets rid of the silly touchy-feely stuff in tech conferences more than how-tos!
  • Swift by Northwest
  • iOSCon 2018: London – Any conference Aaron Hillegass ends up at is gonna’ be good. Especially if you live close. 
  • iosdevukAberystwyth, Wales, UK – iOS Development
  • forwardSwift: San Francisco – Talk about new Swifty-bits!
  • FunSwiftConf: New York – Fun is for Functional Swift!
  • App Builders: Switzerland – My and for app developers. 
  • try! Swift: New York and Tokyo
  • DeveloperWeek: Oakland, CA – More of an overall development conference
  • IndieDevStock
  • Playgrounds: Australia – No dates or location for next year, but it’ll be good.
  • Swift Summit
  • MobileWorld Congress: Barcelona – More upper level but with good dev sessions. Warning, developers sent here might end up writing their own games long term! 😉
  • UIKonf: Berlin – I love these videos, test driven development, specific information about frameworks (often from the people that wrote the frameworks. Awesome.
  • Teki-Con: Atlanta – Any conference Aaron Hillegass ends up at is gonna’ be good. Especially if you live close. 
  • 360 iDev: Denver – Good technical workshops that focus on metal and frameworks and all the fun stuffs.
  • Game Developers Conference: San Francisco – Guess what? Everything you learn building games translates to building any kind of app you could imagine. 
  • ADDC: Barcelona – More of a focus on design than hard core coding techniques. Some people are into that!
  • OSCON: Portland – Learn about all the latest and greatest open source languages and projects.
  • QCon New York – A bit more about organizing software teams and team structure.
  • Microsoft Ignite: Orlando – If you build enterprise software, you likely leverage the Active Directory, Azure identity, or even host on Azure, meaning Ignite is very pertinent to what you’re doing. While you might not see sessions on how to drop a specific Swift framework into a project, you might.
  • Google I/O: San Francisco – What I said above but for s/Microsoft/Google.
  • Facebook F8: San Jose – What I said above but for s/Microsoft/Facebook.
  • AWS reInvent: Las Vegas – What I said above but for s/Microsoft/Amazon
  • IT/Dev Connections: Dallas – When you deploy software, you likely need to automate the build process. When you get into that intersection between IT and DevOps, you should at least read the session descriptions for this conference to see if it’s something you’re into. 
  • DockerCon: San Francisco – If you devop (yes, I made up a verb) in Docker all day then this is your conference. 
  • DevOps Con: Berlin – More on DevOps, but in Germany!
  • MacDevOps YVR: Vancouver – More on Devops, but for Macs!
  • Jax DevOps: London – Devops, but a little more businessy and processy.
  • PowerShell and DevOps Global Summit: Bellevue (Seattleish) – Devops, but more Microsofty.
  • GoTo Conference: Chicago – More devops but kinda’ like an unconference. Which leads to some really interesting and diverse sessions. I like getting ideas from really niche workflows.
  • O’Reilly Fluent Conference: San Jose – Ever read an O’Reilly book on HTML5 or CSS or Java? If so, you will likely find this a cool conference. 
  • JavaOne: San Francisco – Like WWDC but for Java. 
There are also a number of conferences on general Apple administration topics. If you’re doing general Apple devops and admin work I’d definitely check those out! I have a page of those here:

Apple Admin Conferences 2018

I like engineering topics, but if you’re into the businessy side of Apps, check out: 

Top Mobile App Conferences and Events To Go To in (2018)

October 31st, 2018

Posted In: Apps, Swift

Tags: , ,

One Comment

October 9th, 2018

Posted In: JAMF

Tags: ,

As promised, here are my slides from MacSysAdmin 2018. If you were there, hope you enjoyed it. If not, hope it makes sense!


MacSysAdmin2018

October 2nd, 2018

Posted In: Mac OS X, Mac OS X Server

Tags: , , , ,

Just some one-liners you may find useful… I’ve written about codesign a few times in the past. To see a detailed description of how an app was signed:

codesign -dvvvv /Applications/Firefox.app

This also gives you the bundleID for further inspection of an app. But there are a number of tools you can use to check out signing and go further into entitlements and sandboxing. You can check the 

asctl sandbox check --bundle com.microsoft.outlook

The response would be similar to 

/Applications/Microsoft Outlook.app:

signed with App Sandbox entitlements

In the above, we see that Outlook has entitlements to do some stuffs. But where do you see an indication of what it can do? There are a number of sandbox profiles located in /usr/share/sandbox and the more modern /System/Library/Sandbox/Profiles/ and Versions/A/Resources inside each framework should have a .sb file – but those are the Apple sandbox profiles. Additionally, you can see what each app has access to using the container_check.rb script:

/usr/libexec/AppSandbox/container_check.rb -c com.microsoft.outlook --for-user charles.edge --stdout

Simply strip the -c followed by the container and you’ll get a list of all apps. When you’re building and testing sandbox profiles for apps you plan to compile, you may want to test them. To do so, use sandbox

sandbox-exec -f /usr/share/sandbox/lockdown.sb /Applications/TextEdit.app/Contents/MacOS/TextEdit 

As of 10.14, any app looking to access Location Services, Contacts, Calendars, Reminders, Photos, Camera, Microphone, Accessibility, the hard drive, Automation services, Analytics, or Advertising kit will prompt the user to accept that connection. This is TCC, or Privacy Preferences. You can programmatically remove items but not otherwise augment or view the data, via the tccutil command along with the only verb currently supported, reset: 

tccutil reset SERVICE com.smileonmymac.textexpander

October 1st, 2018

Posted In: Mac OS X, Mac Security

Tags: , , , , , ,

September 29th, 2018

Posted In: Mac OS X, Mac OS X Server

Tags: ,

Reporting on application usage is an interesting topic on the Mac. This is done automatically with a number of device management solutions. But there are things built into the OS that can help as well.

mdls "/Applications/Xcode.app" -name kMDItemLastUsedDate | awk '{print $3}'

Now, if you happen to also need the time, simply add ,$4 to the end of your awk print so you can see the next position, which is the time. Additionally, a simple one-liner to grab the foreground app via AppleScript is:

osascript -e 'tell application "System Events"' -e 'set frontApp to name of first application process whose frontmost is true' -e 'end tell'

That’s pretty much all I had to say about that.

September 27th, 2018

Posted In: Mac OS X, Mac Security

Tags: , , ,

There are a number of solutions on the market for scanning a Mac for files that have become infected with a virus or macro-virus. Many of these have a negative return on investment. So customers can instead go the open source route to scan files and quarantine them. And customers can use Jamf Pro to enable doing so. This page is meant to provide a quick and dirty guide to doing so, along with how this might be packaged and potentially tracked with Jamf Pro. First, we’ll install and configure a free tool called clamav.

There are a number of ways to install clam. For this example, just to get it done quickly, we’ll use homebrew which is simply brew with the install verb and clamav as the recipe to be brewed:

brew install clamav

This is going to place your configuration files in /usr/local/etc/clamav and these cannot be used as those supplied by default are simply sample configurations. Because the .sample files have a line that indicates they are an “Example” they cannot be used. So we’ll copy the sample configuration files for freshclam.conf and clamd.conf (the demonized version) and then remove the Example line using the following two lines:

cp /usr/local/etc/clamav/freshclam.conf.sample /usr/local/etc/clamav/freshclam.conf; sed -ie 's/^Example/#Example/g' /usr/local/etc/clamav/freshclam.conf
cp /usr/local/etc/clamav/clamd.conf.sample /usr/local/etc/clamav/clamd.conf; sed -ie 's/^Example/#Example/g' /usr/local/etc/clamav/clamd.conf

Next, we’ll need to update the virus definitions for clamav. This can be run without the fully qualified file path but we are going to go ahead and include it as some computers might have another version installed (e.g. via macOS Server):

freshclam -v

The initial scan should cover the full hard drive and can be run as clamscan

sudo /usr/local/bin/clamscan -r — bell -i /

Your routinely run jobs should be setup to a quarantine location. Because all users should be able to see their data that was quarantined we would write this to /Users/Shared/Quarantine. We can then use a standard clamscan to scan the system and then “move” quarantined items to that location and log those transactions to /Users/Shared/Quarantine/Quarantine.txt.

sudo mkdir /Users/Shared/Quarantine
sudo clamscan -r — scan-pdf=yes -l /Users/Shared/Quarantine/Quarantine.txt — move=/Users/Shared/Quarantine/ /

You can then use an Extension Attribute to read the Quarantine.txt file:

#!/bin/bash
 
#Read Quarantine
 
result = `cat /Users/Shared/Quarantine/Quarantine.txt`
 
#Echo Quarantine into EA
 
echo "<result>$result</result>"

Every environment is different. When combined with standard mrt scans using the built-in malware removal tool for macOS, clamAV can provide a routine added protection to isolate and help you remediate infections. 

Finally, it seems like I have yet to discuss antivirus and malware without getting into the conversation about whether you need it or not. In this post I am in no way taking a side on that argument, and it’s worth mentioning that I’m also not using “antivirus” to exclusively reference viruses but instead including all forms of malware. Rather, I’m exploring options for scanning systems routinely.You can easily run this nightly and parse the quarantine.txt file prior to picking it up with the Extension Attribute routinely in order to provided an additional layer of defense against potential threats to the Mac. Putting all of this into a software package would be rudimentary, and could benefit many organizations without putting our coworkers through the performance hit that many a commercial antivirus solution brings with it.

September 26th, 2018

Posted In: Mac OS X, Mac Security

Tags: , , , ,

I’ve been making guides to macOS Server since Server 2:
And along the way, I’ve also sold plenty of books on Mac Servers and gotten a lot of opportunities I might not have gotten otherwise. So thank you to everyone for joining me on that journey. After teaching so many how to use the services that Apple made available in their server operating system, when they announced they’d no longer be making many of the services my readers have grown dependent upon, I decided to start working on a guide on moving away from macOS Server. 
And then there are tons of all-in-one small business servers solutions, including Buffalo, Qnap, NetGear’s ReadyNAS, Thecus, LaCie, Seagate BlackArmor, and Synology. Because I happen to have a Synology, let’s look at setting up the same services we had in macOS Server, but on a cheaper Synology appliance:

September 25th, 2018

Posted In: Mac OS X, Mac OS X Server, Mac Security

Tags: , , , , , , , , , ,

September 25th, 2018

Posted In: JAMF, Mac OS X

Tags: , , , ,

macOS now comes with a vulnerability scanner called mrt. It’s installed within the MRT.app bundle in /System/Library/CoreServices/MRT.app/Contents/MacOS/ and while it doesn’t currently have a lot that it can do – it does protect against the various bad stuff that is actually available for the Mac. To use mrt, simply run the binary with a -a flag for agent and then a -r flag along with the path to run it against. For example, let’s say you run a launchctl command to list LaunchDaemons and LaunchAgents running:

launchctl list

And you see something that starts with com.abc. Let me assure you that nothing should ever start with that. So you can scan it using the following command: 

sudo /System/Library/CoreServices/MRT.app/Contents/MacOS/mrt -a -r ~/Library/LaunchAgents/com.abc.123.c1e71c3d22039f57527c52d467e06612af4fdc9A.plist

What happens next is that the bad thing you’re scanning for will be checked to see if it matches a known hash from MRT or from /System/Library/CoreServices/XProtect.bundle/Contents/Resources/XProtect.yara and the file will be removed if so. 

A clean output will look like the following:

2018-09-24 21:19:32.036 mrt[48924:4256323] Running as agent

2018-09-24 21:19:32.136 mrt[48924:4256323] Agent finished.

2018-09-24 21:19:32.136 mrt[48924:4256323] Finished MRT run

Note: Yara rules are documented at https://yara.readthedocs.io/en/v3.7.0/. For a brief explanation of the json you see in those yara rules, see https://yara.readthedocs.io/en/v3.5.0/writingrules.html.

So you might be saying “but a user would have had to a username and password for it to run.” And you would be correct. But XProtect protects against 247 file hashes that include about 90 variants of threats. Those are threats that APPLE has acknowledged. And most malware is a numbers game. Get enough people to click on that phishing email about their iTunes account or install that Safari extension or whatever and you can start sending things from their computers to further the cause. But since users have to accept things as they come in through Gatekeeper, let’s look at what was allowed.

To see a list of hashes that have been allowed:

spctl --list

When you allow an app via spctl the act of doing so is stored in a table in 

sudo sqlite3 /var/db/SystemPolicy

Then run .schema to see the structure of tables, etc. These include feature, authority, sequence, and object which contains hashes.

On the flip side, you can search for the com.apple.quarantine attribute set to com.apple.quarantine:

xattr -d -r com.apple.quarantine ~/Downloads

And to view the signature used on an app, use codesign:

codesign -dv MyAwesome.app

To sign a package:

productbuild --distribution mycoolpackage.dist --sign MYSUPERSECRETIDENTITY mycoolpackage.pkg

To sign a dmg:

codesign -s MYSUPERSECRETIDENTITY mycooldmg.dmg

However, in my tests, codesign is used to manage signatures and sign, spctl only checks things with valid developer IDs and spctl checks items downloaded from the App Store. None of these allow for validating a file that has been brought into the computer otherwise (e.g. through a file share). 

Additionally, I see people disable Gatekeeper frequently, which is done by disabling LSQuarantine directly:

defaults write com.apple.LaunchServices LSQuarantine -bool NO

And/or via spctl:

spctl --master-disable

Likewise, mrt is running somewhat resource intensive at the moment and simply moving the binary out of the MRT.app directory will effectively disable it for now if you’re one of the people impacted.

September 24th, 2018

Posted In: Mac OS X, Mac Security

Tags: , , , , ,

Next Page »