freeVSD Enables Safe Experimentation

Using freeVSD enables self-sufficient systems and can save software headaches.
Under the Hood

The /usr/sbin/vsd-genskel.pl installation script copies system files from the host into a directory referred to as the skeleton. This process is controlled by entries in /etc/freevsd.conf, which specifies files to include and delete. The copies are placed in /home/vsd/skel/ by default:

$ ls /home/vsd/skel
bin  dev etc  home  lib  proc sbin  tmp  usr

The root filesystem of each virtual server relies on hard links to corresponding binaries in this skeleton. A hard link is an additional directory entry pointing to a particular file. Note that hard links differ from symbolic links in that every hard link must be deleted before the file is removed from the system; if the file that a symbolic link points to is removed, the symlinked file becomes unresolvable. Since each server shares the same copies of files that comprise most of the default filesystem, relying on hard links creates a tremendous savings of disk usage.

As far as ps and top are concerned, the freeVSD user processes seem to run as root; however, they don't start with root privileges. By default, UIDS start at 1,000 and increment by 200 for each subsequent virtual machine (i.e., the first vm starts at 1,000, the next at 1,200, etc.). This behavior can be modified by changes to the configuration file, /etc/vsd.conf.

As mentioned earlier, the host machine assumes multiple IP addresses using IP aliasing. A dæmon, /usr/sbin/virtuald, works with inetd (or xinetd, which replaces inetd in Red Hat 7.0) to intercept client connections to services such as Telnet or FTP. The incoming connection is handed to the appropriate dæmon in the virtual environment by using chroot to the host's filesystem, by default a directory located in /home/vsd/vs/.

Because of potential security exploits, the virtual web server does not run directly on port 80. Instead, a host server process called vsredirect forwards traffic from port 80 to port 8080 and moves https traffic on port 443 to port 8443. The file documentation file security.txt details how a malicious user could gain root access without this safeguard in place. Redirection is recommended for all privileged ports below 1000.

Within the freeVSD filesystem, several common commands such as rm, ls and passwd have been modified slightly so that the Admin account has the additional privileges required to administer accounts on the virtual server. This includes the ability to establish user accounts and manage their files.

Separate dæmon processes (httpd, pro-ftpd, sendmail and so on) are created for each virtual host. A suid script allows the Admin of the virtual host to start and stop the dæmons via the /usr/sbin/rebootvs command.

The Admin Experience

The Admin account has simulated root privileges, enabling the Admin user to perform various administrative tasks without seriously compromising the host. The Admin is not a diluted root account; rather, it is an enhanced user account with the limited ability to manage files and accounts on a particular virtual server.

Upon logging in, whoami reports admin and your home directory is /root. Examination of the root (/) directory reveals that Admin owns /root, /home and /tmp. Other Admin-owned files can be determined by running

find / -name admin -print

You are really running Linux, and it really is the bash shell. It's not a watered-down experience. You can run Python or Perl or even compile new apps with gcc. You are in a standard Linux shell environment, and it appears to be your own system.

In /home/httpd/docs one can find the DocumentRoot for the default web server, and /home/web/log contains the log files. The httpd.conf file is located in /etc/httpd/conf/ and may be modified by Admin. As mentioned earlier, /usr/sbin/rebootvs will effectively restart the virtual server by restarting its processes.

Examining /etc/passwd shows the regular system accounts and the admin account; note that this file is read-only. However, /usr/sbin/useradd <newuser> works as expected, including the addition of the new user to the /etc/passwd file.

The file /etc/vsd/priv has a format similar to /etc/groups. It controls which users have privileges such as login, Telnet and FTP access, as well as whether they are allowed to run Perl or gcc. The /usr/bin/listrights command will show the rights granted to a named user. The /usr/sbin/setrights command is a utility to manage this file; however, from a review of the source code (setrights.c), it doesn't appear that the login privilege may be granted with this utility. It is possible to edit /etc/vsd/priv manually and grant this privilege; since Admin doesn't have write privileges in /etc/, the login privilege can only be granted by root.

______________________

White Paper
Fabric-Based Computing Enables Optimized Hyperscale Data Centers

Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.

Learn More

Sponsored by AMD

White Paper
Red Hat White Paper: Using an Open Source Framework to Catch the Bad Guy

Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6

Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.

Learn more about catching the bad guy in this free white paper.

Learn More

Sponsored by DLT Solutions