From de0bf0ce9a99daa2533b0af1480209881eb13afc Mon Sep 17 00:00:00 2001 From: Dwi Siswanto Date: Sun, 24 Oct 2021 09:25:47 +0700 Subject: [PATCH 1/3] Add FortiToken Cloud API test --- token-spray/fortitoken-cloud.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 token-spray/fortitoken-cloud.yaml diff --git a/token-spray/fortitoken-cloud.yaml b/token-spray/fortitoken-cloud.yaml new file mode 100644 index 0000000000..a2b374b44d --- /dev/null +++ b/token-spray/fortitoken-cloud.yaml @@ -0,0 +1,28 @@ +id: api-fortitoken-cloud + +info: + name: FortiToken Cloud API Test + author: dwisiswant0 + reference: https://docs.fortinet.com/document/fortitoken-cloud/latest/rest-api/456035/overview + severity: info + tags: token-spray,fortitoken-cloud + +self-contained: true +requests: + - method: GET + path: + - "https://ftc.fortinet.com:9696/api/v1/user" + headers: + Authorization: Bearer {{token}} + + matchers: + - type: regex + part: body + regex: + - "(?:notification_method|mobile_number|(?:c(?:ustomer|lient)_i|(?:realm_|(?:user_)?)i)d|auth_method|fail_times|(?:updated|created|bypass)_at|lockout_at|user(?:_data|name)|active|realm|email)" + + - type: regex + part: body + regex: + - "error_(code|message|name)" + negative: true From 439ad4c5183373592b4328c1370ba034267fba39 Mon Sep 17 00:00:00 2001 From: Dwi Siswanto Date: Sun, 24 Oct 2021 09:27:27 +0700 Subject: [PATCH 2/3] Revert regex matcher with status code & using matcher condition --- token-spray/fortitoken-cloud.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/token-spray/fortitoken-cloud.yaml b/token-spray/fortitoken-cloud.yaml index a2b374b44d..0785e4a98c 100644 --- a/token-spray/fortitoken-cloud.yaml +++ b/token-spray/fortitoken-cloud.yaml @@ -15,11 +15,11 @@ requests: headers: Authorization: Bearer {{token}} + matchers-condition: and matchers: - - type: regex - part: body - regex: - - "(?:notification_method|mobile_number|(?:c(?:ustomer|lient)_i|(?:realm_|(?:user_)?)i)d|auth_method|fail_times|(?:updated|created|bypass)_at|lockout_at|user(?:_data|name)|active|realm|email)" + - type: status + status: + - 200 - type: regex part: body From ec6db6df110a364e3774323561e2617d0a887610 Mon Sep 17 00:00:00 2001 From: Sandeep Singh Date: Sun, 24 Oct 2021 10:18:17 +0530 Subject: [PATCH 3/3] Update fortitoken-cloud.yaml --- token-spray/fortitoken-cloud.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/token-spray/fortitoken-cloud.yaml b/token-spray/fortitoken-cloud.yaml index 0785e4a98c..3a49a9a760 100644 --- a/token-spray/fortitoken-cloud.yaml +++ b/token-spray/fortitoken-cloud.yaml @@ -5,7 +5,7 @@ info: author: dwisiswant0 reference: https://docs.fortinet.com/document/fortitoken-cloud/latest/rest-api/456035/overview severity: info - tags: token-spray,fortitoken-cloud + tags: token-spray,fortinet self-contained: true requests: