From 2e38f8f21089674641674ba929315824f1ed57fc Mon Sep 17 00:00:00 2001 From: Charissa Miller <48832936+clemiller@users.noreply.github.com> Date: Thu, 7 Dec 2023 12:04:54 -0500 Subject: [PATCH 1/2] search all objects by attack ID --- app/services/attack-objects-service.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/services/attack-objects-service.js b/app/services/attack-objects-service.js index fbb10eae..8193b241 100644 --- a/app/services/attack-objects-service.js +++ b/app/services/attack-objects-service.js @@ -75,6 +75,7 @@ exports.retrieveAll = async function(options) { const match = { $match: { $or: [ + { 'workspace.attack_id': { '$regex': options.search, '$options': 'i' }}, { 'stix.name': { '$regex': options.search, '$options': 'i' } }, { 'stix.description': { '$regex': options.search, '$options': 'i' } } ] From b08ab9af1e3e3a85247a8bf52f17b3d94c075aed Mon Sep 17 00:00:00 2001 From: Charissa Miller <48832936+clemiller@users.noreply.github.com> Date: Thu, 7 Dec 2023 12:05:13 -0500 Subject: [PATCH 2/2] update swagger docs --- app/api/definitions/paths/assets-paths.yml | 2 +- app/api/definitions/paths/attack-objects-paths.yml | 2 +- app/api/definitions/paths/campaigns-paths.yml | 2 +- app/api/definitions/paths/data-sources-paths.yml | 2 +- app/api/definitions/paths/groups-paths.yml | 2 +- app/api/definitions/paths/mitigations-paths.yml | 2 +- app/api/definitions/paths/software-paths.yml | 2 +- app/api/definitions/paths/tactics-paths.yml | 2 +- app/api/definitions/paths/techniques-paths.yml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/api/definitions/paths/assets-paths.yml b/app/api/definitions/paths/assets-paths.yml index 04f24759..5cec7e1f 100644 --- a/app/api/definitions/paths/assets-paths.yml +++ b/app/api/definitions/paths/assets-paths.yml @@ -79,7 +79,7 @@ paths: - name: search in: query description: | - Only return objects where the provided search text occurs in the `name` or `description`. + Only return objects where the provided search text occurs in the `attack_id`, `name`, or `description`. The search is case-insensitive. schema: type: string diff --git a/app/api/definitions/paths/attack-objects-paths.yml b/app/api/definitions/paths/attack-objects-paths.yml index b85ba2a6..13051727 100644 --- a/app/api/definitions/paths/attack-objects-paths.yml +++ b/app/api/definitions/paths/attack-objects-paths.yml @@ -68,7 +68,7 @@ paths: - name: search in: query description: | - Only return ATT&CK objects where the provided search text occurs in the `name` or `description`. + Only return ATT&CK objects where the provided search text occurs in the `attack_id`, `name`, or `description`. The search is case-insensitive. schema: type: string diff --git a/app/api/definitions/paths/campaigns-paths.yml b/app/api/definitions/paths/campaigns-paths.yml index da03c2c0..c1dca1e4 100644 --- a/app/api/definitions/paths/campaigns-paths.yml +++ b/app/api/definitions/paths/campaigns-paths.yml @@ -55,7 +55,7 @@ paths: - name: search in: query description: | - Only return objects where the provided search text occurs in the `name` or `description`. + Only return objects where the provided search text occurs in the `attack_id`, `name`, or `description`. The search is case-insensitive. schema: type: string diff --git a/app/api/definitions/paths/data-sources-paths.yml b/app/api/definitions/paths/data-sources-paths.yml index 20d6320a..f45d14ce 100644 --- a/app/api/definitions/paths/data-sources-paths.yml +++ b/app/api/definitions/paths/data-sources-paths.yml @@ -79,7 +79,7 @@ paths: - name: search in: query description: | - Only return objects where the provided search text occurs in the `name` or `description`. + Only return objects where the provided search text occurs in the `attack_id`, `name`, or `description`. The search is case-insensitive. schema: type: string diff --git a/app/api/definitions/paths/groups-paths.yml b/app/api/definitions/paths/groups-paths.yml index 171cd2c3..c9e31c30 100644 --- a/app/api/definitions/paths/groups-paths.yml +++ b/app/api/definitions/paths/groups-paths.yml @@ -55,7 +55,7 @@ paths: - name: search in: query description: | - Only return objects where the provided search text occurs in the `name` or `description`. + Only return objects where the provided search text occurs in the `attack_id`, `name`, or `description`. The search is case-insensitive. schema: type: string diff --git a/app/api/definitions/paths/mitigations-paths.yml b/app/api/definitions/paths/mitigations-paths.yml index 784a956d..a773e6d1 100644 --- a/app/api/definitions/paths/mitigations-paths.yml +++ b/app/api/definitions/paths/mitigations-paths.yml @@ -67,7 +67,7 @@ paths: - name: search in: query description: | - Only return objects where the provided search text occurs in the `name` or `description`. + Only return objects where the provided search text occurs in the `attack_id`, `name`, or `description`. The search is case-insensitive. schema: type: string diff --git a/app/api/definitions/paths/software-paths.yml b/app/api/definitions/paths/software-paths.yml index db214d77..efc3ac7a 100644 --- a/app/api/definitions/paths/software-paths.yml +++ b/app/api/definitions/paths/software-paths.yml @@ -79,7 +79,7 @@ paths: - name: search in: query description: | - Only return objects where the provided search text occurs in the `name` or `description`. + Only return objects where the provided search text occurs in the `attack_id`, `name`, or `description`. The search is case-insensitive. schema: type: string diff --git a/app/api/definitions/paths/tactics-paths.yml b/app/api/definitions/paths/tactics-paths.yml index 8197a3b8..551ca023 100644 --- a/app/api/definitions/paths/tactics-paths.yml +++ b/app/api/definitions/paths/tactics-paths.yml @@ -67,7 +67,7 @@ paths: - name: search in: query description: | - Only return objects where the provided search text occurs in the `name` or `description`. + Only return objects where the provided search text occurs in the `attack_id`, `name`, or `description`. The search is case-insensitive. schema: type: string diff --git a/app/api/definitions/paths/techniques-paths.yml b/app/api/definitions/paths/techniques-paths.yml index 7cc5ce97..effaf3fb 100644 --- a/app/api/definitions/paths/techniques-paths.yml +++ b/app/api/definitions/paths/techniques-paths.yml @@ -80,7 +80,7 @@ paths: - name: search in: query description: | - Only return objects where the provided search text occurs in the `name` or `description`. + Only return objects where the provided search text occurs in the `attack_id`, `name`, or `description`. The search is case-insensitive. schema: type: string