Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

review-plugin-csp

БесплатноЗапускает вложенные скриптыНе проверен

Statically review an OpenShift Console dynamic plugin's source, production bundles, build configuration and resource declarations for CSP compatibility. Use…

openshift-engот openshift-eng★ 123 звезды на GitHub

Об этом скилле

Review Console plugin CSP compatibility

Statically inspect a Console dynamic plugin for code, configuration and resource patterns that conflict with a given Content Security Policy, and produce a findings report with file locations, affected directives and migration steps.

This skill reviews repositories and build artifacts. It does not start Console, deploy a plugin, drive a browser, execute application workflows or collect/import browser violation reports. Users do not need to generate such reports. Its findings are predictions based on static evidence, not runtime confirmation.

Background

Content Security Policy (CSP) is a browser security mechanism delivered via an HTTP response header. The browser applies the policy to the document served with that header, controlling which sources of scripts, styles, images, connections and other resources are permitted. OpenShift Console's Go backend (pkg/server/server.go) sets the CSP header on the HTML document response — the policy is not stored in the HTML itself. Dynamic plugins load over the network at runtime via Module Federation and execute within the Console document — so the Console's CSP governs all plugin code. Plugin assets are proxied through the Console backend at /api/plugins/<name>/, making them same-origin ('self'). A plugin's spec.contentSecurityPolicy in its ConsolePlugin CR declares additional source allowances that the console-operator aggregates into the document-wide policy; this is not per-plugin isolation.

Usage

/console:review-plugin-csp [plugin-path] [--policy-file path] [--console-ref git-ref]
  • plugin-path defaults to the current repository.
  • --policy-file (optional) supplies CSP directive values or captured response-header lines from a running Console. Prefer the authenticated Console HTML document response in browser DevTools Network; a saved HTML file does not preserve HTTP headers, and an unauthenticated request may return an OAuth redirect. A supplied effective policy takes precedence over the source-derived baseline; retain all CSP headers and their enforcing/report-only names.
  • --console-ref (optional) specifies an OpenShift Console Git revision. Without it, resolve the current main HEAD of openshift/console during the review and record its commit SHA; do not silently use a potentially stale local main.

All arguments are optional. With no flags, derive the baseline from the resolved upstream Console revision and inspect the plugin's spec.contentSecurityPolicy declarations if its ConsolePlugin CR manifest is available. Label this assessment source-derived baseline plus declared additions, not a verified deployed policy. Users do not need to prepare a policy file or provide cluster access to start a review.

/console:review-plugin-csp ./my-plugin

To review against a specific Console version or a captured deployed header:

/console:review-plugin-csp ./my-plugin --console-ref release-5.1
/console:review-plugin-csp ./my-plugin --policy-file ./csp-headers.txt

Additional policy, origin or build-mode context may be supplied in the request. These arguments guide the review; they do not change Console configuration.

Perform source/configuration and bundle review and report recommendations. Apply fixes or run production builds only when the user's request includes that work. A review alone does not authorize dependency installation, deployment or changes to a cluster policy; running application workflows is outside this skill's scope.

Establish scope and policy

  1. Locate the plugin metadata, source entry points, webpack/Rspack configuration, lockfile, ConsolePlugin manifests and any existing build output. Identify the build modes and plugin versions in scope. If the path does not identify a Console dynamic plugin or the supplied artifact, ask for the intended path/context before treating unrelated files as plugin code.
  2. Establish the Console document origin if known. Resolve relative resource URLs against that origin/base path, not the plugin container's own host.
  3. Select and record the policy basis:
    • Supplied effective policy: distinguish enforcing headers from report-only headers. If several enforcing policies are present, a request must satisfy all of them; do not merge their source lists into a more permissive policy.
    • Source-derived baseline: resolve an explicit --console-ref if supplied; otherwise resolve openshift/console's current upstream main HEAD. When using an existing checkout, first identify which remote tracks openshift/console (check git remote -v); do not assume origin — in forks, origin typically points to the user's fork, which may be behind or diverged from upstream. Resolve the ref from the remote whose URL contains openshift/console, or use git ls-remote https://github.com/openshift/console HEAD if no such remote exists. After resolving, confirm the remote URL contains openshift/console (no
Полный SKILL.md на GitHub

Установить review-plugin-csp в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

scripts/scan-csp.shscripts/test_scan_csp.py

FAQ

Что делает скилл review-plugin-csp?

Statically review an OpenShift Console dynamic plugin's source, production bundles, build configuration and resource declarations for CSP compatibility. Use when preparing a plugin for CSP enforcement or reviewing CSP-relevant plugin changes.

Как установить скилл review-plugin-csp?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл review-plugin-csp запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить review-plugin-csp с