You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Bill Barker <wb...@wilshire.com> on 2008/01/19 03:35:35 UTC

Re: Filtering the apache clients

"Caldarale, Charles R" <Ch...@unisys.com> wrote in message 
news:2828B04F0113CD468E6D1D51DF4362A4048F5117@USEA-EXCH2.na.uis.unisys.com...
>> From: jean-louis.mateo@bull.net [mailto:jean-louis.mateo@bull.net]
>> Subject: Filtering the apache clients
>>
>> Is there any way of configuring the Tomcat <Connector> to
>> only accept AJP connections from a specific apache server?
>
>1) Comment out the other <Connector> elements.
>
>2) Configure the RemoteAddrValve for the desired IP address:
>http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Remote%20Address%20Filter
>

This won't work, since under AJP/1.3 the "Remote Address" is the address of 
the client that connects to Apache, not the address of the Apache machine. 
>From a quick code check, it looks like the "secure" option isn't supported 
any longer in mod_jk (it was never that secure to begin with).  You can 
duplicate it by setting:
  JkEnvVar MyAuthCode password
in trusted Apache's, and write a filter that rejects requests that don't 
have a Request attribute of MyAuthCode with value "password".  Of course, it 
is only as secure as your way to secure the name and value.

If you want to restrict access to only the copy of Apache running on the 
same machine as Tomcat, then you can do:
  <Connector protocol="AJP/1.3" address="localhost" ...... />
For any other configuration, you should really have a firewall between the 
internet and Tomcat.




>- Chuck






---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Filtering the apache clients

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: news [mailto:news@ger.gmane.org] On Behalf Of Bill Barker
> Subject: Re: Filtering the apache clients
> 
> This won't work, since under AJP/1.3 the "Remote Address" is 
> the address of the client that connects to Apache, not the 
> address of the Apache machine. 

Ahah - thanks for the correction.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Filtering the apache clients

Posted by Bill Barker <wb...@wilshire.com>.
"Bill Barker" <wb...@wilshire.com> wrote in message 
news:fmrnle$9af$1@ger.gmane.org...
>
> "Caldarale, Charles R" <Ch...@unisys.com> wrote in message 
> news:2828B04F0113CD468E6D1D51DF4362A4048F5117@USEA-EXCH2.na.uis.unisys.com...
>>> From: jean-louis.mateo@bull.net [mailto:jean-louis.mateo@bull.net]
>>> Subject: Filtering the apache clients
>>>
>>> Is there any way of configuring the Tomcat <Connector> to
>>> only accept AJP connections from a specific apache server?
>>
>>1) Comment out the other <Connector> elements.
>>
>>2) Configure the RemoteAddrValve for the desired IP address:
>>http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Remote%20Address%20Filter
>>
>
> This won't work, since under AJP/1.3 the "Remote Address" is the address 
> of the client that connects to Apache, not the address of the Apache 
> machine. From a quick code check, it looks like the "secure" option isn't 
> supported any longer in mod_jk (it was never that secure to begin with). 
> You can duplicate it by setting:
>  JkEnvVar MyAuthCode password
> in trusted Apache's, and write a filter that rejects requests that don't 
> have a Request attribute of MyAuthCode with value "password".  Of course, 
> it is only as secure as your way to secure the name and value.
>

You can also use a filter that checks request.getLocalName() (which is the 
name of the Apache server) against the allowed servers.  But again, this is 
easy enough to spoof, since TC trusts the name it was sent.  As a variant, 
you can also use IP-based VHosts in Tomcat (which directs off of LocalName), 
but this suffers from the same weakness.

> If you want to restrict access to only the copy of Apache running on the 
> same machine as Tomcat, then you can do:
>  <Connector protocol="AJP/1.3" address="localhost" ...... />
> For any other configuration, you should really have a firewall between the 
> internet and Tomcat.
>
>
>
>
>>- Chuck
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
> 




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org