Commit Graph

33 Commits

Author SHA1 Message Date
Andrew Dryga
ce932ffd90 fix(portal): Remove token provider and implement separate flow for service accounts (#3146)
Closes #2501
2024-01-10 10:33:10 -06:00
Andrew Dryga
ed5437c881 security(portal): Rework auth tokens (#2696)
- [x] make sure that session cookie for client is stored separately from
session cookie for the portal (will close #2647 and #2032)
- [x] #2622
- [ ] #2501
- [ ] show identity tokens and allow rotating/deleting them (#2138)
- [ ] #2042
- [ ] use Tokens context for Relays and Gateways to remove duplication
- [x] #2823
- [ ] Expire LiveView sockets when subject is expired
- [ ] Service Accounts UI is ambiguous now because of token identity and
actual token shown
- [ ] Limit subject permissions based on token type

Closes #2924. Now we extend the lifetime for client tokens, but not for
browsers.
2024-01-09 13:36:21 -06:00
Andrew Dryga
2c169d58ff Remove client names unique constraint (#2982)
Closes #2980
2023-12-21 10:44:09 -06:00
Jamil
de0a0b911b Use more informative log filepath (#2910)
* Sort clients list by `last_seen_at` desc. This handles the `online?`
case too. Before, they were sorted by `asc` which made it hard to see
which recent clients were connected
* Scope the client log filename by account slug and actor name so it's
easier to find.
2023-12-14 19:45:50 +00:00
Gabi
8e34457340 Add support for DNS sudomains (#2735)
This PR changes the protocol and adds support for DNS subdomains, now
when a DNS resource is added all its subdomains are automatically
tunneled too. Later we will add support for `*.domain` or `?.domain` but
currently there is an Apple split tunnel implementation limitation which
is too labor-intensive to fix right away.

Fixes #2661 

Co-authored-by: Andrew Dryga <andrew@dryga.com>
2023-12-08 00:16:42 -05:00
Andrew Dryga
3b94152edd Do not log a crash when client token is expired 2023-12-07 19:06:41 -05:00
bmanifold
ef480e1acd Add routing option for sites (#2610)
Why:

* As sites are created, the default behavior right now is to route
traffic through whichever path is easiest/fastest. This commit adds the
ability to allow the admin to choose a routing policy for a given site.
2023-11-22 19:59:54 +00:00
Andrew Dryga
8f1d76dde2 Add optional name field to relays (#2544)
The idea is to allow users to explicitly name them so they are easier to
identify in the UI.

@thomaseizinger we will need to add an optional `FIREZONE_NAME`
environment variable for the relays and send it along with other
attributes when you connect to a WebSocket.
2023-11-09 16:34:39 +00:00
Andrew Dryga
4deb5797ff Try to resolve country coordinates from LB-provided country code and use US as default 2023-10-31 18:50:20 -06:00
Andrew Dryga
ad26e508ff GeoIP routing and load-balancing for traffic (#2517) 2023-10-31 15:01:37 -06:00
bmanifold
01f7839d0f Update API Upstream DNS address encoding (#2534)
Why:

* The portal was not able to properly JSON encode the Clients Upstream
DNS struct.
2023-10-31 06:37:07 +00:00
bmanifold
043cd555aa Update DNS portal config (#2432)
Why:

* After further discussion around the Client DNS settings, it was
decided that keeping both `type` and `address` would be easier to help
with validation and parsing. At the moment, only IP DNS servers are
accepted, but placeholders for `DNS over TLS` and `DNS over HTTPS` have
been created.
2023-10-20 21:16:45 +00:00
bmanifold
c8090f8017 Update Account DNS settings UI (#2120)
Why:

* The previous Account DNS Settings page was only a static page. This
commit enables the form on the page to actually save and update the DNS
settings for a given account.
2023-10-02 14:19:48 -06:00
Andrew Dryga
2f78be155f Flows activity/metrics (#2176)
Charts library could be better, I did not find a way to configure
time-series min/max value or step, formatting Y axis is not trivial too,
but for an early feature this should do the job:

<img width="1728" alt="Screenshot 2023-09-27 at 20 00 10"
src="https://github.com/firezone/firezone/assets/1877644/8e4bef6b-2937-4dc2-ac31-3c61e31bffc6">
2023-09-30 16:04:33 +00:00
Andrew Dryga
1dac7d87a0 Do not show resources to clients that are not authorized to access them 2023-09-27 13:48:14 -06:00
Andrew Dryga
0b9dd334b4 Network flows (logs, auth) (#2166)
Closes https://github.com/firezone/firezone/issues/2095
Partially implements #949

<img width="1728" alt="Screenshot 2023-09-26 at 19 25 54"
src="https://github.com/firezone/firezone/assets/1877644/dffa8ae5-3095-4188-a1d2-3e8382e61628">
<img width="1728" alt="Screenshot 2023-09-26 at 19 26 03"
src="https://github.com/firezone/firezone/assets/1877644/853e8c90-eaae-4754-aea3-c58aba7cc97c">
<img width="1728" alt="Screenshot 2023-09-26 at 19 26 10"
src="https://github.com/firezone/firezone/assets/1877644/68aa9556-db11-4512-929a-45d1e4c3b258">
<img width="1728" alt="Screenshot 2023-09-26 at 19 26 17"
src="https://github.com/firezone/firezone/assets/1877644/020e0e98-142b-4b3b-aebf-789f2ad4e3c7">
2023-09-27 11:50:39 -06:00
Andrew Dryga
58e9c42bb6 Broadcast new ICE candidates (#2149)
Closes #2118
2023-09-25 16:40:26 -06:00
Andrew Dryga
e635ee3774 Properly set parent span ids for phoenix channels (#2101) 2023-09-20 22:21:34 -06:00
Andrew Dryga
9281b7fede Allow client logs and messages instrumentation (#2086)
Closes #2019
2023-09-18 15:03:51 -06:00
Andrew Dryga
86f04bff63 Trace api app and finish file renames (#2069) 2023-09-14 00:24:40 -06:00
Andrew Dryga
85b4aba9bc Rename Devices to Clients in Elixir app (#2008)
Renaming it back to clients to reflect service accounts and headless
clients use cases in the terminology. Such a rename will be very painful
on live data so better if we do it early on.

---------

Co-authored-by: Jamil Bou Kheir <jamilbk@users.noreply.github.com>
2023-09-13 12:37:27 +00:00
Andrew Dryga
782bbe9417 Add filters list to the resource view of a Gateway (#1987)
Closes https://github.com/firezone/product/issues/654
2023-09-12 18:46:27 -06:00
Andrew Dryga
8398e3013b Protect the magic links from account spoofing (#1990)
Closes https://github.com/firezone/product/issues/644
2023-09-07 18:23:33 -06:00
Andrew Dryga
e290f26298 Complete Actors, Devices and Groups UIs (#1885)
This will be done once the remaining UI code is covered with tests.
2023-09-02 05:35:52 +00:00
Andrew Dryga
3a5877eaa3 Update protocol to reuse gateway connections (#1825)
This is a result of our discussion with @conectado, this PR will add a
new message type which will allow reusing existing connections to the
gateway to access a new resource. We will also change the LB strategy to
be aware of the current device connection so that we will not pick a
different one if we have a connected gateway that can serve a new
resource.

---------

Co-authored-by: conectado <gabrielalejandro7@gmail.com>
2023-08-10 12:41:06 -05:00
Andrew Dryga
6f3df57df1 Resolve real client ips 2023-08-09 01:22:47 -05:00
Andrew Dryga
30800ddb75 Fix flaky test 2023-07-11 14:19:24 -06:00
Andrew Dryga
f10d298556 Do not render ipv6 relay address if it's nil 2023-06-27 17:59:57 -06:00
Andrew Dryga
e7d5d0579b Authentication for the live app (#1674)
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-06-27 13:11:36 -06:00
Andrew Dryga
e039f1919d Hotifx seeds and references (#1689) 2023-06-23 15:09:52 -06:00
Andrew Dryga
79a44ad0e8 Add resource type and expose it in WS API along with name (#1649)
Additionally:
1. Fixed ipv6 formatting for stun/turn addresses
2. Fixed a tests that check for race conditions concurrently
2023-06-07 15:48:00 -06:00
Andrew Dryga
d9eb2d18df Deployment for the cloud version (#1638)
TODO:
- [x] Cluster formation for all API and web nodes
- [x] Injest Docker logs to Stackdriver
- [x] Fix assets building for prod

To finish later:
- [ ] Structured logging:
https://issuetracker.google.com/issues/285950891
- [ ] Better networking policy (eg. use public postmark ranges and deny
all unwanted egress)
- [ ] OpenTelemetry collector for Google Stackdriver
- [ ] LoggerJSON.Plug integration

---------

Signed-off-by: Andrew Dryga <andrew@dryga.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-06-06 15:03:26 -06:00
Andrew Dryga
37a2d7b7f5 Move elixir code to a subfolder (#1631) 2023-05-24 15:46:51 -06:00