
rust-panosmcp
io.github.mechubsec由 GitHub 帳號 mechubsec 發布v0.17.0更新於 Oct 29, 2026
PAN-OS firewall MCP server: scoped, audited, two-person change control. Rust.
發布方自己的服務:rust.wiki
概覽
針對 Palo Alto Networks PAN-OS 防火牆的 MCP 伺服器:唯讀巡檢,以及受範圍限制、可稽核、需雙人核准的設定變更。
- 可以做什麼
- 檢視裝置:列出已授權防火牆、蒐集裝置資訊、依驗證過的 XPath 讀取設定、分頁讀取規則庫與物件項目、對單一項目計算摘要。
- 執行唯讀維運指令,並模擬安全策略比對,指令受允許清單策略約束。
- 檢查運作狀態:HA 狀態、授權、內容與軟體版本、EDL 訂閱來源狀態、有上限的日誌查詢。
- 檢視 Panorama 裝置群組、範本與推送工作狀態。
- 在指紋與設定鎖保護下暫存、比對、驗證、提交或捨棄候選設定變更。
- 規劃、核准、套用並檢視多動作變更集,核准須由獨立人員完成。
- 適用情境
- 適合讓助理協助維運或稽核 PAN-OS 防火牆:檢視規則庫、HA 與授權狀態,或準備與審查需要驗證、稽核紀錄及第二位人工核准者的策略變更。
- 執行需求
- 以本機程序執行,通常使用已發佈的容器映像或 Linux 發行壓縮檔(自行建置需 Rust 1.89 以上)。需要裝置清單檔案,其中每台防火牆的端點與透過環境變數或受保護檔案引用的 API 金鑰,以及可寫入的狀態目錄。啟動必須提供稽核 HMAC 金鑰檔案。HTTP 傳輸另需 bearer 權杖、TLS 憑證以及允許的主機與來源設定。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 rust-panosmcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
rust-panosmcp
Async Rust Model Context Protocol server for Palo Alto Networks PAN-OS firewalls
a mechub project — sovereign network-security automation
Unofficial / community project. This is an independent community project and does not claim affiliation with or endorsement by Palo Alto Networks. Product names and trademarks are used only to identify the systems with which the software interoperates.
The repository contains the v0.17.0 release: a bearer-protected server with structured audit logging, guarded PAN-OS candidate configuration lifecycle, and hardened release packaging, with authentication and auditing provided by the shared mecmcp-auth and mecmcp-audit crates.
The project goal is a small, fast, production-oriented server with the same
security posture as rust-junosmcp: bearer-token authentication, per-token
device and tool scopes, TLS, strict remote-bind refusal rules, bounded input
and output, auditable change operations, and efficient connection reuse.
The architecture and delivery plan are in PLAN.md. Security boundaries and release-blocking controls are tracked in THREAT_MODEL.md.
Workspace
Quick start
Installation
Choose one of three install paths:
Release tarball (Linux x86_64)
Download the latest release from GitHub releases. Assets follow the pattern rust-panosmcp-v0.17.0-x86_64-unknown-linux-gnu.tar.gz with a corresponding .sha256 file.
This creates a dedicated rust-panosmcp system user and provisions /etc/rust-panosmcp (config, root-owned) and /var/lib/rust-panosmcp (state). The HMAC key at /etc/rust-panosmcp/audit-hmac.key is required for device-redaction in audit logs — the service will not start without it. The extracted archive includes configuration examples in config/ — use devices.example.json and tokens.example.json as starting templates under /etc/rust-panosmcp before starting. See packaging/systemd/ for unit details.
LXC (Debian 13)
For a dedicated unprivileged LXC container on Proxmox or standalone systemd-nspawn, the release tarball includes an idempotent installer that automates the manual sequence above. For a complete setup guide including container creation, see HOW-TO-SETUP-LXC.md.
The installer creates the rust-panosmcp user and directories via systemd-sysusers and systemd-tmpfiles, installs the binary and unit, creates an empty tokens.json with mode 0600, and never overwrites /var/lib/rust-panosmcp/mutation-state.json if it exists (change-set audit trail). The endpoint listens on http://127.0.0.1:30031/mcp by default. See packaging/lxc/install.sh for environment-variable overrides and upgrade behavior.
Docker / GHCR
Prebuilt images are published to ghcr.io/mechubsec/rustpanosmcp on every release tag. See .github/workflows/release-image.yml for the build pipeline. For a complete setup guide including both two-person and lab modes, see HOW-TO-SETUP-DOCKER.md.
The default CMD binds 127.0.0.1:30031 inside the container, so a bare
docker run with no -p and no --host/--allowed-host/--allowed-origin
starts cleanly but is not reachable from outside the container. Follow
HOW-TO-SETUP-DOCKER.md for a working two-person
or lab-mode docker run invocation (including the port publish and the flags
the baked-in ENTRYPOINT already supplies) or use the included
compose.example.yaml.
Run with Docker (stdio)
For MCP clients that launch a server over stdin/stdout, prepare an inventory
with the same shape as config/devices.example.json:
Export the API-key variable before launching the container. This passthrough
form keeps the key out of the command line, but Docker daemon access can still
expose environment values through inspection. For stricter handling, use the
file-based API-key form ({"type":"file","path":"/protected/path"})
documented in the configuration section below and mount that file read-only
with mode 0600.
Make the mounted inventory and state files readable and writable only by the
container user (uid:gid 65532:65532); secret-bearing files must have mode
0600. Stdio is unauthenticated at the process boundary: the launcher can
use every device in the mounted inventory and every tool, so scope access by
limiting that inventory and using a read-only PAN-OS API role. The state
directory must be writable because the server creates its audit state there.
The image ENTRYPOINT already supplies the config, token, state, and audit-key
paths, so do not repeat those flags after the image name. The token path is
only used by HTTP. This invocation leaves HTTP and listener TLS off: supplying
--transport stdio replaces the image CMD, including its HTTP bind and port
flags. Connections to the firewall still use HTTPS according to the
inventory's TLS trust settings.
Build from source
Requires Rust 1.89 or newer (MSRV).
Run (stdio)
Start from config/devices.example.json, keep the real inventory out of Git, and provide the referenced environment secret:
Run (streamable-http with auth)
First mint a least-privilege token, then start the TLS Streamable HTTP transport:
Capture the first command's stdout securely: that is the only display of the new bearer secret. See docs/PHASE2_OPERATIONS.md for token rotation, reload, refusal rules, reverse-proxy deployment, and all security defaults. Phase 1 inventory and firewall TLS details remain in docs/PHASE1_OPERATIONS.md.
Next: Learn the reader, writer, and reviewer MCP role workflow.
Status
Phase 1 implemented validated inventory and secret providers, strict HTTPS with
system roots/custom CA/exact leaf pinning, pooled async PAN-OS XML API calls,
typed errors, timeouts, cancellation, output caps, and a per-device semaphore.
Phase 2 added digest-only bearer tokens, exact device/tool scopes, atomic
inventory/token reload, TLS Streamable HTTP, Host/Origin validation, bounded
request bodies, IP/token rate limits, and audit-safe request tracing. Both
transports share the same 28 tools described in MCP tools
reference below; wildcard * token scopes reach only
the 17 read-only ones (list_devices, gather_device_facts,
execute_panos_op, get_panos_config, list_panos_entries,
get_panos_entry_digest, list_panorama_device_groups,
list_panorama_templates, get_panorama_push_status,
list_panos_rulebase_entries, get_panos_ha_state, get_panos_license_info,
get_panos_content_status, get_panos_feed_status, get_panos_software_status,
test_panos_security_policy_match, query_panos_logs); the 11
lifecycle/change tools must be named explicitly.
Phase 3 adds opt-in candidate fingerprints, narrow XPath policy, PAN-OS config
locks, per-device serialization, stage/diff/full validation, admin-scoped
partial commit/revert, job reconciliation, and structured mutation audit. Write
tools require explicit token scopes; * remains read-only.
Phase 4 adds a digest-pinned non-root distroless image, hardened systemd unit, read-only deployment guidance, PAN-OS release-family matrix, five parser fuzz targets, byte-reproducible archives, security/runbook documentation, and published Rust/Python measurements.
v0.2 adds persistent multi-action change sets, token-specific XPath/action grants and expiry, canonical-endpoint serialization, and independent approval bound to the exact owner/device/fingerprint/action digest. Approved sets apply under one PAN-OS config lock and automatically admin-revert if a later action fails. They then use the existing diff, full-validation, commit, or discard lifecycle. See docs/V0.2_CHANGE_SETS.md.
v0.2.1 makes PAN-OS configuration-lock release a confirmed state transition:
commit/discard records clear config_lock_held only after the device accepts
unlock, while a failed unlock is persisted as indeterminate for explicit
reconciliation. It also records the default-trusted TLS and lab rollout
evidence in docs/V0.2.1_ACCEPTANCE.md.
v0.2.2 updates the maintained Rust dependency graph and GitHub Actions while preserving the v0.2.1 PAN-OS tool, authorization, inventory, and mutation-state interfaces. The published release and guarded lab rollout evidence is in docs/V0.2.2_ACCEPTANCE.md. Multi-vsys, HA, and Panorama work remains deferred.
v0.3.0 moves authentication onto the shared
mecmcp-auth crate, retiring this
repository's own token, store, and token-file implementations in favour of one
shared, separately tested crate. The PAN-OS tool surface, authorization scopes,
inventory, and mutation-state interfaces are unchanged. Two operator-visible
changes: tokens.json must be mode 0600 or the server refuses to start, and the
on-disk envelope version is now preserved on write so a file this release touches
stays readable by the previous one. See CHANGELOG.md for the
upgrade steps.
The full HTTPS mock, MCP end-to-end, and explicitly configured panosvm lab
firewall acceptance suites pass. Phase 1 is complete; the reproducible evidence
is recorded in docs/PHASE1_ACCEPTANCE.md.
Phase 2 acceptance evidence is recorded in docs/PHASE2_ACCEPTANCE.md. Configuration mutation acceptance is in docs/PHASE3_ACCEPTANCE.md, with operator requirements in docs/PHASE3_OPERATIONS.md. Phase 4 release evidence is in docs/PHASE4_ACCEPTANCE.md. Production deployment, rotation, backup/recovery, and upgrades are covered by docs/OPERATIONS.md; see also docs/COMPATIBILITY.md, docs/BENCHMARKS.md, and SECURITY.md. For the PAN-OS-side least-privilege administrator accounts (distinct from the MCP bearer roles above), see docs/PANOS_ADMIN_ROLES.md.
MCP tools reference
The server exposes 28 MCP tools, grouped by operation type:
Read-only tools
list_devices— List authorized PAN-OS devices and safe metadata; never returns API keys.gather_device_facts— Gather hostname, model, serial, version, management IP, and uptime from an authorized device.execute_panos_op— Execute a read-only PAN-OS XML command rooted at<show>on an authorized device, with output caps.get_panos_config— Read running or candidate PAN-OS configuration at a validated/configXPath on an authorized device.list_panos_entries— Page through a rule or object list container's<entry>children as structured JSON, truncation-marked rather than erroring on a large rulebase.get_panos_entry_digest— Fetch and hash exactly one PAN-OS config entry by XPath, for single-rule drift detection.list_panorama_device_groups— List Panorama device groups and the serial numbers of their member firewalls.list_panorama_templates— List Panorama templates and the names of their declared variables.get_panorama_push_status— Read a Panorama commit-all/push job's overall and per-target-firewall status by job id.list_panos_rulebase_entries— List security rules, NAT rules, address objects, or service objects for a vsys as structured JSON, paginated and truncation-marked.get_panos_ha_state— Read PAN-OS high-availability state (enabled, mode, local and peer state) on an authorized device.get_panos_license_info— Read PAN-OS license status (feature, serial, issued, expires, expired) on an authorized device.get_panos_content_status— Read PAN-OS content version status (version, released, downloaded, current) on an authorized device.get_panos_feed_status— Read the status of mecfeedmcp EDL feeds subscribed on an authorized device (per feed: name, kind, url, valid, auth_valid, next_update, total_valid, total_ignored, total_invalid, content_etag, last_event). See Subscribing to a mecfeedmcp feed.get_panos_software_status— Read PAN-OS software version status (version, released, downloaded, current, latest) on an authorized device.test_panos_security_policy_match— Test which PAN-OS security rule, if any, a simulated packet would match on an authorized device.query_panos_logs— Fetch a bounded window of PAN-OS logs (traffic, threat, system, or config) on an authorized device; always capped, never unbounded.
Candidate lifecycle tools (mutation)
get_candidate_fingerprint— Return a SHA-256 fingerprint over all operator-authorized candidate subtrees.stage_panos_config— Stage one policy-bounded PAN-OS candidate set/delete using an expected fingerprint.diff_panos_candidate— Return a bounded PAN-OS change summary for the exact staged candidate fingerprint.validate_panos_candidate— Validate a staged candidate and make only the same fingerprint eligible for commit.commit_panos_candidate— Commit only a successfully validated operation using an exact candidate fingerprint.discard_panos_candidate— Discard a staged operation through an admin-scoped partial candidate revert.get_panos_operation— Return safe status for an owned PAN-OS candidate lifecycle operation.
Change-set tools (v0.2+)
create_panos_change_set— Plan and persist 1-64 ordered PAN-OS candidate actions under inventory and token XPath/action scopes.approve_panos_change_set— Approve an unexpired exact change-set digest; self-approval is refused.get_panos_change_set— Return the exact actions, digest, approval, expiry, and operation state for review or recovery.apply_panos_change_set— Apply an independently approved exact change set under one endpoint/config lock, reverting partial failure.
Write tools require explicit token scopes; wildcard * grants remain read-only.
Configuration
Three example files in config/ demonstrate the configuration surface:
devices.example.json— Device inventory with authentication, TLS validation modes (system roots, custom CA, or exact leaf pin), per-device concurrency limits, and optional admin override for candidate operations.tokens.example.json— Bearer-token store shape: digest-only storage, per-token device and tool allowlists, optional mutation grants (XPath roots, allowed actions), and expiry timestamps.devices.mutation.example.json— Inventory variant demonstrating mutation-root configuration and admin-scoped candidate workflow fields.
Inventory files never hold inline credentials: each device's api_key is a reference — {"type": "env", "name": "VAR_NAME"} for an environment variable or {"type": "file", "path": "/protected/path"} for a mode-restricted secret file.
Command policy (execute_panos_op, test_panos_security_policy_match)
A top-level policy key in the inventory file governs which operational
commands execute_panos_op will run, and the same gate applies to the
server-built <test><security-policy-match> command issued by
test_panos_security_policy_match:
-
mode: "allowlist"(fail-closed, the default) — a command is refused unless it matches an entry inallow(or, for piped output,allowed_pipes). This is what a freshly generated inventory, or one with nopolicysection at all, resolves to.config/devices.example.jsonships a starter read-only set:Allowlist entries are matched as exact element-tag paths taken from the command's own XML structure, not CLI text — there is no abbreviation expansion, so a shortened form such as
sh sys infois refused just like any other command that isn't inallow. Thetest security-policy-matchentry is required fortest_panos_security_policy_matchto run at all in allowlist mode — without it, every call is refused regardless of any other configuration. -
mode: "blocklist"(fail-open, legacy) — every command is allowed except one matching a deny rule under a device'sblocklist.commands. An inventory that has deny rules but no explicitpolicy.modekey loads in this mode for backward compatibility, and the server logs one startup WARN because fail-open blocklist mode has no allowlist to fall back on if a rule is missing a case. New deployments should setmode: "allowlist"instead.
Each device may extend the shared policy.allow / policy.allowed_pipes
lists with device-specific entries via that device's own blocklist.allow /
blocklist.allowed_pipes arrays, merged the same way blocklist.commands
deny rules are merged today.
Every refusal — either mode — is written to the audit log with the reason code from the underlying policy library.
Audit logging
v0.4.0 introduces structured audit logging via the shared mecmcp-audit crate. One event is emitted per tool call with caller attribution, target devices, outcome, and execution duration.
Change-set lifecycle auditing provides independent evidence of approval: the approve_panos_change_set event carries both the change-set id and the fingerprint digest, proving that a second principal reviewed the exact digest later applied via apply_panos_change_set.
Audit configuration flags
--audit-format {text|json}— Choosetext(default, human-readable) orjson(machine-parseable).--audit-log-file <PATH>— Write audit events to a file path.--audit-journald— Emit audit events to the systemd journal.--audit-redact— HMAC-pseudonymise declared fields (device names, caller identity) so the log can be shipped to a SIEM without leaking operational identifiers.--audit-hmac-key-file <PATH>— Path to the HMAC key for redaction; required when--audit-redactis enabled.
All audit targets are optional and can be combined. When no audit target is specified, audit events are not emitted.
Forwarding to the event store
The audit trail does not stay on this host. This server follows the family standard — AUDIT-FORWARDING-STANDARD.md.
An audit record that only exists on the machine that produced it is not an audit trail: it is a log file on a box whose operator is the party the record is about.
Emission (in effect now)
JSON is mandatory. The text format is for reading in a terminal and is not a
parse target. The file is the operator-facing artifact and must be rotated — the
server never truncates it.
Transport (specified, not yet implemented)
Records are written directly into SSDF's ssdf.audit as hash-chained rows,
per SSDF's merged evidence contract, so that deleting or editing a row is
detectable. Tracked in mecmcp#292.
A cheaper syslog path was designed and rejected: it works, but the records are
unchained, and every other link here is tamper-evident by construction — plan
digests bind approvals, approvals name a distinct principal, and
token_verified_fields separates vouched-for provenance from asserted. An
unchained final hop would discard that guarantee exactly where an auditor needs
it. The reasoning is recorded in the standard.
Reading the result
token_verified_fields names the provenance fields the token vouched for.
The rest of that group — client_name, model_id, session_id — is
client-asserted and authenticated by nothing. Do not read them as equivalent.
request_id correlates the transport event, the handler event, and (on Junos)
the device commit comment.
Security
See THREAT_MODEL.md and SECURITY.md for complete coverage. Key points:
- Authentication required for HTTP — bearer tokens with SHA-256 digest-only storage; no plaintext secrets persist.
- Loopback-only defaults — off-loopback HTTP requires TLS or explicit
--allow-insecure-bind; off-loopback TLS requires--allowed-host. - TLS verification always on — system roots, custom CA bundle, or exact leaf pin; no trust-on-first-use or disabled verification.
- Bounded I/O — output caps (512 KiB default, 5 MiB max), request body limits (1 MiB default), timeouts on all PAN-OS calls.
- Audited mutations — candidate operations serialize per device, record principal and fingerprint, require explicit commit after validation, and persist lock/job state for recovery.
CLI reference
--lab-mode
--lab-mode waives the second principal, for a single-operator lab where two-person control is theatre rather than a control. It is off by default and should stay off anywhere the estate matters.
What it does and does not change:
- The waiver is applied automatically when the change set is created. There is no waive tool, and the flow stays create → apply, identical to production.
- Planning, the plan digest, drift detection, and apply-time revalidation all still run. Lab mode removes the second reviewer, not the change record.
- No approver is ever fabricated. A waived change set records
approver: nullalongsideapproval_waiver: "lab-mode", and carries a waiver digest over(change_set_id, plan_digest, owner, approved_at). It is cryptographically distinguishable from a genuine two-person approval and cannot be relabelled afterwards — which matters if anyone later has to prove which changes had real separation of duties. - The server warns loudly at startup whenever it is enabled.
If you want solo write-testing without waiving the control, mint two tokens with different names and use one to create and the other to approve: the principal is the token name, and self-approval is refused. That gives one person the complete lifecycle with the control intact, and is the better choice wherever the ceremony has any value.
Enabling it
Add the flag to the service unit. On a package install, use a drop-in rather than editing the shipped unit, so an upgrade does not silently drop it:
Replacing ExecStart means restating it in full, so copy the shipped command and append the flag rather than writing a shorter one. Dropping other arguments would silently change the state file location or transport settings as a side effect of enabling lab mode:
Check it against packaging/systemd/rust-panosmcp.service before applying it — the shipped arguments are the authority, and this snippet is a copy that can age.
Confirm it took effect. The startup warning uses lab mode in the prose and approval_waiver=lab-mode in the outcome description:
Expected output:
Approver tokens must be human
approve_panos_change_set only accepts a second principal whose token is marked actor_type: human. Tokens issued without --actor-type are unknown, and they are refused as approvers, as are agent tokens. Issue approver tokens with rust-panosmcp token add ... --actor-type human. stdio sessions carry no caller identity and cannot approve; approvals go over authenticated HTTP.
--allow-direct-commit
commit_panos_candidate on an operation created by stage_config directly — not via create_panos_change_set / approve_panos_change_set / apply_panos_change_set — stages, validates, and commits in one lifecycle, with no independent second-principal review at all: there is no change set to point one at. Off by default: without this flag, that commit is refused before the firewall is ever touched, identically over stdio and HTTP (stdio carries no caller context at all, so it cannot be treated any more leniently than an authenticated session).
Residual risk. --allow-direct-commit is an escape hatch, not a fix. An operator who sets it has decided that running this specific path with no independent review is an acceptable risk for this deployment. That decision is:
- Logged loudly at startup, same as
--lab-modeabove. - Audited on every call. A
commit_panos_candidatecall that ran under the flag carriesdirect_commit_allowed=truein its audit record; a refusal is audited too, asauthorization=deniedwithreason=direct_commit_disabled.
It does not add a second-principal review; it only makes running without one visible. Prefer the change-set flow (create_panos_change_set → approve_panos_change_set → apply_panos_change_set) wherever your workflow can use it, and reserve this flag for operations that genuinely cannot fit that shape.
Enable it the same way as --lab-mode: append --allow-direct-commit to the service unit's ExecStart via a systemd drop-in, copying the shipped command in full. Confirm it took effect — unlike the lab-mode banner, this one is deliberately not grouped with the audit stream's per-call schema, so grep the plain startup message:
Validate
Create a deterministic release archive with scripts/build-release.sh, or
compile it twice and require byte identity with
scripts/verify-reproducible-build.sh. Container/systemd installation is
documented in the operator runbook.
License
Licensed under MIT.
[圖片]
a mechub project · deterministic decides · the model explains · a human approves
github.com/fastrevmd-lab
來源:README.md,提交 fad17d8
工具
0版本歷史
3- v0.17.0最新Oct 29, 2026
- v0.16.2Oct 16, 2026
- v0.16.1Oct 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
其他 Rust 整合
rust.wiki
wiki.rust官方發布者
rust.wiki 遠端端點,讓助理取得 Rust 遊戲即時資料:物品與造型價格、戰利品表、遺跡、伺服器與市場統計。

Plane (Rust)
由 GitHub 帳號 ninerf 發布
非官方單一執行檔 MCP 伺服器,讓助理讀寫 Plane 專案管理資料,包括工作項目、留言、週期、模組與頁面等。

AGZ Rust MCP
由 GitHub 帳號 agzyazilim 發布
本機 stdio MCP 伺服器,為助理提供 Rust 開發工具:離線工作區檢視、編譯器診斷、指定測試、Cargo 執行與程式碼導覽。

rust-proxmoxmcp
由 GitHub 帳號 mechubsec 發布
面向多叢集的 Proxmox VE MCP 伺服器,提供虛擬機保護以及計畫、核准、套用三步變更管控。

rust-junosmcp
由 GitHub 帳號 mechubsec 發布
Juniper Junos/SRX MCP 伺服器:限定範圍、可審計、雙人變更控制。Rust 編寫。AI 翻譯