[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Accessing SVN repository via Apache and SSL client certificate? Almost there, but something is missing.

From: Christoph Anton Mitterer <cam_at_mathematica.scientia.net>
Date: 2005-05-12 23:02:43 CEST

Phillip Susi wrote:

> I have not tried it, but there is an mod_ssl directive called
> SSLRequire that you can issue to require certain aspects of the
> client's certificate for access to a given area. I can't remember it
> off the top of my head, but it looked like it was very powerful. For
> instance, you should be able to allow access to only clients whose
> certificate is signed by a particular CA, and says they are a member
> of a certain OU.
> You can also use the standard require directive to require a certain
> user name be authenticated for access to given areas. You are using
> the SSLUserName directive to extract the user name from the
> certificate right?

Uhmm,... I have no idea at all *g*,...
Currently I've set up the following mod_dav_svn configuration (see
attachments).

And what I wanted to do now was,... to take away the AuthType Basic
stuff at all,... and make the whole autorization / authentication thing
using the SSL client certificates only (Thought a 4096 bit key within
the certificates should be much better than the passwords from Authtype
basic ;) ).

But my problem is: If I take the whole AuthType Basic AuthUserFile etc.
away,... I cannot set up my AuthzSVNAccessFile /srv/svn/access because I
have to use the "user-names" there, e.g.:
[myFirstRepos:/]
user1=rw
user3=
user2=r

and so on,.. but how can I integrate information from the certificates
there? And which one (Name, Serial Number, etc) would be the best (that
means an information that has been signed by my CA Certificate and is
thus secured to be unique)?

Thanks and regards,
cam.

NameVirtualHost *:80
<VirtualHost *:80>
        ServerName fermat.scientia.net
        ServerAdmin root@scientia.net
        
        DocumentRoot /var/www/
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
                # This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
                RedirectMatch ^/$ /apache2-default/
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined
        ServerSignature On

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

NameVirtualHost *:443
<VirtualHost *:443>
        ServerName fermat.scientia.net
        ServerAdmin root@scientia.net
        #remove this the following line
        SSLVerifyClient require
        
        SSLEngine on
        
        SSLOptions +StrictRequire
        
        SSLCertificateFile /etc/apache2/ssl.crt/server.rsa.crt
        #SSLCertificateFile /etc/apache2/ssl.crt/server-dsa.crt
        SSLCertificateKeyFile /etc/apache2/ssl.key/server.rsa.key
        #SSLCertificateKeyFile /etc/apache2/ssl.key/server-dsa.key
        
        SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle-client.crt
        #SSLCARevocationFile /etc/apache2/ssl.crl/scientia.net_ca-bundle-client.crt
        
        
        DocumentRoot /var/www/
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
                # This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
                RedirectMatch ^/$ /apache2-default/
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined
        ServerSignature On

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

# dav_svn.conf - Example Subversion/Apache configuration
#
# For details and further options see the Apache user manual and
# the Subversion book.
<Location /svn>
        DAV svn
        SVNParentPath /srv/svn/repositories
        AuthzSVNAccessFile /srv/svn/access
        
        SSLRequireSSL
        SSLVerifyClient require
        SSLVerifyDepth 1
        
        AuthType Basic
        AuthName "scientia.net Subversion Repositories"
        AuthUserFile /srv/svn/users
        Require valid-user
</Location>

<IfModule mod_ssl.c>
# Pseudo Random Number Generator (PRNG):
# Configure one or more sources to seed the PRNG of the SSL library.
# The seed data should be of good random quality.
# WARNING! On some platforms /dev/random blocks if not enough entropy
# is available. This means you then cannot use the /dev/random device
# because it would lead to very long connection times (as long as
# it requires to make more entropy available). But usually those
# platforms additionally provide a /dev/urandom device which doesn't
# block. So, if available, use this one instead. Read the mod_ssl User
# Manual for more details.
#
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
#SSLRandomSeed startup file:/dev/random 512
SSLRandomSeed startup file:/dev/urandom 512
#SSLRandomSeed connect file:/dev/random 512
SSLRandomSeed connect file:/dev/urandom 512

# Some MIME-types for downloading Certificates and CRLs
#
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl

# Pass Phrase Dialog:
# Configure the pass phrase gathering process.
# The filtering dialog program (`builtin' is a internal
# terminal dialog) has to provide the pass phrase on stdout.
SSLPassPhraseDialog builtin

# Inter-Process Session Cache:
# Configure the SSL Session Cache: First the mechanism
# to use and second the expiring timeout (in seconds).
#SSLSessionCache none
#SSLSessionCache shmht:/var/run/apache2/ssl_scache(512000)
#SSLSessionCache shmcb:/var/run/apache2/ssl_scache(512000)
SSLSessionCache dbm:/var/run/apache2/ssl_scache
SSLSessionCacheTimeout 300

# Semaphore:
# Configure the path to the mutual exclusion semaphore the
# SSL engine uses internally for inter-process synchronization.
SSLMutex file:/var/run/apache2/ssl_mutex

SSLProtocol all
SSLCipherSuite HIGH:MEDIUM
#SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

# SSL Protocol Adjustments:
# The safe and default but still SSL/TLS standard compliant shutdown
# approach is that mod_ssl sends the close notify alert but doesn't wait for
# the close notify alert from client. When you need a different shutdown
# approach you can use one of the following variables:
# o ssl-unclean-shutdown:
# This forces an unclean shutdown when the connection is closed, i.e. no
# SSL close notify alert is send or allowed to received. This violates
# the SSL/TLS standard but is needed for some brain-dead browsers. Use
# this when you receive I/O errors because of the standard approach where
# mod_ssl sends the close notify alert.
# o ssl-accurate-shutdown:
# This forces an accurate shutdown when the connection is closed, i.e. a
# SSL close notify alert is send and mod_ssl waits for the close notify
# alert of the client. This is 100% SSL/TLS standard compliant, but in
# practice often causes hanging connections with brain-dead browsers. Use
# this only for browsers where you know that their SSL implementation
# works correctly.
# Notice: Most problems of broken clients are also related to the HTTP
# keep-alive facility, so you usually additionally want to disable
# keep-alive for those clients, too. Use variable "nokeepalive" for this.
# Similarly, one has to force some clients to use HTTP/1.0 to workaround
# their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
# "force-response-1.0" for this.
SetEnvIf User-Agent ".*MSIE.*" \
         nokeepalive ssl-unclean-shutdown \
         downgrade-1.0 force-response-1.0
</IfModule>

Received on Thu May 12 23:06:33 2005

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.