WANdisco Security Agent Administration Guide
Upcoming SlideShare
Loading in...5
×
 

WANdisco Security Agent Administration Guide

on

  • 914 views

 

Statistics

Views

Total Views
914
Views on SlideShare
914
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

WANdisco Security Agent Administration Guide WANdisco Security Agent Administration Guide Document Transcript

  • WANdisco Security Agent Administration Guide
  • WANdisco Security Agent Administration Guide Table of Contents WANdisco Security Agent Administration Guide...........................................................................................1 1. Introduction.....................................................................................................................................................2 1.1. Definitions........................................................................................................................................2 1.2. Pre-requisites .....................................................................................................................................2 2. Understanding the deployment architecture................................................................................................3 3. Installation.......................................................................................................................................................4 3.1. Requirements....................................................................................................................................4 3.2. Installing the bits...............................................................................................................................4 4. Setup.................................................................................................................................................................6 4.1. Silent install option...........................................................................................................................8 5. Running............................................................................................................................................................9 6. Web Administration.....................................................................................................................................10 7. License Management....................................................................................................................................11 8. Setup Secure Access to CVS.........................................................................................................................12 8.1. Using SSH with WANdisco Security Agent..................................................................................12 9. Direct SSH Method.......................................................................................................................................13 9.1. Authentication with cvsrelay..........................................................................................................14 9.2. Configure cvsrelay..........................................................................................................................14 9.2.1. Using setup or install-cvsrelay..............................................................................................15 9.2.2. Manual configuration............................................................................................................15 9.3. Troubleshooting..............................................................................................................................16 10. SSH Tunneling Method..............................................................................................................................18 11. Access Control, Authorization and Auditing with WANdisco Security Agent.....................................19 12. Group Management....................................................................................................................................20 12.1. How to create new Roles or Groups.............................................................................................20 12.1.1. Sub-Group Assignment.......................................................................................................21 12.2. How to delete Roles or Groups.....................................................................................................21 12.3. Add or Remove Users from a Group............................................................................................21 12.4. Group membership ........................................................................................................................22 12.5. How to find the files and directories accessible by a Group .........................................................22 13. User Management.......................................................................................................................................24 13.1. Creating or removing users...........................................................................................................24 13.1.1. Sub-Group Assignment.......................................................................................................26 13.2. List and Search Users ....................................................................................................................26 13.3. Bulk import/export users..............................................................................................................27 i
  • WANdisco Security Agent Administration Guide Table of Contents 14. ACL (Access Control List) Management..................................................................................................29 14.1. Privileges required for executing a CVS command ......................................................................29 14.2. Access Control Rules Setup..........................................................................................................31 14.3. ACL Enforcement.........................................................................................................................32 14.4. ACL Examples..............................................................................................................................32 14.4.1. List Only Access.................................................................................................................33 14.4.2. Deny rule on a file...............................................................................................................33 14.4.3. Read Only Access...............................................................................................................34 14.4.4. Using Sub-Groups...............................................................................................................35 14.5. Configuring Access Control Properties........................................................................................35 15. External Authentication database Integration.........................................................................................36 15.1. CVS properties..............................................................................................................................36 15.2. LDAP Properties...........................................................................................................................36 15.3. NIS Properties...............................................................................................................................37 16. Audit Trail Management............................................................................................................................38 16.1. Configuring Audit properties........................................................................................................38 16.2. Importing to a SQL Database.......................................................................................................39 17. Audit Reports..............................................................................................................................................40 17.1. Installation....................................................................................................................................40 17.2. Running a Report..........................................................................................................................40 17.3. Report Types.................................................................................................................................41 17.3.1. Transaction History Report.................................................................................................41 17.3.2. User Modification Report ...................................................................................................42 . 17.3.3. Group Modification Report.................................................................................................42 17.3.4. ACL Modification Report...................................................................................................43 17.3.5. File Report...........................................................................................................................43 17.3.6. User Report.........................................................................................................................43 . 17.3.7. Access Violation Report .....................................................................................................44 . ii
  • WANdisco Security Agent Administration Guide Version 3.0.1 Nov/2006 WANdisco Security Agent Administration Guide 1
  • 1. Introduction WANdisco Security Agent provides security services for a Software Configuration Management (SCM) repository such as CVS or Subversion. It allows an SCM user to transparently connect to the SCM repository via a network proxy that acts as a security agent. The SCM user connects to the Security Agent on the standard SCM port (configurable) such as 2401 for CVS, 3690 for Subversion, 80 for Subversion-HTTP. The Security Agent in turn connects to the underlying SCM repository server. In this administration guide, you will learn how to easily setup WANdisco Security Agent. 1.1. Definitions SCM Repository Software Configuration Management repository like CVS or Subversion. SCM Server A network server that provides remote access to an SCM Repository Security Agent The intermediary that acts as an application proxy or gateway between the SCM client and the SCM server. Each Security Agent has an associated SCM Repository. This agent is responsible for enforcing security policies, Role based access control (RBAC) setup by the administrator. Security_Agent_root directory The base directory under which WANdisco Security Agent is installed. GUID Globally Unique Identifier. WANdisco Security Agent use 16 byte DCE UUIDs. 1.2. Pre-requisites This guide is intended for an SCM administrator or a user who is reasonably comfortable with: • Setting up a CVS or Subversion repository • Configuring inetd/xinetd service on Unix, Cygwin or Windows platform • Installing Perl and required Perl modules • Installing Apache 2.0+ server if using Subversion/HTTP protocol • Installing Java • Unix or Windows system administration • Reading the WANdisco Security Agent administration guide cover-to-cover If you don't meet the above pre-requisites you may want to contact your SCM administrator. 1. Introduction 2
  • 2. Understanding the deployment architecture The diagram below illustrates a typical deployment architecture for a CVS backend. Similar deployment architecture applies to Subversion or Subversion-HTTP. As you can see in the diagram below, Security Agent acts as the front-end for the SCM clients. As show in the above diagram, the WANdisco Security Agent uses a configurable control port (defaults to 6444) for web based management. It can listen on a configurable SCM port to allow SCM clients to connect transparently. Here is an explanation of various TCP ports used in the above deployment: Port 2401 (Security Agent Proxy) Used by CVS clients for normal CVS request processing. The Security Agent simply relays data between the SCM clients and the SCM repository Port 6444 (Security Agent Http) Http port, used by administrator for Web management. Port 2402 (CVS Server) CVS server listens on this port for normal CVS requests. The CVS server is configured to allow only Security Agent to connect to this port. This ensure the Security Agent is not bypassed accidentally. 2. Understanding the deployment architecture 3
  • 3. Installation 3.1. Requirements Before running the WANdisco Security Agent, please ensure: • On Windows, everything is installed on paths with no spaces in the names. For example, on the Windows platforms, the default installation path for java looks like C:/Program Files/java/jdk1.5.0_03. Choose an alternate installation directory, for example C:/java with no spaces in the path. • You have copied a valid license.key file into Security_Agent_root/config. Depending upon your license,certain features may be disabled. This document will highlight any features that require a Professional Edition license. In particular, audit reporting requires a Professional Edition license. • A local SCM repository has been initialized • JDK/J2SE 1.5.0_03 or greater is installed, and the JAVA_HOME environment variable is defined. ♦ Please ensure the full JDK is installed, not just the JRE. This can be confirmed by running java -server -version. If it generates a not found error, uninstall the JRE Java package and reinstall the JDK Java package. • On UNIX and Cygwin platforms, Perl version 5.6 or greater is installed and the perl executable is on the system PATH. ♦ The optional logtimefix script requires Perl package Date::Manip. - To install a Perl package on UNIX or Cygwin, using CPAN (ensure you are logged into the root account first), for example: $ perl -MCPAN -eshell cpan> install Term::ReadKey • On Windows platform, ActivePerl version 5.8 or greater is installed and the perl executable is on the system PATH. Please download the MSI installer for ActivePerl from here: [http://activestate.com/Products/Download/Download.plex?id=ActivePerl] ♦ The optional logtimefix script requires Perl package Date::Manip. - To install a Perl package on Windows, using ActivePerl package manager, for example: c:>ppm ... ppm>install DateManip • importauditdb script requires Perl package Perl::DBI. ♦ XML::Parser package is required. It should be bundled as a standard module on a perl 5.8 installation. • Please read the latest deployment checklist in our Knowledgebase on our support web site at [http://support.wandisco.com] 3.2. Installing the bits Untar or unzip (using WinZip for example on Windows) the WANdisco Security Agent package (a tar.gz file) into the intended subdirectory. You should see the following directory structure: $ cd Security_Agent_root $ ls config lib logs bin docs 3. Installation 4
  • WANdisco Security Agent Administration Guide bin Contains scripts such as cvssecurityagent and shutdown config Contains the Security_Agent_root/config/prefs.xml file used to configure the WANdisco Security Agent. lib Contains the jar files and DLLs that are required to run the product. docs Contains the administration guide in various formats: PDF, Html and UNIX man page. logs Contains the pid file, log files and other temporary files. WANdisco Security Agent's log file is named ProxyServer-prefs.log.0. 3.2. Installing the bits 5
  • 4. Setup If the installation requirements as specified in the previous section have been met, the express setup should take 20 minutes or less to get a basic WANdisco Security Agent environment configured. The express setup option can be used to quickly create the prefs.xml configuration file used by WANdisco Security Agent. This is accomplished by running the bundled program, Security_Agent_root/bin/setup. The text console based UI will guide you through basic configuration options. At the end of the setup program, you would have created a prefs.xml file for the Security Agent. We will now walk you step by step, through the setup screens for Security Agent. The setup screen below presume a CVS deployment but they are applicable (with different default ports) to Subversion or Subversion-HTTP deployments as well. 1. Startup the setup program: $ Security_Agent_root/bin/setup 2. Specify the Ethernet MAC address of the machine where WANdisco Security Agent would run. Setting up CVS Security Agent instance .... ______________________________________ Now you will specify the Ethernet MAC address of the host on which CVS Security Agent would be running. It is required that you specify a unique MAC address for each host on which CVS Security Agent would be running. The MAC address on UNIX can be obtained via "ifconfig" command and on Windows via "ipconfig /all" command. The MAC Address looks like this - 00-02-A5-C1-7A-2F (Windows) or 00:02:A5:C1:7A:2F (UNIX). If you don't have all the MAC addresses handy, now would be a good time to get them before proceeding further. Enter the MAC Address : 3. Specify the Security Agent host and port. This is the host and port that would be accessed by the SCM (for instance CVS or Subversion) clients. Setting up CVS Security Agent instance .... #1 ______________________________________ Now you will specify the host:port used by cvs clients to connect with the CVS Security Agent. Setting the port to 2401, would be the most transparent option from the cvs client perspective. Note you can NOT specify 0.0.0.0 or localhost as the the host on which CVS Security Agent would be running. The hostname needs to be the DNS hostname or the valid IP address to which remote cvs clients as well as remote cvs CVS Security Agents can connect. For example, let us say on a subnet 192.168.1 in Tokyo, the LAN address of CVS Security Agent machine is 192.168.1.29 and the external WAN address is 203.23.12.129 (DNS hostname is tokyo.cvsrus.org). The CVS Security Agent address should be specified as 203.23.12.129 or tokyo.cvsrus.org and NOT 192.168.1.29. 4. Setup 6
  • WANdisco Security Agent Administration Guide Enter the hostname or IP address of the CVS Security Agent#1 : pi You specified pi, is this correct?[Y|N] [Y] : Enter the TCP port for the CVS Security Agent#1 [2401] : 4. Specify the port used by the WANdisco Security Agent for Web Administration. You can also specify a nice name for the Security Agent node. This will be used in the Web console to denote the Security Agent node instead of the default host:port name. Setting up CVS Security Agent instance .... #1 ______________________________________ Now you will specify the DConeNet port used by the CVS Security Agent to communicate with other nodes. This is not visible to cvs clients but used for actual data transfer between the nodes and/or Failover-Agents. It also serves as the Http port for web administration. Enter the TCP port for DConeNet [6444] : You specified 6444, is this correct?[Y|N] [Y] : Enter a nice name for the node, for e.g "Tokyo Site" [pi:6444] : 5. Specify the cvs pserver host and port used by the WANdisco Security Agent to communicate with the backend CVS repository. After entering this information, the setup program will generate a GUID for the WANdisco Security Agent being configured. Setting up CVS Security Agent instance .... #1 ______________________________________ Now you will specify the cvspserver host:port used by cvs repository. This is typically specified in the /etc/services or inetd file on UNIX. For CVSNT on Windows, consult the CVSNT documentation. It is recommended you change the default cvspserver port to something other than 2401 to avoid operational errors. If cvspserver is allowed to ONLY run on localhost, do NOT specify a remote hostname or IP address then just specify localhost. The default is localhost which means the CVS Security Agent and cvspserver are running on the same host. If that is not the case, please change it. Enter the cvspserver hostname [localhost] : 6. Choose the CVS server type corresponding to the backend CVS repository. If the CVS server is using the CVSNT variant, choose 2 for example in the dialog below. CVS Server Type Selection ------------------------- Backend CVS repository can use either standard CVS distribution or CVSNT distribution. You can use the "cvs version" command to determine the server version and type. You can select the CVS server type from the list below: 1. CVS 2. CVSNT Choose a server type [1] : 2 4. Setup 7
  • WANdisco Security Agent Administration Guide 7. Choose a directory to save the newly generated prefs xml files. The setup program will create the prefs.xml configuration file. Now you will specify the destination directory where prefs xml file for the security agent will be generated. Enter the directory where prefs xml files will be saved [../config] : 8. Please copy the generated files to WANdisco Security Agent's config directory on each host and rename them to prefs.xml. Now you are ready to run the WANdisco Security Agent. 4.1. Silent install option Express setup tool supports a -silent and -record option to allow an admin to perform a silent install without being prompted for input on the console. An admin could start the setup program in the record mode and then latter use the recorded answers file to replay the answers and perform a silent install. The admin could modify the recorded answers in a text editor and then use -silent to create new configuration files. For example $ ./cvs-security/bin/setup -record my-answers $ vi my-answers $ ./cvs-security/bin/setup -silent my-answers $ ./cvs-security/bin/setup -silent old-ans -record new-ans The answers are recorded continuously, so if you restart setup you can also use the recorded file to pick up from where you left off, without having to re-enter the answers. For more information look at the usage of the setup command: $ ./security/bin/setup -h setup [-silent recorded-setup-file] [-record file-to-record-to] -silent recorded-setup-file : Silent install will use the supplied "recorded-setup-file" to automatically answer the setup interview questions. If all the answers are not supplied, it will prompt on the console. -record file-to-record-to Will record all the valid interview answers to the "file-to-record-to". Can latter be used for silent install. Both options can also be used at the same time. For example to continue an install from where you last left off you could do: setup -silent prev-silent-file -record new-silent-file 4.1. Silent install option 8
  • 5. Running That's it, now you are ready to run the WANdisco Security Agent. Using the startup script provided to run WANdisco Security Agent from the command line: $ Security_Agent_root/bin/cvssecurityagent $ tail -f Security_Agent_root/logs/ProxyServer-prefs.log.0 .... INFO: [main] CVS Proxy listener is now turned ON at port :2401 When you see the last line, you know WANdisco Security Agent has started successfully. Alternatively, you can go to the web console and check the status. To shutdown WANdisco Security Agent, just run $ Security_Agent_root/bin/shutdown Caution: We recommend taking all possible precautions to avoid direct access to the SCM server, bypassing the WANdisco Security Agent. For example, you could setup SCM server to only allow connection from the IP address of the host on which Security Agent is running, and limit shell access to the Security Agent and the SCM repository machine. 5. Running 9
  • 6. Web Administration The WANdisco Security Agent has a built-in web-server that can be used for monitoring and dynamic configuration of the Security Agent. You can connect to the web-server on Security Agent's administration port (defaults to 6444). On connecting you will be prompted for a login. The default admin username is root and the default admin password is wandisco. It is highly recommended that you change the default password as soon as possible via the web console. Here is a screen-shot of the Security Agent's web console: 6. Web Administration 10
  • 7. License Management Please ensure your license.key file specifies the IP addresses on which the WANdisco Security Agent is licensed to run. If you have an unlimited license, you do not have any restrictions on IP addresses. 7. License Management 11
  • 8. Setup Secure Access to CVS It is customary to use the CVS_RSH environment variable to specify the remote shell to use in lieu of pserver authentication. The CVS_RSH environment variable can specify for example SSH as the remote shell and can directly use the encryption feature of SSH. WANdisco Security Agent doesn't restrict you in any way when you choose to use a CVS_RSH based remote shell. Just follow the setup directions below to get SSH, Kerberos etc support going for your CVS clients. 8.1. Using SSH with WANdisco Security Agent There are two ways do this. You can directly have the CVS client connect with the SSH daemon (Direct SSH Method) or you can tunnel the CVS pserver protocol over SSH (SSH Tunneling Method). 8. Setup Secure Access to CVS 12
  • 9. Direct SSH Method We will walk through an example with SSH as the remote shell. Set CVS_RSH to point to ssh or ssh.exe depending upon the platform. For Windows, if you use a Putty based ssh client, set CVS_RSH to the path to plink.exe Ensure that your ssh credentials are accessible from the machine you will be running CVS client on. For example if you have a private key, you may want to use the ssh-agent (pageant for Putty) and ssh-add to have ssh pre-register your private key. Use the bundled cvsrelay executable as the CVS_SERVER. This can be done in two ways: 1. All client environments should specify an environment variable CVS_SERVER to point to the bundled cvsrelay executable. For example using tcsh : setenv CVS_SERVER <path-to-WANdisco-install>/bin/cvsrelay 2. If you don't want the clients to modify their environment, you can create a link or rename cvsrelay to cvs and modify the PATH so that the ssh daemon (sshd) will invoke cvsrelay instead of cvs when a CVS client connects to it. If sshd is launched via the init.d startup script, you could modify the script that starts sshd to set the PATH to point to cvsrelay bin directory before any other path element. This lets you essentially invoke cvsrelay when a CVS client request comes in. The cvsrelay executable will then be able to relay CVS request/response packets from sshd to WANdisco Security Agent. > cd Security_Agent_root/bin > pwd Security_Agent_root/bin > ln -s cvsrelay cvs Due to security concerns, on most UNIXs sshd is typically compiled with a hardwired PATH. Then setting the PATH in init.d sshd startup script will not work. This can typically be confirmed via: > strings `which sshd` | grep -i bin ... /usr/bin:/bin:/usr/sbin:/sbin ... If you see a colon separated string like above, that might be the compiled in PATH. Alternatively you may look at the first couple of lines in /etc/ssh/sshd_config: #$OpenBSD: sshd_config,v 1.65 2003/08/28 12:54:34 markus Exp $ # This is the sshd server system-wide configuration file. See # sshd_config(5) for more information. # This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin If you determine that your sshd has a path hardwired at compilation time you could do one of the following: 1. Recompile sshd with PATH to cvsrelay ahead of standard cvs executable. 9. Direct SSH Method 13
  • WANdisco Security Agent Administration Guide 2. Cleanest approach is to rename cvs to something like cvs.org and change references to cvs in xinet.d/cvspserver to point to cvs.org. Finally link cvsrelay into /usr/bin or any system directory that is on sshd compiled in PATH. 9.1. Authentication with cvsrelay If you use cvsrelay, you must setup the CVS server's password database in $CVSROOT/CVSROOT/passwd file. The passwords in this file are encrypted using standard UNIX crypt() function so it is possible to cut and paste from /etc/passwd (on some system /etc/shadow)file. Since the authentication is already done via sshd, all we need to do is select a single system password and have all users in the CVSROOT/passwd file share the same password. In essence the CVSROOT/passwd file would look like: Bach:1sOp854gDF3DY Mozart:1sOp854gDF3DY Handel:1sOp854gDF3DY All users, as you can see, share the same password. A default passwd file can be copied from Security_Agent_root/config/passwd-template. The template file already contains the default password used by cvsrelay. If you decide to over-ride the default password, you have to modify the configuration (/etc/prefs.conf) for cvsrelay to tell it the new system password to use. You can also use the bundled utility Security_Agent_root/bin/cvspasswd to generate crypt() password for CVSROOT/passwd file: $ cvspasswd Enter CVS password : CVSROOT/passwd : sa0Pk81ulv7qc CVSRelay Password : 117:99:121:32:73:121:60:121 Also the CVSROOT/config file needs to turn off System authentication: #Set this to "no" if pserver shouldn't check system users/passwords SystemAuth=no # Put CVS lock files in this directory rather than directly in the repository. #LockDir=/var/lock/cvs The above scheme is essentially delegating the credentials that were obtained after authenticating with sshd to the cvs server as shown below. The CVS user authenticates with the SSH daemon, which then invokes cvsrelay with the user ID of the secure shell. This is the user ID that the CVS client transparently passes to sshd. The cvsrelay process in turns looks up the system password at startup time from prefs.conf and passes the user-name and encrypted password to CVS. The CVS server in turn verifies the delegated credentials with entries in CVSROOT/passwd file. 9.2. Configure cvsrelay The cvsrelay process acts as the bridge between sshd and the WANdisco Security Agent. The prefs.conf file contains the configuration parameters for cvsrelay. 9.1. Authentication with cvsrelay 14
  • WANdisco Security Agent Administration Guide The prefs.conf file is first located in the current working directory (cwd). If it is not found, cvsrelay attempts to locate it in the /etc directory. If it is still not found an error message is logged to UNIX syslog. The prefs.conf can be automatically generated by the setup tool during the express setup or post-setup using the bundled install-cvsrelay tool. 9.2.1. Using setup or install-cvsrelay The following are sample screens depicting how setup or install-cvsrelay can auto-generate the prefs.conf needed by cvsrelay. Specify Security Agent Host name [localhost] : You specified localhost, is this correct?[Y|N] [Y] : Specify Security Agent port [2409] : You specified 2409, is this correct?[Y|N] [Y] : Specify CVS pserver host name [localhost] : tao You specified tao, is this correct?[Y|N] [Y] : Specify CVS pserver port [2401] : 2409 You specified 2409, is this correct?[Y|N] [Y] : Specify path to the cvs client binary [/usr/bin/cvs] : You specified /usr/bin/cvs, is this correct?[Y|N] [Y] : Are CVS Clients using WinCVS or TortoiseCVS? Y/N [N] : Y You specified Y, is this correct?[Y|N] [Y] : Enter a valid CVS user on tao [admin0] : user1 You specified user1, is this correct?[Y|N] [Y] : Enter any valid CVS Root directory on tao [/home/cvs] : /cvsd/admin0/cvsroot You specified /cvsd/admin0/cvsroot, is this correct?[Y|N] [Y] : Enter CVS password : Creating ../config/prefs-localhost.conf ... [DONE] **I: Please copy ../config/prefs-localhost.conf to localhost:/etc/prefs.conf In order to complete the SSH configuration, ensure: 1. All cvspserver host:<cvsroot>/CVSROOT/config have the entry "SystemAuth=no". 2. Copy ../config/passwd-template file to cvspserver host:<cvsroot>/CVSROOT/passwd file and ensure all users added to passwd file have the same password. 3. Ensure SSH daemon (sshd) is using cvsrelay instead of cvs. See Security Agent admin guide for more details. 9.2.2. Manual configuration The prefs.conf syntax is name=value pairs. The following parameters can be specified in prefs.conf to customize its defaults: 9.2. Configure cvsrelay 15
  • WANdisco Security Agent Administration Guide 1. cvs.port . Defaults to 2401 Specifies the port of the CVS Security Agent to which the CVS requests will be relayed. 2. cvs.host . Defaults to 127.0.0.1 Specifies the IP address (in IPv4 dot notation, not DNS name) of the Security Agent to forward to. Using the cvsrelay one can run sshd and the CVS server on separate hosts. It is not necessary to collocate them. 3. cvs.password . Defaults to 117:99:121:32:73:121:60:121 Specifies the octet sequence denoting the system password to pass to the CVS server when delegating the credentials to cvs from sshd. Use the included Security_Agent_root/bin/cvspasswd program to generate password encoded in WANdisco format for cvsrelay. This is done to encode the pass phrase generated by the CVS scrambling algorithm when transmitting cleartext passwords on the wire. 4. relay.buffer.size . Defaults to 4 KBytes Specifies the buffer size used by the relay. Used to tune the performance of the cvsrelay. Here is a sample /etc/prefs.conf file: $ cat /etc/prefs.conf cvs.port=2401 cvs.host=192.168.1.20 cvs.password=117:99:121:32:73:121:60:121 9.2.2.1. TortoiseCVS, WinCVS GUI Clients When using many of the popular GUI clients with cvsrelay, you may need to patch your cvsrelay installation to make it work. For example when using Tortoise and WinCVS, you may see the following error message: warning: unrecognized response `Please run install-cvsrelay for this client' from cvs server If you see the above message, then the administrator needs to run the bundled install-cvsrelay utility. Note this is needed iff you are using cvsrelay. The install-cvsrelay utility will prompt you for the fully qualified path to the cvs server executable. It will then attempt create a patch specific to the version of cvs server being used. If you install a different version of cvs server at a latter date, be sure to re-run install-cvsrelay. > cd Security_Agent_root/bin > pwd Security_Agent_root/bin > ./install-cvsrelay Once install-cvsrelay has patched the prefs.conf, you can then start using Tortoise, WinCVS clients. 9.3. Troubleshooting Configuring SSH access from CVS clients requires getting the SSH credentials setup correctly as well as configuring the cvsrelay as outlined above. Here are common gotchas and their solutions: 1. WinCVS is prompting me for a pass-phrase 9.2.2. Manual configuration 16
  • WANdisco Security Agent Administration Guide Ensure pageant or ssh-agent is running with private keys already loaded, a less secure way is to have no pass-phrase on the private keys at creation time. 2. How do I know cvsrelay is being invoked? First check the system log (on Linux /var/log/messages) for any error messages from cvsrelay, for example: tao /var/log# pwd /var/log tao /var/log# grep cvsrelay messages Dec 1 21:02:04 tao cvs-security/bin/cvsrelay[15105]: failed to open /etc/pref s.conf Feb 24 22:03:07 tao ./cvsrelay[5348]: cvs: delegated login failure. Check syslog for further info. Server response - "error 0 /tmp/cvstest: no such repository" You can also setup cvsrelay to run in verbose mode by passing an optional -v parameter: setenv CVS_SERVER "...../bin/cvsrelay -v" This will cause the system log (on Linux /var/log/messages) to contain detailed messages from cvsrelay. 9.3. Troubleshooting 17
  • 10. SSH Tunneling Method This method requires first setting up a secure SSH tunnel between the CVS client and the SSH daemon. Once the tunnel is set up, ssh will allocate a listen socket on the client-side. All traffic to this port will be automatically forwarded to the remote host (cvs server) over a secure connection. Using the usual ssh -L option setup a local listen port on the client side. >ssh -L 2401:cvs-server-host:2401 cvs-server-host >setenv CVSROOT :pserver:user@cvs-server-host:/a/b/c.../cvsroot >cvs co .. The local port could be 2401, the standard CVS port, but it does not have to. Make sure the remote host:port is the normal pserver host:port for CVS server. Setup CVSROOT on the client to point to localhost. In the example above, all traffic to localhost:2401 will be forwarded via SSH to the CVS server. Note that even a temporary disruption in connectivity will tear down an SSH tunnel. When this happens, the tunnel will have to be recreated using the above ssh command. 10. SSH Tunneling Method 18
  • 11. Access Control, Authorization and Auditing with WANdisco Security Agent The WANdisco Security Agent enables an administrator to implement a comprehensive security model that provides features beyond file-system permissions or cvs_acl scripts that are bundled with CVS sources: • Role (or Group) based Access Control Lists (ACL) • Hierarchical Roles/Groups and Privileges • List, Read, Write and Admin privileges allow controlling not only writes but list and read operations as well • Fine grained access control of file, directory, module, CVSROOT • Limit access via network masks or IP address • Full Perl style Regular expression support • Web Console for managing all aspects of security • Audit Trail with incremental updates to a SQL database • Reports like users/groups and the resources they can access. 11. Access Control, Authorization and Auditing with WANdisco Security Agent 19
  • 12. Group Management The Group Management functions allow an administrator to: • Create new Roles or Groups • Delete existing Roles or Groups • Add or Remove users to Groups • Bulk import/export Groups The WANdisco Groups are hierarchical with parent-children associations between sub-groups. Groups provide a convenient way of organizing multiple users into a related category for controlling access as well as searching for users. It is recommended that you setup ACLs on a group basis rather than users (both are allowed) for easier management of security policies. 12.1. How to create new Roles or Groups The first step towards setting up security is to map organization or project structure to WANdisco Groups (also referred to as Roles in security literature). The groups are hierarchical. If a user belongs to a parent group, they children groups automatically inherit users in the top-level parent groups. In the same way, Access Rules or ACLs attached to children group are automatically applied to the parent groups. Before creating new groups it is important to work out the parent-child hierarchy. For instance an engineering team may be split up along geographical sites: sanramon-engr, tokyo-engr. These two groups may belong to a parent group: engr. Within sanramon-engr group there may be role based hierarchy: sanramon-project-projectlead, sanramon-qa. 12. Group Management 20
  • WANdisco Security Agent Administration Guide To add a new group, click on the Create Group option in the security menu and specify its name. The name can contain any character including white-space, there are no restrictions. The group name is the primary key into the group database, it can not be changed. If you need to change it just delete the group and add a new one with a different name. Description field can contain any relevant text describing the group. The WANdisco Security Agent tracks the creation and modification time-stamp on the groups automatically. Once a group is created, you can start assigning users to it. Please note that a system group Admin always exist in the WANdisco Security Agent. As mentioned in the ACL section below, a user belonging to the Admin group gets Admin privileges which include List,Read,Write privileges on all resources. 12.1.1. Sub-Group Assignment The group is assigned under the checked group as a sub-group. To de-assign, uncheck the checkbox and click 'Save Details'. Note by selecting a group, this group is automatically assigned as its sub-group. A sub-group can have exactly one parent. Clicking on the icon e will allow you to edit the specific group. 12.2. How to delete Roles or Groups From the security web console, click on an edit Group icon to go to the Edit Group page. The edit Group icons are visible from any Group management page. Click on the delete button to remove a group. When a group is deleted it is also removed from the all users who previously belonged to that group. The ACLs associated with the groups are not deleted, they no longer apply though. You can edit them and assign them to a different group. 12.3. Add or Remove Users from a Group On the Web console, the Add or remove function under Group management is context-aware. When you select a group by clicking on its checkbox, only users that can be added or removed are shown. This ensures you don't have to worry about duplicate users when adding them to a group. You can use it to quickly add/remove multiple users to/from a given group or sub-group. 12.1. How to create new Roles or Groups 21
  • WANdisco Security Agent Administration Guide If a user has been added to a parent group, they automatically belong to any sub-groups underneath it. So there is no need to add them to the sub-groups. The context-aware web UI will show users who are not in parent groups for example when adding them to a sub-group. For the initial setup you can also use the bulk user import option to quickly import multiple users and their associated groups. 12.4. Group membership To quickly view a list of users who belong directly to a specific group, just click on the "List users only in this group" in the Edit Group page. To view the list of all users including the ones inherited from ancestor groups, click on the "List all users including inherited from parent groups" hyperlink. 12.5. How to find the files and directories accessible by a Group 12.3. Add or Remove Users from a Group 22
  • WANdisco Security Agent Administration Guide Go to the Edit Group page for the group. Scroll down to the "Resource Details" panel. The resource table contains the listing of all the files and directory patterns (regular expressions) and corresponding ACLs applicable to the specified group. You can click on the ACL hyperlink to edit the associated rule. 12.5. How to find the files and directories accessible by aGroup 23
  • 13. User Management The User Management functions allow an administrator to: • Create or Remove Users • Select Groups a user belongs to • Quickly search Users by several criteria • Bulk import/export Users The users must exist in the authentication database (NIS, LDAP, /etc/passwd etc) used by CVS server. The User management function allows administrator to specify licensed users who can access CVS repository via the WANdisco Security Agent. Even if you are not using security features like ACL, you must register the valid users with the WANdisco Security Agent. If a CVS user has not been registered and they try to access WANdisco Security Agent configured with an unlimited user license, they will see an error message as below: cvs acl: Access Denied: The CVS administrator has not granted cvs acl: you sufficient permissions to execute this command. cvs acl: Please contact your local CVS administrator for help. cvs acl: Aborting the cvs operation. With a limited user license the above error message changes to: cvs acl: Access Denied: The CVS administrator has not registered cvs acl: you as a user of WANdisco Security Agent. cvs acl: Please contact your CVS administrator for help. cvs acl: Aborting the cvs operation. 13.1. Creating or removing users 13. User Management 24
  • WANdisco Security Agent Administration Guide To add a new user, click on the Create User option in the security menu and specify a login id (cvs user name). The last and first name can contain any character including white-space, there are no restrictions. You can specify an optional email address for the user. The user id is the primary key into the user database, it can not be changed. If you need to change it just delete the user and add a new one with a different user id. The WANdisco Security Agent tracks the creation and modification time-stamp on the users automatically. 13.1. Creating or removing users 25
  • WANdisco Security Agent Administration Guide To remove a user, just click on "Delete" button in the Edit User page. You can also delete multiple users from the User List page. 13.1.1. Sub-Group Assignment The user can be assigned to any number of checked groups. To de-assign, uncheck the checkbox and click 'Save Details'. Note by selecting a group, the user is automatically assigned to the group and all its sub-groups. Clicking on the icon e will allow you to edit the specific group. 13.2. List and Search Users 13.1.1. Sub-Group Assignment 26
  • WANdisco Security Agent Administration Guide To get a list of all the registered users, just click on the User List option. The user list page shows all the users by default. The page size by default is set to show 25 users per page. You can change that by selecting the page size on the upper right corner. The page control on the left corner allow you to go to next or previous page. If you want to locate a user by first or last name quickly, just start typing the name in the User name like textbox and an incremental search starts automatically. To get the full list back just hit the backspace button on the keyboard till you have deleted all the characters you typed in the textbox. All the columns in the user list are enabled for sorting. By clicking on the column header you can sort the list in ascending or descending order. The sortable columns include: CVS user id, last name, first name, email, last modified date. To restrict the list by a group or role, just select a group name from the drop down menu. To see users in the selected group as well as all the ancestor groups click the Inherited Users checkbox. You can click on the user id hyperlink to edit the user. Mass delete action is supported via selecting the checkbox in the table header (next to User Login id column) and then clicking the delete button. 13.3. Bulk import/export users 13.2. List and Search Users 27
  • WANdisco Security Agent Administration Guide In order to import users from other databases like NIS, etc/passwd you can have a script create a comma separated import file with all relevant users. The data to be imported must be in a text file with comma separated fields. The syntax of a user row in the csv file is: cvsuserid,lastName,firstName[[,email],group1[,group2..groupN]] Here is an example of a csv file: > cat userlist.csv ravi,Shastri,Ravi,ravi@email.com,Admin,sc-engr rchen,Chen,Roger,rchen@email.com,engr sony,Richards,Sony,Admin,engr vanu,Xandau,Vanu Line 1: Will import a cvs user ravi with last name Shastri, first name Ravi, email address ravi@email.com and assign him groups: Admin and sc-engr. Line 2: Will import a cvs user rchen with last name Chen, first name Roger, email address rchen@email.com and assign him group: engr. Line 3: Will import a cvs user sony with last name Richards, first name Sony, no email address and assign him groups: Admin and engr. Line 4: Will import a cvs user vanu with last name Xandau, first name Vany, no email address and no groups. The cvs user id, last and first name are required and can not be empty. The email and group names are optional. Further if a group name is specified, the group must already exists in the WANdisco Security Agent group database, if not the user will not be added. If the 4th field contains the character "@" it is presumed to be an email address. The path to the CSV file must be accessible by the WANdisco Security Agent server process. Before doing the import make sure the csv file is either copied on the WANdisco Security Agent machine or NFS/Samba accessible to the WANdisco Security Agent process. 13.3. Bulk import/export users 28
  • 14. ACL (Access Control List) Management The Access Control or authorization mechanism in WANdisco Security Agent is based on the concept of a set of valid principals with adequate privileges to access a secured resource. The ACL management features allow an administrator to: • Implement Role Based Access Control (RBAC) • Use CVS client's IP address pattern to restrict access • Specify any number of Allow or Deny Rules • Create ACLs with power regular expression patterns to describe user, groups, files/directories/modules and branches. • Assign privileges like list, read write, admin to principals. • Setup ACLs across multiple CVSROOTs and modules Here are the definitions of the commonly used terms when describing the WANdisco Security Agent's ACL mechanism: CVS Login id The actual cvs account name that can be successfully authenticated by CVS or SSH daemon (if using the ext SSH protocol). The CVS login id is also the primary key for a user in the WANdisco Security Agent's user database. Principal Principal can be any valid WANdisco Security Agent user or group. After authentication the WANdisco Security Agent maps a CVS login id to a set of principals that include the actual user and all its associated groups and sub-groups. Resource Resource is a file, directory, module or the CVSROOT itself. Resource patterns can be specified as Perl-style regular expressions in the ACL. A resource needs to be a fully qualified (with respect to the CVSROOT) path to disambiguate same file/directory names across multiple modules or CVSROOTs. All directory paths, including a CVSROOT should be specified in the slash-terminated form. For example, specify /a/b/c/, not /a/b/c. IP Mask A Perl-style regular expression specifying the CVS client's IP address. It is used in the ACL to restrict access to a specific client network, subnet or a machine. Privilege Privileges are needed by a user to execute specific CVS commands. The WANdisco Security Agent supports four privileges: List Read Write Admin The Admin privileges are granted by assigning a user into the special system group Admin. Explicit ACLs need not be set on the Admin group. 14.1. Privileges required for executing a CVS command The privileges are ordered. In other words if a principal has Admin privilege, they also have the other three: List, Read, Write. If a principal has Write privilege, they do not get Admin privilege but have the other two: 14. ACL (Access Control List) Management 29
  • WANdisco Security Agent Administration Guide List, Read. If a principal has Read privilege, they do not get Admin and Write privileges but have the List privilege. If a principal has only List privilege, they do not get Admin, Write, Read privileges. The following is the mapping of actual CVS commands to minimum privilege needed to execute them: CVS Command Privilege Needed status List log List ls List list List diff Read checkout Read export Read update Read annotate Read commit Write tag Write import Write add Write remove Write admin Admin watch Admin init Admin history Admin release Admin edit Admin rdiff Admin rtag Admin rlog Admin rlist Admin rls Admin rannotate Admin 14.1. Privileges required for executing a CVS command 30
  • WANdisco Security Agent Administration Guide 14.2. Access Control Rules Setup The WANdisco Security Agent ships with no rules in the rules database. That implies by default everyone is denied. This is essential for security - it closes the window of vulnerability that would have allowed everyone full access between the time the product is first installed and the admin creates access rules. In order to grant access, the administrator has to explicitly create allow rules. Using the ACL editor from the web console, the admin can create allow or deny rules. Powerful Perl style regular expressions can be used wherever patterns are allowed. Principal (user/group) or IP patterns for instance - engineering.* (note the dot) or 217.[0-9]+ are all valid patterns. By default the HEAD branch is specified but you can enter a regular expression just as well - release9.0_.* for instance. Note: With the Perl regular expression syntax, if you need to use the '.' (dot) character literally, you need to escape it with a backslash, otherwise '.' (dot) will match any character. To learn more about regular expressions look at a tutorial here. 14.2. Access Control Rules Setup 31
  • WANdisco Security Agent Administration Guide Multiple rules can be edited atomically using the WANdisco Security Agent. When you submit changes to ACLs, the WANdisco Security Agent guarantees either all the rules are updated or none at all. This ensures consistent rules database across multiple sites, with any pattern of failures. 14.3. ACL Enforcement The following steps are followed by the WANdisco Security Agent's ACL engine when making an allow or deny decision on a CVS command the user is trying to execute: 1. Check if a user is registered/licensed in the WANdisco Security Agent's user database. If not access is denied. 2. Obtain the list of groups a user belongs to as part of their principal set. 3. Check if anyone of the principal is allowed access based on several parameters: ♦ Map principal to privileges they have been granted ♦ For each resource and branch, the principal is trying to access check if there is a matching rule ♦ A rule is matched if the principal's name, IP address, branch and file/directory matches with the patterns specified in the ACL. ♦ If matching ACL rule is found, see if it denies access. If a matching deny rule applies then the principal is denied access to that resource. ♦ If no matching rules are found, the principal is denied ♦ If no deny rules match and there exists at least one allow rule, the principal is allowed access to that resource. 4. If the user is allowed access to ALL of the resources via at least one principal per resource, then user is allowed to execute the CVS command else the command is denied. 14.4. ACL Examples To illustrate how the ACL enforcement works, lets walk through several examples below: 14.3. ACL Enforcement 32
  • WANdisco Security Agent Administration Guide 14.4.1. List Only Access User doe belongs to group engr. The administrator has setup the following rules: Rule Privilege Group Pattern IP Pattern File/Dir Pattern Branch Pattern Allow List engr.* 192.* /data/cvsroot/ecommerce.* HEAD The user is allowed to execute the following commands that require only list privilege: $ echo $CVSROOT :pserver:doe@mypc:/data/cvsroot $ cd /home/ecommerce/ $ cvs status $ cvs ls The user is denied access when executing the following commands that require read or write privilege: $ cvs update foo cvs acl: Access Denied: The CVS administrator has not granted cvs acl: you sufficient permissions to execute this command. cvs acl: Please contact your local CVS administrator for help. cvs acl: Aborting the cvs operation. $ cvs commit -m "my changes" cvs acl: Access Denied: The CVS administrator has not granted cvs acl: you sufficient permissions to execute this command. cvs acl: Please contact your local CVS administrator for help. cvs acl: Aborting the cvs operation. The user is denied access when executing the following list commands from subnet 10.23.1: $ ifconfig -a eth0 Link encap:Ethernet HWaddr 00:09:5B:19:3E:F8 inet addr:10.23.1.7 Bcast:10.23.1.255 Mask:255.255.255.0 ... $ cvs status cvs acl: Access Denied: The CVS administrator has not granted ... 14.4.2. Deny rule on a file User jane belongs to group build-engr. The administrator has setup the following rules: Rule Privilege Group Pattern IP Pattern File/Dir Pattern Branch Pattern Allow Write build-engr 192.* /data/cvsroot/build.* rel.* Deny Write build-engr 192.* /data/cvsroot/build/secret.make rel.* The user is allowed to execute the following command: $ echo $CVSROOT :ext:jane@mypc:/data/cvsroot $ cd /home/build 14.4.1. List Only Access 33
  • WANdisco Security Agent Administration Guide $ ls foo.c bar.v secret.make $ cvs update secret.make $ cvs ci -m "new" foo.c bar.v The deny rule above doesn't restrict read access to secret.make, only write access is limited. The user is denied access when executing the following command: $ cvs ci -m "new changes" secret.make cvs acl: Access Denied: The CVS administrator has not granted ... In this example, the deny rule is used to restrict access to the file secret.make. Deny rules can be applied to a file or directory pattern as well. 14.4.3. Read Only Access User jane belongs to group qa. The administrator has setup the following rules: Rule Privilege Group Pattern IP Pattern File/Dir Pattern Branch Pattern Allow Read qa 192.* /data/cvsroot/ecommerce.* HEAD Allow Read qa 192.* /data/cvsroot/ecommerce.* rel_1_0 The user is allowed to execute the following commands that require only list privilege: $ echo $CVSROOT :ext:jane@mypc:/data/cvsroot $ cd /home/ecommerce/ $ ls foo.c bar.v $ cvs status foo.c $ cvs ls $ cvs up -r rel_1_0 bar.v $ cvs diff -r rel_1_0 foo.c The user is denied access when executing the following commands: $ cvs ci -m "new changes" cvs acl: Access Denied: The CVS administrator has not granted ... $ cvs up -j rel_2_0 cvs acl: Access Denied: The CVS administrator has not granted ... $ cd /home $ cvs co ecommerce cvs acl: Access Denied: The CVS administrator has not granted ... The last checkout command is denied because to checkout from the CVSROOT requires read privilege not only on the module ecommerce but also the top level cvsroot /data/cvsroot. To checkout the module the administrator would setup access rules as: 14.4.2. Deny rule on a file 34
  • WANdisco Security Agent Administration Guide Rule Privilege Group Pattern IP Pattern File/Dir Pattern Branch Pattern Allow Read qa 192.* /data/cvsroot[/] HEAD Allow Read qa 192.* /data/cvsroot/ecommerce.* HEAD 14.4.4. Using Sub-Groups User bigoram belongs to parent group div-engr, while user smalloram belongs to sub-group nyc-engr of div-engr. The administrator has setup the following rules: Rule Privilege Group Pattern IP Pattern File/Dir Pattern Branch Pattern Allow Read div-engr .* /data/cvsroot/dvd/sfo.* .* Allow Read nyc-engr .* /data/cvsroot/dvd/nyc.* rel.* The user bigoram belongs to both the groups (div-engr, nyc-engr), therefore is allowed to execute the following commands: $ echo $CVSROOT :pserver:bigoram@mypc:/data/cvsroot $ cd /home/dvd $ cvs update -P -d sfo $ cvs update -P -d nyc The user smalloram is belongs to only the group (nyc-engr), therefore is allowed to execute the command: $ echo $CVSROOT :pserver:smalloram@mypc:/data/cvsroot $ cd /home/dvd $ cvs update -P -d nyc The user smalloram is denied access when executing the following command: $ cvs -z6 update -P -d sfo cvs acl: Access Denied: The CVS administrator has not granted ... 14.5. Configuring Access Control Properties The following properties in the prefs.xml file can be used to control the ACL engine: <Security> <AccessControl> <Enable>true</Enable> </AccessControl> </Security> By default, the WANdisco Security Agent has access control enabled. To turn it off set /Security/AccessControl/Enable to false. 14.4.3. Read Only Access 35
  • 15. External Authentication database Integration In order to setup security policies the administrator needs to typically setup the users in the WANdisco Security Agent's internal database. For large organization this can be cumbersome if the user information is already maintained in an external database like LDAP or NIS. For such a deployment, the WANdisco Security Agent for CVS provides integration with LDAP/NIS based authentication databases. The integration allows the administrator to automatically synchronize the user properties (user id, password) from an LDAP/NIS database. The WANdisco Security Agent for CVS will periodically (default is every 5 minutes) connect with the LDAP/NIS database server and pull the user information. Using the WANdisco web console, the administrator can go and select the new users that were discovered during the synchronization with LDAP/NIS. The selected user's are then added to the WANdisco Security Agent's internal database. If CVS repository properties are configured correctly, the user and password information is also updated in the CVSROOT/passwd file. Using the CVSROOT/passwd file is a good idea as it increases the availability of CVS if the external authentication database is unavailable. The following properties can be configured from the WANdisco Security Agent's web console to setup the LDAP/NIS integration: 15.1. CVS properties The CVS properties section is common to both NIS and LDAP (* indicates mandatory): Executable* The CVS client executable. It is an obsolute path to the binary. Default is '/usr/bin/cvs' Host* WANdisco CVS proxy host. It can either be an IP address or a host name. Defaults is 'localhost' Port WANdisco CVS proxy port. It left blank, it will default to '2401' Username* The CVS username. This user must have 'Admin' rights to CVSROOT module Password* The password of the CVS user with 'Admin' rights Roots* A colon separated list of CVSROOTs. Default User* It will be used as the third entry in a CVSROOT/passwd file when updating the file with new users. The CVS server will switch to this user when executing the command. Temp Directory* The directory that will be used as a temporary working directory in order to run the CVS commands. 15.2. LDAP Properties If setting up integration with LDAP, the following properties need to be setup (* indicates mandatory): Host* The hostname or the IP address of the LDAP server Port The port of the the LDAP server. If none specified, it defaults to 389 15. External Authentication database Integration 36
  • WANdisco Security Agent Administration Guide Root DN* The string to login into LDAP server. It could be a 'username' or ROOTDN. An example of DN is 'cn=Manager,dc=example,dc=com' Password* The password for 'username' or ROOTDN Context* The context within the LDAP server to perform the search at. An example of the the context is 'dc=engineering,dc=example,dc=com' Search* The search object. If none specified, it defaults to 'person' Note: The password should be stored in the same format (crypt etc) on LDAP server as the format on the CVS server machine. 15.3. NIS Properties If setting up integration with NIS, the following properties need to be setup (* indicates mandatory): Host* The hostname of the IP address of the NIS Server Port The port of the NIS Server. Domain* The domain that the NIS server is serving. An example of the domain is 'office.example.com' Note: The password should be stored in the same format (crypt etc) on NIS server as the format on the CVS server machine. 15.2. LDAP Properties 37
  • 16. Audit Trail Management With the WANdisco Security Agent, any CVS access (allowed or denied) by the user is logged in an audit trail file. The text file has a complete history of all CVS actions in the following format: # Column syntax - # 0 seq | 1 time | 2 txid | 3 cmd | 4 user | 5 ipaddress | 6 access | # 7 dir | 8 file | 9 rev | 10 branch The column description is as following: Column Number Description 0 Record Sequence Number 1 UNIX Timestamp 2 Transaction Id 3 CVS Command Name 4 CVS User id 5 IP Address of User 6 Access Decision (Allow or Deny) 7 CVS Directory being accessed 8 CVS File being accessed 9 User's File Revision 10 Branch Name 16.1. Configuring Audit properties The audit trail files are created under cvs-security/audit directory. By default they are automatically rotated upto 10 times when they get to 10MBytes. These defaults can be changed via configuration in config/prefs.xml file: <Audit> <MaxFileSize>10485760</MaxFileSize> <MaxFileCount>10</MaxFileCount> <Disable>false</Disable> </Audit> The MaxFileSize specifies a size in bytes, MaxFileCount specifies how many files to rotate before recycling the files. By default auditing is enabled in WANdisco Security Agent, it can be turned off by setting Disable to true. To ensure no audit records are lost, please schedule a job (using cron for example) to import the audit records into a SQL database periodically. Inserting in a SQL database also enables complex SQL queries to be made against the audit database. To create audit files in a different directory just create a symbolic link (cvs-security/audit) to another 16. Audit Trail Management 38
  • WANdisco Security Agent Administration Guide directory. 16.2. Importing to a SQL Database The WANdisco Security Agent bundles a tool importauditdb that allows audit records in audit-trail files to be imported to a SQL database. The usage of the import command is as below: [admin@smp1 ~/cvs-security]$ bin/importauditdb -h Usage: importauditdb [-host <db-host>] [-port <db-port>] [-user <db user>] [-pass <db user password>] [-db <database to use>] -f file-pattern1 file-pattern2 .. file-pattern-N Defaults: host : localhost port : Default DB Port user : root password : empty Database : wd_audit_db The import tool requires Perl::DBI module to be installed. Please run Security_Agent_root/bin/checkdbi to check if the module is installed and correct database driver is available on your system. Note: Before using import you must create a database (default name is wd_audit_db) on the database server. The import tool will automatically create the table schema in that database, the first time it runs. The import tool uses standard SQL syntax, it makes use of a system function FROM_UNIXTIME, please ensure your database version supports it. MySQL, Microsoft SQLServer support this function. 16.1. Configuring Audit properties 39
  • 17. Audit Reports Please note: Audit Reports are only available with the WANdisco Security Agent of the product. 17.1. Installation • Setup the audit database as described in the previous section on Audit trail management. • Extract the reports.tar to the directory you would like the reporting web pages to reside. • Add the following to your apache httpd.conf file. Make sure to replace "/home/wandisco/reports" with your installation directory. You may also want to rename the '/reports/' alias (e.g. '/wandisco_reports'). Alias /reports/ "/home/wandisco/reports/" <Directory "/home/wandisco/reports"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory> • Restart apache. On most machines this can be accomplished by running the following command as root: apachectl restart or apache2ctl restart • Modify the reports/config.php file: ♦ update mysql server, username and password ♦ set $wdr_scm to cvs or svn • Point your browser to the alias directory to verify the installation. In the above example the URL would be: http://server/reports 17.2. Running a Report • Select 'File Report' from the main menu 17. Audit Reports 40
  • WANdisco Security Agent Administration Guide • Enter the criteria for the report. For example, select a user from the dropdown, specify an access level or a SCM command to filter the results. note: use % for wildcards • Click Run Report 17.3. Report Types 17.3.1. Transaction History Report Shows all transactions against the SCM system. 17.2. Running a Report 41
  • WANdisco Security Agent Administration Guide 17.3.2. User Modification Report Shows all user modifications made via the proxy's security administration user interface. 17.3.3. Group Modification Report Shows all group modifications made via the proxy's security administration user interface. 17.3.1. Transaction History Report 42
  • WANdisco Security Agent Administration Guide 17.3.4. ACL Modification Report Shows a history of all ACL modifications. 17.3.5. File Report List file access and filter by parameters such as: date, access, command, user, ip address, directory, filename, revision or branch. 17.3.6. User Report Show SCM allowed / denied access per user. 17.3.4. ACL Modification Report 43
  • WANdisco Security Agent Administration Guide 17.3.7. Access Violation Report Display all denied access to the SCM system. 17.3.6. User Report 44