Skip to content

Commit

Permalink
* Added basic auth protection for /admin URIs.
Browse files Browse the repository at this point in the history
  • Loading branch information
António P. P. Almeida committed Jun 11, 2013
1 parent 9535984 commit 04019e8
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 0 deletions.
12 changes: 12 additions & 0 deletions apps/drupal/admin_basic_auth.conf
@@ -0,0 +1,12 @@
# -*- mode: nginx; mode: flyspell-prog; ispell-local-dictionary: "american" -*-

## Protect the /admin URIs with a basic auth.
location ^~ /admin {
auth_basic "Restricted access"; #realm
auth_basic_user_file .htpasswd-users;

## Include the specific FastCGI configuration. This is for a
## FCGI backend like php-cgi or php-fpm.
include apps/drupal/fastcgi_drupal.conf;
fastcgi_pass phpcgi;
}
6 changes: 6 additions & 0 deletions apps/drupal/drupal.conf
Expand Up @@ -213,6 +213,12 @@ location / {

########### Security measures ##########

## Uncomment the line below if you want to enable basic auth for
## access to all /admin URIs. Note that this provides much better
## protection if use HTTPS. Since it can easily be eavesdropped if you
## use HTTP.
#include apps/drupal/admin_basic_auth.conf;

## Restrict access to the strictly necessary PHP files. Reducing the
## scope for exploits. Handling of PHP code and the Drupal event loop.
location @drupal {
Expand Down
6 changes: 6 additions & 0 deletions apps/drupal/drupal6.conf
Expand Up @@ -215,6 +215,12 @@ location / {

########### Security measures ##########

## Uncomment the line below if you want to enable basic auth for
## access to all /admin URIs. Note that this provides much better
## protection if use HTTPS. Since it can easily be eavesdropped if you
## use HTTP.
#include apps/drupal/admin_basic_auth.conf;

## Restrict access to the strictly necessary PHP files. Reducing the
## scope for exploits. Handling of PHP code and the Drupal event loop.
location = /index.php {
Expand Down
5 changes: 5 additions & 0 deletions apps/drupal/drupal6_escaped.conf
Expand Up @@ -222,6 +222,11 @@ location / {
}

########### Security measures ##########
## Uncomment the line below if you want to enable basic auth for
## access to all /admin URIs. Note that this provides much better
## protection if use HTTPS. Since it can easily be eavesdropped if you
## use HTTP.
#include apps/drupal/admin_basic_auth.conf;

## Restrict access to the strictly necessary PHP files. Reducing the
## scope for exploits. Handling of PHP code and the Drupal event loop.
Expand Down
6 changes: 6 additions & 0 deletions apps/drupal/drupal_boost.conf
Expand Up @@ -247,6 +247,12 @@ location @cache {

########### Security measures ##########

## Uncomment the line below if you want to enable basic auth for
## access to all /admin URIs. Note that this provides much better
## protection if use HTTPS. Since it can easily be eavesdropped if you
## use HTTP.
#include apps/drupal/admin_basic_auth.conf;

## Restrict access to the strictly necessary PHP files. Reducing the
## scope for exploits. Handling of PHP code and the Drupal event loop.
location @drupal {
Expand Down
6 changes: 6 additions & 0 deletions apps/drupal/drupal_boost6.conf
Expand Up @@ -282,6 +282,12 @@ location @no_cache {

########### Security measures ##########

## Uncomment the line below if you want to enable basic auth for
## access to all /admin URIs. Note that this provides much better
## protection if use HTTPS. Since it can easily be eavesdropped if you
## use HTTP.
#include apps/drupal/admin_basic_auth.conf;

## Restrict access to the strictly necessary PHP files. Reducing the
## scope for exploits. Handling of PHP code and the Drupal event loop.
location = /index.php {
Expand Down
6 changes: 6 additions & 0 deletions apps/drupal/drupal_boost6_escaped.conf
Expand Up @@ -290,6 +290,12 @@ location @no_cache {

########### Security measures ##########

## Uncomment the line below if you want to enable basic auth for
## access to all /admin URIs. Note that this provides much better
## protection if use HTTPS. Since it can easily be eavesdropped if you
## use HTTP.
#include apps/drupal/admin_basic_auth.conf;

## Restrict access to the strictly necessary PHP files. Reducing the
## scope for exploits. Handling of PHP code and the Drupal event loop.
location = /index.php {
Expand Down
6 changes: 6 additions & 0 deletions apps/drupal/drupal_boost_escaped.conf
Expand Up @@ -250,6 +250,12 @@ location @cache {

########### Security measures ##########

## Uncomment the line below if you want to enable basic auth for
## access to all /admin URIs. Note that this provides much better
## protection if use HTTPS. Since it can easily be eavesdropped if you
## use HTTP.
#include apps/drupal/admin_basic_auth.conf;

## Restrict access to the strictly necessary PHP files. Reducing the
## scope for exploits. Handling of PHP code and the Drupal event loop.
location @drupal {
Expand Down
6 changes: 6 additions & 0 deletions apps/drupal/drupal_escaped.conf
Expand Up @@ -216,6 +216,12 @@ location / {

########### Security measures ##########

## Uncomment the line below if you want to enable basic auth for
## access to all /admin URIs. Note that this provides much better
## protection if use HTTPS. Since it can easily be eavesdropped if you
## use HTTP.
#include apps/drupal/admin_basic_auth.conf;

## Restrict access to the strictly necessary PHP files. Reducing the
## scope for exploits. Handling of PHP code and the Drupal event loop.
location @drupal {
Expand Down

0 comments on commit 04019e8

Please sign in to comment.