TOMCAT HTTP Status 403 - Access to the specified resource() has been forbidden - tomcat6

Recently I moved a application into different Tomcat server environment and for some users who are accessing my application outside network getting Status 403 access forbidden error. Intranet users have no issues, only few outside network users alone facing this issue.Even i tested it from outside network and its working fine for me. Tomcat version is 6.0.18. Please help me to find some idea about this issue.There is no credential for login into this application.
Successful user getting below log
IP Address - - [16/Jul/2015:08:27:20 -0500] "POST /AppName/Main.jsp HTTP/1.1" 200 12403
Other user(facing issue) getting below log
IP Address - - [16/Jul/2015:08:30:16 -0500] "GET /AppName/Main.jsp HTTP/1.1" 403 964
I don't know how its getting changed with "GET" & "POST" for different users.

Found the root cause of this issue, In that new server those particular IPs are being blocked for some reasons through context.xml.

Related

Web Server HTTP Header Internal IP Disclosure SOLR port

I am using Apache SOLR 6.6.5 as my search engine and when we do security scan on our server, we got the below response
When processing the following request : GET / HTTP/1.0 this web server leaks the following private IP address : X.X.X.X as found in the following collection of HTTP headers : HTTP/1.1 302 Found Location: http://X.X.X.X:8983/solr/ Content-Length: 0
I have checked for more time however haven't find any solutions to fix this problem. Any idea of how to solve this would be really appreciated.
Thanks

localhost http 500 internal server error stripe react

I try to use stripe in my LocalHost, but when I post a request to stripe server, I've got this error :
POST https://localhost:3000/charge 500 (Internal Server Error)
But, on the stripe dashboard, the request have 200 return code. In accord with the support, the problem come from my localhost, but I don't have a idea ...
I have just follow this tutorial : https://stripe.com/docs/recipes/elements-react#setup
Thanks !
It's ok, it's work.
This is why it's work now :
If you are on windows, install BashUbuntu, and make all command in bashUbuntu !
First have a look at the access log. 500 error indicates that your front end has some problems talking to the back end, though the TCP port itself and HTTPD server are alive. In the access log (location depends on your OS) you will see the error. Then you will make further steps.

A simple Cron job on frontend servers and no backends. Fails

I configured a simple cron job available at secure(admin only) path /cron?method=sendMail to send an email once daily. The servlet at the endpoint of the url is a jsp file which has the code to send the email.
This is tested through the frontend with the full url and it works.
I do not have any backend servers configured. Only frontend instances with 1 resident and dynamics.
The issue is that cron triggers successfully but the request fails with the following message.
0.1.0.1 - - [17/Nov/2013:01:07:44 -0800] "GET /cron?method=sendMail HTTP/1.1" 503 364 - "AppEngine-Google; (+http://code.google.com/appengine)"
This request is getting retried continuously and keeps failing.
The complete url however works. What is wrong with the setup? what am I missing?
Also, how do I stop the retries?
The cron entry I use goes like
<cron>
<url>/cron?method=sendMail</url>
<description>Send mail</description>
<schedule>every mon,tue,wed,thu,fri,sat,sun 11:30</schedule>
<timezone>Asia/Calcutta</timezone>
</cron>
The issue was resolved using the following tip from the documentation to secure the url
Requests from the Cron Service will also contain a HTTP header: X-AppEngine-Cron: true
The X-AppEngine-Cron header is set internally by Google App Engine. If your request handler finds this header it can trust that the request is a cron request. If the header is present in an external user request to your app, it is stripped.

Intermittent timeout for cron job to another server that is serving ok?

I have an app engine project. I have a cron task that will try to open a url (on another server I own, running jetty), every 15 minutes:
<cron>
<url>/pingjetty</url>
<description>Jetty up check.</description>
<schedule>every 15 minutes</schedule>
</cron>
I'll get a SocketTimeoutException 25% of the time. I know that the jetty instance is up and running when app engine reports the timeout. Looking at the jetty logs, it looks like these requests never reach it:
[28/Apr/2013:12:24:59 +0000] "GET /jettyapi/echo HTTP/1.1" 200 31
[28/Apr/2013:12:40:03 +0000] "GET /jettyapi/echo HTTP/1.1" 200 31
[28/Apr/2013:12:55:04 +0000] "GET /jettyapi/echo HTTP/1.1" 200 31
---- missing entry, should be a connection attempt here around 13:10 -----
[28/Apr/2013:13:27:08 +0000] "GET /jettyapi/echo HTTP/1.1" 200 31
[28/Apr/2013:13:42:09 +0000] "GET /jettyapi/echo HTTP/1.1" 200 31
[28/Apr/2013:13:57:09 +0000] "GET /jettyapi/echo HTTP/1.1" 200 31
And just to be clear, here's the flow of things:
Cron job fires on my app engine instance, calling local servlet for /pingjetty.
This servlet tries to open url: "www.example.com/jettyapi/echo", which lives on my jetty instance.
The connection is fine 75% of the time - but 25% of the time I'll get the SocketTimeoutException. The exception is thrown from within the app engine servlet, trying to communicate with my jetty instance.
Is it possible that there's something going on from app engine's side? I've had this cron job running for the last two years and never saw this. I increased the connect and read timeouts to 60 seconds each. I'm also making sure the jetty instance is up and serving when the timeouts happen (other users are connecting to the jetty instance via their browsers when this timeout happens).
Any ideas would be great, not sure where to continue investigating,
Thanks
------- Update ---------------
I wasn't able to figure out what was going on. I just added a retry loop to my cron job as follows:
int tries = 3;
for (int i = 0; i < tries; i++) {
try {
openUrl("www.example.com/jettyapi/echo");
} catch (SocketTimeoutException) {
continue; // try again
}
}
So the first attempt fails 25% like before, but the subsequent retries work fine. I haven't had a total failure since adding this. But it's still confusing.
Your Cron job first makes a request to the path /pingjetty in your App Engine App and then a Servlet in your App Engine app makes a request to your Jetty instance. Where are you seeing the error message? Are you seeing a stack trace in your App Engine application logs? This means that the Cron job is successfully firing and sending a request to your App Engine app.

Why is my Flask app processing requests for a different, and unfamilar, domain (http://imagefreak007.com/2ch.php)?

I have a Flask app running on a domain - let's say abc.com. It logs all 404 errors so I can review them and in the log it includes the request.url value. This works well but occasionally I get a log entry with a request.url value of "http://imagefreak007.com/2ch.php". It's always the same url - same domain and page.
I thought the request object, and specifically the url value, indicated the url the client is trying to access - which I assumed must be on the same domain/s that the Flask app is running on. I am not sure where the url value is coming from - it is not an intentional part of the Flask app.
A client can always lie about the hostname it is trying to access. If your site is example.com, the following would be a normal HTTP request:
GET /some/path
Host: example.com
The requests you recieve are also sent to example.com, but are probably something like:
GET /2ch.php
Host: imagefreak007.com
You can try this out with the telnet command: execute telnet example.com 80, then type one of the requests in the prompt and hit enter twice at the end.

Resources