-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Add SYNO_USE_TEMP_ADMIN variable & Fix broken logic #4706
Conversation
1. Fix the broken logic in (Sorry for including fix commit in same PR, I'm feeling quite tired and would like to go to sleep right away...) 2. Provides new method to obtain credential info for authentication, it will create a temp admin user if SYNO_USE_TEMP_ADMIN is set, instead of requiring the user's own credentials which will be saved in disk. I do really don't like to have plaintext credentials be saved in disk, and I noticed that you've spent a lot of time fighting with 2FA related stuffs, so why not just get rid of the whole old way. :)
@Eagle3386 Hi, consider I opened this PR two months ago, and haven't yet got any feedbacks, so I think it's better to mention somebody to push the progress, sorry for this if you feel disturbed. |
Mentioning me won't push progress - it's @Neilpang who owns this repo & therefore is solely in charge of accepting any PR. Personally, I'm pretty much against your approach. Besides, what's the whole point of not storing the password on disk since without the TOTP secret, no external access is even possible due to no TOTP code provide upon login attempt?! If ever, the whole account - name as well as its password - should be randomized & only the name should be stored, but just to be randomized upon each run again. |
Can you add some comments by using code review tool to clarify your opinions? About the "invert?" you mentioned, I think what I did in this PR is just fixed the lack logic of your merged code... And I'd like to ask: did you even try to test all possible usages? e.g., if user have an account which don't have 2FA enabled? -- Currently it will keep requiring the OTP code even the account won't require it while logging in...
To automatically renew certificates, I do think that most of the people will just set
First, the user must be created as an administrator to be able to "granted the required rights for certificate renewal.", and the admin users can easily gain root privileges via SSH, you can't prevent anything for this for now on DSM, unless you just disable SSH feature, for me, disable it will cause my own inconvenience. Secondly, I don't know what you are saying, because I don't know how to only grant the specific right to a user on DSM - without any other rights, could you please post an article to talk about "how to achieve" exactly? I really look forward to it. Thirdly, for this "new user", consider the only reason for creating it is "do the renewal job" rather than to use like a normal user, did you really want to see it in your control panel each time when you open the "user&group" tab? For me, the answer is obvious.
For above two advices you mentioned:
Already replied, and if you want to have some arguments about whether it is acceptable to store your own passwords in plain text on your local storage, then you are all right, peace :) |
Nope, won't comment/review that much code - already used more time on this than initially intended.
Nope, you didn't. It's supposed to fail, because that's the previous way of using it.
Nope & I didn't even have to. Accounts without 2FA enabled were supposed to not be supported.
You basically got it wrong, right from the start -
First, your inconvenience is not those of others, let alone "everybody".
Are you serious? An entry like "CertRenewUser" bothers you?
First & foremost, "your" script should be stable enough to handle that situation.
Again, I won't discuss this, as I dislike/oppose the whole purpose you're after with this PR.
Honestly, the script would be way uglier with your PR than with such handful lines.
I don't store my passwords in plaintext, but happily that of a darn "renewal user", in a directory only accessible by Besides, you seem to still just not getting it & that's why I unsubscribe from this now. |
Hmm, how nice are you.
Then why not in your code, you didn't explain anything about your "default" failure by printing some error messages?
Hmm, what you are talking about? Looks like that you just replied even you don't know what I said, and don't want to have a normal conversation to ask...
Hmm, how nice are you. x2
You can do what ever you want, but when you blame someone, you'd better not to do the same thing in the same post, and hope you also can keep remembering "let alone everybody" in your mind.
Hmm, how nice are you. x3
Hmm, how nice are you. x4
Oh, I see, so you just consider that store the info (username & password) of your "renewal user" in plaintext is acceptable, but have you ever did the thing - "only granted the required rights for certificate renewal." - you mentioned before? If so, then I think your system is quite secure, even consider that the script will store
Neither are you. Thank you for canceling your subscription, really. @Eagle3386 Little advice: try to be more friendly, and don't make excuses for yourself, everyone will make many mistakes in their whole life, and it doesn't matter at all, as long as they can admit them, then do the correction. |
While it was relatively fun and distressing reading all of this, @scruel I would very much be against this PR because it assumes this is running while installed directly on the OS and not in a docker container (as a LOT of users do). This is very much not ideal and should not be merged because it would break a lot of installations. I kind of agree with @Eagle3386 on one point (I didn't bother to read the entire ... review fist-fight?) and that is the fact that this PR solves the problem in this particular case only with a bit of a hack (sure, it minimizes the window of opportunity for an attack, but it does leave artifacts for that user around and only works when locally installed). Edit and PS: I would be interested in @Eagle3386 's comment that you can limit the user to cert renewals only. Reading the API docs from Synology, I haven't been able to find anything that would grant access only to that part of the API. |
It won't break anything, if you check the code, you can see that anyone who are prefer to use docker can still use it in the docker, however, they have to use it with the old ways which will require their admin user's password. |
I don't think it's possible ATM on DSM, based on the whole researchs I've made for this. |
can anyone explain the synology dsm device to me? Or give me a link to amazon.com? so that I know what it is. |
Check: |
Hi @Neilpang, happy Loong Year! I'd like to ask, do we have any update on this PR? Could I do anything to push the progress? Thanks! |
thanks, here you go. |
I do really don't like to have plaintext credentials be saved in disk, and I noticed that you've spent a lot of time fighting with 2FA related stuffs, so why not just get rid of some parts of the old way. :)