Skip to content

Commit

Permalink
Tat 121 single page app conversion (#24)
Browse files Browse the repository at this point in the history
* TAT-127 create shell for spa (#7)

* clone base vue template

* add all pages and navbar

* style navbar

* add package-lock

* remove md files from template

* make fixes to remove prettier

---------

Co-authored-by: arobbins <[email protected]>

* Tat 123 create homepage initial (#8)

* get hero section working

* initial hero structure

* update hero with design feedback

* set up content for small screens

* feat(TAT-123): final styling touches

* feat(#123): fix navbar responsiveness

* feat(TAT-123): update tailwind scheme to ctid scheme

* ci: install Azure website previews and `release-please`

* ci: re-enable linter

* bugfix(TAT-123): fix img parameters and component names

* refactor(TAT-123): fix css bug for mobile menu

* refactor(TAT-123): replace & with @amp;

---------

Co-authored-by: arobbins <[email protected]>
Co-authored-by: Michael Carenzo <[email protected]>

* ci: build site previews on `TAT-121-single-page-app-conversion` and on `workflow_dispatch`

* TAT-138 create calculator pages (#11)

* feat(TAT-138): overall page structure

* feat(TAT-138): get filter section scaffolded out

* feat(TAT-138): reorganize files

* feat(TAT-138): add system config section

* feat(TAT-138): fine tune responsive design

* feat(TAT-138): finalize changes

* feat(TAT-124):  foundation for top ten list page

* fix (TAT-124): refactor to move calculator code into components and add mobile view

* style(TAT-124): added formatting for calculator accordion headers

* refactor(TAT-138): integrate two calculator screens and link between them

* style(TAT-124): format section selections on calculator page so user can see what they selected

* feat(TAT-124): add markdown library for technique descriptions

* refactor(TAT-124): reorganize css into component files

* refactor(TAT-138): pull in changes from homepage

* refactor(TAT-138): lint fix

* refactor(TAT-124): download technique list, persist filter selections, open markdown links in new tab

* refactor(TAT-124): clean up css and unused code

* refactor(TAT-138): requested wording fixes, remove logs, styling fix

---------

Co-authored-by: arobbins <[email protected]>

* TAT-139 Load ATT&CK data from Calculator spreadsheet into application (#12)

* feat(TAT-139): set up script to parse technique and score data from Calculator spreadsheet

* refactor(TAT-139): clean up console log, update some object types

* feat(TAT-139): parse mitigations to add to technique JSON

* refactor(TAT-139): remove unused code

* refactor(TAT-139): restructure build scripts to fix lint error

* feat(TAT-139): set filter options on calculator page from technique values

* refactor(TAT-139): restructure code in update_techniques to utilize asyn/await and add detection to subtechnique description

* refactor(TAT-139): define object types for calculator store

* refactor(TAT-139): add type definitions in new file, remove setTechniques() function

* refactor(TAT-139): fix spread operator error

---------

Co-authored-by: arobbins <[email protected]>

* TAT-144 apply scores and filters to technique list (#13)

* feat(TAT-144): Add select/deselect all functionality to NIST and CIS and apply scores to sort technique list

* feat(TAT-144): handle technique list less than ten items

* feat(TAT-144): apply system scores and filters to sorted top 10 list of techniques

* refactor(TAT-144): restructure filterPropertiesObject to synchronize variables, misc code improvements

* refactor(TAT-144): restructure select all to be an empty set if all filters are selected

* refactor(TAT-144): rework select all display for filters

* refactor(TAT-144): define props as required or default

* refactor(144): removing unnecessary if statements in filter logic

---------

Co-authored-by: arobbins <[email protected]>

* feat(TAT-126): Build help page (#14)

* feat(TAT-126): add FAQ and step-by-step guide to using the calculator to help page

* style(TAT-126): make all router links scroll to top of page (remove error with FAQ link auto scrolling to middle of page)

* feat(TAT-126): add icon to links indicating it opens an external site

---------

Co-authored-by: arobbins <[email protected]>

* TAT-145 Top 10 JSON export format (#16)

* feat(TAT-145): remove some technique elements (supertechnique, cumulative_score, etc.) to optimize json export on calculator page

* feat(TAT-145): structure json export

* feat(TAT-97): add actionability, choke point, and prevalence scores to technique metadata

* feat(TAT-97): add prevalence, actionability, and choke point scores to JSON export

---------

Co-authored-by: arobbins <[email protected]>

* TAT-141 dynamic page titles (#17)

* feat(TAT-141): set dynamic page titles based on route

* feat(TAT-141): reference meta.title property to display page name instead of name property

* feat(TAT-141): use nextTick for dynamic page title code

---------

Co-authored-by: arobbins <[email protected]>

* feat(TAT-148): add google tracking code to the inde.html (#20)

Co-authored-by: arobbins <[email protected]>

* TAT-143 add footer to application pages (#18)

* feat(TAT-143): add footer to application pages

* feat(TAT-143): link to related external projects instead of to pages within SPA

* refactor(TAT143): fix attack flow spelling

* feat(TAT-143): update subject line of email link

* refactor(TAT-143): remove ampersand

---------

Co-authored-by: arobbins <[email protected]>

* TAT(114): Updated calculator sheets to ATTCK version 14.0

* TAT-125 create methodology page (#15)

* feat(TAT-125): swt up methodology page structure with container and sidebar

* feat(TAT-125): add text for actionability and choke point

* feat(TAT-125): add text for prevalence

* feat(TAT-125): use mathjax wrapper to convert latex expressions to html text

* feat(TAT-125): adding graph images to methodology pages, delete unnecessary images

* feat(TAT-125): add remaining methodology graphs

* feat(TAT-125): write good alt text for the graphs on methodology pages

* refactor(TAT-125): fix lint error

* feat(TAT-125): use emit instead of referencing parent methods in methodology page and calculator page

* feat(TAT-125): fix mixed content error

* refactor(TAT-125): fix mixed content error

* feat(TAT-125): use static mathjax wrapper instead of importing library

* feat(TAT-125): split methodology details code into dynamic components

* refactor(TAT-125): remove unnecessary code

* feat(TAT-125): upgrade to MathJax 3, typeset on mounted hook

---------

Co-authored-by: arobbins <[email protected]>

* feat(TAT-119): add detection and mitigation actionabilities to the exported JSON (#21)

* feat(TAT-119): add detection and mitigation actionabilities to the exported JSON

* feat(TAT-119): nest actionability scores for clarity when reading json

* feat(TAT-119): Deconstruct Technique and ExportedTechnique into sub interfaces

* feat(TAT-119): remove actionability from json download

---------

Co-authored-by: arobbins <[email protected]>

* TAT-92 export top techniques to navigator layer (#22)

* feat(TAT-92): use primevue SplitButton to add another download option to create navigator layers with top 10 technique scores

* feat(TAT-92): Add score information to navigator comments

* feat(TAT-92): break up strings for usability, fix typescript type error, and remove unnecessary code

* feat(TAT-92): fix bug after merging in change to actionability

---------

Co-authored-by: arobbins <[email protected]>

* TAT-146 put ransomware list on homepage (#19)

* feat(TAT-146): add static ransomware list to home, configure wrapper to reuse list components

* refactor(TAT-146): remove console statements, add comments to explain code

* refactor(TAT-146): fix lint errors

* feat(TAT-146): make text on homepage links different for each link section

* feat(TAT-147): add static lists to top 10 lists page

* style(TAT-146): add pipe or comma between filter/score items on top 10 results page for visual differentiation

* refactor(TAT-146): lint errors

* style(TAT-146): fix styling bug on homepage

* feat(TAT-146): use pipe instead of span, move static list definitions to store

---------

Co-authored-by: arobbins <[email protected]>

* feat(TAT-114): add relationship and mitigation data for version 14 (#23)

* feat(TAT-114): add relationship and mitigation data for version 14 and update script to parse it

* feat(TAT-114): change any references to version 10

---------

Co-authored-by: arobbins <[email protected]>

* feat(TAT-149): switch to hash based routing for azure blob (#26)

Co-authored-by: arobbins <[email protected]>

* feat(TAT-135): update ransomware list to match latest spreadsheet update (#27)

Co-authored-by: arobbins <[email protected]>

* TAT-150 fix spreadsheet logic (#30)

* bugfix(TAT-150): fix cells AF, AH, AJ, AL,AN to have formula that calculates score instead of setting to arbitrary static value

* bugfix(TAT-150): fix score adjustment to match spreadsheet equation and update technique list

---------

Co-authored-by: arobbins <[email protected]>

* TAT-142 Add logo to site, 508 compliance, and misc formatting

* feat(TAT-142): Update favicon

* feat(TAT-142): add logo to homepage and footer, update default text on homepage

* feat(TAT-142): 508 compliance: add alt text to images, add labels to elements

* feat(TAT-142):more accessibility fixes, move css to scoped block

* bugfix(TAT-142): add conditional to delete icons for static lists, set attack version as a store value

* Edited some of the static text

* Pre-release repo cleanup and update README

* style(TAT-142): misc formatting to make site consistent across pages, improve 508 compliance and mobile view

* feat(TAT-142): apply markdown to all text blocks, fix errors with parsing spreadsheet (from updating to latest ATT&CK)

* style(TAT-142): set max width for footer

---------

Co-authored-by: arobbins <[email protected]>
Co-authored-by: Mark E. Haase <[email protected]>

---------

Co-authored-by: arobbins <[email protected]>
Co-authored-by: Michael Carenzo <[email protected]>
Co-authored-by: jlasky2 <[email protected]>
Co-authored-by: Mark E. Haase <[email protected]>
  • Loading branch information
5 people authored Jul 10, 2024
1 parent f53376f commit 3c79ab2
Show file tree
Hide file tree
Showing 83 changed files with 57,773 additions and 401 deletions.
16 changes: 16 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* eslint-env node */
require("@rushstack/eslint-patch/modern-module-resolution");

module.exports = {
root: true,
parserOptions: {
parser: "@typescript-eslint/parser",
ecmaVersion: 2020,
},
extends: [
"plugin:vue/vue3-essential",
"eslint:recommended",
"@vue/typescript",
"@vue/typescript/recommended",
],
};
21 changes: 21 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Update Release

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Update release
uses: google-github-actions/release-please-action@v3
with:
command: manifest
132 changes: 132 additions & 0 deletions .github/workflows/website-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: Build Website

on:
push:
branches: [TAT-121-single-page-app-conversion]
pull_request:
workflow_dispatch:

# If another web build starts for the same branch, cancel the previous build. This
# protects us from two builds trying to upload at the same time and clobbering each
# other.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read
id-token: write
pages: write
pull-requests: write

jobs:
tat_website_build:
runs-on: ubuntu-latest
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
steps:

# Configure Environment
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
id: "setup-node"
with:
node-version: '19'
cache: 'npm'
cache-dependency-path: './package-lock.json'
- name: Install dependencies
run: npm ci

# Lint
- name: Lint
run: npm run lint

# Build and Upload Artifact
- name: Type Check
run: npm run type-check
- name: Build
run: npm run build-only -- --base /$BRANCH_NAME/
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: tat_website
path: ./dist/

# Publish to Azure blob only on PRs, not main.
azure_blob:
if: github.ref_name != 'main'
needs: tat_website_build
runs-on: ubuntu-latest
env:
AZURE_STORAGE_ACCOUNT: topattacktechniques
AZURE_STORAGE_SAS_TOKEN: ${{ secrets.AZURE_SAS_TOKEN }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
STATICRYPT_PASS: ${{ secrets.STATICRYPT_PASS }}
steps:
- uses: actions/setup-node@v3
with:
node-version: "19"
- run: npm install -g staticrypt
- name: Download Web Site
uses: actions/download-artifact@v3
with:
name: tat_website
path: tat_website
- env:
STATICRYPT_PASS: ${{ secrets.STATICRYPT_PASS }}
run: >
staticrypt --remember 3 --salt b1c18fbb5081eca3e2db08a413b01774 \
--password $STATICRYPT_PASS --short \
--template-title "Top ATT&CK Techniques (branch: $BRANCH_NAME)" \
--template-instructions "The contents of this site are marked TLP:AMBER:CTID-R&D:22-80. Do not share with unauthorized individuals." \
--template-color-primary "#6241c5" \
--template-color-secondary "#b2b2b2" \
--template-button "Log In" \
-r tat_website/
- name: Ensure StatiCrypt ran # StatiCrypt will fail without warning; verify it created a directory
run: test -d encrypted
- name: Copy encrypted HTML files
run: rsync -Ir -v --include='*.html' --exclude='*.*' encrypted/tat_website .
- name: Set the branch name
run: mv tat_website "$BRANCH_NAME"
- name: Install Azure CLI
run: curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
- name: Delete old blobs
run: az storage blob delete-batch -s '$web' --pattern "$BRANCH_NAME/*"
- name: Upload to blob storage
run: az storage blob upload-batch -s . --pattern "$BRANCH_NAME/*" -d '$web'
- uses: actions/github-script@v6
if: github.event_name == 'pull_request'
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `This PR has been published to https://topattacktechniques.z13.web.core.windows.net/${process.env['BRANCH_NAME']}/`,
})
# github_pages:
# # This job only runs when committing or merging to main branch.
# if: github.ref_name == 'main'
# needs: tat_website_build
# runs-on: ubuntu-latest
# environment:
# name: github-pages
# url: $\{\{ steps.deployment.outputs.page_url \}\}

# steps:
# - name: Setup Pages
# uses: actions/configure-pages@v2
# - name: Download Web Site
# uses: actions/download-artifact@v3
# with:
# name: tat_website
# path: tat_website
# - name: Upload artifact
# uses: actions/upload-pages-artifact@v1
# with:
# path: ./tat_website
# - name: Deploy to GitHub Pages
# id: deployment
# uses: actions/deploy-pages@v1
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
!.vscode/settings.json
!.vscode/vue.code-snippets
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
1 change: 1 addition & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
}
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
}
17 changes: 17 additions & 0 deletions .vscode/vue.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"Vue 3 SFC with Scoped CSS": {
"prefix": "sfc",
"body": [
"<script setup></script>",
"",
"<template>",
" <div>$0</div>",
"</template>",
"",
"<style scoped></style>",
""
],
"description": "Base for a Vue 3 SFC with scoped css style block",
"scope": "vue"
},
}
29 changes: 0 additions & 29 deletions Calculator.md

This file was deleted.

Binary file removed Calculator.xlsx
Binary file not shown.
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# See `make help` for a list of all available commands.
#

.DEFAULT_GOAL := help
ROOTDIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))

.PHONY: help
help: ## Show Makefile help
@grep -hE '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | \
sort

.PHONY: build
build: ## Build the application
npm run build

.PHONY: serve
serve: ## Run the dev server
npm run dev
Loading

0 comments on commit 3c79ab2

Please sign in to comment.