Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
3d56c87
Initial commit
mehaase Oct 12, 2023
1aa329e
initial data processing
Feb 9, 2024
943a4b2
add dataset
Feb 13, 2024
74ce771
Merge pull request #2 from center-for-threat-informed-defense/matt/da…
jlasky2 Feb 13, 2024
176a230
initial model
Feb 14, 2024
42c55aa
Add python project template to this repo
mehaase Feb 15, 2024
abee141
initial model
Feb 15, 2024
10ea84e
Merge branch 'main' into matt/initial-model
Feb 15, 2024
b02ddbf
update structure and dependencies
Feb 15, 2024
cb16656
transition to notebook
Feb 19, 2024
ee866a1
pre-commit
Feb 19, 2024
72b7878
run black
Feb 19, 2024
eeb4c1d
transition to tensorflow 2.0
Feb 20, 2024
4e6e059
lint keras
Feb 20, 2024
4c5c1a0
get predictions
Feb 21, 2024
20a23d3
refactor data class
Feb 23, 2024
0c7eb62
visualize predictions
Feb 29, 2024
0e0b80d
add regularization
Mar 4, 2024
c4da065
refactor to data builder
Mar 5, 2024
92563a6
Merge pull request #3 from center-for-threat-informed-defense/matt/in…
jlasky2 Mar 5, 2024
7a3f2e2
Merge pull request #4 from center-for-threat-informed-defense/matt/te…
jlasky2 Mar 5, 2024
ee53265
Merge pull request #5 from center-for-threat-informed-defense/matt/pr…
mturner-ml Mar 5, 2024
d581a24
added MITRE ATT&CK Campaigns and fixed references structure for Vectr…
jlasky2 Mar 7, 2024
b177c6b
Merge pull request #6 from center-for-threat-informed-defense/update_…
rossj-en Mar 11, 2024
e72aad0
updated dataset with TIE changes and added OpenCTI data
jlasky2 Mar 12, 2024
7cf2520
removed non-enterprise technique IDs from dataset
jlasky2 Mar 14, 2024
3614102
Updated dataset with TIE changes and added OpenCTI data (#8)
jlasky2 Mar 18, 2024
3313ece
Matt/t sne visualizations and output (#7)
mturner-ml Mar 20, 2024
a443298
update to new dataset format (#10)
mturner-ml Mar 20, 2024
1626158
updated dataset with more OpenCTI reports and removed duplicate entries
jlasky2 Mar 22, 2024
8a29d48
resolving merge conflicts
jlasky2 Apr 2, 2024
e45f41c
Merge pull request #11 from center-for-threat-informed-defense/update…
jlasky2 Apr 2, 2024
8e30bd4
Matt/predict unseen reports (#12)
mturner-ml Apr 7, 2024
2d4d6de
add back tsne (#13)
mturner-ml Apr 9, 2024
23b1f52
add readme for using notebook (#14)
mturner-ml Apr 9, 2024
a330454
added negative ttps set for tram data only
jlasky2 Apr 23, 2024
df0cb91
Merge pull request #15 from center-for-threat-informed-defense/add-ne…
jlasky2 Apr 30, 2024
5ddf0a0
added new data collection folder with opencti graphql python script
jlasky2 Apr 30, 2024
4189b7c
Merge pull request #16 from center-for-threat-informed-defense/add-da…
jlasky2 May 6, 2024
588771e
Matt/bayesian personalized ranking (#17)
mturner-ml May 10, 2024
fbe4d8a
Matt/evaluation metrics (#18)
mturner-ml May 10, 2024
feb5bbc
Matt/wals (#19)
mturner-ml May 10, 2024
8a3c0cb
Matt/implicit bpr recommender (#20)
mturner-ml May 31, 2024
9afe37f
Matt/wals in house implementation (#21)
mturner-ml Jun 10, 2024
153a53e
add necessary requirements (#22)
mturner-ml Jun 11, 2024
fa4f58e
export U and V with ids (#23)
mturner-ml Jun 11, 2024
6cc29be
speed up bpr performance by sampling once (#24)
mturner-ml Jun 13, 2024
c1e1a7f
Matt/test multiple embedding dimensions (#26)
mturner-ml Jun 20, 2024
67f0e73
implement top techniques recommender (#27)
mturner-ml Jul 3, 2024
07aa37a
added dataset with parent only att&ck techniques (#28)
jlasky2 Jul 5, 2024
45942c0
Matt/dot product prediction (#29)
mturner-ml Jul 11, 2024
1267c6d
create command line interface (#31)
mturner-ml Jul 11, 2024
66a7c60
resolve saving incomplete rep
Jul 8, 2024
d8bef9b
Merge pull request #32 from center-for-threat-informed-defense/matt/f…
mikecarenzo Jul 12, 2024
40444f3
Matt/fix recall (#33)
mturner-ml Jul 17, 2024
6e4fa04
Initial Website Implementation (#25)
mikecarenzo Jul 17, 2024
69e7932
TIE-76: Install Build Pipeline (#34)
mikecarenzo Jul 19, 2024
834ff1e
deploy preview site on `main`
mikecarenzo Jul 19, 2024
b733edc
updated datasets to ensure old techniques removed, removed any empty …
jlasky2 Jul 24, 2024
7bc3cb8
Merge pull request #36 from center-for-threat-informed-defense/update…
jlasky2 Jul 30, 2024
3fff832
add baseline analytics
mikecarenzo Aug 20, 2024
9d673a4
adds application-specific analytics
mikecarenzo Aug 20, 2024
45a5359
add affordance for technique collapse/uncollapse
mikecarenzo Aug 20, 2024
02ddaa9
rename `total_techniques_provided` to `total_observed_techniques`
mikecarenzo Aug 20, 2024
46f235c
include technique ids
mikecarenzo Aug 21, 2024
2ab6f93
Merge pull request #37 from center-for-threat-informed-defense/TIE-78…
mehaase Sep 5, 2024
ae17133
patch markdown parsing
mikecarenzo Sep 5, 2024
c93053d
update README
mikecarenzo Sep 5, 2024
efe4d5a
update README
mikecarenzo Sep 5, 2024
c3d7b5c
Final review before publication
mehaase Sep 5, 2024
3e3be02
make notebook pretty
Sep 5, 2024
6411251
Merge pull request #38 from center-for-threat-informed-defense/matt/m…
mehaase Sep 6, 2024
e9ebd8d
update Notebook epochs
mikecarenzo Sep 6, 2024
83e6043
Enable the github pages build
mehaase Sep 6, 2024
2d75424
Don't build azure blob on main
mehaase Sep 6, 2024
9c57bfc
Ensure the build runs when modifying workflows
mehaase Sep 6, 2024
42542d3
TIE-77: Project Documentation (#35)
mikecarenzo Sep 6, 2024
7159a2c
Enable model retraining
mikecarenzo Sep 6, 2024
78b7dac
Python Notebook Documentation (#39)
mikecarenzo Sep 6, 2024
2f52f7d
update README
mikecarenzo Sep 7, 2024
dab98e7
TIE-83 Improve the instructions for the TIE notebook
mehaase Feb 17, 2025
e5eb7fa
TIE-83 Fix the deprecated artifacts github actions
mehaase Feb 17, 2025
a52e9ca
Build fix - set production URL prefix correctly
mehaase Mar 19, 2025
8ce08fe
Your commit message
Nov 24, 2025
4db59b4
Merge branch 'main' of github.com:GreenWinters/PyTIE into TIE-83-jupy…
Nov 24, 2025
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
Binary file added .coverage
Binary file not shown.
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Standard text editor settings.
# See: https://editorconfig.org/

root = true

[*]
end_of_line = = lf
insert_final_newline = true

[*.{js, py}]
charset = utf-8
indent_style = space
indent_size = 4

[Makefile]
indent_style = tab
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
; Force unix line endings for all text files
* text=auto
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
164 changes: 164 additions & 0 deletions .github/workflows/build_website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
name: Build Website

on:
push:
branches: [main]
paths:
- '.github/workflows/**'
- 'src/**'
- 'data/**/*.json'
pull_request:
paths:
- '.github/workflows/**'
- 'src/**'
- 'data/**/*.json'
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:
tie_website_build:
runs-on: ubuntu-latest
env:
BRANCH_NAME: ${{ github.ref_name == 'main' && 'technique-inference-engine' || github.ref_name }}
steps:

# Configure Environment
- uses: actions/checkout@v4

# Configure Node
- uses: actions/setup-node@v4
id: "setup-node"
with:
node-version: '19'
cache: 'npm'
cache-dependency-path: 'src/tie-web-interface/package-lock.json'
- name: Install dependencies
working-directory: src/tie-web-interface/
run: npm ci

# Lint
- name: Lint
working-directory: src/tie-web-interface/
run: npm run lint

# Run Type Checks
- name: Type Check
working-directory: src/tie-web-interface/
run: npm run type-check

# Configure Python
- uses: actions/setup-python@v4
with:
python-version: '3.11.8'
- name: Install Poetry
run: curl -sSL https://install.python-poetry.org/ | python -
- name: Add Poetry to PATH
run: echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Install dependencies
run: poetry install

# Train Model
- name: Retrain Technique Inference Engine Model
working-directory: src/tie-web-interface/
run: npm run build-model

# Build Website
- name: Compile Website
working-directory: src/tie-web-interface/
run: npm run build-only -- --base /technique-inference-engine/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: tie_website
path: src/tie-web-interface/dist/

# Publish to Azure blob only on PRs, not main.
azure_blob:
if: github.ref_name != 'main'
needs: tie_website_build
runs-on: ubuntu-latest
env:
AZURE_STORAGE_ACCOUNT: techniqueinferenceengine
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@v4
with:
node-version: "19"
- run: npm install -g staticrypt
- name: Download Web Site
uses: actions/download-artifact@v4
with:
name: tie_website
path: tie_website
- env:
STATICRYPT_PASS: ${{ secrets.STATICRYPT_PASS }}
run: >
staticrypt --remember 3 --salt b1c18fbb5081eca3e2db08a413b01774 \
--password $STATICRYPT_PASS --short \
--template-title "Technique Inference Engine (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 tie_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/tie_website .
- name: Set the branch name
run: mv tie_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://techniqueinferenceengine.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: tie_website_build
runs-on: ubuntu-latest
environment:
name: github-pages
url: $\{\{ steps.deployment.outputs.page_url \}\}

steps:
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Download Web Site
uses: actions/download-artifact@v4
with:
name: tie_website
path: tie_website
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./tie_website
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
40 changes: 40 additions & 0 deletions .github/workflows/python_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Python Tests

on:
push:
branches: [main]
paths:
- 'src/**'
pull_request:
paths:
- 'src/**'

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11.8'
- name: Install Poetry
run: curl -sSL https://install.python-poetry.org/ | python -
- name: Add Poetry to PATH
run: echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Install dependencies
run: poetry install
- name: Check code formatting
run: poetry run ruff format --check src/
- name: Check imports formatting
run: poetry run ruff check src/
# - name: Check type annotations
# run: poetry run mypy --check src/
- name: Run unit tests
run: poetry run make test-ci
- name: Upload coverage to CodeCov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_SECRET }}
files: coverage.xml
verbose: true
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
__pycache__/
build/
dist/
sdist/
*.egg-info/
coverage.xml
docs/_build/
.mypy_cache/
*.tmp
.DS_Store
.pre-commit-config.yaml
.vscode/
tests
.github
18 changes: 18 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"files.insertFinalNewline": true,
"files.trimTrailingWhitespace": true,
"files.exclude": {
"**/__pycache__": true
},
"editor.rulers": [
88
],
"python.formatting.autopep8Path": "black",
"markdown.extension.toc.levels": "2..6",
"python.formatting.provider": "black",
"editor.formatOnSave": true,
"[scss]": {
"editor.formatOnSave": false,
"editor.formatOnType": false
}
}
47 changes: 47 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Contributing

## How to contribute

Thanks for contributing to Technique Inference Engine!

You are welcome to comment on issues, open new issues, and open pull requests.

Pull requests should target the **main** branch of the repository.

Also, if you contribute any source code, we need you to agree to the following
Developer's Certificate of Origin below.

## Reporting Issues

* Describe (in detail) what should have happened. Include any supporting information
that may be helpful in resolving the issue.

* Be sure to include any steps to replicate the issue.

### Developer's Certificate of Origin v1.1

```
By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
```
Loading
Loading