10-18-2011
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!
10 More Discussions You Might Find Interesting
1. Cybersecurity
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
2. UNIX Desktop Questions & Answers
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
3. Shell Programming and Scripting
Hi,
Can anyone provide me with the Code Review Checklist for Shell scripts ??
Thanks in advance. (2 Replies)
Discussion started by: Shivdatta
2 Replies
4. OS X (Apple)
is there anyway of looking at, and if possible, modifying it? (2 Replies)
Discussion started by: cleansing_flame
2 Replies
5. Shell Programming and Scripting
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
6. OS X (Apple)
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
7. UNIX for Dummies Questions & Answers
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
8. UNIX for Advanced & Expert Users
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
9. UNIX Desktop Questions & Answers
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
10. Shell Programming and Scripting
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
LEARN ABOUT CENTOS
cpanplus::shell
CPANPLUS::Shell(3) User Contributed Perl Documentation CPANPLUS::Shell(3)
NAME
CPANPLUS::Shell - base class for CPANPLUS shells
SYNOPSIS
use CPANPLUS::Shell; # load the shell indicated by your
# config -- defaults to
# CPANPLUS::Shell::Default
use CPANPLUS::Shell qw[Classic] # load CPANPLUS::Shell::Classic;
my $ui = CPANPLUS::Shell->new();
my $name = $ui->which; # Find out what shell you loaded
$ui->shell; # run the ui shell
DESCRIPTION
This module is the generic loading (and base class) for all "CPANPLUS" shells. Through this module you can load any installed "CPANPLUS"
shell.
Just about all the functionality is provided by the shell that you have loaded, and not by this class (which merely functions as a generic
loading class), so please consult the documentation of your shell of choice.
BUG REPORTS
Please report bugs or other issues to <bug-cpanplus@rt.cpan.org<gt>.
AUTHOR
This module by Jos Boumans <kane@cpan.org>.
COPYRIGHT
The CPAN++ interface (of which this module is a part of) is copyright (c) 2001 - 2007, Jos Boumans <kane@cpan.org>. All rights reserved.
This library is free software; you may redistribute and/or modify it under the same terms as Perl itself.
SEE ALSO
CPANPLUS::Shell::Default, CPANPLUS::Shell::Classic, cpanp
perl v5.16.3 2013-05-20 CPANPLUS::Shell(3)