πŸ”’ Private Access

DeadCatFound is in development.
Enter your access code to continue.

Incorrect access code.
← DeadCatFound
Courses Performance Live Trades
Track 07 β€” Operational SecurityS-01
Why Security Matters for Traders
You built a system that handles real money, real API keys, and live brokerage access. That makes you a target. This module explains exactly what's at stake β€” and why most traders don't take it seriously until it's too late.

The Attack Surface of a Retail Trading Firm

When you build an automated trading firm β€” even a small one β€” you create an attack surface that most people don't think about. You're running:

  • Brokerage API keys with trading permissions (IBKR, Alpaca, Binance)
  • Claude/OpenAI API keys with spending authority tied to your credit card
  • Telegram bot tokens that can trigger real trades via command
  • Public-facing web properties revealing your strategies, positions, and infrastructure
  • A machine running 24/7 connected to the internet and your home network

Any single one of these, compromised, can result in financial loss β€” and the attacker doesn't need to be sophisticated. Credential stuffing, phishing, open ports, and misconfigured cloud services are the vectors that actually cause breaches, not Hollywood hacking.

Real Scenario: What a Breach Looks Like
An attacker finds your IBKR API key committed to a public GitHub repo. They make 50 trades in 4 minutes β€” all losses, designed to drain your account fast. Your launchd strategy runs at 9:35 AM and submits another $25K order on top. By the time you get the Telegram alert, the account is wiped. This scenario is not hypothetical. It happens to retail traders every month.

The Threat Landscape

Common Attack Vectors for Retail Traders
Attack VectorLikelihoodImpactWhere It Hits
API key in public repoVery HighCatastrophicGitHub, Gist, Pastebin
Hardcoded creds in scriptsHighCatastrophicAny shared machine
Open brokerage API (no IP whitelist)MediumAccount wipeStolen key scenario
Unprotected dashboardMediumStrategy exposure*.workers.dev URLs
Local network attackerMediumFull machine accessSame WiFi network
Phishing / credential theftMediumAccount takeoverEmail, Telegram
Unsecured SSH portMediumFull remote accessRemote machine

The Mindset Shift

Security is not a feature you add at the end. It's a property of every decision you make while building. The good news: 90% of retail trader breaches are preventable with a small set of non-negotiable practices β€” all covered in this course. None of them require enterprise tools or a security team.

What This Course Covers
Zero Trust access architecture, API key storage and rotation, dashboard hardening, local network threats, machine-level firewall configuration, credential management, and what to do when something goes wrong. By the end, your firm runs on a security posture that most professional hedge funds would recognize.
Track 07 β€” Operational SecurityS-02
Zero Trust Architecture
Zero Trust means: never trust, always verify. No device, user, or service is trusted by default β€” regardless of whether it's inside or outside your network. This is how professional firms operate, and you can implement it for free.

The Old Model vs. Zero Trust

The traditional security model assumes everything inside your network is safe. Zero Trust flips this: trust is never implicit, always earned, and always time-limited. Every request must authenticate, every session must be authorized, and every access must be logged.

Traditional vs. Zero Trust Model
DimensionTraditionalZero Trust
Default assumptionInside = trustedNothing is trusted
IdentityNetwork locationVerified per-request
Access scopeBroad (once in, broad access)Least-privilege only
Breach impactLateral movement is easyBlast radius is contained
MonitoringPerimeter onlyEvery request logged

Cloudflare Zero Trust β€” What It Is and Its Limits

Cloudflare Zero Trust (Access) is a free service that places an identity gate in front of any application on a domain you control. Anyone trying to visit your dashboard is required to authenticate via email OTP, Google, or GitHub SSO before seeing any content.

Critical limitation: Cloudflare Zero Trust only protects domains in your Cloudflare account DNS zone. The *.workers.dev subdomain is a Cloudflare-managed domain β€” it is NOT in your DNS zone and CANNOT be protected by Zero Trust Access. This is why the client-side password gate exists for the DeadCatFound courses.

The Fix: Custom Domain
To use Zero Trust on your Workers sites, point a domain you own (e.g., deadcatfound.io) to Cloudflare, then deploy your Workers under that domain. Zero Trust Access can protect anything under a domain you control in Cloudflare.

Setting Up Zero Trust on Your Dashboard

Your firm dashboard (firm-dashboard.christopherpwhite31087.workers.dev) is currently accessible to anyone who knows the URL. If it's deployed under a custom domain, here's how to protect it:

  • Go to Cloudflare Dashboard β†’ Zero Trust β†’ Access β†’ Applications
  • Click Add an Application β†’ Self-hosted
  • Enter your domain (e.g., dashboard.yourdomain.com)
  • Create a policy: Email β†’ Allow β†’ your email address
  • Choose login method: One-time PIN (email) β€” simplest, no OAuth setup needed
  • Save and test in an incognito window β€” you should see a login prompt

Zero Trust Principles for the Firm

  • Every external service requires authentication β€” no anonymous access to dashboards, no open APIs
  • Least privilege on every API key β€” read-only when possible, trading permissions only when required
  • Short-lived sessions β€” set Zero Trust session duration to 8 hours, not "never expire"
  • Device posture checks (advanced) β€” require that the accessing device has disk encryption enabled
  • Log everything β€” Cloudflare Zero Trust logs every access attempt; review weekly
Track 07 β€” Operational SecurityS-03
API Key Security
Your API keys are the keys to the kingdom. A leaked IBKR key means someone can trade your account. A leaked Claude key means someone can run up a $10,000 bill on your credit card overnight. Treat them like cash.

The Cardinal Rules

Non-Negotiable Rules
1. Never hardcode a key in source code. Not even temporarily. Not "just for testing."
2. Never commit a key to git. Even if the repo is private β€” employees get fired, accounts get compromised, repos get made public by accident.
3. Never share a key over Telegram, Slack, email, or Discord. Those channels are not encrypted end-to-end for this purpose.
4. Use the minimum permissions a key needs. A data-pull script doesn't need trading permissions.

How to Store API Keys Properly

Key Storage Methods β€” Ranked
MethodSecurityConvenienceRecommendation
Hardcoded in scriptNoneHighNever
Environment variable (shell)LowHighDev only
JSON config file (chmod 600)MediumHighAcceptable for local scripts
macOS Keychain / secret storeHighMediumRecommended
1Password CLI (op run)Very HighMediumRecommended
Cloudflare Workers SecretsVery HighMediumFor production Workers

File Permissions β€” The Immediate Fix

If you're using JSON config files to store keys (like config/alpaca.json or config/ibkr.json), they should be readable only by your user account. This prevents other processes and users on the machine from reading them:

terminal β€” secure config files
# Lock down all credential files β€” owner read/write only chmod 600 ~/christs-first-firm/config/alpaca.json chmod 600 ~/christs-first-firm/config/ibkr.json chmod 600 ~/.ssh/id_rsa # Verify (should show -rw-------) ls -la ~/christs-first-firm/config/ # Make sure .gitignore covers them β€” add if missing echo "config/alpaca.json" >> ~/christs-first-firm/.gitignore echo "config/ibkr.json" >> ~/christs-first-firm/.gitignore echo "*.env" >> ~/christs-first-firm/.gitignore

IP Whitelisting on Brokerage APIs

Most brokerages allow you to restrict API key usage to specific IP addresses. This is one of the highest-value, lowest-effort security controls available. Even if a key leaks, it cannot be used from any IP other than your home or server.

  • IBKR: TWS API connections are bound to localhost by default β€” this is actually secure. For IB Gateway, keep the trusted IP list to your machine only.
  • Alpaca: Go to Paper Trading API Keys β†’ IP Restriction β†’ add your static IP or home IP range.
  • Binance: API Management β†’ Edit β†’ Restrict access to trusted IPs only. This is critical for crypto β€” do this now.
  • Claude/OpenAI: These don't support IP whitelisting, so key rotation and spending limits are your controls instead. Set monthly spend limits in the API settings.

