Skip to content

Netatalk: Prompt user when pre-existing config is found; Append the images dir as a shared volume#916

Merged
rdmark merged 11 commits intodevelopfrom
rdmark-netatalk-share-images
Oct 18, 2022
Merged

Netatalk: Prompt user when pre-existing config is found; Append the images dir as a shared volume#916
rdmark merged 11 commits intodevelopfrom
rdmark-netatalk-share-images

Conversation

@rdmark
Copy link
Copy Markdown
Member

@rdmark rdmark commented Oct 15, 2022

No description provided.

Copy link
Copy Markdown
Contributor

@uweseimet uweseimet left a comment

Choose a reason for hiding this comment

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

Is this feature unconditional? Exposing folders (even in a local network) is insecure. It should not be done unless explicitly confirmed (in easyinstall) by the user.
In addition, if I am not mistaken the additional line will be appended each time easyinstall is run, i.e. potentially many times?

@rdmark
Copy link
Copy Markdown
Member Author

rdmark commented Oct 15, 2022

@uweseimet Those are good points. For the first question, the script will notify the user about pending changes to their system, and solicit a confirmation before proceeding. The easyinstall script invokes another installation script in the Netatalk source tree where this is done: https://github.com/rdmark/Netatalk-2.x/blob/branch-netatalk-2-x/contrib/shell_utils/debian_install.sh#L23

Granted, this does not mention ~/images explicitly. I can add a notice about this earlier on.

As for the second question, in the script Netatalk is configured with the --enable-overwrite flag, which will replace the configuration files in /etc/netatalk with fresh ones every time you run the script. Hence, I think it should be safe for easyinstall to assume fresh files and not check for existing lines.

@uweseimet
Copy link
Copy Markdown
Contributor

uweseimet commented Oct 15, 2022

@rdmark I don't think network configurations should just be overwritten. There may be users who already have exported (that's what I assume Netatalk does) something, or who add other exports after easyinstall has been run. Especially users who would like to export the images folder may already have exported something else, or are going to do so.

@uweseimet
Copy link
Copy Markdown
Contributor

@rdmark Thinking more about this, IMHO this is all very dangerous. easyinstall is becoming too intrusive. Scripts running with root permissions that reconfigure all kinds services without user control are causing more problems than they are resolving.

@rdmark
Copy link
Copy Markdown
Member Author

rdmark commented Oct 15, 2022

@rdmark I don't think network configurations should just be overwritten. There may be users who already have exported (that's what I assume Netatalk does) something, or who add other exports after easyinstall has been run. Especially users who would like to export the images folder may already have exported something else, or are going to do so.

@uweseimet I can see that now after about 1 year of distributing this script with RaSCSI, and other efforts of promoting Netatalk 2x, that there may be a significant install base to justify being more mindful about existing installations. When we set out last year, Netatalk 2 had been practically dead for many years, especially on Linux, so there was little incentive to consider an install base.

I will look into improving the script before a future RaSCSI release.

As a short term measure, I added a warning message to the script.

@uweseimet
Copy link
Copy Markdown
Contributor

uweseimet commented Oct 15, 2022

@rdmark In any case, please disregard my comment in the ticket about exporting via nfs and samba. This seemed to be a nice idea, but I have realized that it is definitely not what I would want, at least not as a side effect of a software installation.
Regarding a warning in the script: What is a user supposed to do who does not want the images folder to be exported?

@rdmark
Copy link
Copy Markdown
Member Author

rdmark commented Oct 15, 2022

@rdmark Thinking more about this, IMHO this is all very dangerous. easyinstall is becoming too intrusive. Scripts running with root permissions that reconfigure all kinds services without user control are causing more problems than they are resolving.

@uweseimet Can you please be more specific about when exactly the script became too intrusive, and what new problems they are causing? I can't see how the script today is significantly different from 1.5 years ago, but maybe I'm overlooking something. In fact, we've since added prominent breakdowns of the changes that the script is making before seeking user consent.

Of course, I would be the first to admit that the script is not an ideal configuration mechanism and comes with significant risks. Something like deb packages would be a lot cleaner and safer. But at the same time, RaSCSI software runs on what are typically one-purpose, non-business critical systems. From my experience interacting with our end users, they're very used to taking backups of image files, and just reflashing their SD cards with a fresh pre-built RaSCSI image if they encounter challenging issues.

Anyhow, I'm definitely interested in exploring alternative distribution solutions, but I don't see it as a high priority.

@rdmark
Copy link
Copy Markdown
Member Author

rdmark commented Oct 15, 2022

@rdmark In any case, please disregard my comment in the ticket about exporting via nfs and samba. This seemed to be a nice idea, but I have realized that it is definitely not what I would want, at least not as a side effect of a software installation. Regarding a warning in the script: What is a user supposed to do who does not want the images folder to be exported?

@uweseimet Good point about user choice. Now the Netatalk + sharing images dir is an "experimental" option in the menu.

@rdmark rdmark requested a review from uweseimet October 15, 2022 21:15
@uweseimet
Copy link
Copy Markdown
Contributor

@rdmark I cannot really tell whether the script has changed much in the last 1.5 years. Any script running with root permissions (which cannot be avoided in this case) makes me feel uneasy. And when a scripts starts do export data, and I cannot even do something about it (at least if my understanding is correct), it's even more a good reason to feel uneasy.
This is not about not having backups (you should have them anyway), but about data security. You see data being leaked by all kinds of gadgets all the time, because everything is connected to the internet and thus is vulnerable, and this is getting worse. I try to consider this security stuff as relevant, regardless of the kind of system.

And the more powerful PIs get, the more likely it is that you would like to run more than just a single piece of software on them.

@uweseimet
Copy link
Copy Markdown
Contributor

@rdmark Giving users a choice in such a case is important, thank you.

The approval should be given by somebody else. I might simply miss a syntax error somewhere, not being that familiar with python. I wonder whether it would be better to wait until after the 21.10 release before merging, because it is good practice to only fix bugs during a code freeze before a release.

@rdmark
Copy link
Copy Markdown
Member Author

rdmark commented Oct 15, 2022

@rdmark Giving users a choice in such a case is important, thank you.

The approval should be given by somebody else. I might simply miss a syntax error somewhere, not being that familiar with python. I wonder whether it would be better to wait until after the 21.10 release before merging, because it is good practice to only fix bugs during a code freeze before a release.

Yes, this change has become intrusive enough that I agree we should wait until after the release.

@uweseimet
Copy link
Copy Markdown
Contributor

uweseimet commented Oct 15, 2022

@rdmark Sounds good. In particular when something is security-sensitive one should not rush things.

@rdmark rdmark requested a review from nucleogenic October 17, 2022 19:08
Copy link
Copy Markdown
Member

@nucleogenic nucleogenic left a comment

Choose a reason for hiding this comment

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

Tested option 13:

  • No Netatalk installed (pass)
  • Enabling the share (pass)
  • Removing the share (pass)

Tested option 8 and found a potential usability issue.

Approved, but equally happy to re-test if you wish to make further changes.

@rdmark rdmark changed the title Netatalk: Append the images dir as a shared volume Netatalk: Prompt user when pre-existing config is found; Append the images dir as a shared volume Oct 18, 2022
@rdmark
Copy link
Copy Markdown
Member Author

rdmark commented Oct 18, 2022

@uweseimet I decided to merge this before the release, since it adds a layer of protection for users, warning them before potentially overwriting their local configurations.

@rdmark rdmark merged commit ac39b3b into develop Oct 18, 2022
@rdmark rdmark deleted the rdmark-netatalk-share-images branch October 18, 2022 00:42
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

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.

3 participants