Creating Shell Script for STIG Checklist MAC OSX 10.6

 
Thread Tools Search this Thread
Operating Systems OS X (Apple) Creating Shell Script for STIG Checklist MAC OSX 10.6
# 1  
Old 10-18-2011
Error Creating Shell Script for STIG Checklist MAC OSX 10.6

Hello,

I am new to Mac OSX and shell scripting all together. I was wondering if anyone could help get me started in a few scenarios so that I would be able to automate checking a system against a STIG checklist. A STIG Checklist is a DoD Guideline for securing systems. Here is the first instance I would like to learn how to automate:

Open a terminal session and use the following command to view the setting for password history.

sudo pwpolicy -n -getglobalpolicy | tr " " "\n" | grep usingHistory

If the value of usingHistory is less than 15, this is a finding.

NOTE: If the command returns a response of password server is not configured, the system is not managed. Use the following command for non-managed systems.

pwpolicy -n /Local/Default -getglobalpolicy | tr " " "\n" | grep usingHistory



Now, I know that it tells you what to check and makes it so that anyone can perform this check, so please excuse my stupidity. We all have to start somewhere.

I am not interested in fixing a system, just running a script against a system to see if it conforms to the guideline or not. It would be nice if output could be printed telling me if it passes or not, or even print the output into a log file. There will be a couple of hundred checks that I will have to do, so all output will have to go to a log file.

Thank you for your time and assistance!
# 2  
Old 10-20-2011
cisecurity.org

A great deal of effort has been put in by people at cisecurity.org in creating tools to do just what you are looking for. There is a spreadsheet of security guidelines, as well as the Unix bash commands that will allow you to check for compliance. They even have a compliance tool that you can customize and run against your systems. I recommend checking their material out. For purpose of full disclosure, I am a member of the working group for Mac OS X security guidelines.

p.s. This looks like a direct quote from the 18 Aug 2011 DISA STIG, are you actively working on this project?

Last edited by bcarter5876; 10-20-2011 at 04:37 PM.. Reason: remove html
# 3  
Old 10-20-2011
Well, for starters, does that line you pasted work when you type it into Terminal? I have my doubts. Macintosh machines don't allow easy access to root, which that line of code appears to need access to. ('sudo commandname' runs 'commandname' as root, if the user has permissions.)

Modifications to OSX's setup may be necessary to make OSX insecure enough to run your security testing script.
# 4  
Old 01-26-2012
Mac OS X 10.6 Draft STIG Shell Script

I thought someone on this board may be able to use a set of scripts I've developed to check and remediate OS X 10.6 machines using the draft STIG guidance released in August. It is available at MacSTIG . com

There is further information on its use available in the readme.txt.


Thanks
Jackie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Creating an script to automate on mac

First of all, i'm sorry if this topic isn't in the right place, I have a Mac and I've read that is unix based, that's why I'm writing here. I'm trying to "create" a script with which i will be able to download any Tv Show automatically and then rename it. I'm using for that goal the following... (1 Reply)
Discussion started by: Qyles
1 Replies

2. UNIX Desktop Questions & Answers

X11 Display Problem with Mac OSX after creating new account

For preliminaries, I am on a Mac Pro running 10.5. I am trying to run a program that opens an X11 graphic and plots a mesh. The little program is called showme. It has worked just fine in the past. Up until I had to make a new user account on this machine for myself. Now every time I try to... (8 Replies)
Discussion started by: Bocephus85
8 Replies

3. UNIX for Advanced & Expert Users

UML on MAC OSX

Hey guyz, Is it possible to build user-mode linux kernel on MAC OSX? Please I need a reply asap as I have an assignment that I need to do. Thanks! Adel (1 Reply)
Discussion started by: aje02
1 Replies

4. UNIX for Dummies Questions & Answers

Mac OSX Cron Script Execution

Hello, On Mac OSX, I was wondering about my Cron Script: HELL=/bin/tcsh PATH=/sbin:/bin:/usr/sbin:/usr/bin HOME=/var/log MAILTO=jwillis 25 1 * * * root /Users/jwillis/Fbcmd\Scripts/DailyBirthday.scrmy returned message is: Subject: Cron... (3 Replies)
Discussion started by: jwillis0720
3 Replies

5. OS X (Apple)

Cron on Mac OSX

Hello, I was wondering about my Cron Script: HELL=/bin/tcsh PATH=/sbin:/bin:/usr/sbin:/usr/bin HOME=/var/log MAILTO=jwillis 25 1 * * * root /Users/jwillis/Fbcmd\Scripts/DailyBirthday.scrmy returned message is: Subject: Cron <jwillis@Macintosh-66> root ... (1 Reply)
Discussion started by: jwillis0720
1 Replies

6. Shell Programming and Scripting

#!/bin/bash and #1bin/sh command not found error on mac osx terminal/shell script

i am having a weird error on mac os x running some shell scripts. i am a complete newbie at this and this question concerns 2 scripts. one of which a friend of mine wrote (videochecker.sh) a couple weeks ago and it's been running fine on another machine. then last week i wrote capture.sh and it... (2 Replies)
Discussion started by: danpaluska
2 Replies

7. OS X (Apple)

Mac OSX kernel

is there anyway of looking at, and if possible, modifying it? (2 Replies)
Discussion started by: cleansing_flame
2 Replies

8. Shell Programming and Scripting

Checklist for Shell Script reqd

Hi, Can anyone provide me with the Code Review Checklist for Shell scripts ?? Thanks in advance. (2 Replies)
Discussion started by: Shivdatta
2 Replies

9. UNIX Desktop Questions & Answers

Mac Osx.2

I finally broke down and decided to buy a new piece of hardware. I think I made the right decision when I chose an Apple iBook - OSX is incredible! I haven't used a Mac since System7.5, and 10.2 is just blowing me away! Best of all, it's easy to use for people who are not used to Mac, but if I... (5 Replies)
Discussion started by: LivinFree
5 Replies

10. Cybersecurity

ssh and Mac OSX

Please help if you are familiar with Mac OSX. I downloaded OpenSSH for a newer version of SSH than what comes with OS 10.1. What a mistake! Now every time I try to make a connection to my remote server I get an message that ssh was built against version such and such and I have version such and... (2 Replies)
Discussion started by: glfisfn
2 Replies
Login or Register to Ask a Question