-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add smb encrypt option #4289
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
base: master
Are you sure you want to change the base?
Add smb encrypt option #4289
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| --- | ||
| version: 12.5.4 | ||
| version: 12.5.5 | ||
| slug: samba | ||
| name: Samba share | ||
| description: Expose Home Assistant folders with SMB/CIFS | ||
|
|
@@ -37,6 +37,7 @@ options: | |
| - ssl | ||
| compatibility_mode: false | ||
| apple_compatibility_mode: true | ||
| encryption: "desired" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to Samba 4.18 smb.conf man the default is Also,
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. default == if_required: will only enable encrytion if the client requires it so desired is better because it encrypts all possible connections, while still supporting clients which can't encrypt ...and this is a server service, which should be shipped with "secure" defaults, SMB 3 was introduced with Windows 10 / Server 2016, so every supported windows Client today will support SMB Encryption, if one need access with older clients, he can still use compability mode
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you know why the Samba developers did not choose this option by default?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the developer of this addon is setting up a smb-server, as such he is indirectly the admin of a samba server, and as admin he is responsible do setup the server with secure defaults, because the end-user who is installing this addon/app does not care/does not know how to do a secure setup... running unencrypted services, even on LAN is NOT secure and should not be embraced by unsecure defaults, especially as there are practically no more clients which do not support smb encryption, even Windows 8 and Windows Server 2012 do support it, also all smbclients on linux support it .../me is voting for secure defaults ...but this are just my 2 cents :)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah I get that you want to pick a good, secure default. I generally agree with that principle. It just strikes me as odd that this is not the default in Samba 🤔Makes me wonder if there are reasons 🤷 . I way more towards least surprise: This PR as it stands today changes the default for existing users. At the very least, this should be made clear in the changlog. Also, no matter what default we are going with, at the very least let's add the old default
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe we should provide the end user options which make it easy to understand what will be the achieved effect. This is why I decided to only expose Concerning the If we provide Furthermore I think it would be good if the user could supply his own smb.conf to the app without being forced to build a custom HA app. But that is a little bit offtopic.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If that is the concern, then let's add a quick note in the option description: "Note: default will only encrypt if clients require encryption." Not having today's default as a possible option is a no-go from my point of view. At the very least it is useful to regression test in case something doesn't work the way users expect after upgrading the Samba app to this new version. |
||
| server_signing: "default" | ||
| veto_files: | ||
| - ._* | ||
|
|
@@ -60,6 +61,7 @@ schema: | |
| - "match(^(?i:(addons|addon_configs|backup|config|media|share|ssl))$)" | ||
| compatibility_mode: bool | ||
| apple_compatibility_mode: bool | ||
| encryption: list(off|desired|required) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The documentation of Samba 4.18 (as shipped with the current app version) lists |
||
| server_signing: list(default|auto|mandatory|disabled) | ||
| veto_files: | ||
| - str | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -18,10 +18,20 @@ | |||||
| interfaces = lo {{ .interfaces | join " " }} | ||||||
| hosts allow = 127.0.0.1 {{ .allow_hosts | join " " }} | ||||||
|
|
||||||
| smb encrypt = {{ .encryption }} | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To align with the other config uses:
Suggested change
|
||||||
| {{ if eq .encryption "required" }} | ||||||
| client min protocol = SMB3 | ||||||
| client max protocol = SMB3 | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Client features are not used by the add-on so this doesn't really do anything. |
||||||
| server min protocol = SMB3 | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this needed? With |
||||||
| server max protocol = SMB3 | ||||||
| server signing = mandatory | ||||||
| {{ else }} | ||||||
| server signing = {{ .server_signing }} | ||||||
| {{ if .compatibility_mode }} | ||||||
| client min protocol = NT1 | ||||||
| server min protocol = NT1 | ||||||
| {{ end }} | ||||||
| {{ end }} | ||||||
|
|
||||||
| mangled names = no | ||||||
| dos charset = CP850 | ||||||
|
|
@@ -31,8 +41,6 @@ | |||||
| vfs objects = catia fruit streams_xattr | ||||||
| {{ end }} | ||||||
|
|
||||||
| server signing = {{ .server_signing }} | ||||||
|
|
||||||
| {{ if (has "config" .enabled_shares) }} | ||||||
| [config] | ||||||
| browseable = yes | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,12 @@ configuration: | |
| Enable Samba configurations to improve interoperability with Apple | ||
| devices. May cause issues with file systems that do not support xattr | ||
| such as exFAT. | ||
| encryption: | ||
| name: Encryption | ||
| description: >- | ||
| Configure SMB encryption. | ||
| SMB3 protocol is used if set to required. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be interpreted as if SMB3 is not used if this is not set to |
||
| Compatibility mode option will be ignored in this case. | ||
| server_signing: | ||
| name: Server signing | ||
| description: >- | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a note that the default changes.