Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tat 121 single page app conversion #24

Merged
merged 21 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
6bec512
TAT-127 create shell for spa (#7)
allisonrobbins Mar 27, 2024
d660915
Tat 123 create homepage initial (#8)
allisonrobbins Apr 11, 2024
2c40081
ci: build site previews on `TAT-121-single-page-app-conversion` and o…
mikecarenzo Apr 11, 2024
d98cec2
TAT-138 create calculator pages (#11)
allisonrobbins Apr 18, 2024
b25a4d4
TAT-139 Load ATT&CK data from Calculator spreadsheet into application…
allisonrobbins Apr 25, 2024
b027204
TAT-144 apply scores and filters to technique list (#13)
allisonrobbins May 16, 2024
c08a8d1
feat(TAT-126): Build help page (#14)
allisonrobbins May 28, 2024
29c6801
TAT-145 Top 10 JSON export format (#16)
allisonrobbins May 28, 2024
360402d
TAT-141 dynamic page titles (#17)
allisonrobbins May 31, 2024
c1a893c
feat(TAT-148): add google tracking code to the inde.html (#20)
allisonrobbins Jun 3, 2024
3c48f42
TAT-143 add footer to application pages (#18)
allisonrobbins Jun 3, 2024
b1aae84
TAT(114): Updated calculator sheets to ATTCK version 14.0
jlasky2 Jun 10, 2024
5a5460d
TAT-125 create methodology page (#15)
allisonrobbins Jun 13, 2024
1ee9e94
feat(TAT-119): add detection and mitigation actionabilities to the ex…
allisonrobbins Jun 13, 2024
ba7279f
TAT-92 export top techniques to navigator layer (#22)
allisonrobbins Jun 13, 2024
d6e7e28
TAT-146 put ransomware list on homepage (#19)
allisonrobbins Jun 13, 2024
94f427d
feat(TAT-114): add relationship and mitigation data for version 14 (#23)
allisonrobbins Jun 13, 2024
374e7b9
feat(TAT-149): switch to hash based routing for azure blob (#26)
allisonrobbins Jul 3, 2024
1fb650d
feat(TAT-135): update ransomware list to match latest spreadsheet upd…
allisonrobbins Jul 9, 2024
752a6c5
TAT-150 fix spreadsheet logic (#30)
allisonrobbins Jul 10, 2024
556853b
TAT-142 Add logo to site, 508 compliance, and misc formatting
allisonrobbins Jul 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading