netfilter.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: William Taylor <williamt@corp.sonic.net>
To: Francesco Morosinotto <francescomorosinotto@gmail.com>,
	netfilter@vger.kernel.org
Subject: Re: help needed preventing bruteforce behind a reverse proxy
Date: Tue, 01 Jul 2014 08:35:49 -0700	[thread overview]
Message-ID: <53B2D555.7060106@corp.sonic.net> (raw)
In-Reply-To: <53B26B4C.4030002@gmail.com>

On 7/1/2014 1:03 AM, Francesco Morosinotto wrote:
> Hi guys,
>
> I'm a young "system administrator" that works for a non profit organization.
> I've recently implemented owncloud on a local server running several
> virtual machines.
> Having only a static IP every service (running on different vms) is
> served through a reverse proxy (apache).
>
> I'm trying to secure my cloud installation in order to prevent
> bruteforce attack: I can log the attackers IP (using apache-mod-rpaf
> that reads the original ip from the x-forwarded-for header) and I was
> setting up fail2ban to add these ips to a blacklist and deny the access
> through iptables.
>
> But It seems that iptables is not able to understand where does the
> request come from and always log the internal proxy ip address.
>
> Is there a way to tell iptables to read the x-forwarded-for headers?
>
> can you suggest some other workaround?
>
> thank you guys
>
If you are logging the original source ip's with apache and having
fail2ban add them to a blacklist,
that should be all you need. Iptables should be able to block on those
ips you are feeding it unless
you aren't logging the correct ip. Even if there was an "easy" way for
iptables to reach into the packet
and read the x-forwarded-for address, it wouldn't do any good in this
case because when the packet
hits iptables it hasn't gone through your proxy yet (unless you are
trying to block it on the destination machine
and not the proxy machine). If you need more help post what your
iptables rules look like with an example
of what you are trying to block.

-william

  reply	other threads:[~2014-07-01 15:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-01  8:03 help needed preventing bruteforce behind a reverse proxy Francesco Morosinotto
2014-07-01 15:35 ` William Taylor [this message]
2014-07-01 17:17 ` Eliezer Croitoru
2014-07-01 19:02   ` Paul Robert Marino
     [not found]   ` <CAMEq33fMwz-iufG+kVsrvdXwf7m9HZoE_0vF4Er5vZ8yyHk_9g@mail.gmail.com>
2014-07-02  2:34     ` Eliezer Croitoru

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53B2D555.7060106@corp.sonic.net \
    --to=williamt@corp.sonic.net \
    --cc=francescomorosinotto@gmail.com \
    --cc=netfilter@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).