Show HN: Lockbox: forward proxy for making third party API calls
github.com
github.com
and that's not even getting into the assorted awesome HTTP request smuggling and SSRF vulns when 3 or more http implementations rub up against one another
This seems cool if there are more complex needs or configuration that can't be done with simple proxying and nginx rules.
There is OpenResty, a version of nginx [0]. It allows you to script all sorts of stuff with Lua inside nginx itself.
Tools like lockbox are not necessary, nginx, caddy, etc or heck even a normal 70 line python3 fastapi based script works just fine and should be more extendable than lockbox.
Well in that case you could make that argument about any piece of software.
There's always value in providing a simple tool for handling & automating the complexity found in 90% of use cases.
A normal 170 lines of Python3 Flask based script, but who's counting?
Btw cool startup! (ClearAlpha) , good luck with it !
It’s funny because as a passionate self-hoster, I consider as an advantage what you consider as a drawback.
I'm so jealous of PDS2 in the EU <https://www.berlin-group.org/> (although I guess it's easy for me to be jealous since I don't know if their banks actually implement the standards, but it's still a bunch better than the situation here)
Or, you can use something like GoCardless which provides a sort of aggregated API and "connection APIs" for making things simpler: https://gocardless.com/bank-account-data/
Not affiliated with them, but I do use GoCardless to automatically import transaction data from a couple of EU bank accounts to my local datastore.
> The license can be obtained within 6-9 months for the application fee of 6,800 EUR. The minimum capital requirement varies depending on the nature and scale of the AISP’s activities but is typically around 125,000 EUR. The amount is ultimately determined on a case-by-case basis by the Dutch Central Bank which is the regulator of the Dutch financial market.
I recall a similar experience linking Chase to my Schwab account.
I was pleasantly surprised that I was not asked to give my bank password to anyone but my bank.
Not a Plaid employee, just a dev completing their OAUTH approval form.
To access your own data, it needs to go from your bank, to a licensed Account Information Services Provider (AISP), to your budgeting app of choice, and finally to you. You can't utilize PSD2 without involving all of those 3rd parties because banks don't offer PSD2 APIs to consumers and I've only seen AISP services sold B2B. [1]
I'm someone who has no issues using 2FA everywhere and carrying around a Yubikey, but even I got fed-up with constant re-authentication requirements: Enter bank email & password, next, next, confirm, approve, yes I'm sure, now take out your phone, unlock it, open the bank app, log in there, confirm that prompt, yes, i'm really sure. Then it takes 1-2 minutes to "connect" your account and load the latest data. Repeat for every bank account, every 30 days.
It beats trusting your banking password to some random 3rd party, but it's a pretty terrible experience as an end-user if you ask me.
[1] Someone pointed out GoCardless which seems to accept private customers as well, a welcome surprise.
We do something similar with our tool (generative code thingy), where users can make API calls to various services (without credentials), and then we add the necessary auth tokens/headers for their code to actually run.
I'd love to give folks better control over their own data/credentials, Lockbox could be an interesting workaround without us having to build anything. Thanks and nice work!
https://github.com/stripe/smokescreen
Smokescreen is a HTTP CONNECT proxy. It proxies most traffic from Stripe to the external world (e.g., webhooks).
Smokescreen restricts which URLs it connects to:
It uses a pre-configured hostname ACL to only allow requests addressed to certain allow-listed hostnames, to ensure that no malicious code is attempting to make requests to unexpected services. It also resolves each domain name that is requested, and ensures that it is a publicly routable IP address and not an internal IP address. This prevents a class of attacks where, for instance, our own webhooks infrastructure is used to scan Stripe’s internal network. Smokescreen can also be further configured to allow or deny specific IP addresses or ranges.
- Location anonymization to fetch any resources like restaurants.
- Sensitive personal data encryption to verify credit info securely.
My guess is not all of the above could be easy/possible, its a leaky abstraction to think of APIs that way. But the biggest bang for the buck could be for privacy in the most mundane of usecases.
1. Run a Lockbox server
2. Define the API request in automation tool as a webhook.
3. Proxy it via lockbox to add auth.
All this really does it allow you to revoke auth at any time. As they can freely use the key. I see there are plans to restrict the requests allowed but doing that on the fully composed request it going to be extremely difficult to do reliably.
If you are already hosting some API why not do something like this instead.
1. Run a Lockbox server.
2. Send a webhook from the automation tool that just contains the relevant variables.
3. Lockbox composes the variabless into a request.
Basically if you want any sort of security and access control that is reliable you just want to send the parameters of the operation to Lockbox, then have the actual request generated on your server. Rather then doing the request generation in the automation tool then trying to validate that it was generated correctly.
> You can restrict access to external APIs in a more fine grained manner
I've done this very successfully for many APIs before. I've found weird things among providers where using AWS (or GCP or Azure) gives you crazy fine-grained access controls (which are great after you spend two days figuring out how to use them well), but, some of the low cost competitors have core services that work just as well but their APIs are entirely binary (either you have full access, or none) but by adding a thin API layer above that you can enable all sorts of useful things. Provider doesn't support R/O API keys for terraform plans? Just run a proxy which enables that. Provider won't allow you to give someone an API key which can only reboot VMs, but, not delete them? Just write a proxy which does.
Very powerful model if you adopt it well.
Relevant to OP, all platform auth creds are secured and not exposed after initial setup.
Separately, we just launched custom actions which allows anyone to extend existing public apps on Zapier with new endpoints (https://help.zapier.com/hc/en-us/articles/16277139110157-Cre...)
Noho ora mai
I really liked the layout:
- Why
- How Lockbox helps
- Main benefits
- Drawbacks
- How to run
- Design philosophy
I wish more projects would follow this format :)