Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

https: T6734: disable software version reporting #4282

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions data/templates/https/nginx.default.j2
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ server {
listen [::]:{{ port }} ssl;
{% endif %}

server_tokens {{ 'on' if server_version_id is vyos_defined and server_version_id == 'enable' else 'off' }};
Copy link
Member

Choose a reason for hiding this comment

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

With default disabled I actually ment this ;)

Suggested change
server_tokens {{ 'on' if server_version_id is vyos_defined and server_version_id == 'enable' else 'off' }};
server_tokens 'off';

Copy link
Author

Choose a reason for hiding this comment

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

Default is off in my submission. What does it hurt to change the default behavior to off (as you prefer), but allow it to be enabled if the user wants it?

Copy link
Member

Choose a reason for hiding this comment

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

We do not use bool yes|no, disable|enable, true|false, and so on

  • I also prefer to disable the version as in the suggested change.


server_name {{ hostname }};
root /srv/localui;

Expand Down
20 changes: 20 additions & 0 deletions interface-definitions/service_https.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,26 @@
<defaultValue>1.2 1.3</defaultValue>
</leafNode>
#include <include/interface/vrf.xml.i>
<leafNode name='server-version-id'>
<properties>
<help>Show version on error pages and in the Server response header field.</help>
<completionHelp>
<list>enable disable</list>
</completionHelp>
<valueHelp>
<format>enable</format>
<description>Enable webserver version reporting</description>
</valueHelp>
<valueHelp>
<format>disable</format>
<description>Disable webserver version reporting</description>
</valueHelp>
<constraint>
<regex>(enable|disable)</regex>
</constraint>
</properties>
<defaultValue>disable</defaultValue>
</leafNode>
</children>
</node>
</children>
Expand Down
Loading