Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

Hashing sensible information in cookies, request_url and referer. #494

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

skoenen
Copy link
Contributor

@skoenen skoenen commented Jul 19, 2013

Added hashing of requestlog

  • replace login token of adhocracy_login cookie with a hash of it.
  • replace the welcome code in request_url and referer with a hash of it.

def _url_filter(self, url):
if url is not None:
url = re.sub(r'(/welcome/[^/]+/)([0-9a-f]+)(?=/|\?|$)',
lambda m: m.group(1) + self.hash_func(m.group(2)).hexdigest(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cuts off the part after the welcome code. Is this intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What make you think so?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My bad, I misunderstood what re.sub does.

@wawe
Copy link
Collaborator

wawe commented Jul 24, 2013

LGTM.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants