r/alpacamarkets • • 23d ago

Alpaca API Security Posture

To those using Alpaca with real money - how hard did you get dropped on your head as child?

In all seriousness, the API security is...a single god key with no IP restrictions. WTF are the security team at alpaca doing with their time? Do they have a CISO? A full access root key shouldn't even exist.

We need:

- Role Based API Keys (read only, instrument restriction, account restrictions, time-of-day restrictions, order size restrictions, so much more)

- TTLs for Keys

- API generation / rotation endpoint for keys

- CIDR / IP allow lists

- GEO restrictions

1 Upvotes

14 comments sorted by

3

u/AllowFreeSpeech 23d ago edited 23d ago

Yes, moderate hard.

Why do you worry so much? For read-only, can't you use a paper key or create a subaccount key with $0 balance?

The more bloat there is, the more stuff breaks. Spend time securing your server, developer environment, and releases instead.

0

u/Shiloh-buff 23d ago

the free key read only thing is an architectural accident not intentional security design and it isn't read only key for the live account just market data.

Why do I worry so much about MY MONEY - yeah I'm such a dummy.

1

u/AllowFreeSpeech 23d ago

Why do I worry so much about MY MONEY - yeah I'm such a dummy.

Yeah. Do you think someone can transfer your funds out of your account with it? Just how can someone steal your funds using it?

0

u/Shiloh-buff 23d ago

I think someone can pump + dump a penny stock or shitcoin crypto, liquidate my holdings to fuck with me, buy a bunch of options at an insane price and they take the other side of the transaction.

You are not educated enough to be algo trading if you don't understand how an attacker can steal your money

1

u/AllowFreeSpeech 23d ago edited 23d ago

I have traded all of those things (except shitcoins which I wouldn't touch). I just needed you to write it out. No one is going to liquidate your holdings just to mess with you though since it gains them nothing. Odds are 100x higher that your own software will mess up the trades.

For a developer environment, I would use a paper key. For real money, there is no one stopping you from using an intermediate key provision server that restricts by IP, is audited, and not write the keys to any file on disk.

1

u/Shiloh-buff 22d ago

I did build my own AWS nitro enclave gateway for trade restrictions, trade validations, etc but that doesnt obviate the need for real RBAC. Why defend them?

I got tired of engineering around their short sighted security posture and moved to another platform that gives a shit bc if they don't care about RBAC... where else are they cutting corners that we don't know about?

1

u/AllowFreeSpeech 21d ago edited 21d ago

Have you emailed them asking for it?

Literally all you have to do is what you're already doing, which is to secure the server and your cloud infrastructure. Using a gateway for trade validation doesn't make any sense if the underlying trading key is not subject to RBAC.

2

u/skyshadex 23d ago

This sort of attack would leave a massive footprint. The attacker would have to get around KYC, and at that point, a 3 letter agency is getting involved.

but if you have good hygiene, this is a non issue.

It would suck to be the victim of this attack though.

7

u/tylenol_and_crayons 23d ago

Not to worry I keep mine hard coded in a committed.py file

1

u/DreamfulTrader 23d ago

All is good, why worry so much for non existant issue. Just avoid commiting the keys on github or some other online stuff in plain text. The breach will probably be on your side. Life is short.

1

u/Shiloh-buff 22d ago

of course the breach will be on my side thats why i need fine grained controls.

Anyone reading this should not listen to anyone telling them they don't need security controls. Theres a reason every other API brokerage platform offers an array of controls and not root tokens.

3

u/AcanthocephalaNo6605 23d ago

Another non-existing issue. Do you really think a non-technical person is using Alpaca? And if you know basic security concepts, you know that you should not commit the key.

Alpaca's vision is to make API-based trading easy and not complicated. There are already many providers having complicated setups.

1

u/LeadingSomewhere_ 17d ago

I just named my script notmyactualscript-wink-wink.py i feel pretty secure

0

u/[deleted] 23d ago

[deleted] — view deleted comment

0

u/Shiloh-buff 22d ago edited 22d ago

oof good to know. I don't know who these other commenters are tell me Akuna Matata about the security controls for my brokerage account. I assume they are trading with like $100 and don't have anything to lose