From 12daf7cceef8bf6299f51aecde60c5b6f368a1f1 Mon Sep 17 00:00:00 2001 From: VijayKesharwani <122533719+VijayKesharwani@users.noreply.github.com> Date: Tue, 21 Nov 2023 11:44:28 +0530 Subject: [PATCH] Create camara-security-no-secrets-in-path-or-query-parameters.js --- ...y-no-secrets-in-path-or-query-parameters.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 lint_function/camara-security-no-secrets-in-path-or-query-parameters.js diff --git a/lint_function/camara-security-no-secrets-in-path-or-query-parameters.js b/lint_function/camara-security-no-secrets-in-path-or-query-parameters.js new file mode 100644 index 0000000000..df99c8f07c --- /dev/null +++ b/lint_function/camara-security-no-secrets-in-path-or-query-parameters.js @@ -0,0 +1,18 @@ +const sensetiveData = ['MSISDN','IMSI']; + +export default async function (input) { + + // Iterate over properties of the input object + for (const path in input) { + + if (typeof path === 'string') { + for (const word of sensetiveData) { + const regex = new RegExp(`\\b${word}\\b`, 'g'); // Use a regular expression to match 'word' as a standalone word + + if (regex.test(path)) { + console.log(`Warn: Sensetive Data found in input: '${path}' Consider avoiding the use of Sesentive data '${word}'. `); + } + } + } + } +}