Skip to content

Commit

Permalink
Merge pull request #328 from center-for-threat-informed-defense/searc…
Browse files Browse the repository at this point in the history
…h-all-by-id

Search all objects by ATT&CK ID
  • Loading branch information
ElJocko authored Dec 13, 2023
2 parents 583f251 + b08ab9a commit 1e3f048
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/api/definitions/paths/assets-paths.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/api/definitions/paths/attack-objects-paths.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/api/definitions/paths/campaigns-paths.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/api/definitions/paths/data-sources-paths.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/api/definitions/paths/groups-paths.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/api/definitions/paths/mitigations-paths.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/api/definitions/paths/software-paths.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/api/definitions/paths/tactics-paths.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/api/definitions/paths/techniques-paths.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions app/services/attack-objects-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' } }
]
Expand Down

0 comments on commit 1e3f048

Please sign in to comment.