Back to skill

Security audit

Auditd

Security checks for vulnerabilities and agentic risk

Overview

This is a straightforward auditd reference skill that prints command examples, though some examples would be powerful if a user manually runs them on a real Linux system.

Installers should understand this as a sysadmin reference, not an automation tool. Review and adapt any auditctl, service, semodule, or rules.d examples before running them, especially on production systems, because copied commands can change or disable audit coverage.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (22)

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/script.sh (reported line 70)May include surrounding context.

sh
auditctl -l

# Watch a file
auditctl -w /etc/passwd -p wa -k identity

# Search for events
ausearch -k identity

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/script.sh (reported line 90)May include surrounding context.

sh
auditctl -l

# Watch a file
auditctl -w /etc/passwd -p wa -k identity

# Search for events
ausearch -k identity

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/script.sh (reported line 127)May include surrounding context.

sh
auditctl -l

# Watch a file
auditctl -w /etc/passwd -p wa -k identity

# Search for events
ausearch -k identity

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/script.sh (reported line 137)May include surrounding context.

sh
auditctl -l

# Watch a file
auditctl -w /etc/passwd -p wa -k identity

# Search for events
ausearch -k identity

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/script.sh (reported line 155)May include surrounding context.

sh
auditctl -l

# Watch a file
auditctl -w /etc/passwd -p wa -k identity

# Search for events
ausearch -k identity

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/script.sh (reported line 285)May include surrounding context.

sh
auditctl -l

# Watch a file
auditctl -w /etc/passwd -p wa -k identity

# Search for events
ausearch -k identity

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/script.sh (reported line 303)May include surrounding context.

sh
auditctl -l

# Watch a file
auditctl -w /etc/passwd -p wa -k identity

# Search for events
ausearch -k identity

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/script.sh (reported line 304)May include surrounding context.

sh
auditctl -l

# Watch a file
auditctl -w /etc/passwd -p wa -k identity

# Search for events
ausearch -k identity

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/script.sh (reported line 467)May include surrounding context.

sh
auditctl -l

# Watch a file
auditctl -w /etc/passwd -p wa -k identity

# Search for events
ausearch -k identity

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/script.sh (reported line 96)May include surrounding context.

sh
auditctl -w /etc/ssh/ -p wa -k sshd_config

# Permission filters: r=read, w=write, x=execute, a=attribute
auditctl -w /etc/shadow -p rwxa -k shadow_access
```

### System Call Rules (-a)

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/script.sh (reported line 138)May include surrounding context.

sh
auditctl -w /etc/ssh/ -p wa -k sshd_config

# Permission filters: r=read, w=write, x=execute, a=attribute
auditctl -w /etc/shadow -p rwxa -k shadow_access
```

### System Call Rules (-a)

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/script.sh (reported line 286)May include surrounding context.

sh
auditctl -w /etc/ssh/ -p wa -k sshd_config

# Permission filters: r=read, w=write, x=execute, a=attribute
auditctl -w /etc/shadow -p rwxa -k shadow_access
```

### System Call Rules (-a)

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/script.sh (reported line 405)May include surrounding context.

sh
auditctl -w /etc/ssh/ -p wa -k sshd_config

# Permission filters: r=read, w=write, x=execute, a=attribute
auditctl -w /etc/shadow -p rwxa -k shadow_access
```

### System Call Rules (-a)

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/script.sh (reported line 469)May include surrounding context.

sh
auditctl -w /etc/ssh/ -p wa -k sshd_config

# Permission filters: r=read, w=write, x=execute, a=attribute
auditctl -w /etc/shadow -p rwxa -k shadow_access
```

### System Call Rules (-a)

Context Leakage

High
Category
Data Exfiltration
Confidence
85% confidence
Finding

Code or instructions that leak agent conversation context to external services, potentially exposing sensitive user interactions.

Content

Scanner excerpt · scripts/script.sh (reported line 483)May include surrounding context.

sh
-w /var/log/lastlog -p wa -k logins
-w /var/run/faillock/ -p wa -k logins

# 4.1.7 Record session initiation
-w /var/run/utmp -p wa -k session
-w /var/log/wtmp -p wa -k logins
-w /var/log/btmp -p wa -k logins

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Persistent Context Injection

Medium
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill injects content designed to persist in agent memory or context across interactions. Persistent injection can alter agent behavior long after the initial interaction.

Content

Scanner excerpt · scripts/script.sh (reported line 133)May include surrounding context.

sh
| success | 0 or 1 | Syscall succeeded? |
| exit | -EACCES | Exit value |

## Persistent Rules
```bash
# Rules in /etc/audit/rules.d/*.rules survive reboot
# File: /etc/audit/rules.d/10-identity.rules

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script presents destructive audit rule management commands such as deleting all active audit rules without any warning, confirmation, or clear note about operational impact. In a reference skill, this can mislead users into disabling or removing audit coverage and reduce visibility during incidents or compliance monitoring.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
85% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/script.sh (reported line 489)May include surrounding context.

sh
-w /var/log/btmp -p wa -k logins

# 4.1.8 Record permission changes
-a always,exit -F arch=b64 -S chmod -S fchmod -S fchmodat -k perm_mod
-a always,exit -F arch=b64 -S chown -S fchown -S fchownat -S lchown -k perm_mod
-a always,exit -F arch=b64 -S setxattr -S lsetxattr -S fsetxattr -k perm_mod
-a always,exit -F arch=b64 -S removexattr -S lremovexattr -S fremovexattr -k perm_mod

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/script.sh (reported line 496)May include surrounding context.

sh
# 4.1.11 Record use of privileged commands
# Generate with: find / -xdev -perm /6000 -type f
-a always,exit -F path=/usr/bin/sudo -F perm=x -F auid>=1000 -F auid!=4294967295 -k privileged
-a always,exit -F path=/usr/bin/su -F perm=x -F auid>=1000 -F auid!=4294967295 -k privileged

# 4.1.17 Make rules immutable

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · scripts/script.sh (reported line 570)May include surrounding context.

sh
# 4.1.11 Record use of privileged commands
# Generate with: find / -xdev -perm /6000 -type f
-a always,exit -F path=/usr/bin/sudo -F perm=x -F auid>=1000 -F auid!=4294967295 -k privileged
-a always,exit -F path=/usr/bin/su -F perm=x -F auid>=1000 -F auid!=4294967295 -k privileged

# 4.1.17 Make rules immutable

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The tool reference includes commands to disable auditing, unlock or weaken audit behavior, and reduce failure handling without any cautionary context. Users may copy these examples directly, causing loss of audit logs, weaker enforcement, or complete audit shutdown on production systems.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.