Added mac address validation on network policy whitelist

This commit is contained in:
Matteo Biscosi 2025-02-06 15:22:43 +01:00
parent fccc47eb0d
commit a4e84f5682
3 changed files with 17 additions and 6 deletions

View file

@ -86,6 +86,12 @@ const validateURL = (url) => {
return urlRegex.test(url);
}
const validateMAC = (mac_address) => {
const macRegex = new RegExp(regexes.mac_address)
return macRegex.test(mac_address);
}
/* ****************************************************** */
const validatePortRange = (ports) => {
@ -150,7 +156,8 @@ const regexValidation = function () {
validatePortRange,
validateSingleWord,
validateURL,
validateCIDR
validateCIDR,
validateMAC
};
}();