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: Nginx - disable software version reporting #4273

Closed
wants to merge 3 commits into from

Conversation

mwheeler1982
Copy link

@mwheeler1982 mwheeler1982 commented Jan 3, 2025

Change summary

Added new option under "service https" called "no-server-version". This affects the "server_tokens" option in the nginx default site configuration.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

How to test / Smoketest result

By default or when this option is not set, the HTTP response headers look like this:

< HTTP/1.1 301 Moved Permanently
< Server: nginx/1.22.1
< Date: Fri, 03 Jan 2025 15:19:18 GMT
< Content-Type: text/html
< Content-Length: 169
< Connection: close
< Location: https://xxx.xxx.xxx.103:80/

When the option is set, the HTTP response headers look like this:

< HTTP/1.1 301 Moved Permanently
< Server: nginx
< Date: Fri, 03 Jan 2025 15:18:48 GMT
< Content-Type: text/html
< Content-Length: 162
< Connection: close
< Location: https://xxx.xxx.xxx.103:80/

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

Copy link

github-actions bot commented Jan 3, 2025

👍
No issues in PR Title / Commit Title

data/templates/https/nginx.default.j2 Outdated Show resolved Hide resolved
interface-definitions/service_https.xml.in Outdated Show resolved Hide resolved
mwheeler1982 and others added 2 commits January 3, 2025 10:50
Clean up text in help description

Co-authored-by: Christian Breunig <christian@breunig.cc>
Simplify nginx config file interface-definition
@mwheeler1982
Copy link
Author

It doesn't look like the smoke test failure was related to my feature.

Copy link

github-actions bot commented Jan 3, 2025

CI integration ❌ failed!

Details

CI logs

  • CLI Smoketests (no interfaces) ❌ failed
  • CLI Smoketests (interfaces only) ❌ failed
  • Config tests 👍 passed
  • RAID1 tests 👍 passed
  • TPM tests 👍 passed

@@ -18,6 +18,8 @@ server {
listen [::]:{{ port }} ssl;
{% endif %}

server_tokens {{ 'off' if no_server_version is vyos_defined else 'on' }};
Copy link
Member

Choose a reason for hiding this comment

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

Wrong indention

@c-po
Copy link
Member

c-po commented Jan 5, 2025

@dmbaturin I wonder if we should not always disable this. I see no reason in exposing the webservers version information.

@dmbaturin
Copy link
Member

@dmbaturin I wonder if we should not always disable this. I see no reason in exposing the webservers version information.

Interesting question. Maybe it should indeed be the default at least.

@mwheeler1982 mwheeler1982 deleted the T6734 branch January 6, 2025 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants