Skip to content

Hayredin950/oauthsentry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

113 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OAuthSentry Logo

OAuthSentry

Third-Party AI & OAuth Risk Agent
Find the third-party AI tool that breaches you before it does

Live Demo GitHub License

Next.js TypeScript Tailwind CSS Vercel OpenAI

πŸ“– Table of Contents

🎯 About

OAuthSentry is a production-ready security agent that continuously scans your organization's OAuth apps, third-party AI integrations, and npm dependencies against live IOC threat feeds. High-risk findings automatically file Linear tickets and send Slack alerts in real-time. Built for security teams protecting against supply-chain attacks and compromised AI tool integrations.

⚠️ Problem Statement

After the April 2026 Vercel/Context.ai incident where a compromised OAuth app pivoted into employee Google Workspace accounts, security teams need continuous monitoring of:

  • OAuth apps with excessive permissions
  • Third-party AI integrations with admin scopes
  • Malicious npm packages (typosquats, backdoors)
  • Vendor trust changes and abandoned projects

✨ Features

Feature Description
πŸ” AI-Powered Scanning Scan OAuth apps, npm packages, and SaaS tools using GPT-4o-mini
πŸ“Š Risk Scoring 0–100 scoring with IOC matching and detailed reasoning
🎫 Linear Integration Auto-file tickets for critical findings
πŸ’¬ Slack Alerts Rich Block Kit messages with actionable remediation steps
⏰ Scheduled Scans 24/7 monitoring persisted in Upstash Redis
πŸ“‘ Live Threat Feed Real-time intel from NVD, OSV, and GitHub Security Advisories
πŸ“„ PDF Export Comprehensive reports with executive summaries
πŸŒ“ Dark/Light Mode Beautiful UI with theme toggle
πŸ§ͺ Demo Mode Instantly load realistic findings without API calls
⚑ Real-time Streaming NDJSON streaming of scan results

πŸ› οΈ Tech Stack

Frontend

  • Framework: Next.js 16 App Router
  • Styling: Tailwind CSS v4
  • UI Components: shadcn/ui
  • Type Safety: TypeScript

Backend & AI

  • AI SDK: Vercel AI SDK 6
  • Model: OpenAI GPT-4o-mini (via AI Gateway)
  • Workflows: Vercel Workflow Development Kit (WDK)
  • Storage: Upstash Redis
  • APIs: REST & GraphQL

Integrations

  • Linear: GraphQL API for ticket filing
  • Slack: Incoming Webhooks for alerts
  • Threat Feeds: NVD, OSV, GitHub Security Advisories

Deployment

  • Hosting: Vercel
  • Cron: Vercel Cron Jobs

πŸš€ Getting Started

Prerequisites

  • Node.js 18+
  • pnpm or npm
  • Vercel account (for deployment)
  • OpenAI API key (via Vercel AI Gateway)

Installation

  1. Clone the repository

    git clone https://github.com/Hayredin950/oauthsentry.git
    cd oauthsentry
  2. Install dependencies

    pnpm install
    # or
    npm install
  3. Configure environment variables Create a .env.local file:

    # Required β€” Vercel AI Gateway
    AI_GATEWAY_API_KEY=your_vercel_ai_gateway_key
    
    # Optional β€” Linear integration
    LINEAR_API_KEY=your_linear_api_key
    
    # Optional β€” Slack integration
    SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/WEBHOOK/URL
    
    # Required for scheduled scans β€” Upstash Redis
    KV_REST_API_URL=your_upstash_redis_url
    KV_REST_API_TOKEN=your_upstash_redis_token
    
    # Optional β€” App URL for links in alerts
    NEXT_PUBLIC_APP_URL=https://your-deployment.vercel.app

    Note: Linear and Slack keys can also be configured at runtime through the Settings dialog β€” no redeployment needed!

  4. Run the development server

    pnpm dev
    # or
    npm run dev
  5. Open the application Navigate to http://localhost:3000

