is_sensitive_command

Function is_sensitive_command 

Source
pub fn is_sensitive_command(cmd: &str) -> bool
Expand description

Check if a command contains sensitive information.

Returns true if the command should be filtered out.

§Arguments

  • cmd - The command to check

§Example

use aprender_shell::security::is_sensitive_command;

assert!(is_sensitive_command("export AWS_SECRET_ACCESS_KEY=abc123"));
assert!(is_sensitive_command("curl -u admin:password123 https://api.example.com"));
assert!(!is_sensitive_command("git status"));