Google Groups Home
Help | Sign in
authentication in cherrypy
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 35 - Collapse all   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
James  
View profile
 More options Jul 7, 7:37 pm
From: James <j...@nc.rr.com>
Date: Mon, 7 Jul 2008 19:37:57 -0400
Local: Mon, Jul 7 2008 7:37 pm
Subject: authentication in cherrypy
All,

I'm trying to set up an authentication scheme in my CherryPy webapp.
I've seen both simple and complex snippets of code in the Wiki, such
as:

http://tools.cherrypy.org/wiki/AuthenticationAndAccessRestrictions
http://tools.cherrypy.org/wiki/CustomSessionAuth
http://tools.cherrypy.org/wiki/NewAuth
http://tools.cherrypy.org/wiki/VeryVerySimpleAuthFramework
http://tools.cherrypy.org/wiki/MultiAuth

I've always found security to be a bit of a conundrum. I'm working on
a web application that requires some reasonable level of security. The
passwords are stored as a double-md5-hashed value in a database. I
don't have any issues "getting" the password out of the database, but
am curious as to the best method for creating and enforcing user
sessions when working on webapps. I remember reading many years ago
when studying PHP that setting sessions when working with web
applications is important: you shouldn't set the password in the
session, but setting the username only may result in weak security.

Does anyone have any opinions on the best way to attack security in a
CherryPy web application?

Thanks!
-j


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pete H  
View profile
 More options Jul 8, 5:47 am
From: Pete H <pe...@ssbg.zetnet.co.uk>
Date: Tue, 8 Jul 2008 02:47:07 -0700 (PDT)
Local: Tues, Jul 8 2008 5:47 am
Subject: Re: authentication in cherrypy

On Jul 8, 12:37 am, James <j...@nc.rr.com> wrote:

I've written an extended version of the Digest Auth tool which may
help if your app is designed on RESTful lines. Though your mention of
sessions implies that may not be the case. It should be possible to
hook it into CherryPy's Sessions tool if you really can't avoid
sessions.

The tool uses expiring nonces to allow things like logout, forcible
logout after a set time, one-time access (ie force re-authentication
on every access), access control depending on the HTTP method, and a
simple role based authorisation scheme.

It's subject to most of the limitations of Digest Authentication,
except that replay attacks are limited by the nonce expiration
mechanism.
All the other attack possiblities are mitigated by using SSL, which
you will be in any case if you want any sort of security.

If I could work out how to add a new page to the Wiki I would - but it
doesn't seem to be possible to edit the Tools List page where the link
should go.
I can add a link to the Start page, but that's no use. How is it
supposed to be done?

Pete

It doe


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Brewer  
View profile
 More options Jul 8, 12:31 pm
From: "Robert Brewer" <fuman...@aminus.org>
Date: Tue, 8 Jul 2008 09:31:36 -0700
Local: Tues, Jul 8 2008 12:31 pm
Subject: RE: [cherrypy-users] Re: authentication in cherrypy

Pete H wrote:
> If I could work out how to add a new page to the Wiki I would - but it
> doesn't seem to be possible to edit the Tools List page where the link
> should go.
> I can add a link to the Start page, but that's no use. How is it
> supposed to be done?

http://tools.cherrypy.org/wiki/RestfulAuth gives me a 'Create this page'
button once I log in using the guest account. Do you not get that?

Robert Brewer
fuman...@aminus.org


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pete H  
View profile
 More options Jul 8, 2:31 pm
From: Pete H <pe...@ssbg.zetnet.co.uk>
Date: Tue, 8 Jul 2008 11:31:04 -0700 (PDT)
Local: Tues, Jul 8 2008 2:31 pm
Subject: Re: authentication in cherrypy

On Jul 8, 5:31 pm, "Robert Brewer" <fuman...@aminus.org> wrote:

> Pete H wrote:
> > If I could work out how to add a new page to the Wiki I would - but it
> > doesn't seem to be possible to edit the Tools List page where the link
> > should go.
> > I can add a link to the Start page, but that's no use. How is it
> > supposed to be done?