πŸ“š API Documentation

Full API documentation available at: https://oauthsentry-phi.vercel.app/api-docs

Key Endpoints

Method Path Purpose
POST /api/scan AI-powered streaming scan (NDJSON)
GET /api/threat-feed Live threat intelligence
POST /api/actions/file-ticket Create Linear issue
POST /api/actions/send-alert Send Slack alert
GET/POST/PUT/DELETE /api/scheduled-scans Manage scan schedules

πŸ—οΈ Architecture

Data Flow

User clicks "Run Scan"
    ↓
POST /api/scan with asset list
    ↓
AI analyzes each asset against IOC feeds + advisories (streaming)
    ↓
RiskFinding[] streamed to dashboard in real-time
    ↓
User clicks "File ticket" β†’ POST /api/actions/file-ticket
    ↓
Linear issue created via GraphQL API
    ↓
User clicks "Send alert" β†’ POST /api/actions/send-alert
    ↓
Rich Block Kit message posted to Slack webhook

Project Structure

oauthsentry/
β”œβ”€β”€ app/
β”‚   β”œβ”€β”€ layout.tsx               # Root layout + ThemeProvider
β”‚   β”œβ”€β”€ page.tsx                 # Main dashboard
β”‚   β”œβ”€β”€ globals.css              # Tailwind v4 + design tokens
β”‚   β”œβ”€β”€ api-docs/page.tsx        # API documentation
β”‚   └── api/
β”‚       β”œβ”€β”€ scan/route.ts        # AI scan agent
β”‚       β”œβ”€β”€ threat-feed/route.ts # Threat intel feed
β”‚       β”œβ”€β”€ actions/
β”‚       β”‚   β”œβ”€β”€ file-ticket/
β”‚       β”‚   └── send-alert/
β”‚       β”œβ”€β”€ scheduled-scans/
β”‚       └── workflow/
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ ui/                      # shadcn/ui components
β”‚   β”œβ”€β”€ hero.tsx
β”‚   β”œβ”€β”€ risk-scanner.tsx
β”‚   β”œβ”€β”€ risk-results-table.tsx
β”‚   └── ...
β”œβ”€β”€ lib/
β”‚   β”œβ”€β”€ types.ts
β”‚   β”œβ”€β”€ linear-client.ts
β”‚   β”œβ”€β”€ risk-knowledge.ts
β”‚   └── ...
β”œβ”€β”€ public/
β”œβ”€β”€ package.json
β”œβ”€β”€ tsconfig.json
└── vercel.json

πŸš€ Deployment

Deploy to Vercel

  1. Deploy via Vercel CLI

    vercel
  2. Set environment variables in Vercel Project Settings β†’ Environment Variables.

  3. Required Integration: Add Upstash for Redis via Vercel Marketplace for scheduled scans.

The vercel.json includes a Cron job that fires /api/scheduled-scans/execute every 15 minutes to run due schedules.

πŸ”§ Troubleshooting

Issue Solution
Scan not running Verify AI_GATEWAY_API_KEY is set
Linear tickets not created Check Linear API key in Settings or env var
Slack alerts not posting Ensure Slack Webhook URL is configured
Threat feed empty External APIs may be rate-limited β€” auto-retry enabled
Scheduled scans failing Confirm Upstash Redis integration is active
Build errors Run pnpm build locally to debug TypeScript issues

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

Distributed under the MIT License. See LICENSE for more information.

πŸ“¬ Contact

Hayredin - hayredin.950@gmail.com

Project Link: https://github.com/Hayredin950/oauthsentry

Live Demo: https://oauthsentry-phi.vercel.app


Built with ❀️ by Hayredin

Β© 2026 OAuthSentry. All rights reserved.

About

Production-ready security agent that scans OAuth apps, AI integrations, and npm dependencies against live IOC feeds. Auto-files Linear tickets and sends Slack alerts.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors