diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85f2c6d..4fb512a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,9 +23,9 @@ jobs: python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - - uses: actions/setup-python@v5 + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: ${{ matrix.python-version }} cache: "pip" @@ -40,9 +40,9 @@ jobs: name: Lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - - uses: actions/setup-python@v5 + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: "3.12" cache: "pip" @@ -68,9 +68,9 @@ jobs: name: Version consistency runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - - uses: actions/setup-python@v5 + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: "3.12" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0235d29..502c11a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -17,9 +17,9 @@ jobs: permissions: id-token: write # Required for Trusted Publishing (OIDC) steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - - uses: actions/setup-python@v5 + - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 with: python-version: "3.10" cache: "pip" @@ -31,4 +31,4 @@ jobs: run: python -m build - name: Publish package to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3 diff --git a/CHANGELOG.md b/CHANGELOG.md index dece61f..45c1f52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,11 +13,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **GitHub Copilot CLI manifest:** `plugins/scrapingbee-cli/plugin.json` in the Agent Plugins format, which Copilot CLI and the awesome-copilot marketplace require at the plugin root. - **Kiro power:** `plugins/scrapingbee-kiro/` (Agent Plugins `plugin.json` + `mcp.json` that connects the ScrapingBee MCP server, README, synced skills) for the Kiro Powers marketplace. - **Antigravity plugin:** `plugins/scrapingbee-antigravity/` bundles the ScrapingBee MCP server through `mcp_config.json`, with the API key declared as a plugin variable that Antigravity asks for on enable, plus the synced skills. The `scrapingbee-cli` and `scrapingbee-kiro` folders carry label-only Antigravity manifests so a repository-wide install names them clearly. Plugin READMEs gain a "Support and privacy" section and the marketplace contact is now contact@scrapingbee.com. +- **Security policy:** `SECURITY.md` (repo root and `plugins/scrapingbee-cli/`) with how to report a vulnerability; `plugins/scrapingbee-cli/.codexignore` keeps local files out of the Codex bundle. - **Cursor and ChatGPT / Codex manifests:** the same plugin folder now carries `.cursor-plugin/plugin.json` (with a `SCRAPINGBEE_API_KEY` variable and `mcp.json` that connects the ScrapingBee MCP server) and `.codex-plugin/plugin.json`, plus logo assets, so one folder can be submitted to each marketplace. ### Changed - **Cursor plugin moved to `plugins/scrapingbee-cursor/`** (manifest, `mcp.json`, skills), with a root `.cursor-plugin/marketplace.json`. The Claude plugin manifest gains the directory listing fields (icon, documentation, support, privacy, terms). +- **GitHub Actions pinned to commit SHAs** in `ci.yml` and `publish.yml` (same versions as before: checkout v4.4.0, setup-python v5.6.0, pypi-publish v1.14.3). ### Fixed diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..4e38f50 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,36 @@ +# Security Policy + +## Supported versions + +Security fixes are released for the latest minor version of `scrapingbee-cli` on PyPI and for the plugins and skills in this repository on the `main` branch. + +| Version | Supported | +| ------- | --------- | +| 1.6.x | Yes | +| < 1.6 | No — upgrade with `pip install --upgrade scrapingbee-cli` | + +## Scope + +This policy covers the code in this repository: + +- the `scrapingbee` command-line tool (`src/scrapingbee_cli/`) +- the agent plugins under `plugins/` (Claude Code, Codex, Cursor, Kiro, Antigravity) +- the Agent Skills under `.agents/skills/` and their mirrors + +Issues in the ScrapingBee API or the hosted MCP server (`https://mcp.scrapingbee.com/mcp`) can be reported the same way; we will route them to the right team. + +## Reporting a vulnerability + +Please do not open a public GitHub issue for security problems. + +Email **contact@scrapingbee.com** with the subject "Security: scrapingbee-cli" and include: + +- a description of the issue and its impact +- steps or a minimal command to reproduce it +- the CLI version (`scrapingbee --version`) and your OS + +We acknowledge reports within 3 business days and aim to ship a fix for confirmed high-severity issues within 30 days. We will credit you in the release notes unless you prefer otherwise. + +## Handling of API keys + +The CLI reads your ScrapingBee API key from the `SCRAPINGBEE_API_KEY` environment variable, a `.env` file, or the file written by `scrapingbee auth`. It never prints the key or sends it anywhere except the ScrapingBee API. If you believe a key was exposed, rotate it in your ScrapingBee dashboard. diff --git a/plugins/scrapingbee-cli/.codexignore b/plugins/scrapingbee-cli/.codexignore new file mode 100644 index 0000000..0c112f1 --- /dev/null +++ b/plugins/scrapingbee-cli/.codexignore @@ -0,0 +1,10 @@ +# Files Codex should not package from this plugin bundle +.env +.env.* +*.log +.DS_Store +__pycache__/ +*.py[cod] +.pytest_cache/ +batch_*/ +crawl_*/ diff --git a/plugins/scrapingbee-cli/SECURITY.md b/plugins/scrapingbee-cli/SECURITY.md new file mode 100644 index 0000000..4e38f50 --- /dev/null +++ b/plugins/scrapingbee-cli/SECURITY.md @@ -0,0 +1,36 @@ +# Security Policy + +## Supported versions + +Security fixes are released for the latest minor version of `scrapingbee-cli` on PyPI and for the plugins and skills in this repository on the `main` branch. + +| Version | Supported | +| ------- | --------- | +| 1.6.x | Yes | +| < 1.6 | No — upgrade with `pip install --upgrade scrapingbee-cli` | + +## Scope + +This policy covers the code in this repository: + +- the `scrapingbee` command-line tool (`src/scrapingbee_cli/`) +- the agent plugins under `plugins/` (Claude Code, Codex, Cursor, Kiro, Antigravity) +- the Agent Skills under `.agents/skills/` and their mirrors + +Issues in the ScrapingBee API or the hosted MCP server (`https://mcp.scrapingbee.com/mcp`) can be reported the same way; we will route them to the right team. + +## Reporting a vulnerability + +Please do not open a public GitHub issue for security problems. + +Email **contact@scrapingbee.com** with the subject "Security: scrapingbee-cli" and include: + +- a description of the issue and its impact +- steps or a minimal command to reproduce it +- the CLI version (`scrapingbee --version`) and your OS + +We acknowledge reports within 3 business days and aim to ship a fix for confirmed high-severity issues within 30 days. We will credit you in the release notes unless you prefer otherwise. + +## Handling of API keys + +The CLI reads your ScrapingBee API key from the `SCRAPINGBEE_API_KEY` environment variable, a `.env` file, or the file written by `scrapingbee auth`. It never prints the key or sends it anywhere except the ScrapingBee API. If you believe a key was exposed, rotate it in your ScrapingBee dashboard. diff --git a/src/scrapingbee_cli/config.py b/src/scrapingbee_cli/config.py index 0a84735..f00287d 100644 --- a/src/scrapingbee_cli/config.py +++ b/src/scrapingbee_cli/config.py @@ -4,8 +4,9 @@ import os from pathlib import Path +from typing import Final -ENV_API_KEY = "SCRAPINGBEE_API_KEY" +ENV_API_KEY: Final = "SCRAPINGBEE_API_KEY" BASE_URL = "https://app.scrapingbee.com/api/v1" # Persistent auth .env path (evaluated once; cwd .env is evaluated at load_dotenv() call time) diff --git a/tests/unit/test_config.py b/tests/unit/test_config.py index 593d8e4..2ae9ba9 100644 --- a/tests/unit/test_config.py +++ b/tests/unit/test_config.py @@ -96,9 +96,9 @@ def test_save_and_remove_api_key_dotenv(monkeypatch, tmp_path): monkeypatch.setattr(config, "auth_config_path", lambda: auth_file) assert remove_api_key_from_dotenv() is False - path = save_api_key_to_dotenv("test-key-123") + path = save_api_key_to_dotenv("example-key-123") assert path == auth_file - assert auth_file.read_text() == 'SCRAPINGBEE_API_KEY="test-key-123"\n' + assert auth_file.read_text() == 'SCRAPINGBEE_API_KEY="example-key-123"\n' assert remove_api_key_from_dotenv() is True assert not auth_file.exists()