-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
FEAT: User Auth on Diagnostics Page #441
Conversation
Feature: User Authentication [DO NOT MERGE YET]
a4fa369
to
5821bf9
Compare
5821bf9
to
4b30054
Compare
@robputt the security thing is below: and at https://sonarcloud.io/dashboard?id=NebraLtd_hm-diag&pullRequest=441 I can mark it as safe if it is not an issue, but wasn't sure |
also @robputt I was thinking - is there any chance we can add some brute-force protection? perhaps by rate limiting password entries? just thinking if someone accidentally exposes this to the open internet, we should have some protection to stop people from brute forcing |
@shawaj please mark this as safe in Sonarqube, we already follow this pattern in the other view and it has been accepted in Sonarqube. 👍 |
@shawaj - yep I can add this if password_wrong > 5 tries then block login for 15 mins? something like this? |
@robputt yep exactly 😊 |
@NebraLtd/tech-support @ChristopherRush once this is merged we will need a support article explaining the functionality and why we have introduced it and possibly a blog/email as well |
9f410a1
to
161c659
Compare
10840a6
to
05bb898
Compare
Don't worry this is still a few days off, I am changing how it works a bit. 🤦 |
6db5929
to
3cf29e0
Compare
Oh and maybe a cheeky squash/rebase @robputt 😜 |
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.
Looks like for the user, only way to recover forgotten password is reflash the miner or wipe storage from balena. Does the user have capability to wipe miner on his own without raising a request to customer support.
Not currently, they would need to ask Nebra support :-(. @shawaj any thoughts how to handle this? |
@robputt I thought we said it would be via some button press combination? Although some non Nebra ones don't have a button. Having said that, if they had local access to the miner, with the move to OpenFleets, they would be able to reflash their miner without any support help to get it back to default which seems like an ok solution. Perhaps we do a hybrid solution:
The only issue with this is that currently, if no button or led is defined in pyhelper hm-config craps out and possibly diag too. We have fixed this by just putting in incorrect button and LED definitions when there isn't one. Ref NebraLtd/hm-config#172 But this can probably be fixed properly very easily so think it should be ok. Additionally, for dashboard, how are devices identified for whether they have a subscription do you know @pritamghanghas ? If it's by Balena uuid then obviously this would break. But then, if it's a paid dashboard subscriber then it's ok to have a bit of support load and this will be the minority. What do you think? Another option could be reset over Bluetooth in our app but the seems like overkill to me, at least for now. And also some miners don't have Bluetooth 😂 |
@shawaj Here is my suggestion, not sure about security implications.
|
@kashifpk will know better about identity in dashboard, but i would expect they can be identified by both uuid and mac addresses. |
The issue with email is that we don't have the users email and also we would have to send through a mail server which seems like overkill on the diagnostics. Agree about the local network thing, but TBH that can probably be spoofed and could also cause issues if someone's network gets hacked. So I think more cumbersome methods that require physical access or a reflash is probably better |
The main thing I'm wondering, is if a device that's already listed in the dashboard changes it's Balena uuid but still has the same Mac address and all other info, what will happen? @kashifpk any idea? |
7ae5561
to
b1e2d54
Compare
b1e2d54
to
1916b46
Compare
afa497d
to
fd7c034
Compare
fd7c034
to
720a994
Compare
a372160
to
7a37d07
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
To be merged and deployed with NebraLtd/hm-config#225 |
This comment still needs resolving @KevinWassermann94 but apart from that I think we are good to go @robputt so approving but should follow this up. Maybe I'll create a new issue on hm-dashboard to follow this question up |
Follow up ticket for the above... https://github.com/NebraLtd/hm-dashboard/issues/1471 |
@shawaj -AFAIK in such case our balena celery task would create a new balena record in balena table. This is being done here. This table links with the main devices table using serial number so the FK would still be valid. One problem though would be that within the devices table itself we have a balena_uuid field that never gets updated during this process so that field would contain old/invalid balena uuid. |
Add user auth to the local diagnostics pages...
Features