name: Passive provider smoke

on:
  workflow_dispatch:

permissions:
  contents: read

jobs:
  Passive-provider-smoke:
    runs-on: ubuntu-latest
    timeout-minutes: 30
    env:
      # Mozilla publishes a bug bounty and safe harbor; keep this job passive.
      SMOKE_TEST_DOMAIN: mozilla.org

    steps:
      - name: Harden the runner (Audit all outbound calls)
        uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0
        with:
          egress-policy: audit

      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
        with:
          persist-credentials: false

      - name: Install uv
        uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
        with:
          python-version: '3.14'
          enable-cache: true
          cache-dependency-glob: "uv.lock"

      - name: Install dependencies
        run: |
          sudo mkdir -p /usr/local/etc/theHarvester
          sudo cp theHarvester/data/*.yaml /usr/local/etc/theHarvester/
          sudo chown -R runner:runner /usr/local/etc/theHarvester/
          uv sync --all-groups --frozen
          echo "$GITHUB_WORKSPACE/.venv/bin" >> $GITHUB_PATH

      - name: Run opt-in live provider tests
        timeout-minutes: 5
        run: pytest --run-live-network -m live_network

      - name: Run theHarvester module CertSpotter
        timeout-minutes: 5
        run: theHarvester -d "$SMOKE_TEST_DOMAIN" -b certspotter

      - name: Run theHarvester module Crtsh
        timeout-minutes: 5
        run: theHarvester -d "$SMOKE_TEST_DOMAIN" -b crtsh

      - name: Run theHarvester module DuckDuckGo
        timeout-minutes: 5
        run: theHarvester -d "$SMOKE_TEST_DOMAIN" -b duckduckgo

      - name: Run theHarvester module HackerTarget
        timeout-minutes: 5
        run: theHarvester -d "$SMOKE_TEST_DOMAIN" -b hackertarget

      - name: Run theHarvester module Otx
        timeout-minutes: 5
        run: theHarvester -d "$SMOKE_TEST_DOMAIN" -b otx

      - name: Run theHarvester module RapidDns
        timeout-minutes: 5
        run: theHarvester -d "$SMOKE_TEST_DOMAIN" -b rapiddns

      - name: Run theHarvester module Urlscan
        timeout-minutes: 5
        run: theHarvester -d "$SMOKE_TEST_DOMAIN" -b urlscan

      - name: Run theHarvester module Yahoo
        timeout-minutes: 5
        run: theHarvester -d "$SMOKE_TEST_DOMAIN" -b yahoo
