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

Conversation

mwheeler1982
Copy link

Change summary

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

When disabled (default state), server_tokens in nginx are off, HTTP response headers appear like this

< HTTP/1.1 301 Moved Permanently
< Server: nginx
< Date: Mon, 06 Jan 2025 16:56:13 GMT
< Content-Type: text/html
< Content-Length: 162
< Connection: close

When enabled, server_tokens in nginx are on, HTTP response headers appear like this

< HTTP/1.1 301 Moved Permanently
< Server: nginx/1.22.1
< Date: Mon, 06 Jan 2025 16:55:33 GMT
< Content-Type: text/html
< Content-Length: 169
< Connection: close

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 6, 2025

👍
No issues in PR Title / Commit Title

@mwheeler1982 mwheeler1982 changed the title https: T6734: Nginx - disable software version reporting https: T6734: nginx disable software version reporting Jan 6, 2025
@mwheeler1982 mwheeler1982 changed the title https: T6734: nginx disable software version reporting https: T6734: disable software version reporting Jan 6, 2025
Copy link

github-actions bot commented Jan 6, 2025

CI integration ❌ failed!

Details

CI logs

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

@@ -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.

@mwheeler1982 mwheeler1982 deleted the T6734 branch January 7, 2025 14:02
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