diff --git a/.github/workflows/cypress-workflow.yml b/.github/workflows/cypress-workflow.yml index 5df3d7107..3b6bc009d 100644 --- a/.github/workflows/cypress-workflow.yml +++ b/.github/workflows/cypress-workflow.yml @@ -9,7 +9,7 @@ on: env: OPENSEARCH_DASHBOARDS_VERSION: '2.9.0' OPENSEARCH_VERSION: '2.9.0-SNAPSHOT' - SECURITY_ANALYTICS_BRANCH: '2.x' + SECURITY_ANALYTICS_BRANCH: '2.9' GRADLE_VERSION: '7.6.1' # If this variable is not empty, the package.json, opensearch_dashboards.json, and yarn.lock files will be replaced diff --git a/package.json b/package.json index d4bac67fc..e5704a22f 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,8 @@ "tough-cookie": "^4.1.3", "semver": "^7.5.2", "@babel/core": "^7.20.12", - "@babel/traverse": "^7.20.12" + "@babel/traverse": "^7.20.12", + "word-wrap": "^1.2.4" }, "devDependencies": { "@elastic/elastic-eslint-config-kibana": "link:../../packages/opensearch-eslint-config-opensearch-dashboards", diff --git a/public/pages/Rules/components/RuleContentViewer/RuleContentViewer.tsx b/public/pages/Rules/components/RuleContentViewer/RuleContentViewer.tsx index 9c5c83afb..193ebfa39 100644 --- a/public/pages/Rules/components/RuleContentViewer/RuleContentViewer.tsx +++ b/public/pages/Rules/components/RuleContentViewer/RuleContentViewer.tsx @@ -129,11 +129,29 @@ export const RuleContentViewer: React.FC = ({ gutterSize="s" data-test-subj={'rule_flyout_rule_tags'} > - {ruleData.tags.map((tag: any, i: number) => ( - - {tag.value} - - ))} + {ruleData.tags.map((tag: { value: string }, i: number) => { + const isLinkable = !!tag.value.match(/attack\.t[0-9]+/); + let tagComponent: React.ReactNode = tag.value; + + if (isLinkable) { + const link = `https://attack.mitre.org/techniques/${tag.value + .split('.') + .slice(1) + .join('/') + .toUpperCase()}`; + tagComponent = ( + + {tag.value} + + ); + } + + return ( + + {tagComponent} + + ); + })} ) : (
{DEFAULT_EMPTY_DATA}
diff --git a/yarn.lock b/yarn.lock index 2f7dbe8a9..5b52758d8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6933,10 +6933,10 @@ which@^2.0.1: dependencies: isexe "^2.0.0" -word-wrap@~1.2.3: - version "1.2.3" - resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" - integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== +word-wrap@^1.2.4, word-wrap@~1.2.3: + version "1.2.5" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" + integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== worker-farm@^1.7.0: version "1.7.0"