Key Rotation

Rotate every API key on a schedule β€” even if you don't think it's been compromised. Rotation limits the window of exposure if a key was silently stolen. Recommended cadence:

  • Brokerage keys: every 90 days
  • AI API keys: every 60 days, or any time you share access with a script/agent
  • Telegram bot tokens: after any suspected compromise β€” invalidate immediately
Track 07 β€” Operational SecurityS-04
Dashboard & Infrastructure Hardening
Your public-facing infrastructure reveals more than you think. A strategy dashboard showing open positions, P&L, and entry prices is a roadmap for front-runners, copycats, and attackers. Harden it before it's public.

What Your Dashboard Reveals

An unprotected trading dashboard exposes:

  • Open positions β€” exactly what you're holding, at what size
  • Entry prices β€” revealing your cost basis and likely stop levels
  • Strategy logic β€” patterns in your trades reveal which signals you're using
  • Infrastructure topology β€” Cloudflare Worker names, script paths, update cadence
  • Account size β€” position sizing reveals approximate capital
Front-Running Risk
If a large-enough actor can see your positions before you execute, they can trade ahead of you. This is called front-running. Even at small scale, revealing your position size and strategy pattern to other retail traders is a competitive disadvantage you've given away for free.

Cloudflare-Specific Hardening

  • Workers environment variables β€” use wrangler secret put SECRET_NAME to inject secrets as environment variables, never hardcode them in worker code
  • Disable directory listing β€” Cloudflare Workers with static assets do not expose directory listings, but ensure your wrangler.jsonc is not committing credential files
  • Custom error pages β€” don't expose stack traces or internal paths in error messages visible to users
  • Rate limiting β€” Cloudflare's WAF rules can block brute-force attempts on password-protected pages
  • Audit log access β€” Cloudflare Zero Trust logs every successful and failed access attempt; review the logs weekly

Secrets in Cloudflare Workers

terminal β€” cloudflare worker secrets
# Store a secret (not in code, not in wrangler.jsonc) wrangler secret put TELEGRAM_BOT_TOKEN # Enter value when prompted β€” it's encrypted at rest # List secrets for a worker wrangler secret list # Access in worker code as an environment variable: # env.TELEGRAM_BOT_TOKEN

Security Headers

If you build a Worker that serves HTML, add these security headers to prevent clickjacking, XSS, and content injection:

worker.js β€” security headers
// Add to any fetch handler response const secureHeaders = { "X-Frame-Options": "DENY", "X-Content-Type-Options": "nosniff", "Referrer-Policy": "no-referrer", "Strict-Transport-Security": "max-age=63072000; includeSubDomains", "Content-Security-Policy": "default-src 'self'", }; return new Response(html, { headers: { "Content-Type": "text/html", ...secureHeaders } });

The Public vs. Private Split

Decide intentionally what is public-facing and what is private. A reasonable split for a retail trading firm:

  • Public: Educational courses (DeadCatFound), newsletter, about page
  • Private (gated): Live positions dashboard, strategy details, trade history with sizing, agent logs
  • Local only: API keys, brokerage configs, launchd plist details, Paperclip admin panel
Track 07 β€” Operational SecurityS-05
Local Network Threats
The attacker doesn't need to cross the internet. If they're on your WiFi β€” at a coffee shop, a co-working space, or even your home network with a compromised device β€” they're already inside. This is the threat most traders never think about.

The Local Network Attack Surface

When your trading machine is connected to any network β€” home WiFi, office ethernet, or a hotspot β€” other devices on that network can potentially reach your machine. The key question is: what are you listening on?

🎭
ARP Spoofing (Man-in-the-Middle)
An attacker poisons ARP tables to intercept traffic between your machine and the router.

Same network segment

Unencrypted HTTP, DNS queries

HTTPS everywhere, VPN, static ARP

If your dashboard or scripts call any API over plain HTTP on the local network, an ARP-spoofing attacker can read or modify those responses. Always use HTTPS β€” never HTTP β€” even on local networks.

πŸ”
Port Scanning & Service Discovery
A local attacker scans your machine to find open ports and vulnerable services.

nmap, masscan, zmap

Paperclip (:3100), SSH (:22), Postgres (:5432)

macOS firewall, bind to localhost

Every service you run that listens on 0.0.0.0 (all interfaces) is visible to your entire network. Bind services to 127.0.0.1 (localhost only) unless they explicitly need to be network-accessible.

↔️
Lateral Movement
An attacker who compromises one device on your network pivots to attack others.

Any network device (smart TV, phone, printer)

Your trading machine with keys and scripts

Network segmentation, firewall, strong auth

A compromised IoT device β€” your smart thermostat, TV, or a guest's laptop β€” can be used as a jump host to scan and attack your trading machine. Network segmentation (putting IoT devices on a separate VLAN or guest network) eliminates this pivot path.

πŸ“‘
Rogue Access Points & Evil Twin Attacks
A fake WiFi network mimics your trusted network to intercept connections.

Coffee shops, airports, co-working

Login credentials, API calls, session tokens

VPN always on public WiFi

Never run trading scripts or access brokerage dashboards on public WiFi without a VPN. A VPN encrypts all traffic before it leaves your machine, making WiFi-level interception useless.

The Home Network Fix

  • Put IoT devices (smart speakers, TVs, printers) on a separate guest WiFi β€” isolated from your trading machine
  • Use WPA3 on your main WiFi if your router supports it
  • Change your router admin password from the default
  • Disable UPnP on your router β€” this allows devices to open ports to the internet without your knowledge
  • Enable your router's firewall β€” most consumer routers have this off by default
Track 07 β€” Operational SecurityS-06
Securing Your Trading Machine
The machine running your trading firm is a production server. Treat it like one. This means a properly configured firewall, minimal exposed services, disk encryption, and no unnecessary access paths.

macOS Firewall β€” Enable It Now

macOS ships with a built-in application-layer firewall that blocks incoming connections. It's off by default. Turn it on:

terminal β€” enable macos firewall
# Enable the firewall (requires sudo) sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on # Enable stealth mode β€” don't respond to pings or port probes sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setstealthmode on # Check status sudo /usr/libexec/ApplicationFirewall/socketfilterfw --getglobalstate # Or use System Settings β†’ Network β†’ Firewall (GUI)

Bind Services to Localhost

