Commit Graph

54 Commits

Author SHA1 Message Date
Anders Pitman
53aa3735a9 Implement managing clients through web UI 2022-02-17 13:38:27 -07:00
Anders Pitman
0a23c2fc0e Limit token permissions
Added the ability to scope tokens to a specific client. If
enabled, this has the affect of limiting the token to being used
to list tunnels for that specific client. It can't be used for
the web UI or for any state-changing actions such as creating
new tunnels.
2022-02-16 11:44:24 -07:00
Anders Pitman
20eeeb53e9 Move a bunch more code into namedrop 2021-12-30 22:05:29 -07:00
Anders Pitman
f8281d95a4 Move some stuff into namedrop library 2021-12-30 20:57:28 -07:00
Anders Pitman
f087863a4b Remove remaining dnsapi code 2021-12-30 17:20:55 -07:00
Anders Pitman
988bb37bad First draft namedrop API integration 2021-12-30 01:00:52 -07:00
Anders Pitman
e83df3478f Improve TakingNames.io request generation
Before we were pre-generating a DNS request ID every time the
add tunnel page was visited. Now we have a separate endpoint for
generating the IDs only after the user indicates they actually
want to perform a TakingNames.io domain request.
2021-12-23 00:02:28 -07:00
Anders Pitman
a3140efb20 Implement domain request failure 2021-12-21 15:18:08 -07:00
Anders Pitman
53946e878f Removed unused tunMan from ui_handler.go 2021-12-21 14:05:14 -07:00
Anders Pitman
0934799ccd Clean up Tunnel struct a bit
Removed unused CssId and moved members that should eventually be
removed from the API surface (ie internal values) to be together
so they're easier to identify later.
2021-12-21 13:57:56 -07:00
Anders Pitman
b795ee0bc9 Remove unused custom SSH key code
Was originally planning to allow people to upload public keys to
use for tunnels, but so far no one has asked for this and I
haven't needed it.
2021-12-21 13:14:01 -07:00
Anders Pitman
7c6077a0fe Implement admin domain with bootstrap domain
TakingNames.io now provides bootstrap domains, which simply
creates an A record based off the ip address of the requesting
server, without requiring any authorization. This allows
boringproxy to always use HTTPS, even when getting the admin
domain.
2021-12-19 21:24:52 -07:00
Anders Pitman
49c467f85c Rename webdo to dnsapi
Still need a better name
2021-12-19 17:08:11 -07:00
Anders Pitman
5db952a069 Improve security of TakingNames.io integration
The requests themselves now must be retrieve from the boringproxy
server by TakingNames.io, over HTTPS. This provides several
security benefits:

* You can tell the user the request is coming from a specific
  domain.
* Requests are tied to an ephemeral request-id, to prevent
  prebuilt phishing links.

There is currently a single hard-coded exception for setting a
single A record for an IP address. This is needed for
bootstrapping a service that doesn't have any certs yet (ie the
boringproxy admin domain), and will need to display a big scary
message to users.
2021-12-18 17:40:59 -07:00
Anders Pitman
2d4465f665 Use the admin domain with HTTPS for redirect
When using TakingNames.io for getting a domain for a new tunnel,
previously it redirected to the public IP of the server over HTTP.

Now uses the admin domain over HTTPS.
2021-12-17 22:22:44 -07:00
Anders Pitman
334549cb05 First draft of TakingNames.io integration 2021-12-15 14:34:06 -07:00
Anders Pitman
ffe05ccdb4 Simplify tunnel editor page 2021-12-14 16:52:26 -07:00
Anders Pitman
898a520c55 Run go fmt 2021-12-14 14:54:32 -07:00
Anders Pitman
d13486ce2c Fix logo loading 2021-12-14 14:54:16 -07:00
Anders Pitman
94a3316e2f Remove old CSS UI 2021-12-14 14:44:04 -07:00
Anders Pitman
60fbfac081 Implement first draft of HTML UI
The UI was originally written using fancy HTML checkbox toggle
hacks in order to make the UI very fast. It's cool but complicated
and difficult to change. In order to make updates to the UI more
quickly, I'm changing it to use traditional HTML with full page
reloads for navigation. It's not as fast but much simpler.
2021-12-14 14:06:25 -07:00
Anders Pitman
20f7d53c0f Rename instances of BoringProxy
Full name isn't necessary now that it's a library.

