Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security by obscurity #165

Open
s1037989 opened this issue Aug 1, 2016 · 0 comments
Open

Security by obscurity #165

s1037989 opened this issue Aug 1, 2016 · 0 comments

Comments

@s1037989
Copy link
Contributor

s1037989 commented Aug 1, 2016

Leave the admin functionality disabled when oauth not provided, but enable an obfuscated route that enables admin in the session and redirects to /

Something like this code snippet:

unless ( $self->config->{oauth} ) {
  my $obfuscated = $self->config->{obfuscated} || $self->random();
  $self->log->info("Obfuscated admin route is $obfuscated");
  $r->get("/$obfuscated")->to(cb=>sub{shift->redirect_to('/')});
}

sub random {
  my $self = shift;
  my $file = $self->home->rel_file('.obfuscated');
  return slurp $file if -e $file;
  my $random = md5(rand());
  spurt $file, $random;
  return $random;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant