Scott Miller

OS X Authenticated Scans - How To

Discussion created by Scott Miller on Sep 14, 2012

Q. How do I perform an authenticated scan in Qualys for Mac OS X?

A. For authenticated Mac OS X scans, use a Unix Authentication record in Qualys.

 

 

The Qualys scanner logs in to OS X via ssh similar to Linux operating systems.

 

 

To enable ssh in OS X, turn on what is called Remote Login in the OS X System Preferences.

 

This can be found under Sharing > Remove Login. Make note of the short name of the user account.

 

osx_ssh.png

 

This username and password can now be supplied in the Unix authentication record. If the user is an Administrator in OS X, sudo can be used.

 

osx_auth_record.png

 


 

SSH Keys

 

ssh keys can also be used for OS X authenticated scans.

 

 

 

To generate a public/private key pair in OS X, open the Terminal.

 

 

In the terminal type:

 

ssh-keygen -t rsa

 

 

 

On each prompt, hit enter. The output will look similar to the following:

 

 

 

mac:~ user$ ssh-keygen -t rsa

Generating public/private rsa key pair.

Enter file in which to save the key (/Users/user/.ssh/id_rsa):

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /Users/user/.ssh/id_rsa.

Your public key has been saved in /Users/user/.ssh/id_rsa.pub.

The key fingerprint is:

7b:04:21:f0:d7:30:16:27:9a:20:6b:62:ae:6d:d8:c3 user@mac.local

The key's randomart image is:

+--[ RSA 2048]----+

|  . o.. B..      |

|   o o = B       |

|..o   + o .      |

|oo     . .       |

| .      S .      |

|.=       o       |

|o E     . .      |

| . .     .       |

|                 |

+-----------------+

mac:~ user$

 

 

 

 

 

 

To view the private key that can be copy and pasted into the Qualys Authentication record, type the command

 

cat .ssh/id_rsa

 

 

It will look similar to the following:

 

mac:~ user$ cat .ssh/id_rsa

-----BEGIN RSA PRIVATE KEY-----

MIIEogIBAAKCAQEA3o9Rr4sOkKo4tIAiQ2BJ9F/0sdNPbDk48i0xmT8HZ5pmhGfd

s6peXZvN77EpGxsTGFB1ULHcvTjGiSLYM2ZJoGFLEOetxtI7acN/jzYu9+dgcje9

m/S0YKjXKRmAx4JdBa6mES9K1s+wy2HfiURm6jLc2IsOo5c6Y2pJXzT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