VMware Cloud Community
pmorrison
Enthusiast
Enthusiast

ESX_SRRSecure - Script to allow ESX to pass a DISA Security Readiness Review.

Background: taken from the DISA website:

In a DOD facility all systems must pass the Security Technical Implementation Guide (STIGs) for the host operating system. The STIG is the configuration standard for DOD IA and IA-enabled devices/systems.

A Security Checklist (sometimes referred to as a lockdown guide, hardening guide, or benchmark configuration) is essentially a document that contains instructions or procedures to verify compliance to a baseline level of security.

Security Readiness Review Scripts (SRRs) test products for STIG compliance. SRR Scripts are available for all operating systems and databases that have STIGs, and web servers using IIS. The SRR scripts are unlicensed tools developed by the Field Security Office (FSO) and the use of these tools on products is completely at the user's own risk.

The problem:

As of this writing there is no “official” VMware ESX STIGbut it has been determined that since the ESX service console is *nix based it must conform to the latest Unix STIG.

The current Unix STIG is located here:

The current Unix SRR is located here:

When reviewing the results of the SRR, not all open issues are valid as the DISA SRR was written for UNIX, LINUX, and AIX. The ESX’s console operating system is based on the Linux Redhat Enterprise 4.5 version, but only contains a subset of the entire operating system and has been customized with specific functionality for interfacing the ESX kernel.

The solution:

Running the SRR will result in an open findings report. After remediating the open issues the SRR is re-run. The goal is to have as few open issues and to document the remaining items as either false findings or open issues with notes as to when they will be closed (patches from VMware) or why they need to be left open.

An example of an open issue is:

==========PDI=IAVA1115 Result========================

PDI Number: IAVA1115

Finding Category: CAT II

Reference: IAVA 2007-T-0042

Description: Sun JRE Web Start Multiple Remote

Vulnerabilities.

Status: Open – *will be fixed in a patch from VMware due

in June.*

For example:

IAVA1115: IAVA 2007-T-0042 - Sun JRE Web Start Multiple

Remote Vulnerabilities.

Outdated

/usr/lib/vmware/webAccess/java/jre1.5.0_12/bin/java, JAVA version 1.5.0.12

found on esx.philhome.dyndns.org.

Upgrade to JAVA version 1.5.0.13 on esx.philhome.dyndns.org.

=========================================================

An example of a false finding that will remain is:

==========PDI=IAVA0360 Result========================

PDI Number: IAVA0360

Finding Category: CAT I

Reference: IAVA 2003-A-0015

Description: There are multiple vulnerabilities in OpenSSL.

Status: Open – *This is a documented false finding as the

vulnerabilities were fixed but the version number was not updated.*

For example:

IAVA0360: IAVA 2003-A-0015

/usr/bin/openssl version 0.9.7a found on

esx.philhome.dyndns.org 2.4.21-47.0.1.ELvmnix.

==========PDI=IAVA0410 Result========================

The ESX SRR Secure script is a shell script which attempts to remediate all of the issues possible on an ESX 3.x host. Some prerequisites to running this script are as follows:

1. Must be run as root.
2.The host must be in maintenance mode.
3. Before beginning with the SRR its advised to install the LAuS library to increase auditing capabilities within the ESX service console, as by default there is limited auditing taking place within the service console itself. These libraries are located on the VMware ESX CD in the /vmware/RPM/ directory. (Note: It appears that this is installed by default in ESX 3.5 update 1)
4. </span>Make sure that all passwords meet the complexity requirements. 7 characters with at least 1 number, 1 symbol, 1 upper case and 1 lower case. This needs to be done for root and any additional accounts installed manually. (Do not change any accounts created by adding a host to Virtual Center).

Once the system is ready, run the script as root and allow the host to be rebooted. Re-run the Unix SRR and compare the open findings report. Below is an example of the summary section both before and after running ESX SRR Secure:

Before:

CAT I = 3/541, CAT II = 55/541, CAT III = 3/541, CAT IV = 0/541

After:

CAT I = 1/139, CAT II = 9/345, CAT III = 1/57, CAT IV = 0/5

The remaining open issues should be documented and should be sufficient to present to the DISA FSO for approval.

Since this is the first “public” exposure for this script, please consider this an early release and test this in a NON-production environment until verification can be made that it does not break something. Also, please give feedback as we would love to see what the community thinks and are continuing to try and make this process better.

Updated script with some corrections and begin to address ESX STIG findings.

Tags (4)
0 Kudos
134 Replies
pmorrison
Enthusiast
Enthusiast

Everything is logged to /var/log/ESX_SRRSecure.&lt;time stamp&gt; so you should be able to see everything that was done.

If you are getting errors either PM me with the log output or post to the thread and I will take a look at them. We are trying to put together another update soon but other projects are taking up all my scripting time. Smiley Sad

0 Kudos
gary1012
Expert
Expert

Hi Phil,

This is good stuff. Mentioned in this thread is version 1.3 of your SRR script. Is it posted to a web site or can you attach it to your reply? I only see 1.2 in your original post.

TIA,

Gary

Community Supported, Community Rewarded - Please consider marking questions answered and awarding points to the correct post. It helps us all.
0 Kudos
vmwareluverz
Contributor
Contributor

i just downloaded the 1.2 shell script anyone know how to deploy this on esx host? instructions or guide would be good.

0 Kudos
Texiwill
Leadership
Leadership

Hello,

You SCP it to your Service Console, and run as the root user. You most likely want to read through the code to make sure everything is as expected.


Best regards,

Edward L. Haletky

VMware Communities User Moderator

====

Author of the book 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', Copyright 2008 Pearson Education.

CIO Virtualization Blog: http://www.cio.com/blog/index/topic/168354

As well as the Virtualization Wiki at http://www.astroarch.com/wiki/index.php/Virtualization

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
0 Kudos
pmorrison
Enthusiast
Enthusiast

Yes we have version 1.3 but discovered a small flaw that we are trying to fix before we release it to the public. I believe it will be 1.4 by the time it is released. Hopefully it will be this week.

0 Kudos
Andy_Imm
Contributor
Contributor

Pmorrison,

Was there any reason why this script removes the vimuser? Everything seems to work, but just wondering.

0 Kudos
pmorrison
Enthusiast
Enthusiast

We debated over this quite a bit and have not realy had any "official" response from VMware but vimuser caused several findings when you run the SRR so we just removed it.

0 Kudos
Texiwill
Leadership
Leadership

Hello,

I do not see anything that uses this user either. I will see if I can get a comment from VMware on this.


Best regards,

Edward L. Haletky

VMware Communities User Moderator

====

Author of the book 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', Copyright 2008 Pearson Education.

CIO Virtualization Blog: http://www.cio.com/blog/index/topic/168354

As well as the Virtualization Wiki at http://www.astroarch.com/wiki/index.php/Virtualization

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
0 Kudos
admin
Immortal
Immortal

OK...I did some digging on this user internally and got the following from one of our engineers.

The vimuser is a delegate user account. The delegate user is an experimental feature for enabling the use of root-squashed NFS datastores; and it's safe to remove the vimuser account unless it's been explicitly set as the delegate user.

The feature is documented in the Basic System Administration guide, under "security: delegate user" in the index, or on the following page:

http://pubs.vmware.com/vi301/server_config/sc_security_auth.16.8.html

The question that we do have though is what specific tests is the vimuser failing on? It will help us fix this in the future.

Hope this helps.

Rob

0 Kudos
pmorrison
Enthusiast
Enthusiast

I will see if it is more than one but the main one is that vimuser and vpxuser and any other id specific to VMware is not on the DISA "approved" list of privilaged users.

0 Kudos
dhand
Contributor
Contributor

GEN000340: vimuser is not a privileged account.

Finding Category: CAT II

Reference: UNIX STIG: 3.1.1

Description: The SA will ensure uids 0 - 99 (0-499 for Linux) are reserved for system accounts.

GEN000360: vimuser:x:12:20:vimuser:/sbin:/sbin/nologin is in a privileged group.

Finding Category: CAT II

Reference: UNIX STIG: 3.1.1

Description: An undocumented account exists with a GID of 99 (499 for Linux) or less.

GEN001500: vimuser: drwxr-x--- 2 root root 4096 Jul 2 14:17 /sbin

Finding Category: CAT II

Reference: UNIX STIG: 3.5

Description: Users do not own their home directory.

GEN001520: vimuser: /sbin - expected "vimuser" (20), but got "root" (0).

Finding Category: CAT II

Reference: UNIX STIG: 3.5

Description: An account primary GID is different from the account home directory GID.

0 Kudos
pmorrison
Enthusiast
Enthusiast

beat me to it. Smiley Happy I knew it had something to do with privilaged user/group or system accounts.... Those are definately the ones. Unless those are fixed it's easier to just remove the user (unless you fall into the whole NFS thing)...

0 Kudos
Texiwill
Leadership
Leadership

Hello,

Rob thank you for the research, since it is an experimental feature I would delete, but how would you fix vimuser to have it pass the STIG. Also where is a link to the UNIX SSR?


Best regards,

Edward L. Haletky

VMware Communities User Moderator

====

Author of the book 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', Copyright 2008 Pearson Education.

CIO Virtualization Blog: http://www.cio.com/blog/index/topic/168354

As well as the Virtualization Wiki at http://www.astroarch.com/wiki/index.php/Virtualization

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
0 Kudos
pmorrison
Enthusiast
Enthusiast

The link to the latest Unix SRR is here http://iase.disa.mil/stigs/SRR/unix.html

0 Kudos
mikekris89
Contributor
Contributor

Has version 1.4 of the ESX_SRRSecure script been released?

Mike Jones

0 Kudos
pmorrison
Enthusiast
Enthusiast

I sooo wish it was. Been sidetracked on other projects but should be able to get something out soon.

0 Kudos
admin
Immortal
Immortal

So I checked on the four findings and whether it is OK to fix them (if you are using the NFS funtionality that this provides) for the vimuser and the answer is yes. You can chang the UID and GID to something over 499 and you can remove the home directory from the vimuser account. This should satisfy the four findings you sent. The option to delete it altogether in this release is also just fine. Future releases might require it, but for now it wont affect anything by the NFS functionality.

I hope this helps.

Regards,

Rob

0 Kudos
dmaahs
Contributor
Contributor

I have a question on your script. The script reviews for being in maintenance mode and wants to reboot afterwards, although I didn't see anything in the script that would require a reboot. Did I miss it or is the reboot just to make sure the settings didn't break anything?

I have a similar script, but I wrote it to lock down/set up Linux in general, then modified it to also do ESX. I run this live with no issues, and no reboots.

Be aware that scripts like this need to be run on a regular basis. During patching if the VMware-esx-srvrmgmt file is updated, so could the vmware mib files. This will cause an issue with the file permissions, and the srr will pick it up.

On an additional note, I just found this thread via a google search for laus & esx. Since LAUS was a SuSE thing I didn't know it was part of ESX, so I was able to MSR the finding in the past. Now it looks like I should install it, grrr. Anyway, I am going to look within this Security & Compliance area now to see what else is here. Are there any threads dedicated to sharing information on resolving SRR script findings and DIACAP audits? I was actually surprised to come across this thread.

0 Kudos
pmorrison
Enthusiast
Enthusiast

So I will attempt to talk to all of these.

In the beginning we did have a pice of code which would put the host into maintenance mode but ran into issues where if a VM on the box for whatever reason (direct attached CD for example) the script would hang/time out. So we just check for it and if it isnt in maintenance mode we dump out. Seemed the safer thing to do.

LAUS is included on the ESX cd so it is safe to install and is required in order to get many of the audit findings (I think there are over 10 if LAUS is not installed).

As far as I know it this is the only thread out there where people talk about this. We started this thread as the group I work with does consulting work for DoD facilities and we knew the ESX STIG was going to come out and that it would be quite painfull for existing sites which were operating under a waiver since the STIG was not out. For now we just keep everything here until there is (if there ever will be) an official response from VMware re: the ESX STIG.

0 Kudos
Texiwill
Leadership
Leadership

Hello,

Does your new script check for Laus as the old one definitely did not. As of Update2 Laus-libs are installed can you point out the elements that require this in the UNIX STIG? Or are there other options like auditd, etc. that work as well.

I have found that often a reboot is required when changing some security settings dealing with the console, which is just odd.


Best regards,

Edward L. Haletky

VMware Communities User Moderator

====

Author of the book 'VMWare ESX Server in the Enterprise: Planning and Securing Virtualization Servers', Copyright 2008 Pearson Education.

CIO Virtualization Blog: http://www.cio.com/blog/index/topic/168354

As well as the Virtualization Wiki at http://www.astroarch.com/wiki/index.php/Virtualization

--
Edward L. Haletky
vExpert XIV: 2009-2023,
VMTN Community Moderator
vSphere Upgrade Saga: https://www.astroarch.com/blogs
GitHub Repo: https://github.com/Texiwill
0 Kudos