logo       


Re: How to secure ViewVC access ?: msg#00002

Subject: Re: How to secure ViewVC access ?
Yves Martin wrote:
> I have first thought to use also "Location" block to protect access to
> each root but the current URL pattern does not suit my needs:
> https://server.mydomain/cgi-bin/viewvc.cgi/path/in/repo/?root=repo
> 
> Another need in my case: prevent users to gain access to the repository
> listing.
> 
> Is it possible to setup such access control with current version ?
> 
> For such a need - prevent full read access to everyone thanks to
> "Location" - I propose to refactor URL to get "repo" in the URL path:
> https://server.mydomain/cgi-bin/viewvc.cgi/repo/path/in/repo/
> 
> What do you think about this idea ?

I think it's a fantastic idea!  So much so that I wrote this very feature
for ViewVC a few years ago, and it's already present in your ViewVC 1.0.4
release.  :-)

See the root_as_url_component option in viewvc.conf.  Toggling that option
to a non-zero value will cause ViewVC to generate URLs exactly as you
recommended.  This will facilitate using Location blocks to do per-repos
auth protection.

As for blocking the repository listing, you could just edit lib/viewvc.py,
and tweak the function view_roots() to throw an exception:

   def view_roots(request):
  +  raise debug.ViewVCException('Access denied', '501 Not Authorized')
     data = common_template_data(request)
     request.server.header()
     generate_page(request, "roots", data)

But the root listing also appears in a drop-down box in the template set, so
you'll also want to tweak templates/include/header.ezt so that it no longer
thinks there are any roots to list:

   ...
   <body>
   <div class="vc_navheader">
  +[define roots][end]
   [if-any roots]
     <form method="get" action="[change_root_action]">
   [end]
   ...


-- 
C. Michael Pilato <cmpilato@xxxxxxxxxx>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Attachment: signature.asc
Description: OpenPGP digital signature

Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
Search:
Java, servers, webhosting, windows, cisco ...
more...
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe