Git Product home page Git Product logo

hass-wh-triggers's People

Contributors

danielperna84 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

hass-wh-triggers's Issues

Update requirements

The current requirements.txt uses the package versions referenced be the example app from py_webauthn. Some packages probably can be pinned to a more recent version, which may also improve security.

Make optional use of Geo-Location

It could be useful to take a users Geo-Location into account for either logging in, or for firing triggers. After all it wouldn't always make sense to open the front door if the user isn't actually in front of the door.
This probably should be rather configured per trigger (and included in the JSON payload), and possibly even dependent on who the users is. The reasoning for this is, that trusted users may have to be able to fire a trigger regardless of where they are, while for others a specific physical location is required. Of course this will not help if the location is spoofed. But as an additional layer of protection this could be useful.

Add OTP-only mode

The way it is now the manually created OTP tokens only serve as a fallback if 2FA is not available. Those users can still add 2FA when logged in. A flag should be added to the userdata that marks him as OTP-only. With this enabled FIDO2 / TOTP authentication should be rejected. With this in place the admin has the control to limit how often a user is able to log in.

Ensure unassigned users can't fire triggers

Currently users that are not assigned to a trigger won't see the trigger. However, if they know how they could still fire it because in triggers_fire it is not checked if the user is assigned to the trigger.

Reverse Proxy compatibility

It seems as if using a Reverse Proxy setup where the app is located further down the path the url_for mechanism doesn't work. This is a popular solution to the problem.

Firefox constantly refreshes

When opening in Firefox on Windows 10, the browser constantly refreshes the site. Probably related to the PWA stuff or the auto-logout.

Settings appear to not apply (with multiple processes)

The way globals are used for things like the app-title or ssl verification only reliably works with a single process. When using e.g. gunicorn with multiple workers, the settings only get reloaded for the process which handled the request to save the settings. Refreshing the site hence can still display the old settings if it's a different process. In this case the new settings also won't apply.

This does not affect things like triggers though. After restarting gunicorn all processes will work with the new settings. So there is a workaround available by restarting the server process.

Option to en/disable autocomplete at login form

The browser may propose to save login-information, possibly making the 2nd factor the only way of authentication when autofilled. A global option to disable autocomplete for the input fields probably can prevent this. And for the TOTP field autocomplete always should be disabled.

Edit: autocomplete=off may not prevent password managers from doing their job. But the browser itself may stop offering suggestions for the data. See this discussion.

Option to prohibit users to add additional FIDO2 tokens

Users can add additional FIDO2 tokens currently. So if they share their credentials and add another key, someone else could use that key to login. To counteract this problem it should be possible to disable the addition of further tokens.

Add OTP support

On top of WebAuthn and TOTP it could also be useful for the admin to create OTP tokens (like the registration tokens) that expire after a configurable amount of time and can be used for exactly one login. This could be especially usefule if a user has registered the account, but did not add a 2FA token.

Encrypt TOTP Base32 in database

The TOTP Base32 secret should be encrypted before storing the value in the database. The key could com from the environment, much like the secret used for the Flask sessions.

Allow assigning triggers to users

Limiting triggers to a defined set of users would be nice. That way not all users would be presented with all available triggers.

Improve Registration/OTP tokens

It might be worth it to follow common patterns when dealing with these these types of tokens. This section of the Flask documentation seems related.

Trigger-Adminsite improvements

Some ideas:

  • Button to generate webhook IDs
  • Export / import triggers as JSON
  • Provide automation-examples that make good use of a trigger

Deployment

Easy and versatile deployment options are needed. For Flask itself this looks interesting. On top of that Docker and a hassio add-on could be useful.

Improve database initialization

Since I'm new to Flask the way I initialize the database and prefill the default settings seems a bit hacky. If there is a better solution, it should be implemented.

Auto-refresh when opened

Opening the site (either in the browser or PWA) should initially do a refresh because usually the users session will have expired at that point. In this state firing a trigger will just display the spinner within the button and nothing happens. Pulling down to refrehs will solve this problem. But users might not know how to do this, and in general it would be just more user-friendly if they get redirected to the login-site right away in case the session has expired.

Support for internal Android authentication

Currently registration fails using the internal FIDO2 capabilities of Android.

Error:

Server validation of credential failed: Registration failed.
Error: Registration rejected. Error: Unable to verify attestation statement format..
didClickRegister @ webauthn.js:77

This probably is a result of the underlying py_webauthn package simply not supporting these type of devices yet. Issue 28 at their repository seems to be where this problem is being discussed.

Using external tokens with Android (e.g. NFC Yubikey) is working.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.