BoringProxy -> Server
BoringProxyClient -> Client
BoringProxyConfig -> Config
2020-12-07 21:50:33 -07:00
Anders Pitman
45f609b8ba Move executable into separate package
Enables us to move towards being able to import as a library.
2020-12-07 21:41:45 -07:00
Anders Pitman
98a6ff52fc Delete tokens when user is deleted
Also added DeleteUser to API
2020-10-30 18:50:24 -06:00
Anders Pitman
6b9f9aa413 Implement creating users and tokens from REST API 2020-10-29 17:56:38 -06:00
Anders Pitman
4fd830167f Fix more security holes 2020-10-27 15:21:56 -06:00
Anders Pitman
3a705cf252 Fix QR codes not rendering for admin 2020-10-27 14:51:59 -06:00
Anders Pitman
51dce1876d Fix token delete security bug 2020-10-27 14:48:22 -06:00
Anders Pitman
b3f1636be6 Fix some security issues
* The CSS styles were leaking information about tunnels, even for
  things like the login page, which can be sent to anyone.
* Tokens could be created for any user by any user.
2020-10-26 12:18:51 -06:00
Anders Pitman
1abc141d13 Make client selection a dropdown
Also implemented adding and deleting clients through the API.
2020-10-24 16:48:53 -06:00
Anders Pitman
1607d41e5c Add button for downloading private keys
Allows users to access tunnels using standard SSH clients.
2020-10-24 14:12:18 -06:00
Anders Pitman
2ca14901fc Disable custom SSH keys for now
Not sure the feature is boring enough to keep. There are some tricky
things that still need to be solved like figuring out how to let
tunnels share the same public key, since the OpenSSH server seems to
only pick up the first instance of each key in the authorized_keys
file.

Also, what happens if someone wants to use their normal SSH key for
the server for a boringproxy tunnel. I could easily introduce a bug
that would lock someone out of their server in certain corner cases.

I think adding the ability to download the private key for each tunnel
will handle most cases for now.
2020-10-24 13:27:41 -06:00
Anders Pitman
8477391273 Implement using custom SSH keys 2020-10-23 20:56:55 -06:00
Anders Pitman
f9f2155ab1 Add logo for favicon 2020-10-21 10:53:51 -06:00
Anders Pitman
9882017d5a Add ClientAddress
Allows tunnels to specify what address the client with connect to
for upstream connections.

Also changed the tunnel-adder UI.

Also fixed a bug where invalid domains would crash. Needed to
properly return an error dialog.
2020-10-20 18:52:32 -06:00
Anders Pitman
84e00161bd Implement request logging
Added logs to stdout, and cleaned up some of the stderr ones.
2020-10-18 19:29:57 -06:00
Anders Pitman
0e39e9dd57 Add QR code login URLs for tokens
Also set cookies to max age of a year rather than session cookies.
2020-10-18 18:39:30 -06:00
Anders Pitman
18e09120a7 Change delete to work without a page navigation.
Uses more CSS checkbox hackery.
2020-10-17 08:42:29 -06:00
Anders Pitman
bdc1721870 Delete pending requests 2020-10-16 11:24:13 -06:00
Anders Pitman
cca211de0e Implement loading screen for slow requests 2020-10-16 11:21:41 -06:00
Anders Pitman
e51b304275 Make tunnel delete buttons pure CSS 2020-10-16 09:40:46 -06:00
Anders Pitman
2eafde030e Clean up menu stuff
Also only send /users page when isAdmin is true
2020-10-15 13:20:59 -06:00
Anders Pitman
7df93c0821 Highlight selected page
Needed to change HTML architecture to inline multiple independent
copies of the menu. There might be a cleaner way to do this, but
it will work for now.
2020-10-15 13:01:15 -06:00
Anders Pitman
f911ca3b1a Implement logout button 2020-10-15 10:05:09 -06:00
Anders Pitman
4c78059e66 Overhaul UI architecture
Learned about the :target CSS selector, which can be used to
replace content depending on the current URL hash. This allows
making a sort of single page app without JavaScript.

Currently experimenting with returning all the pages in a single
request, then switching between them with :target. Seems to be
working quite well so far.
2020-10-15 09:50:12 -06:00
Anders Pitman
770440ef79 Handle DeleteTunnel for UI in API 2020-10-14 10:42:54 -06:00
Anders Pitman
fb8d379663 Create UI tunnels through API 2020-10-14 10:29:19 -06:00
Anders Pitman
a4fa2862e4 Use random server ports for tunnels 2020-10-14 09:47:46 -06:00
Anders Pitman
cfcd781276 Filter UI requests through API
API is now the central control point for making authorized
requests. The current architecture is:

* db simply returns all data
* api uses tokens to filter data from db. It includes methods for
  returning objects, and HTTP endpoints for return JSON.
* ui calls the api functions to get filtered data.
2020-10-14 09:17:04 -06:00
Anders Pitman
85d67e262a Do more authorization checking
Limit certain information based on user and whether they're an
admin.
2020-10-13 11:21:42 -06:00