From dc305d8e1682d8391165656ad16b487c72b21eb7 Mon Sep 17 00:00:00 2001 From: Shreya Date: Mon, 5 Jul 2021 15:22:20 +0530 Subject: [PATCH] cc: Add validation format (starts wih `~`) for ransomware linux target directory --- .../components/configuration-components/ValidationFormats.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/ValidationFormats.js b/monkey/monkey_island/cc/ui/src/components/configuration-components/ValidationFormats.js index 1038c45a2..540942f80 100644 --- a/monkey/monkey_island/cc/ui/src/components/configuration-components/ValidationFormats.js +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/ValidationFormats.js @@ -4,6 +4,7 @@ const hostnameRegex = '^([A-Za-z0-9]*[A-Za-z]+[A-Za-z0-9]*.?)*([A-Za-z0-9]*[A-Za const linuxAbsolutePathRegex = '^/' // path starts with `/` const linuxPathStartsWithEnvVariableRegex = '^\\$' // path starts with `$` +const linuxPathStartsWithTilde = '^~' // path starts with `~` const windowsAbsolutePathRegex = '^([A-Za-z]:(\\\\|\\/))' // path starts like `C:\` OR `C:/` const windowsPathStartsWithEnvVariableRegex = '^\\$|^(%\\w*\\d*\\s*%)' // path starts like `$` OR `%abc%` @@ -40,7 +41,8 @@ function buildValidRansomwarePathLinuxRegex() { return new RegExp([ whitespacesOnlyRegex, linuxAbsolutePathRegex, - linuxPathStartsWithEnvVariableRegex + linuxPathStartsWithEnvVariableRegex, + linuxPathStartsWithTilde ].join('|')) }