Skip to content

Conversation

@javierivanov
Copy link
Contributor

What is this PR for?

A few sentences describing the overall goals of the pull request's commits.
First time? Check out the contributing guide - https://zeppelin.apache.org/contribution/contributions.html

What type of PR is it?

[Improvement]

What is the Jira issue?

How should this be tested?

  • Travis should pass

With defaultzeppelin.server.send.jetty.name = true

$ curl -i localhost:8080/nonexisting
HTTP/1.1 404 Not Found
Date: Fri, 31 Jan 2020 19:16:33 GMT
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: authorization,Content-Type
Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, HEAD, DELETE
X-FRAME-OPTIONS: SAMEORIGIN
X-XSS-Protection: 1
X-Content-Type-Options: nosniff
Cache-Control: must-revalidate,no-cache,no-store
Content-Type: text/html;charset=iso-8859-1
Content-Length: 328
Server: Jetty(9.4.18.v20190429)

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /nonexisting. Reason:
<pre>    Not Found</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.18.v20190429</a><hr/>

</body>
</html>

By changing to false zeppelin.server.send.jetty.name = false

$ curl -i localhost:8080/nonexisting
HTTP/1.1 404 Not Found
Date: Fri, 31 Jan 2020 19:15:57 GMT
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: authorization,Content-Type
Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, HEAD, DELETE
X-FRAME-OPTIONS: SAMEORIGIN
X-XSS-Protection: 1
X-Content-Type-Options: nosniff
Cache-Control: must-revalidate,no-cache,no-store
Content-Type: text/html;charset=iso-8859-1
Content-Length: 243

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /nonexisting. Reason:
<pre>    Not Found</pre></p>
</body>
</html>

Questions:

  • Does the licenses files need update?
    No
  • Is there breaking changes for older versions?
    No
  • Does this needs documentation?
    Yes

@krishna-pandey
Copy link
Contributor

Have you checked the existing ZEPPELIN-2461 where you can custom configure the Header. I feel not sending a header raises more suspicion to the Attacker and won't be a good form of deception.

@javierivanov
Copy link
Contributor Author

@krishna-pandey Yes, but I think bot approaches are good here, since the goal is to avoid to show the exact version and target specific known vulnerabilities. And there are users that would like to avoid showing that at all. This PR is just to give more options to users. Let me know what you think 👍

@krishna-pandey
Copy link
Contributor

bot
You got me confused here. I got into thinking about Bots fingerprinting server version and using relevant payloads to attack.

My point is "abnormal" or "deviating from normal pattern" makes attacker more curious. Not sending Server version is not a fool-proof way to hide that information, however if someone wants to do that, you just have to put a space char like in below config

<property>
    <name>zeppelin.server.jetty.name</name>
    <value> </value>
    <description>Hardcoding Application Server name to Prevent Fingerprinting</description>
</property>

and you will get below effect

Screenshot 2020-02-04 at 08 07 34

Let me know your thoughts.

Copy link
Contributor

@alexott alexott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with small comment about value in template

@alexott
Copy link
Contributor

alexott commented Apr 9, 2020

@krishna-pandey Can you please rebase it to master?

@Reamer
Copy link
Contributor

Reamer commented Apr 29, 2020

LGTM

@Reamer
Copy link
Contributor

Reamer commented May 11, 2020

What is blocking the merging of this PR?

@asfgit asfgit closed this in f9ab6bb May 11, 2020
asfgit pushed a commit that referenced this pull request May 11, 2020
…and on 300/400 pages

### What is this PR for?
A few sentences describing the overall goals of the pull request's commits.
First time? Check out the contributing guide - https://zeppelin.apache.org/contribution/contributions.html

### What type of PR is it?
[Improvement]

### What is the Jira issue?
* https://issues.apache.org/jira/browse/ZEPPELIN-4586

### How should this be tested?
* Travis should pass

With default`zeppelin.server.send.jetty.name = true`
```
$ curl -i localhost:8080/nonexisting
HTTP/1.1 404 Not Found
Date: Fri, 31 Jan 2020 19:16:33 GMT
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: authorization,Content-Type
Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, HEAD, DELETE
X-FRAME-OPTIONS: SAMEORIGIN
X-XSS-Protection: 1
X-Content-Type-Options: nosniff
Cache-Control: must-revalidate,no-cache,no-store
Content-Type: text/html;charset=iso-8859-1
Content-Length: 328
Server: Jetty(9.4.18.v20190429)

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /nonexisting. Reason:
<pre>    Not Found</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.18.v20190429</a><hr/>

</body>
</html>
```
By changing to false `zeppelin.server.send.jetty.name = false`

```
$ curl -i localhost:8080/nonexisting
HTTP/1.1 404 Not Found
Date: Fri, 31 Jan 2020 19:15:57 GMT
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: authorization,Content-Type
Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, HEAD, DELETE
X-FRAME-OPTIONS: SAMEORIGIN
X-XSS-Protection: 1
X-Content-Type-Options: nosniff
Cache-Control: must-revalidate,no-cache,no-store
Content-Type: text/html;charset=iso-8859-1
Content-Length: 243

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /nonexisting. Reason:
<pre>    Not Found</pre></p>
</body>
</html>
```

### Questions:
* Does the licenses files need update?
No
* Is there breaking changes for older versions?
No
* Does this needs documentation?
Yes

Author: Javier Fuentes <[email protected]>
Author: Javier <[email protected]>

Closes #3622 from javierivanov/ZEPPELIN-SENDVERSION and squashes the following commits:

44e0474 [Javier Fuentes] fixed template
b720757 [Javier Fuentes] fixes
430b92d [Javier] added parameter and doc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants