/prodsec-skills:os-tool-securityfrom prodsec-skills
Enforces least privilege, sandboxing, and safe command execution for MCP servers that run OS tools. Use when building or auditing MCP server security.
Ships in prodsec-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
When MCP servers execute tools in the operating system, they run with the permissions of the MCP server process. The following security controls are required:
Never pass unsanitized input to a shell. Use safe, parameterized APIs:
import subprocess
# CORRECT - parameterized, no shell
subprocess.run(['echo', user_input], shell=False)
# FORBIDDEN - shell injection risk
import os
os.system(f"echo {user_input}") # NEVER do this
subprocess.run(f"echo {user_input}", shell=True) # NEVER do this
Never execute commands with higher privileges than necessary. Never run as root.
Before executing a command, drop privileges not required for that specific command:
# Drop to restricted user before executing tool command
import os
def execute_tool_command(command, restricted_uid, restricted_gid):
pid = os.fork()
if pid == 0:
os.setgid(restricted_gid)
os.setuid(restricted_uid)
os.execvp(command[0], command)
else:
_, status = os.waitpid(pid, 0)
return status
Use one or more of the following to contain tool execution:
| Mechanism | Description |
|---|---|
| Containers (Podman, Docker) | Isolate tool execution in a container with limited capabilities |
| seccomp | Restrict system calls available to the tool process |
| AppArmor / SELinux | Mandatory access control policies limiting file and network access |
| namespaces | Isolate PID, network, mount, and user namespaces |
| chroot / pivot_root | Restrict filesystem visibility |
| cgroups | Limit CPU, memory, and I/O resources |
os.system() or shell=True; use parameterized APIs (subprocess.run with shell=False)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
mcp-server, sandboxing, privilege-dropping, command-injection
npx claudepluginhub redhatproductsecurity/prodsec-skills --plugin prodsec-skills130 skills in this plugin
/address-sanitizerAddressSanitizer detects memory errors during fuzzing. Use when fuzzing C/C++ code to find buffer overflows and use-after-free bugs.
/admin-interface-securitySecure the administrative interface of model registries. Use when building, deploying, or reviewing model registry access controls and admin interfaces./aflppAFL++ is a fork of AFL with better fuzzing performance and advanced features. Use for multi-core fuzzing of C/C++ projects.
Other plugins' skills for the same job