More screenshots
Works with the AI Agents you already use
Sudoers Check
/bin/cat /var/log/* also lets a user read /var/log/../../etc/shadow, and Defaults env_keep += "LD_PRELOAD" turns any command a user may run into root code execution.
$5
Sudoers Check
Example session with this skill installed
Check this project with sudoers-check.
- Read your context and instructions
- Compiled the sudoers check
$ python3 scripts/check_sudoers.py examples/risky
BLOCK etc/sudoers:6 U05 UNSAFE_ENVIRONMENT_PASSED
Defaults env_keep += "LD_PRELOAD PYTHONPATH" (keeps LD_PRELOAD, PYTHONPATH)
Why: env_keep passes LD_PRELOAD, LD_LIBRARY_PATH, PYTHONPATH or a similar variable to commands run as root, or the SETENV tag or Defaults setenv lets the user set any variable. A user allowed even one command can then load their own library or module into it (LD_PRELOAD=/tmp/x.so sudo /usr/bin/anything) and run code as root. With env_reset on, env_keep overrides sudo's built-in list of unsafe variables.
Safer: Remove those names from env_keep and drop SETENV and setenv. If a program needs a setting, set it inside a root-owned wrapper script. Keeping harmless variables such as LANG, TZ or SSH_AUTH_SOCK is fine.
BLOCK etc/sudoers.d/90-cloud-init-users:4 U01 NOPASSWD_ALL
BLOCK etc/sudoers.d/deploy:2 U02 NOPASSWD_SHELL_ESCAPE
BLOCK etc/sudoers.d/deploy:3 U04 COMMAND_IN_USER_WRITABLE_FOLDER
BLOCK etc/sudoers.d/deploy:4 U05 UNSAFE_ENVIRONMENT_PASSED
BLOCK etc/sudoers.d/helpdesk:2 U03 WILDCARD_IN_COMMAND
REVIEW etc/sudoers U13 SECURE_PATH_MISSING_OR_UNSAFE
REVIEW etc/sudoers:5 U12 ENV_RESET_OFF
REVIEW etc/sudoers:8 U14 LONG_PASSWORD_CACHE
REVIEW etc/sudoers:9 U11 AUTHENTICATION_TURNED_OFF
REVIEW etc/sudoers.d/helpdesk:2 U16 SHELL_ESCAPE_WITH_PASSWORD
REVIEW etc/sudoers.d/helpdesk:3 U17 COMMAND_SUBTRACTED_FROM_ALL
REVIEW etc/sudoers.d/helpdesk:6 U15 RULE_FOR_ALL_USERS
(Each finding also has Why and Safer lines, as in the first one.)
Verdict: BLOCK. Checked 4 files, 4 with sudoers content.
This is a static check of file text. NOT FLAGGED is not a guarantee.
Connects securely to your tools. The creator never sees your data.
About this skill
A drop-in like deploy ALL=(root) NOPASSWD: /usr/bin/vim /etc/nginx/nginx.conf looks limited, but :!sh inside vim is a root shell with no password. /bin/cat /var/log/* also lets a user read /var/log/../../etc/shadow, and Defaults env_keep += "LD_PRELOAD" turns any command a user may run into root code execution. This skill finds those and other sudoers mistakes before the rules are installed, and tells you how to fix each one.
Your agent runs a scanner on your sudo rules: /etc/sudoers, every file in sudoers.d, sudoers templates (sudoers.j2 and similar) and files such as sudoers_deploy in Ansible roles or image builds. It reads them the way sudo does: comments and #uid user IDs, backslash line continuations, User, Runas, Host and Cmnd aliases (also across files), Defaults bound to users, hosts or commands, NOPASSWD and other tags that carry over to later commands, "" for no arguments and ^...$ regular expressions. Rules that only root gets and commands run as a user other than root are not flagged for root access, and the default sudoers files of Debian, Ubuntu, Fedora, RHEL, Arch Linux, openSUSE and macOS give NOT FLAGGED. It never runs sudo or visudo. It returns BLOCK, REVIEW, or NOT FLAGGED, with the file, line, reason, and a safer approach. Secrets are never printed.
What it checks
BLOCK
- U01: NOPASSWD: ALL (directly, through a Cmnd_Alias or carried over from an earlier command), or ALL with the password turned off by Defaults !authenticate
- U02: commands allowed without a password that open a root shell or write any file: editors, pagers, man and git with any arguments; crontab -e, systemctl edit and kubectl edit; shells, interpreters, find, tar, rsync, docker, kubectl, systemctl, cp, tee and package managers with open or wildcard arguments; interactive shells and su to root
- U03: wildcards in command arguments, regular expressions with ., paths such as /usr/bin/ and folders ending in /
- U04: commands, scripts or installer files (pip install -r, dpkg -i) in home folders, /tmp, /var/tmp or /dev/shm
- U05: env_keep with LD_PRELOAD, LD_LIBRARY_PATH, PYTHONPATH, PERL5LIB, NODE_OPTIONS and similar variables; the SETENV tag; Defaults setenv
REVIEW
- U11: Defaults !authenticate
- U12: Defaults !env_reset
- U13: secure_path missing (while users get limited command rules), turned off, or listing a user-writable folder or "."
- U14: timestamp_timeout above 15 minutes or negative, timestamp_type=global, !tty_tickets
- U15: rules for ALL users or for %users and %everyone (not when Defaults targetpw, rootpw or runaspw asks for the target's password)
- U16: the same shell-escape commands as U02 when a password is asked
- U17: commands subtracted from ALL (ALL, !/bin/su)
What's included
- The scanner (Python 3.9+, standard library only)
- A rules guide with the reason and safer approach for each rule
- A risky and a safe example /etc (sudoers, a cloud-init drop-in, deploy and helpdesk rules), and the real report the scanner produces on the risky one
Limits It reads rule text: host restrictions, group membership, #include files outside the scanned folder, file ownership and the installed sudo version are not checked, and template logic (Jinja, ERB) is skipped. Rules written inside other files (Ansible lineinfile, cloud-init sudo: keys, LDAP sudoRole entries) are not read. NOT FLAGGED is not a guarantee.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.
Static check of sudoers text (sudoers, sudoers.d files and templates). Host and group membership, file ownership, the sudo version and the live system are not checked. NOT FLAGGED is not a guarantee.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 5 days ago
Permissions
Runs one local Python script in the terminal. It reads your project's files, writes nothing, and makes no network calls. The example sudoers files are inert samples. They are never installed, and the scanner never runs sudo or visudo.