krypted.com

Tiny Deathstars of Foulness

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: , , , , , ,

Leave a Comment

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: , , , ,

If you’re interested in Mac Security, the next edition of my Enterprise Mac Security book is now shipping. You can get it here http://www.amazon.com/Enterprise-Mac-Security-OS/dp/148421711X. The book is shipping from 3rd party sellers, but should ship directly from Amazon soon at the regular price. I don’t usually know exactly when, but it should also appear for Kindle and on the Apple Books store as well. Hope you enjoy! Screen Shot 2016-01-11 at 8.27.19 PM

January 12th, 2016

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

Tags: , , , , ,

Two-factor verification on your AppleID helps to keep everything nice and secure. Once enabled, you will need any two  of the following to access your iCloud account: The password to your Apple ID, a device trusted in the portal (we’ll trust devices during this process) or a recovery key (which we’ll create during this process). In other words, don’t loose your recovery key! Learn To Enable Two-Factor Verification to Secure your AppleID On The Bushel Blog

May 10th, 2015

Posted In: Bushel

Tags: , , ,

For those of you who say Apple doesn’t care about the enterprise, Apple has released a number of assets (technical white papers) on integrating Macs (Lion) into enterprise environments at http://training.apple.com/lion. This is also the page that you’ll find links to all of the official training and certification courses for Lion. The assets up on this page are about as close to a publicly accessible book on integrating OS X into the enterprise as you’ll to see for Lion… The first covers the basics of integrating Macs into enterprise environments:

The second covers self support:

The third is on evaluating Macs in Enterprise environments:

The fourth is on deployment:

The fifth is on integrating with Active Directory:

The sixth is on managing Macs with Configuration Profiles:

The seventh is on OS X Security:

The last of the papers is on 802.1x authentication:

May 21st, 2012

Posted In: Active Directory, Articles and Books, iPhone, Mac OS X, Mac OS X Server, Mac Security, Mass Deployment, Microsoft Exchange Server

Tags: , , , , , , ,

I recently wrote up an article on some of the new malware safeguards in Snow Leopard. Well, turns out some people want to disable some of it. So you know the prompt that you are downloading an application that then asks you if you want to open it since it’s been quarantined. Well, you can disable it (not that you should but I’ve seen a couple of cases now where I needed to. To do so you’re going to place an LSQuarantine key into the com.apple.LaunchServices.plist. To do so, run:
defaults write com.apple.LaunchServices LSQuarantine -bool NO
To set it back to normal:
defaults write com.apple.LaunchServices LSQuarantine -bool YES

February 8th, 2010

Posted In: Mac OS X, Mac Security

Tags: , , ,

A hashing function is used to calculate a hash value.  If you insert a file into a hashing function then it should produce a value that is almost certain to be unique (there’s always the remote likelihood that no matter how good your function, you may end up with a duplicate).   The openssl command is used to access a number of functions/ciphers including sha1, base64, md5, rc4/rc5 and of course des/des3.  It is a very simple command to use, simply provide the cipher, followed by the path to the file you would like to get a hash value (aka digest) for.  So if I have a file called myfile.txt and I would like to get a digest for it I could just use the following command: openssl md5 myfile.txt At its most basic level, we’re just leveraging openssl to grab digests quickly and easily.

March 27th, 2009

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

Tags: , , , , ,

Every hardware network adapter has a unique MAC address.  However, they’re not always what they seem.  According to Wikipedia:
MAC Spoofing is a hacking technique of changing an assigned Media Access Control (MAC) address of a networked device to a different one. The changing of the assigned MAC address may allow the bypassing of access control lists on servers or routers, either hiding a computer on a network or allowing it to impersonate another computer.
I was talking to someone the other day about security and the topic of spoofing MAC addresses came up.  They seemed to discount that this was usually a concern except for in super secure environments because they considered it an extremely complex process.  Here’s my answer to that:
ifconfig en0 ether 00:00:00:00:00:00 
That should take you about 5 seconds to copy to your clipboard and paste into a terminal window…  You can then replace the en0 with whichever adapter you’d like to implement the spoofed addy on, and hopefully the series of zero’s here with the actual MAC address of a target host.  The next comment was that it was really hard to figure out a MAC address and that’s what makes it hard to spoof them.  If it’s local and you can ping it then arp will cache it.  Therefore, see the IP of the host you’d like to spoof the MAC on in your arp cache with a little:
arp -a
Which gives you something like:
? (192.168.210.249) at 0:16:cb:aa:dc:58 on en1 [ethernet]
Now, once you’ve set the MAC, you’ll need to reboot to undo it.  Or just set it back if you copied it before running the earlier command.

March 10th, 2009

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

Tags: , , , ,

Article on the 10 Most Mysterious Cyber Crimes: http://www.pcmag.com/article2/0,2817,2331225,00.asp

October 1st, 2008

Posted In: Mac Security

Tags: , ,

dsconfigad did not support signing of LDAP packets in 10.4.x.  However, this was an upgrade that was introduced in the 10.5 version of the AD Plug-in.  Provided that your Active Directory environment uses LDAP signing, a standard policy with DCs, you can mirror your settings on the DC in dsconfigad by using the -packetsigning option followed by either an allow, disable or require variable.  To force LDAP signing, just run the following command: dsconfigad -packetsigning required To then disable signing if your environment doesn’t support it use the following command: dsconfigad -packetsigning disable The default variable is allow, which will use LDAP signing when possible.

September 27th, 2008

Posted In: Active Directory, Mac OS X, Mac OS X Server, Mac Security, Mass Deployment, Windows Server

Tags: , , , ,

Next Page »