DestructiveCommandDetector class final
Detects destructive deletion commands (rm, rmdir, del, erase,
shred, unlink, ...), escalating severity based on flags and targets.
- A plain deletion is SecurityLevel.mediumRisk.
- Recursive and forced deletion is SecurityLevel.highRisk.
- Deletion targeting a filesystem root or critical system path (the classic
rm -rf /) is SecurityLevel.critical.
The detector also looks through wrapper commands, so sudo rm -rf / is
still classified as critical.
- Inheritance
-
- Object
- SecurityDetector
- DestructiveCommandDetector
Constructors
- DestructiveCommandDetector()
-
Creates the detector.
const
Properties
- code → String
-
A stable identifier for the detector (matches the SecurityFinding.code
it emits).
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
detect(
SecurityContext context) → List< SecurityFinding> -
Returns any findings for
context. Returns an empty list when nothing is detected.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited