Skip to content

OWASP-BLT/BLT-Lettuce

Repository files navigation

πŸ₯¬ BLT-Lettuce

An intelligent Slack bot for the OWASP community

License GitHub Stars GitHub Forks GitHub Issues GitHub Pull Requests

Contributors Last Commit Commit Activity Repo Size

Python Cloudflare Workers Slack

Pre-commit Code Style: Ruff Conventional Commits

πŸ“Š Live Dashboard Β· πŸ’¬ Join OWASP Slack Β· πŸ› Report Bug Β· ✨ Request Feature


πŸ“– About

BLT-Lettuce is an intelligent Slack bot designed for the OWASP Slack workspace. It welcomes new members, helps them discover projects, and connects the global security community.

Note: This Slack bot functionality has been incorporated into the main BLT repository and is being transferred back to this repo for better organization.

🎯 Core Features

  • πŸ‘‹ Welcome New Members - Automatically sends personalized welcome messages to newcomers
  • πŸ” Project Discovery - Interactive conversations help users find relevant OWASP projects
  • πŸ“Š GitHub Integration - Scans configured organizations and caches project metadata
  • πŸ€– Conversational Flow - Asks multiple-choice questions to understand user needs
  • ⚑ Edge-Powered - Runs on Cloudflare Workers for global, low-latency performance

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        OWASP Slack Workspace                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                  β”‚
                                  β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Cloudflare Worker (Python)                    β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚   Webhook    β”‚  β”‚    Stats     β”‚  β”‚   Project Discovery  β”‚  β”‚
β”‚  β”‚   Handler    β”‚  β”‚   Tracking   β”‚  β”‚      Flowchart       β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                  β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β–Ό                       β–Ό                       β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Cloudflare    β”‚    β”‚    GitHub API   β”‚    β”‚   GitHub Pages  β”‚
β”‚   KV Storage    β”‚    β”‚  (Org scanning) β”‚    β”‚  (Dashboard)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ”„ Project Discovery Flow

The bot uses a conversational flowchart to help users find OWASP projects:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚        User Initiates Chat          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  "What type of project interests    β”‚
β”‚   you?" (Multiple Choice)           β”‚
β”‚  β€’ Documentation/Standards          β”‚
β”‚  β€’ Security Tools                   β”‚
β”‚  β€’ Deliberately Insecure Apps       β”‚
β”‚  β€’ Research/Education               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  "What technology stack?"           β”‚
β”‚  β€’ Python  β€’ Java  β€’ JavaScript     β”‚
β”‚  β€’ Go      β€’ .NET  β€’ Any            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Query cached project metadata      β”‚
β”‚  from configured GitHub orgs        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Return matching project links      β”‚
β”‚  with descriptions and stats        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                  β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  No matches? Offer to:              β”‚
β”‚  β€’ Start over with different params β”‚
β”‚  β€’ Learn how to start a new project β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ“Š Live Dashboard

View real-time statistics at our Stats Dashboard:

  • πŸ‘‹ Members welcomed
  • ⚑ Commands executed
  • πŸ™ GitHub project health metrics
  • 🌍 Global availability status

☁️ Cloudflare Worker

The bot is powered by a Python Cloudflare Worker that:

  • Handles Slack webhook events
  • Sends personalized welcome messages
  • Tracks statistics in KV storage
  • Provides a stats API for the dashboard
  • Caches project metadata (expires every 24-48 hours)

See cloudflare-worker/README.md for setup instructions.

API Endpoints

Endpoint Method Description
/webhook POST Slack webhook for events
/stats GET Returns statistics JSON
/health GET Health check endpoint

πŸš€ Quick Start

Prerequisites

  • Python 3.10+
  • Poetry for dependency management
  • Wrangler CLI for Cloudflare Workers
  • Slack Bot Token and Signing Secret

Installation

  1. Clone the repository

    git clone https://github.com/OWASP-BLT/BLT-Lettuce.git
    cd BLT-Lettuce
  2. Install dependencies

    poetry install
  3. Set up environment variables

    cp .env.sample .env
    # Edit .env with your Slack credentials
  4. Run locally

    poetry run python app.py

Deploy Cloudflare Worker

cd cloudflare-worker
wrangler login
wrangler kv:namespace create "STATS_KV"
# Update wrangler.toml with the namespace ID
wrangler secret put SLACK_TOKEN
wrangler secret put SIGNING_SECRET
wrangler deploy

πŸ“ Project Structure

BLT-Lettuce/
β”œβ”€β”€ app.py                  # Main Flask application
β”œβ”€β”€ cloudflare-worker/      # Cloudflare Worker code
β”‚   β”œβ”€β”€ worker.py           # Python worker implementation
β”‚   β”œβ”€β”€ wrangler.toml       # Worker configuration
β”‚   └── README.md           # Worker documentation
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ projects.json       # OWASP project metadata cache
β”‚   └── repos.json          # Repository categorization
β”œβ”€β”€ docs/
β”‚   └── index.html          # GitHub Pages dashboard
β”œβ”€β”€ src/lettuce/            # Bot plugins and modules
β”œβ”€β”€ tests/                  # Test suite
β”œβ”€β”€ pyproject.toml          # Poetry configuration
└── README.md               # This file

🀝 How to Contribute

We welcome contributions from everyone! Here's how to get started:

  1. Fork the Repository - Click "Fork" at the top right of this page
  2. Clone Your Fork
    git clone https://github.com/YOUR-USERNAME/BLT-Lettuce.git
  3. Create a Branch
    git checkout -b feature/your-feature-name
  4. Make Changes - Follow our coding standards (enforced by pre-commit hooks)
  5. Test Your Changes
    poetry run pytest
  6. Commit with Conventional Commits
    git commit -m "feat: add new feature"
  7. Push and Open a PR
    git push origin feature/your-feature-name

πŸ“Ί Contributing Video Tutorial

Watch our contribution walkthrough video for a step-by-step guide.


πŸ§‘β€πŸ’» Development

Running Tests

poetry run pytest

Code Formatting

poetry run ruff check --fix .
poetry run ruff format .

Pre-commit Hooks

pip install pre-commit
pre-commit install

πŸ“œ License

This project is licensed under the AGPL-3.0 License - see the LICENSE file for details.


πŸ™ Acknowledgments


Made with πŸ’š by the OWASP BLT Team

Join OWASP Slack Star this repo

Releases

No releases published

Packages

No packages published

Contributors 8

Languages