You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Elkin Koren <Ko...@comverse.com> on 2003/06/24 14:58:03 UTC

IP based access control

Hi,
Is it possible to configure in Tomcat 3.3.1 access control list: white and
black lists?
(My purpose is to configure white list - list of ip's Tomcat will receive
HTTP from. Packets which come from any other ip should be rejected.)

Thanks in advance,
Koren


 

Re: IP based access control

Posted by Bill Barker <wb...@wilshire.com>.
Slight oversight on the return value on the good case.

"Bill Barker" <wb...@wilshire.com> wrote in message
news:bdba72$ctm$1@main.gmane.org...
> Not out of the box.  However it's an easy enough plug-in to write.
> Something like:
>
> import org.apache.tomcat.core.*;
>
> public class MyIPAccessController extends BaseInterceptor {
>
>    MyIPAccessController() {
>        // Possible init stuff
>    }
>
>    public int requestMap(Request request) {
>        if(! validate(request) ) {
>             return 403;
>        }
          return 0;
>    }
>
>    private boolean validate(Request request) {
>       // You're validation code here.
>       // At this point, the request is already mapped, so you have all the
> info you need
>       // from the Request methods (e.g Context, servletPath, PathInfo).
>   }
> }
>
> Other methods you might want to implement include:
>
>    public void engineStart(ContextManager cm) throws TomcatException {
>       // Another possible init point.
>       // Ignore this one if you don't require engine state info.
>    }
>
>    public void engineStop(ContextManager cm) throws TomcatException {
>       // Global cleanups.  Ignore it if you don't need it.
>    }
>
>    public void contextInit(ContextManager cm, Context ctx) throws
> TomcatException{
>      // Place for per-context info.  Ignore if not required.
>    }
>
>
>
> "Elkin Koren" <Ko...@comverse.com> wrote in message
> news:380E8F36D3E4D5119F9B0002A5CE8F6A041B68B6@il-tlv-mail6.comverse.com...
> > Hi,
> > Is it possible to configure in Tomcat 3.3.1 access control list: white
and
> > black lists?
> > (My purpose is to configure white list - list of ip's Tomcat will
receive
> > HTTP from. Packets which come from any other ip should be rejected.)
> >
> > Thanks in advance,
> > Koren
> >
> >
> >
> >




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: IP based access control

Posted by Bill Barker <wb...@wilshire.com>.
Not out of the box.  However it's an easy enough plug-in to write.
Something like:

import org.apache.tomcat.core.*;

public class MyIPAccessController extends BaseInterceptor {

   MyIPAccessController() {
       // Possible init stuff
   }

   public int requestMap(Request request) {
       if(! validate(request) ) {
            return 403;
       }
   }

   private boolean validate(Request request) {
      // You're validation code here.
      // At this point, the request is already mapped, so you have all the
info you need
      // from the Request methods (e.g Context, servletPath, PathInfo).
  }
}

Other methods you might want to implement include:

   public void engineStart(ContextManager cm) throws TomcatException {
      // Another possible init point.
      // Ignore this one if you don't require engine state info.
   }

   public void engineStop(ContextManager cm) throws TomcatException {
      // Global cleanups.  Ignore it if you don't need it.
   }

   public void contextInit(ContextManager cm, Context ctx) throws
TomcatException{
     // Place for per-context info.  Ignore if not required.
   }



"Elkin Koren" <Ko...@comverse.com> wrote in message
news:380E8F36D3E4D5119F9B0002A5CE8F6A041B68B6@il-tlv-mail6.comverse.com...
> Hi,
> Is it possible to configure in Tomcat 3.3.1 access control list: white and
> black lists?
> (My purpose is to configure white list - list of ip's Tomcat will receive
> HTTP from. Packets which come from any other ip should be rejected.)
>
> Thanks in advance,
> Koren
>
>
>
>




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org