Every service you run that only needs to be accessed from your own machine β€” Paperclip, Postgres, Ollama, llama.cpp server β€” should bind to 127.0.0.1 (localhost) instead of 0.0.0.0 (all interfaces). This makes them invisible to your network.

  • Paperclip runs on localhost:3100 by default β€” good, don't change it
  • Postgres (Paperclip's embedded DB) binds to localhost β€” do not change the pg_hba.conf
  • Ollama binds to 127.0.0.1:11434 by default β€” do not expose this
  • IBKR TWS/Gateway API binds to localhost β€” only loosen this if you know exactly why

FileVault β€” Full Disk Encryption

If your machine is stolen or physically accessed, disk encryption is your last line of defense. macOS FileVault encrypts your entire disk. With a strong login password, a stolen machine reveals nothing.

terminal β€” check filevault status
# Check if FileVault is enabled fdesetup status # If not enabled: # System Settings β†’ Privacy & Security β†’ FileVault β†’ Turn On # Save your recovery key in 1Password or print it

SSH Hardening

If you use SSH to access your machine remotely, harden it:

  • Disable password authentication β€” use SSH keys only
  • Disable root login β€” PermitRootLogin no in /etc/ssh/sshd_config
  • Change the default port (optional) β€” reduces automated scan noise
  • Use AllowUsers to restrict which users can SSH in
  • Consider Cloudflare Tunnel instead of exposing SSH to the internet at all

Software Hygiene

  • Keep macOS updated β€” security patches, not just features
  • Review installed npm/pip packages β€” supply chain attacks via package dependencies are real
  • Don't run as root for any trading scripts β€” use your normal user account
  • Lock your screen when away β€” set a 5-minute screen lock timeout
  • Enable Find My Mac β€” remote wipe capability if the machine is stolen
Track 07 β€” Operational SecurityS-07
Credential & Secret Management
Storing credentials correctly is not optional β€” it's foundational. This module covers the professional approach: password managers, secret injection, .gitignore hygiene, and the tools that make it sustainable.

1Password CLI β€” The Right Tool

1Password CLI (op) allows you to inject secrets from your 1Password vault into any script or environment at runtime β€” without ever writing them to disk in plaintext. Your scripts reference secrets by name; the actual values live only in the encrypted vault.

terminal β€” 1password cli setup
# Install brew install 1password-cli # Sign in op signin # Store a secret (from terminal) op item create --category=login --title="IBKR API Key" \ --field label=api_key,value="YOUR_KEY_HERE" # Inject at runtime β€” run any script with secrets from vault op run --env-file=.env.tpl -- python3 scripts/momentum_v10_executor.py # .env.tpl format (references vault items by name): # IBKR_API_KEY=op://Personal/IBKR API Key/api_key # CLAUDE_API_KEY=op://Personal/Claude API/credential

macOS Keychain

For simpler setups, macOS Keychain is a built-in secure secret store available to any script on your machine:

python β€” read from keychain
import subprocess, json def get_keychain_secret(service: str, account: str) -> str: """Retrieve a secret from macOS Keychain.""" result = subprocess.run( ["security", "find-generic-password", "-s", service, "-a", account, "-w"], capture_output=True, text=True ) if result.returncode != 0: raise ValueError(f"Keychain secret not found: {service}/{account}") return result.stdout.strip() # Store via terminal: # security add-generic-password -s "ibkr" -a "api_key" -w "YOUR_KEY" api_key = get_keychain_secret("ibkr", "api_key")

.gitignore β€” The Essential File

Every project that handles credentials needs a comprehensive .gitignore. Here's the minimum for a trading firm:

.gitignore β€” trading firm essentials
# Credentials β€” NEVER commit these config/alpaca.json config/ibkr.json config/binance.json *.env .env* secrets/ credentials/ # Python __pycache__/ *.pyc *.pyo .venv/ venv/ # macOS .DS_Store .AppleDouble # Logs (often contain sensitive data) logs/ *.log # Database files *.db *.sqlite

YubiKey β€” Hardware Authentication

A YubiKey is a physical hardware security key that acts as a second factor for logins. Even if an attacker has your password, they cannot log in without the physical key in your hand. Recommended for:

  • Your brokerage account logins (IBKR, Alpaca, Binance)
  • Your Cloudflare account (protects your Zero Trust config)
  • Your GitHub account (protects your code repos)
  • Your Google/Apple account (protects everything tied to it)

The YubiKey 5C NFC (~$55) supports USB-C and NFC and works with every major platform. It's the single highest-ROI security investment available to a retail trader.

The Security Stack Priority Order
1. Fix .gitignore β€” takes 5 minutes, prevents catastrophic leaks
2. chmod 600 all credential files β€” takes 30 seconds
3. IP whitelist your brokerage API keys β€” takes 5 minutes
4. Enable FileVault disk encryption β€” takes 1 minute
5. Enable macOS Firewall β€” takes 1 minute
6. Add YubiKey to brokerage accounts β€” takes 15 minutes
7. 1Password CLI for secret injection β€” takes 30 minutes to set up
Track 07 β€” Operational SecurityS-08
Incident Response & Recovery
Even with all the right controls, things go wrong. A breach isn't a failure of character β€” it's an operational event. What matters is how fast you respond, how much you contain, and how quickly you recover. This module is your playbook.

The First 15 Minutes

If you suspect a breach β€” unauthorized trades, API calls you didn't make, unexpected charges, or a Telegram command you didn't send β€” the clock starts immediately. Here's the decision tree:

Immediate Response by Scenario
ScenarioImmediate ActionThen
Unauthorized trades on brokerageCancel all open orders immediatelyRevoke API key, call broker, document
Unexpected Claude/OpenAI chargesRevoke API key in dashboard NOWContact provider, request refund, rotate key
Telegram bot acting on commands you didn't sendStop Telegram listener immediatelyRevoke bot token, audit who has the token
Suspected malware on trading machineDisconnect from networkDon't reboot β€” preserve evidence; restore from backup
GitHub repo with secrets was publicRotate every key that was in the repoAudit git log, remove from history with BFG

Kill Switches β€” Build Them Before You Need Them

Your firm needs documented kill switches that can be executed in under 60 seconds. Write these down and test them:

terminal β€” firm kill switches
# Stop all trading agents immediately for p in ~/Library/LaunchAgents/com.chris.*.plist; do launchctl unload "$p" 2>/dev/null done echo "All agents stopped" # Stop Telegram listener (prevents command execution) launchctl unload ~/Library/LaunchAgents/com.chris.paperclip.telegram.plist # Stop Paperclip entirely pkill -f "paperclipai" || true # Verify nothing trading-related is still running ps aux | grep -E "momentum|levetf|paperclip|telegram" | grep -v grep

Backing Up Before You Need It

Time Machine or equivalent backup of your trading machine protects against:

  • Malware that encrypts your files (ransomware)
  • Accidental deletion of strategies or configs
  • Machine failure during market hours

Specifically back up: ~/christs-first-firm/config/, ~/christs-first-firm/strategies/, ~/christs-first-firm/memory/, and ~/Library/LaunchAgents/com.chris.*.plist. Your code should be in git β€” that's already a backup.

Post-Incident: What to Document

After containing a breach, write a brief incident report before you forget the details:

  • Timeline: when did you first notice, what were the first signs?
  • Scope: what was affected β€” keys, accounts, machines, data?
  • Root cause: how did the attacker get in?
  • Actions taken: what did you do and in what order?
  • Gaps identified: what control would have prevented this?
After Every Incident: Close the Gap
Every breach is a one-time opportunity to find a control that was missing. The firms that get breached repeatedly are the ones that fix the symptom without finding the root cause. Don't just rotate the key β€” find out how it was stolen.

The Ongoing Security Posture

  • Weekly: review Cloudflare access logs, brokerage login history, API call volume for anomalies
  • Monthly: rotate AI API keys, audit .gitignore, check for exposed ports with sudo lsof -i -P | grep LISTEN
  • Quarterly: rotate brokerage API keys, review IP whitelist rules, update macOS and dependencies
  • Annually: full security audit β€” every credential, every service, every exposed port

Your Firm Is Now Hardened.

Zero Trust, API key security, network threat awareness, machine hardening, credential management, and incident response β€” you have the complete operational security posture. The gap between you and an unprotected trader is now enormous.

Continue building on DeadCatFound β€” every track stacks together into a complete, professional trading operation.

Back to DeadCatFound β†’
Important Disclaimer

DeadCatFound is an educational platform only. Security advice in this course is general guidance, not professional security consulting. Threat landscapes change rapidly β€” always consult current resources and a qualified security professional for production environments handling significant capital.

All content is for educational and informational purposes only. By accessing this course you acknowledge that DeadCatFound bears no liability for any security outcomes.