> http://tools.cherrypy.org/wiki/RestfulAuthgives me a 'Create this page'
> button once I log in using the guest account. Do you not get that?

> Robert Brewer
> fuman...@aminus.org

So _that's_ what it means in the 'Steps to Add a New Wiki Page' item 3
in the Wiki Help.
<quote>
   1. Choose a name for your new page. See WikiPageNames for naming
conventions.
   2. Edit an existing page and add a hyperlink to your new page. Save
your changes.
   3. Follow the link you created to take you to the new page. Trac
will display a "describe PageName here" message.
   4. Click the "Edit this page" button to edit and add content to
your new page. Save your changes.
   5. All done. Your new page is published.
</quote>

 Seems step 2, which is where I got stuck, is irrelevant.

Thanks Robert, I'll get on and create a new page.

Pete


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James  
View profile
 More options Jul 8, 2:51 pm
From: James <j...@nc.rr.com>
Date: Tue, 8 Jul 2008 14:51:42 -0400
Local: Tues, Jul 8 2008 2:51 pm
Subject: Re: [cherrypy-users] Re: authentication in cherrypy
Wow! Sounds like you went all out on your code. :)

How hard is it to create a basic authentication scheme? I'm certainly
not a security guru and I'm aware that making one mistake could result
in a security hole. Some folks have indicated to me (privately) that I
should simply create a form, get the returned variables and then
compare the password to the database. If everything checks out I can
simply create a session and proceed with letting the user in to the
private sites.

Thoughts?
-j


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
arjuna  
View profile
 More options Jul 8, 9:54 pm
From: arjuna <brahmafor...@gmail.com>
Date: Wed, 9 Jul 2008 07:24:54 +0530
Local: Tues, Jul 8 2008 9:54 pm
Subject: Re: [cherrypy-users] Re: authentication in cherrypy

Hi James,
Couple of years ago I had created a simple authentication. I am now looking
to put the 'right' authentication from a security, simplicity and elegance
point of view...Maybe we could share ideas, code and research to get a good
authentication system up on our websites, as we go along. This could also
help with the problem solving...

On 7/9/08, James <j...@nc.rr.com> wrote:

--
Best regards,
arjuna
http://www.brahmaforces.com

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
arjuna  
View profile
 More options Jul 9, 12:33 am
From: arjuna <brahmafor...@gmail.com>
Date: Wed, 9 Jul 2008 10:03:40 +0530
Local: Wed, Jul 9 2008 12:33 am
Subject: Re: [cherrypy-users] Re: authentication in cherrypy

Hi All,

Given the slew of options available for user authentication, what is the
best way to go? I am looking for a standard secure login where logged in
users can access a private area...Given the various approaches and code,
what are the heavy weights using?

On 7/9/08, arjuna <brahmafor...@gmail.com> wrote:

--
Best regards,
arjuna
http://www.brahmaforces.com

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
James  
View profile
 More options Jul 9, 6:53 pm
From: James <j...@nc.rr.com>
Date: Wed, 9 Jul 2008 18:53:56 -0400
Local: Wed, Jul 9 2008 6:53 pm
Subject: Re: [cherrypy-users] Re: authentication in cherrypy
I would also like to know.

That's one of the things I like about web frameworks like Django and
TurboGears; they seem to make it very easy to set up simple
authentication so that credentials are required to view certain pages.

I have poured over quite a bit of CherryPy documentation and haven't
really found any "great" article on how to write something simple,
very secure and straightforward...

Thoughts?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
arjuna  
View profile
 More options Jul 10, 2:23 am
From: arjuna <brahmafor...@gmail.com>
Date: Wed, 9 Jul 2008 23:23:04 -0700
Local: Thurs, Jul 10 2008 2:23 am
Subject: Re: [cherrypy-users] Re: authentication in cherrypy

Hi James,

There are some very simple examples. Like if you go to tools in the wiki the
following seem quite straightforward:

password protected pages
mutiauth

However given the other options I am not sure which is the best or standard
way to go. Also I am not sure how secture teh password protected pages code
is? It is very simple and straightforward though?

Is it secure?

--
Best regards,
arjuna
http://www.brahmaforces.com

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.