Commit Graph

429 Commits

Author SHA1 Message Date
Andrew
df969bdb23 Fix nil device error for stats push service and use live WireGuard adapter in dev. (#825)
* Conditionally start WireGuard sandbox adapter if set in app env

* Use Live wg adapter module in dev, sandbox in test. fz_vpn supervised children from app env
2022-07-25 11:47:58 -07:00
Po Chen
f86e080471 Fix handling invalid client reason (#828)
* Catch different reasons

* redirect
2022-07-25 11:47:58 -07:00
Gabi
76f6e53cfd NFTables fixes (#804) 2022-07-25 11:47:58 -07:00
Po Chen
6bd66dc711 Logo Customization (#800) 2022-07-25 11:47:58 -07:00
Jamil Bou Kheir
4b8b0c39ce Fix endpoint typo 2022-07-25 11:47:58 -07:00
Jamil
2de119a49e Docker dev polish (#803)
* checkpoint

* Docker dev environment final root cause analysis

* Update CONTRIBUTING.md

* Update apps/fz_common/lib/fz_net.ex

Co-authored-by: Po Chen <chenpaul914@gmail.com>

Co-authored-by: Po Chen <chenpaul914@gmail.com>
2022-07-25 11:47:58 -07:00
Andrew
7a14f178a4 Add telemetry data to the ping event (#801)
* Add telemetry data for feature configs and other useful stats

* use conf helper in more places & unit tests for ping_data

* include db url setting, improve unit tests
2022-07-25 11:47:58 -07:00
Jamil
9925f43f16 Add sample users/devices (#802) 2022-07-25 11:47:58 -07:00
Po Chen
bfbb671d32 Docker DEV (#737) 2022-07-25 11:47:58 -07:00
Andrew
69a4412d75 Remove pre-configured Okta & Google OAuth providers (#793)
* Remove pre-configured Okta & Google OAuth providers, update docs

* Upgrade docs clarifications & remove unused auth code for pre-configured providers (google/okta)

* Fix docs url for upgrade note
2022-07-25 11:47:58 -07:00
Po Chen
48d8ea75a9 Implement PKCE (#789)
* use to_existing_atom

* implement pkce

* fix and add tests

* Update apps/fz_http/lib/fz_http_web/controllers/auth_controller.ex

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2022-07-25 11:47:58 -07:00
Po Chen
90c63f1db5 use x-forwarded-for in addition to x-real-ip (#785) 2022-07-25 11:47:58 -07:00
Andrew
0a4f08665d Use toggle for vpn connection permission (#787)
* Add ui refresh of danger zone section for user view

* Use large switch style

* Go back to medium style for toggle
2022-07-25 11:47:58 -07:00
Andrew
3e39339643 Improve user vpn connection status ui (#784)
* Update VPN Connection column with status tag, update docs explaining tags under authenticate section

* Fix events test warning

* Fix formatting

* Fix docs lint

* Move vpn status doc to fix doc lint

* Use div instead of label for tag root, update oidc language

* Refactor vpn status component for pr feedback

* use a component instead of a live one
2022-07-25 11:47:58 -07:00
Andrew
6dbd5cc59d Update egress rules user guide with user scope ui (#782)
* Update egress rules user guide with user scope ui

* Fix user scope description

* Update egress rules view with correct user scope text & corresponding doc img

* Revert previous doc text
2022-07-25 11:47:58 -07:00
Jamil Bou Kheir
f1af5ddf2f wait 10 2022-07-25 11:47:58 -07:00
Po Chen
abd5085ab8 fix build (#778) 2022-07-25 11:47:58 -07:00
Andrew
a75dfa3073 Add redirect routes for oidc signin links by provider (#770)
* Add redirect routes for oidc signin links by provider

* whitespace fix

* restore comment

* Add oidc redirect route helper to auth template for sign-in buttons

* Update docs to mention pretty URLs.

* Fix docs
2022-07-25 11:47:58 -07:00
Gabi
f5806a2d8a Replaces nftables rule management to use sets (#766)
* Replaces nftables rule management to use sets

Fixes firezone/product#398

* Fix fz_wall not existing function

* Minor tidy up

* Refactor tests and projections

* Refactor fz_wall state to use map instead of tuple

* Minor fix
2022-07-25 11:47:58 -07:00
Andrew
d49e44c3fc Update rules UI to include optional user scope (#764)
* Add optional user scope field to Rules UI

* Build a users map and use for rule list table

* Include current user in user scope options

* Add user scope tests to live rule view test

* Finish adding/removing scoped rule tests

* Add rules number field to user detail view with link to rules page

* Woops, forgot to define destination in remove scope test

* Only add rules path to user_details template for auth'd views.

* Use socket for rules_path router & remove user options logic from view

* Update fw rules guide to explain user scoped rules
2022-07-25 11:47:58 -07:00
Gabi
8888839e97 add user id to rules (#722)
* checkpoint

* Add and delete functions for multiple rules

* Update delete device to delete user rules

* Fix tests

* Improve testing

* Multiple suggested small improvments

* Swap call order on update device

* Fix rule deletion for users/devices

* Fix deletion for multiple rules

* Remove device deletion by pubkey

* Fix multiple rule deletion in case of handle change

* Optimize sql query for getting nftable spec rules

* Fix rule deletion when same daddr

* Fix rule deletion to account for whitespace at the start of line

* Improve rule duplicate error message

Co-authored-by: Jamil Bou Kheir <jamilbk@users.noreply.github.com>
2022-07-25 11:47:58 -07:00
dependabot[bot]
91020f89d7 Bump phoenix_html from 3.1.0 to 3.2.0 (#841)
Bumps [phoenix_html](https://github.com/phoenixframework/phoenix_html) from 3.1.0 to 3.2.0.
- [Release notes](https://github.com/phoenixframework/phoenix_html/releases)
- [Changelog](https://github.com/phoenixframework/phoenix_html/blob/master/CHANGELOG.md)
- [Commits](https://github.com/phoenixframework/phoenix_html/compare/v3.1.0...v3.2.0)

---
updated-dependencies:
- dependency-name: phoenix_html
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-25 09:26:43 -07:00
Jamil
6442439378 Telemetry check service (#771) 2022-06-30 09:34:03 -07:00
Jamil
f461ef84c6 Option to disable masquerade (#769)
* Option to disable masquerade

Fixes #666

* Fix markdown lint issues

* Reflow text

* Fix markdownlint errors

* Clean up conditional
2022-06-29 17:21:37 -07:00
Po Chen
7cc94f1497 Fix error message matching (#760)
* Fix error message matching

* Update live.ex

* use more conventional delimiter
2022-06-28 05:21:53 -07:00
Jamil
938c359e5a Disable changing password when local_auth is disabled (#751)
* segregate account form between admins and unprivileged users

* Disable magic_link, identity providers when local auth disabled

* Revert authentication.ex
2022-06-23 21:32:08 -07:00
Andrew
73403613ae re-add logger require in fz_http Devices module (#752)
* re-add logger require in fz_http Devices module

* fix interface test in fz_vpn

* Start GenServer dynamically on first use

* docs clarify

Co-authored-by: Jamil Bou Kheir <jamilbk@users.noreply.github.com>
2022-06-23 16:36:47 -07:00
Andrew
dc4f07dc8a Remove wireguard-tools from firezone. (#748)
* Remove wireguard-tools from firezone

* Remove unused public key environment variable

* remove wg private keygen from omnibus config

* Move private key file management to Elixir

* cleanup perms, remove unused code

* Cleanup some more code, fix interface test

* fix functional test & refactor FzVpn.Interface.set

* update owner group on wg_private_key even if file is present

* Fix device config generation

Co-authored-by: Jamil Bou Kheir <jamilbk@users.noreply.github.com>
2022-06-23 11:29:57 -07:00
Jamil
576ff89c93 Display flash error when creating device results in interface error (#747)
* Display flash error when creating device results in interface error

* Don't overwrite state with error_info

* Add for delete; refactor a tad

* D'oh, handle GenServer call appropriately

* Add missing device delete tests (!!)
2022-06-23 08:33:45 -07:00
Jamil
7b92db5736 Add user_count, device_count, users_with_mfa_count (#741) 2022-06-21 17:41:24 -07:00
Jamil
42dc05c7e7 set default MTU to 1280 (#742) 2022-06-21 17:31:40 -07:00
Jamil
416ea0d9c9 Add more debugging oidc (#738) 2022-06-21 08:16:41 -07:00
Jamil
e6adc0fc92 Allow option to disable auto-creating OIDC users (#728)
* Allow option to disable auto-creating OIDC users

* Po's comments
2022-06-18 10:19:05 -04:00
Andrew
b5683243f5 Refactor fz_vpn with Wireguardex (#718)
* Refactor fz_vpn with Wireguardex library, tests failing and some more to go with the sandbox adapter

* fix dump test & static-analysis refactoring

* finish sandbox, dump test working

* add functional test for WireGuard calls

* remove leftover cli code from refactor

* remove unusued cli & config modules

* remove setcap recipe after app recipe to preserve setcap on beam

* PR feedback: Change Interface warnings to errors, code improvements, remove wg_path from config

* add tests for interface module & PR feedback

* update to Wireguardex 0.3.0

* delete extra line in test

* Switch WGAdapter live module to prod config instead of runtime
2022-06-18 08:40:06 -04:00
Jamil
f26cca54b4 Allow disabling the VPN session disabling through OIDC (#727)
* Allow disabling the VPN session disabling through OIDC

* More debugging

* Update docs/docs/authenticate/index.md

* Update omnibus/cookbooks/firezone/attributes/default.rb

* Update apps/fz_http/lib/fz_http_web/live/hooks/live_auth.ex

Co-authored-by: Andrew <andrew@firezone.dev>

Co-authored-by: Andrew <andrew@firezone.dev>
2022-06-17 10:15:41 -07:00
Po Chen
709e59e3b5 Improve OIDC connection UX (#725)
* Allow changing VPN connection permission on admins

* Add deletion of OIDC connections

* fix test

* crash and reconnect view if deletion failed
2022-06-17 08:55:17 -07:00
Jamil
70f08fc8f4 Minor usability fixes (#723) 2022-06-16 17:26:20 -07:00
Jamil
e3133ec49f Decrease OIDC refresh interval to 10 minutes (#720) 2022-06-16 12:46:38 -07:00
Po Chen
6af6259b56 add display and copy key (#714) 2022-06-15 20:59:24 -07:00
Po Chen
0e466d2e6c Esbuild (#716)
* replace webpack with esbuild

* rename

* watcher

* revert

* newlines

* change script name back

* newline

* delete comments
2022-06-15 09:37:24 -07:00
Gabi
1746dc5731 Add source ip option for fz_wall (#715)
* Add source ip option for fz_wall

Fixes firezone/product#393

* Swap source/dest parameters in fz_wall
2022-06-14 22:31:14 -07:00
Jamil
342c26312f Hide unused MFA methods (#707) 2022-06-14 11:31:03 -07:00
Jamil
221739edeb 0.4.0 (#688)
* Bump npm

* Bump deps for dependabot issues

* MFA (#660)

* 2fa wip

add encrypted map

gen schema

add nimble_totp

add module doc

add qrusty

bump base to enable use of qrusty

requires a newer version of glibc

Revert "add qrusty"

This reverts commit 27eaf7864ea98578186c53ed4c5f650e244e8ede.

cannot be used on bionic

add eqrcode

scaffold

extract renderQR

Revert "add eqrcode"

This reverts commit fe6f74f18f13dfcc92dbdace657d194e5536e164.

use frontend qr code generation

display MFA methods

add description

* wip

* finish mfa totp addition workflow

* use real user

* allow deleting authenticator

* use valid? and :since

* make credo happy

* use mfa

* make credo happy

* add account page for unprivileged users

* eof

* add unit tests

* add integration tests

* Workaround for SSH dropping by not using random port (#697)

* Bump npm

* Bump deps for dependabot issues

* Workaround for SSH dropping by not using random port

Fixes #478

Co-authored-by: Jamil Bou Kheir <jamilbk@users.noreply.github.com>

* Update repo README (#700)

* update main readme

* add link

* update badges

* remove redundant copy

* Fix show-config to display current config (#703)

Fixes #553

* Minor MFA fixes (#704)

* Fix conflicting cache-control header (#706)

* Add manual refresh (#705)

* Add manual refresh

* Align button right

Co-authored-by: Jamil Bou Kheir <jamilbk@users.noreply.github.com>

Co-authored-by: Po Chen <chenpaul914@gmail.com>
Co-authored-by: Gabi <gabriel@firezone.dev>
Co-authored-by: Jason G <52545545+gongjason@users.noreply.github.com>
2022-06-14 09:19:56 -07:00
Po Chen
f7c1a545ea Hide footer content (#695)
* Hide footer content

* a few seconds is sufficient
2022-06-11 19:12:34 -07:00
Po Chen
4ac4818bed Prevent last admin from being deleted (#694)
* Prevent last admin from being deleted

* fix tests
2022-06-09 19:57:39 -07:00
Po Chen
b5dc6b36fd migrate refresh token to text (#693) 2022-06-09 19:55:22 -07:00
Gabi
58072952f7 Lock wireguardex version (#686) 2022-06-07 09:29:09 -07:00
Andrew Rousset
836bfda9e2 Add wireguardex dependency to fz_vpn (#676) 2022-06-05 06:55:10 -06:00
Gabi
c67d9a81c4 Add cookie encryption salt to session (#671)
Closes firezone/product#365
2022-06-01 09:57:55 -07:00
Jamil
795416f9f2 Use normalized CIDR for nftables (#667) 2022-05-31 21:44:18 -07:00