secure-bash-rules

Enforce security and reliability rules for Bash scripts in the UMRS project.

Updated Dec 4, 2025
One-click install
npx skills add https://github.com/jamieadams-nerd/umrs-project --skill secure-bash-rules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: secure-bash-rules
Source: https://github.com/jamieadams-nerd/umrs-project/tree/main/.claude/skills/secure-bash-rules
Command: npx skills add https://github.com/jamieadams-nerd/umrs-project --skill secure-bash-rules

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Security rules for writing Bash scripts in the UMRS project: shebang directives, PATH locking, environment sanitization, strict mode, quoting, input validation, exit codes, temporary files, privileged script requirements, and secret handling. Use this skill when working with bash scripts, .sh files, shebang, PATH lock, env sanitization in bash, strict mode, privileged scripts, or writing bash. Trigger when creating or editing any .sh file or bash script content.

Core Features & Use Cases

  • Interpreter Directive Rule: enforce absolute interpreter paths in shebang lines to avoid PATH manipulation.
  • PATH locking & environment sanitization: set restricted PATH at startup and unset dangerous env vars to reduce surface area.
  • Strict mode & robust quotes: enable set -euo pipefail and strict quoting and input validation.

Quick Start

Apply these rules when creating or editing any Bash script to ensure secure, auditable execution.

Frequently Asked Questions about secure-bash-rules

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I secure a Bash script to prevent common security flaws?

To secure a Bash script, you should enforce absolute interpreter paths in shebang lines, lock PATH at startup, sanitize dangerous environment variables, and enable strict mode using set -euo pipefail.

What is the best way to handle input validation and exit codes in shell scripting?

The best way to handle input validation and exit codes in shell scripting is to apply strict quoting for all variables and return explicit exit codes to catch failures and prevent misconfigurations.

How does PATH locking and environment sanitization work in Bash?

PATH locking and environment sanitization in Bash work by setting a restricted PATH at script startup and unsetting dangerous environment variables to reduce the attack surface area.

When do I need to use strict mode and privileged script controls in Bash automation?

You need to use strict mode and privileged script controls in Bash automation whenever creating or editing .sh files to ensure secure, auditable execution and prevent unauthorized privilege escalation.

What are the limitations of relying on standard Bash scripting without secret management?

Without strict secret management and environment sanitization, standard Bash scripts risk exposing sensitive data and are vulnerable to PATH manipulation and unintended shell misconfigurations.

Can I use these Bash security rules for temporary files and secret handling?

Yes, these rules specify secure temporary files handling and strict secret management to ensure that any .sh script or Bash-based automation executes safely without leaking sensitive data.