360 Secure SkillHub
360 安全技能中心

Whoami Tool Check

该 Skill 提供 whoami-tool-check 命令行工具,用于校验当前用户身份,检查 sudo/root 访问权限,验证用户是否属于指定角色组(如 sudo、docker、admin),列出系统能力,并审计 uid、gid、组、shell 和 home 目录等信息,支持 JSON 输出和退出码集成。

分类:安全
dinghaibin
dinghaibin
热度 25.17
最近更新 2026-05-17 00:36:47

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add dinghaibin/whoami-tool-check
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
whoami-tool-check
description
Identity verification utility — validate current user against expected roles, check sudo access, and audit user capabilities. Extended whoami for security and access audits.

Whoami Tool Check — Identity & Access Verifier

Extended identity verification: confirm the current user matches an expected role, verify sudo/root access, check group membership for specific capabilities, and audit user-level access for security-sensitive operations.

Quick Start

# Verify current user
whoami-tool-check

# Check if current user has sudo access
whoami-tool-check --sudo

Usage

whoami-tool-check [OPTIONS]

Options:
  --sudo          Check if user has sudo/root access
  --role ROLE     Verify user belongs to a role group (sudo, docker, admin, etc.)
  --capabilities  List all accessible system capabilities
  --audit         Full user audit: uid, gid, groups, sudo, shell, home
  --json          Output as structured JSON
  --check-user USER   Check if a specific user exists and their details

Examples

# Full audit
whoami-tool-check --audit

# Check if user has docker access
whoami-tool-check --role docker

# List all capabilities
whoami-tool-check --capabilities

# Check if another user exists
whoami-tool-check --check-user www-data

# JSON for pipeline ingestion
whoami-tool-check --audit --json

Features

  • Current identity — standard whoami output
  • Sudo access check — passwordless sudo availability
  • Role verification — check group membership for specific roles
  • User audit — comprehensive report (uid, gid, groups, sudo, shell, home dir)
  • User existence — verify other system users
  • JSON output — structured for security audits and automation
  • Exit codes — 0/1 for easy script integration