Showing preview only (353K chars total). Download the full file or copy to clipboard to get everything.
Repository: we45/ThreatPlaybook
Branch: master
Commit: 36eb825b0ca3
Files: 108
Total size: 324.2 KB
Directory structure:
gitextract_ntphgy1z/
├── .dockerignore
├── .github/
│ └── workflows/
│ └── main.yml
├── .gitignore
├── README.md
├── api/
│ ├── .vscode/
│ │ └── settings.json
│ ├── Dockerfile
│ ├── conftest.py
│ ├── requirements.txt
│ ├── tests/
│ │ └── test_flask.py
│ └── tp_api/
│ ├── __init__.py
│ ├── app.py
│ ├── asvs/
│ │ └── asvs.csv
│ ├── models.py
│ ├── repo/
│ │ ├── aws_s3.yaml
│ │ ├── cert_validation.yaml
│ │ ├── code_injection.yaml
│ │ ├── idor_pk.yaml
│ │ ├── insecure_deserialization.yaml
│ │ ├── password-bruteforce.yaml
│ │ ├── plaintext-transmission.yaml
│ │ ├── sql_injection.yaml
│ │ ├── ssrf.yaml
│ │ ├── weak-default-password.yaml
│ │ ├── xss.yaml
│ │ └── xxe.yaml
│ ├── swagger/
│ │ ├── abuse-create.yml
│ │ ├── change-password.yml
│ │ ├── feature-create.yml
│ │ ├── get-abuse.yml
│ │ ├── get-feature.yml
│ │ ├── get-project.yml
│ │ ├── get-scenario.yml
│ │ ├── get-tests.yml
│ │ ├── scan-create.yml
│ │ ├── scenario-inline.yml
│ │ ├── scenario-repo.yml
│ │ ├── target-create-update.yml
│ │ ├── test-case-create.yml
│ │ └── vulnerability-create.yml
│ ├── utils.py
│ └── wait-for
├── docker-compose.yml
├── documentation/
│ ├── .gitignore
│ ├── README.md
│ ├── babel.config.js
│ ├── docs/
│ │ ├── client-ui.md
│ │ ├── configure-cli.md
│ │ ├── create-project.md
│ │ ├── install-client.md
│ │ ├── overview.md
│ │ ├── quick-installation.md
│ │ ├── story-driven.md
│ │ ├── tutorial-client-ui.md
│ │ └── tutorial.md
│ ├── docusaurus.config.js
│ ├── package.json
│ ├── sidebars.js
│ ├── src/
│ │ ├── css/
│ │ │ └── custom.css
│ │ └── pages/
│ │ ├── index.js
│ │ └── styles.module.css
│ └── static/
│ └── .nojekyll
├── frontend/
│ └── Playbook-Frontend/
│ ├── .babelrc
│ ├── .editorconfig
│ ├── .gitignore
│ ├── Dockerfile
│ ├── README.md
│ ├── assets/
│ │ └── variables.scss
│ ├── components/
│ │ ├── Logo.vue
│ │ ├── README.md
│ │ ├── VuetifyLogo.vue
│ │ ├── project/
│ │ │ ├── Content.vue
│ │ │ └── Header.vue
│ │ └── projects/
│ │ └── ProjectsPage.vue
│ ├── jest.config.js
│ ├── jsconfig.json
│ ├── layouts/
│ │ ├── default.vue
│ │ ├── error.vue
│ │ └── main.vue
│ ├── middleware/
│ │ └── README.md
│ ├── nuxt.config.js
│ ├── package.json
│ ├── pages/
│ │ ├── home/
│ │ │ └── index.vue
│ │ ├── index.vue
│ │ ├── projects/
│ │ │ ├── _name/
│ │ │ │ ├── abuser-story.vue
│ │ │ │ ├── project.vue
│ │ │ │ ├── threat-map.vue
│ │ │ │ ├── threat-scenario.vue
│ │ │ │ ├── user-story.vue
│ │ │ │ └── vulnerabilities.vue
│ │ │ └── index.vue
│ │ └── scan/
│ │ └── _name.vue
│ ├── plugins/
│ │ ├── README.md
│ │ ├── vue-apexchart.js
│ │ └── vue-organization-chart.js
│ ├── store/
│ │ ├── abuserStory.js
│ │ ├── home.js
│ │ ├── index.js
│ │ ├── login.js
│ │ ├── projects.js
│ │ ├── scan.js
│ │ ├── threatScenario.js
│ │ ├── threatmap.js
│ │ ├── userStory.js
│ │ └── vulnerability.js
│ └── test/
│ └── Logo.spec.js
└── nginx/
├── Dockerfile
├── alpine.df
└── sites-enabled/
└── tp_nginx
================================================
FILE CONTENTS
================================================
================================================
FILE: .dockerignore
================================================
*/node_modules
*.log
================================================
FILE: .github/workflows/main.yml
================================================
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Build API Docker Container
run: cd $GITHUB_WORKSPACE/api/ && docker build . --file $GITHUB_WORKSPACE/api/Dockerfile --tag we45/threatplaybook-server
- name: Test Secret
run: echo $DOCKER_LOGIN_USER
- name: Build and Push
uses: zemuldo/docker-build-push@master
env:
DOCKER_USERNAME: "we45"
DOCKER_NAMESPACE: "we45"
DOCKER_PASSWORD: ${{ secrets.DOCKER_LOGIN_PASS }}
REGISTRY_URL: "docker.io"
with:
image_name: "threatplaybook-server"
image_tag: "latest"
================================================
FILE: .gitignore
================================================
example/*.html
example/*.xml
example/*.json
example/*.png
example/*.txt
example/*.mmd
example/*.md
results/
tv/
ThreatPlaybook.egg-info/*
dist/*
threat_playbook/ThreatPlaybook.egg-info/dependency_links.txt
threat_playbook/ThreatPlaybook.egg-info/entry_points.txt
threat_playbook/ThreatPlaybook.egg-info/PKG-INFO
threat_playbook/ThreatPlaybook.egg-info/requires.txt
threat_playbook/ThreatPlaybook.egg-info/SOURCES.txt
threat_playbook/ThreatPlaybook.egg-info/top_level.txt
venv3/*
v1/ThreatPlaybook.egg-info/top_level.txt
v1/ThreatPlaybook.egg-info/SOURCES.txt
v1/ThreatPlaybook.egg-info/requires.txt
v1/ThreatPlaybook.egg-info/PKG-INFO
v1/ThreatPlaybook.egg-info/entry_points.txt
v1/ThreatPlaybook.egg-info/dependency_links.txt
v3/cli/.cred
v3/cli/schematest.json
v3/cli/schema.schema
v3/cli/threat_model_example.json
v3/cli/case_example.json
v3/cli/repo_gql.json
v3/cli/feature_test.json
v3/api/.env
.idea/encodings.xml
*.xml
*.xml
.idea/vcs.xml
.idea/ThreatPlaybook.iml
v3/api/.env
v3/api/.env
.idea/vcs.xml
.idea/*
v3/threatplaybook_db/
v3/robot/test/log.html
v3/robot/test/report.html
v3/.DS_Store
v3/frontend/.DS_Store
.DS_Store
api/.env
threatplaybook_db/*
robot/test/log.html
robot/test/report.html
robot/test/log.html
robot/test/report.html
robot/test/log.html
*.html
v3/frontend/ThreatPlaybook-Frontend/node_modules/
v3/frontend/ThreatPlaybook-Frontend/dist/
v3/frontend/ThreatPlaybook-Frontend/npm-debug.log*
v3/frontend/ThreatPlaybook-Frontend/yarn-debug.log*
v3/frontend/ThreatPlaybook-Frontend/yarn-error.log*
v3/frontend/ThreatPlaybook-Frontend/package-lock.json
frontend/ThreatPlaybook-Frontend/node_modules/
frontend/ThreatPlaybook-Frontend/npm-debug.log*
frontend/ThreatPlaybook-Frontend/yarn-debug.log*
frontend/ThreatPlaybook-Frontend/yarn-error.log*
frontend/ThreatPlaybook-Frontend/package-lock.json
# frontend/ThreatPlaybook-Frontend/.babelrc
# frontend/ThreatPlaybook-Frontend/.editorconfig
Pipfile.lock
Pipfile
cli/dist/ThreatPlaybook-Client-3.0.3.tar.gz
cli/playbook/.cred
venv/
*.pyc
api/__pycache__/utils.cpython-37.pyc
api/__pycache__/models.cpython-37.pyc
.vscode/settings.json
*.lock
apiv2/.vscode/settings.json
apiv2/tp_api/logs/output.log
apiv2/logs/output.log
logs/output.log
website/node_modules/*
frontend/Playbook-Frontend/package-lock.json
api/tp_api/logs/output.log
================================================
FILE: README.md
================================================
# ThreatPlaybook
> This is version 3 (beta)
### What it was:
A (relatively) Unopinionated framework that faciliates Threat Modeling as Code married with Application Security Automation on a single Fabric
### What it is now:
A unified DevSecOps Framework that allows you to go from iterative, collaborative Threat Modeling to Application Security Test Orchestration
[](https://www.blackhat.com/us-18/arsenal/schedule/index.html#threatplaybook-11697)
[Documentation](https://threatplaybook.netlify.app)
* [Quick Start](https://threatplaybook.netlify.app/docs/installation)
* [Tutorial](https://threatplaybook.netlify.app/docs/tutorial)

## Brought to you proudly by

================================================
FILE: api/.vscode/settings.json
================================================
{
"python.formatting.provider": "black",
"python.pythonPath": "venv/bin/python"
}
================================================
FILE: api/Dockerfile
================================================
FROM python:alpine3.7
COPY tp_api/ /app
COPY requirements.txt /app
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.2.1/wait ./wait
RUN chmod +x ./wait
WORKDIR /app
RUN chmod +x wait-for
RUN apk add --no-cache --virtual .build-deps g++ python3-dev libffi-dev libressl-dev && \
apk add --no-cache --update python3 && \
pip3 install --upgrade pip setuptools
RUN pip install -r requirements.txt
EXPOSE 5000
CMD ["/usr/local/bin/python", "/app/app.py"]
================================================
FILE: api/conftest.py
================================================
================================================
FILE: api/requirements.txt
================================================
appdirs==1.4.3
attrs==19.3.0
bcrypt==3.1.7
black==19.10b0
blinker==1.4
cffi==1.14.0
click==7.1.1
entrypoints==0.3
flake8==3.7.9
flasgger==0.9.4
Flask==1.1.2
Flask-Cors==3.0.8
flask-mongoengine==0.9.5
Flask-WTF==0.14.3
importlib-metadata==1.6.0
itsdangerous==1.1.0
Jinja2==2.11.2
jsonschema==3.2.0
loguru==0.4.1
MarkupSafe==1.1.1
mccabe==0.6.1
mistune==0.8.4
mongoengine==0.19.1
more-itertools==8.2.0
packaging==20.3
pathspec==0.8.0
pluggy==0.13.1
py==1.8.1
pycodestyle==2.5.0
pycparser==2.20
pyflakes==2.1.1
PyJWT==1.7.1
pymongo==3.10.1
pyparsing==2.4.7
pyrsistent==0.16.0
pytest==5.4.1
pytest-flask==1.0.0
PyYAML==5.3.1
regex==2020.4.4
six==1.14.0
toml==0.10.0
typed-ast==1.4.1
wcwidth==0.1.9
Werkzeug==1.0.1
WTForms==2.3.1
zipp==3.1.0
================================================
FILE: api/tests/test_flask.py
================================================
import pytest
from tp_api.app import app
import json
import secrets
token = ""
project_name = ""
use_case = ""
abuse_case = ""
threat_scenario = ""
target_name = ""
scan_name = ""
cwe = 89
@pytest.fixture(scope="module")
def client():
with app.test_client() as c:
yield c
def test_change_password(client):
response = client.post(
"/change-password",
data=json.dumps(
{
"email": "admin@admin.com",
"old_password": "supersecret",
"new_password": "supersecret",
"verify_password": "supersecret",
}
),
content_type="application/json",
)
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
def test_login(client):
response = client.post(
"/login",
data=json.dumps({"email": "admin@admin.com",
"password": "supersecret"}),
content_type="application/json",
)
data = json.loads(response.get_data(as_text=True))
global token
token = data.get("data").get("token")
assert response.status_code == 200
assert data.get("success")
def test_create_project(client):
response = client.post(
"/project/create",
data=json.dumps(
{"name": "test-project-{}".format(secrets.token_urlsafe(8))}),
content_type="application/json",
headers={"Authorization": token},
)
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
assert data.get("data").get("name")
global project_name
project_name = data.get("data").get("name")
def test_create_feature(client):
response = client.post(
"/feature/create",
data=json.dumps(
{
"short_name": "test-feature-{}".format(secrets.token_urlsafe(8)),
"description": "This is a test description",
"project": project_name,
}
),
content_type="application/json",
headers={"Authorization": token},
)
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
assert data.get("data").get("short_name")
global use_case
use_case = data.get("data").get("short_name")
def test_create_abuser_story(client):
response = client.post(
"/abuse-case/create",
data=json.dumps(
{
"short_name": "test-abuser-story-{}".format(secrets.token_urlsafe(8)),
"description": "This is a test description",
"feature": use_case,
}
),
content_type="application/json",
headers={"Authorization": token},
)
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
assert data.get("data").get("short_name")
global abuse_case
abuse_case = data.get("data").get("short_name")
def test_create_threat_scenario_repo(client):
response = client.post(
"/scenario/repo/create",
data=json.dumps(
{
"name": "threat-scenario-{}".format(secrets.token_urlsafe(8)),
"description": "This is a test description",
"feature": use_case,
"abuser_story": abuse_case,
"vul_name": "SQL Injection",
"type": "repo",
"repo_name": "sql_injection"
}
),
content_type="application/json",
headers={"Authorization": token},
)
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
assert data.get("data").get("name")
def test_create_threat_scenario(client):
response = client.post(
"/scenario/create",
data=json.dumps(
{
"name": "threat-scenario-{}".format(secrets.token_urlsafe(8)),
"description": "This is a test description",
"feature": use_case,
"abuser_story": abuse_case,
"vul_name": "SQL Injection",
"type": "inline"
}
),
content_type="application/json",
headers={"Authorization": token},
)
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
assert data.get("data").get("name")
global threat_scenario
threat_scenario = data.get("data").get("name")
def test_create_test_case(client):
response = client.post(
"/test/create",
data=json.dumps(
{
"name": "test-case-{}".format(secrets.token_urlsafe(8)),
"test_case": "some test case",
"threat_scenario": threat_scenario,
}
),
content_type="application/json",
headers={"Authorization": token},
)
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
assert data.get("data").get("name")
def test_create_target(client):
response = client.post(
"/target/create",
data=json.dumps(
{
"name": "test-target-{}".format(secrets.token_urlsafe(8)),
"url": "http://example.com",
"project": project_name,
}
),
content_type="application/json",
headers={"Authorization": token},
)
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
assert data.get("data").get("name")
global target_name
target_name = data.get('data').get('name')
def test_create_scan(client):
response = client.post(
"/scan/create",
data=json.dumps(
{
"tool": "ZAP",
"target": target_name,
"scan_type": "DAST"
}
),
content_type="application/json",
headers={"Authorization": token},
)
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
assert data.get("data").get("name")
global scan_name
scan_name = data.get('data').get('name')
def test_create_vulnerability(client):
response = client.post(
"/vulnerability/create",
data=json.dumps(
{
"name": "SQL Injection",
"scan": scan_name,
"vul_name": "SQL Injection",
"cwe": 89,
"severity": 3,
"description": "Test Description",
"evidences": [
{
"log": "test log",
"url": "attack.php",
"param": "vulnId",
"info": "Found this param by Vulnerability Scanning"
}
]
}
),
content_type="application/json",
headers={"Authorization": token},
)
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
assert data.get("data").get("name")
def test_get_project(client):
response = client.get("/project/read", headers={"Authorization": token})
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
def test_get_project_specific(client):
response = client.post(
"/project/read",
data=json.dumps(
{"name": project_name}
),
content_type="application/json",
headers={"Authorization": token},
)
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
def test_get_feature_by_project(client):
response = client.post(
"/feature/read",
data=json.dumps(
{"project": project_name}
),
content_type="application/json",
headers={"Authorization": token},
)
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
def test_get_abuse_case_specific(client):
response = client.post(
"/abuses/read",
data=json.dumps(
{"user_story": use_case}
),
content_type="application/json",
headers={"Authorization": token},
)
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
def test_get_threat_scenario(client):
response = client.post(
"/scenarios/read",
data=json.dumps(
{"abuser_story": abuse_case}
),
content_type="application/json",
headers={"Authorization": token},
)
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
def test_get_test_case(client):
response = client.post(
"/test/read",
data=json.dumps(
{"scenario": threat_scenario}
),
content_type="application/json",
headers={"Authorization": token},
)
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
def test_threat_scenario_severity(client):
response = client.get("/scenario/severity",
headers={"Authorization": token})
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
def test_vulnerability_severity(client):
response = client.get("/vulnerability/severity",
headers={"Authorization": token})
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
def test_get_scan(client):
response = client.get("/scan/read",
headers={"Authorization": token})
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
def test_get_threat_scenario_by_project(client):
response = client.post(
"/scenarios/project",
data=json.dumps(
{"project": project_name}
),
content_type="application/json",
headers={"Authorization": token})
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
def test_get_vulnerability(client):
response = client.get(
"/vulnerability/read",
headers={"Authorization": token})
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
def test_get_vulnerability_by_project(client):
response = client.post(
"/vulnerability/project",
data=json.dumps(
{"project": project_name}
),
content_type="application/json",
headers={"Authorization": token})
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
def test_get_scan_by_project(client):
response = client.post(
"/scan/project",
data=json.dumps(
{"project": project_name}
),
content_type="application/json",
headers={"Authorization": token})
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
def test_get_user_story_tree_by_project(client):
response = client.post(
"/user-story/project",
data=json.dumps(
{"project": project_name}
),
content_type="application/json",
headers={"Authorization": token})
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
def test_get_abuser_story_tree_by_project(client):
response = client.post(
"/abuser-story/project",
data=json.dumps(
{"project": project_name}
),
content_type="application/json",
headers={"Authorization": token})
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
def test_get_threat_scenario_tree_by_project(client):
response = client.post(
"/threat-scenario/project",
data=json.dumps(
{"project": project_name}
),
content_type="application/json",
headers={"Authorization": token})
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
def test_get_threatmap_by_project(client):
response = client.post(
"/threatmap/project",
data=json.dumps(
{"project": project_name}
),
content_type="application/json",
headers={"Authorization": token})
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
def test_get_individual_scan_vuls(client):
response = client.post(
"/scan-vuls/project",
data=json.dumps(
{"name": scan_name}
),
content_type="application/json",
headers={"Authorization": token})
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
def test_get_asvs_vuls(client):
response = client.post(
"/asvs",
data=json.dumps(
{"cwe": cwe}
),
content_type="application/json",
headers={"Authorization": token})
data = json.loads(response.get_data(as_text=True))
assert response.status_code == 200
assert data.get("success")
================================================
FILE: api/tp_api/__init__.py
================================================
================================================
FILE: api/tp_api/app.py
================================================
from flask import Flask, jsonify, request
import jwt
from secrets import token_urlsafe
from os import getenv
from utils import (
logger,
connect_db,
load_reload_asvs_db,
load_reload_repo_db,
initialize_superuser,
respond,
)
from models import *
import bcrypt
from functools import wraps
import json
from flask_cors import CORS
import uuid
from flasgger import Swagger, swag_from
JWT_PASSWORD = getenv("JWT_PASS", token_urlsafe(16))
items_per_page = 20
db = connect_db()
load_reload_repo_db()
load_reload_asvs_db()
initialize_superuser()
app = Flask(__name__)
swagger = Swagger(app)
CORS(app)
def validate_user(f):
@wraps(f)
def inner(*args, **kwargs):
if "Authorization" not in request.headers and not request.headers.get(
"Authorization"
):
no_auth = respond(False, True, message="No Authentication data")
return no_auth, 403
else:
try:
token = request.headers.get("Authorization")
decoded = jwt.decode(token, JWT_PASSWORD, algorithms=["HS256"])
ref_user = User.objects.get(email=decoded["email"])
return f(*args, **kwargs)
except Exception as e:
logger.exception(e)
token_err = respond(False, True, message="Invalid Token or User")
return token_err, 403
return inner
# swagger done
@app.route("/api/change-password", methods=["POST"])
@swag_from("swagger/change-password.yml")
def change_password():
if request.method == "POST":
pass_data = request.get_json()
if pass_data:
if (
"email" not in pass_data
and "old_password" not in pass_data
and "verify_password" not in pass_data
):
return (
jsonify(
{
"success": False,
"error": True,
"message": "Mandatory values in request unavailable",
}
),
400,
)
else:
try:
ref_user = User.objects.get(email=pass_data["email"])
except DoesNotExist:
return (
jsonify(
{
"success": False,
"error": True,
"message": "No user found",
}
),
403,
)
verify_pass = bcrypt.checkpw(
pass_data["old_password"].encode(), str(ref_user.password).encode()
)
if verify_pass and (
pass_data["new_password"] == pass_data["verify_password"]
):
hash_pass = bcrypt.hashpw(
pass_data.get("new_password").encode(), bcrypt.gensalt()
).decode()
ref_user.update(password=hash_pass, default_password=False)
logger.info(
"Changed password for user {}".format(pass_data["email"])
)
return jsonify(
{
"success": True,
"error": False,
"message": "Successfully changed password for user {}".format(
pass_data["email"]
),
}
)
else:
logger.error(
"Change password exception. User passwords dont match OR old password is wrong for user {}".format(
pass_data["email"]
)
)
return (
jsonify(
{
"success": False,
"error": True,
"message": "Unable to change password for user {}".format(
pass_data["email"]
),
}
),
403,
)
else:
invalid_data = respond(
False, True, message="Unable to decode request payload"
)
return jsonify(invalid_data), 400
# swagger done
@app.route("/api/login", methods=["POST"])
def login():
if request.method == "POST":
login_data = request.get_json()
if "email" not in login_data and "password" not in login_data:
input_error = respond(False, True, message="Input Validation Error")
return input_error, 400
else:
try:
ref_user = User.objects.get(email=login_data["email"])
except DoesNotExist:
user_not_exists = respond(False, True, message="Invalid credentials")
return user_not_exists, 403
verify_pass = bcrypt.checkpw(
login_data["password"].encode(), str(ref_user.password).encode()
)
if verify_pass:
logger.info("User '{}' successfully logged in".format(ref_user.email))
token = jwt.encode(
{"email": ref_user.email}, key=JWT_PASSWORD, algorithm="HS256"
).decode()
success_message = respond(
True, False, message="Logged in successfully", data={"token": token}
)
return success_message
else:
invalid_credentials = respond(
False, True, message="Invalid credentials"
)
return invalid_credentials, 403
# swagger done
@app.route("/api/project/create", methods=["POST"])
@validate_user
def create_project():
data = request.get_json()
if "name" not in data and not data.get("name"):
logger.error("Input Validation Error - no 'name' param in request")
inval_err = respond(False, True, "Mandatory param not in request")
return inval_err, 400
else:
try:
Project(name=data.get("name")).save()
success = respond(
True,
False,
message="successfully saved project",
data={"name": data.get("name")},
)
logger.info("Successfully created project {}".format(data.get("name")))
return success
except Exception as e:
logger.exception(e)
exc = respond(False, True, "unable to save Project to DB")
return exc, 400
# swagger done
@app.route("/api/feature/create", methods=["POST"])
@validate_user
@swag_from("swagger/feature-create.yml")
def create_user_story():
data = request.get_json()
if not set(("short_name", "description", "project")) <= set(data):
logger.error(
"Mandatory params 'short_name', 'description', 'project' not in request"
)
input_val_err = respond(
False,
True,
message="Mandatory params 'short_name', 'description', 'project' not in request",
)
return input_val_err, 400
else:
try:
my_proj = Project.objects.get(name=data.get("project"))
except DoesNotExist:
project_not_exists = respond(
False,
True,
message="Project '{}' does not exist".format(data.get("project")),
)
return project_not_exists, 404
short_name = data.get("short_name")
desc = data.get("description")
try:
ref_user_case = UseCase.objects(short_name=short_name).update_one(
short_name=short_name, description=desc, project=my_proj, upsert=True,
)
ref_feature = UseCase.objects.get(short_name=short_name)
if ref_feature not in my_proj.features:
my_proj.features.append(ref_feature)
my_proj.save()
logger.info(
"Successfully created user-story/feature '{}'".format(short_name)
)
return respond(
True,
False,
message="Successfully created Feature '{}'".format(short_name),
data={"short_name": short_name},
)
except Exception as e:
logger.exception(e)
return respond(False, True, message="Unable to create User Story"), 400
# swagger done
@app.route("/api/abuse-case/create", methods=["POST"])
@validate_user
@swag_from("swagger/abuse-create.yml")
def create_abuser_story():
data = request.get_json()
if not set(("short_name", "description", "feature")) <= set(data):
logger.error(
"Mandatory params 'short_name', 'description', 'feature' not in request"
)
input_val_err = respond(
False,
True,
message="Mandatory params 'short_name', 'description', 'feature' not in request",
)
return input_val_err, 400
else:
try:
ref_user_story = UseCase.objects.get(short_name=data.get("feature"))
except DoesNotExist:
project_not_exists = respond(
False,
True,
message="Feature '{}' does not exist".format(data.get("feature")),
)
return project_not_exists, 404
short_name = data.get("short_name")
desc = data.get("description")
try:
ref_user_case = AbuseCase.objects(short_name=short_name).update_one(
short_name=short_name,
description=desc,
use_case=ref_user_story,
upsert=True,
)
ref_abuse = AbuseCase.objects.get(short_name=short_name)
if ref_abuse not in ref_user_story.abuses:
ref_user_story.abuses.append(ref_abuse)
ref_user_story.save()
logger.info("Successfully created abuser-story '{}'".format(short_name))
return respond(
True,
False,
message="Successfully created Abuser Story '{}'".format(short_name),
data={"short_name": short_name},
)
except Exception as e:
logger.exception(e)
return respond(False, True, message="Unable to create Abuser Story"), 400
# swagger done
@app.route("/api/scenario/repo/create", methods=["POST"])
@validate_user
@swag_from("swagger/scenario-repo.yml")
def create_repo_scenario():
data = request.get_json()
try:
ref_user_story = UseCase.objects.get(short_name=data.get("feature"))
except DoesNotExist:
return (
respond(False, True, message="Unable to find reference User Story"),
400,
)
try:
ref_abuser_story = AbuseCase.objects.get(short_name=data.get("abuser_story"))
except DoesNotExist:
return (
respond(False, True, message="Unable to find reference Abuser Story"),
400,
)
tm_name = data.get("name")
description = data.get("description")
if not data.get("type") == "repo" and data.get("repo_name"):
return respond(False, True, message="Input Validation Error"), 400
else:
repo_name = data.get("repo_name")
severity = data.get("severity", 1)
try:
ref_repo = Repo.objects.get(short_name=repo_name)
except Exception:
return respond(False, True, message="repo not found"), 404
try:
ThreatModel.objects(name=tm_name).update_one(
name=tm_name,
cwe=ref_repo.cwe,
vul_name=ref_repo.name,
description=description,
use_case=ref_user_story,
abuse_case=ref_abuser_story,
mitigations=ref_repo.mitigations,
categories=ref_repo.categories,
severity=severity,
upsert=True,
)
ref_scenario = ThreatModel.objects.get(name=tm_name)
if ref_scenario not in ref_abuser_story.scenarios:
ref_abuser_story.scenarios.append(ref_scenario)
ref_abuser_story.save()
except Exception as e:
logger.exception(e)
return (
respond(
False,
True,
message="Unable to store Threat Scenario: {}".format(tm_name),
),
500,
)
if ref_repo.tests:
for single_test in ref_repo.tests:
try:
Test.objects(name=single_test.name).update_one(
name=single_test.name,
test_case=single_test.test_case,
executed=False,
scenario=ref_scenario,
tools=single_test.tools,
upsert=True,
)
ref_my_test = Test.objects.get(
name=single_test.name, scenario=ref_scenario
)
if ref_my_test not in ref_scenario.tests:
ref_scenario.tests.append(ref_my_test)
ref_scenario.save()
except Exception as e:
logger.exception(e)
pass
return respond(
True,
False,
message="Successfully created Threat Scenario",
data={"name": tm_name},
)
# swagger done
@app.route("/api/scenario/create", methods=["POST"])
@validate_user
@swag_from("swagger/scenario-inline.yml")
def create_threat_scenario():
data = request.get_json()
mandatory_params = (
"vul_name",
"name",
"description",
"feature",
"abuser_story",
"type",
)
if not set(mandatory_params) <= set(data):
return (
respond(
False,
True,
message="Input validation error",
data={"mandatory_params": list(mandatory_params)},
),
400,
)
else:
try:
ref_user_story = UseCase.objects.get(short_name=data.get("feature"))
except DoesNotExist:
return (
respond(False, True, message="Unable to find reference User Story"),
400,
)
try:
ref_abuser_story = AbuseCase.objects.get(
short_name=data.get("abuser_story")
)
except DoesNotExist:
return (
respond(False, True, message="Unable to find reference Abuser Story"),
400,
)
try:
tm_name = data.get("name")
description = data.get("description")
cwe_val = data.get("cwe", 0)
mitigations = data.get("mitigations", [])
severity = int(data.get("severity", 1))
vul_name = data.get("vul_name")
ThreatModel.objects(name=tm_name).update_one(
name=tm_name,
vul_name=vul_name,
cwe=cwe_val,
severity=severity,
mitigations=mitigations,
description=description,
use_case=ref_user_story,
abuse_case=ref_abuser_story,
upsert=True,
)
ref_threat_model = ThreatModel.objects.get(name=tm_name)
# if "categories" in data:
# for single_category in data.categories:
# if single_category not in ref_threat_model.categories:
# ref_threat_model.categories.append(single_category)
# ref_threat_model.save()
if "mitigations" in data:
ThreatModel.objects(name=tm_name).update_one(
mitigations=data.get("mitigations"), upsert=True
)
if ref_threat_model not in ref_abuser_story.scenarios:
ref_abuser_story.scenarios.append(ref_threat_model)
ref_abuser_story.save()
logger.info("Created Threat Scenario '{}'".format(tm_name))
return respond(
True,
False,
message="Successfully created Threat Scenario",
data={"name": tm_name},
)
except Exception as e:
logger.exception(e)
return respond(False, True, message="Unable to load Threat Scenario"), 400
# swagger done
@app.route("/api/test/create", methods=["POST"])
@validate_user
@swag_from("swagger/test-case-create.yml")
def create_test_case():
data = request.get_json()
if not set(("test_case", "name", "threat_scenario")) <= set(data):
logger.error(
"Mandatory params 'test_case', 'name', 'threat_scenario' not in request"
)
input_val_err = respond(
False,
True,
message="Mandatory params 'test_case', 'name', 'threat_scenario' not in request",
)
return input_val_err, 400
else:
try:
ref_scenario = ThreatModel.objects.get(name=data.get("threat_scenario"))
except DoesNotExist:
project_not_exists = respond(
False,
True,
message="Threat Scenario '{}' does not exist".format(
data.get("threat_scenario")
),
)
return project_not_exists, 404
test_name = data.get("name")
test_case = data.get("test_case")
tool_list = data.get("tools", [])
tag_list = data.get("tags", [])
executed = data.get("executed", False)
test_type = data.get("test_type", "discovery")
try:
Test.objects(name=test_name).update_one(
name=test_name,
test_case=test_case,
executed=executed,
test_type=test_type,
scenario=ref_scenario,
upsert=True,
)
if tool_list:
Test.objects(name=test_name, scenario=ref_scenario).update_one(
tools=tool_list
)
if tag_list:
Test.objects(name=test_name, scenario=ref_scenario).update_one(
tags=tag_list
)
ref_test = Test.objects.get(name=test_name, scenario=ref_scenario)
if ref_test not in ref_scenario.tests:
ref_scenario.tests.append(ref_test)
ref_scenario.save()
logger.info(
"Created Test-Case '{}' for Threat Scenario '{}'".format(
test_name, ref_scenario.name
)
)
return respond(
True,
False,
message="Created Test-Case '{}' for Threat Scenario '{}'".format(
test_name, ref_scenario.name
),
data={"name": test_name},
)
except Exception as e:
logger.exception(e)
return respond(False, True, message="Unable to create Test Case"), 400
# swagger done
@app.route("/api/target/create", methods=["POST"])
@validate_user
@swag_from("swagger/target-create-update.yml")
def create_target():
data = request.get_json()
if not set(("name", "url", "project")) <= set(data):
logger.error("Mandatory params 'name', 'url', 'project' not in request")
input_val_err = respond(
False,
True,
message="Mandatory params 'name', 'url', 'project' not in request",
)
return input_val_err, 400
else:
try:
ref_project = Project.objects.get(name=data.get("project"))
except Exception:
return respond(False, True, message="Project not found"), 404
try:
new_target = Target(
name=data.get("name"), url=data.get("url"), project=ref_project
)
new_target.save()
return respond(
True,
False,
message="successfully created target",
data={"name": data.get("name")},
)
except Exception:
return respond(False, True, message="Unable to create Target")
@app.route("/api/scan/create", methods=["POST"])
@validate_user
@swag_from("swagger/scan-create.yml")
def create_scan():
data = request.get_json()
if not set(("tool", "target")) <= set(data):
logger.error("Mandatory params 'tool', 'target' not in request")
input_val_err = respond(
False, True, message="Mandatory params 'tool', 'target' not in request",
)
return input_val_err, 400
else:
try:
ref_target = Target.objects.get(name=data.get("target"))
ref_project = Project.objects.get(id=ref_target.project.id)
except Exception:
return respond(False, True, message="Target not found"), 404
try:
new_scan = Scan(tool=data.get("tool"), target=ref_target)
if "scan_type" in data:
if data.get("scan_type") in ["SAST", "DAST", "SCA", "IAST", "Manual"]:
new_scan.scan_type = data.get("scan_type")
new_scan.save()
if new_scan not in ref_target.scans:
ref_target.scans.append(new_scan)
ref_target.save()
ref_features = UseCase.objects(project=ref_project)
for single_feature in ref_features:
ref_scenarios = ThreatModel.objects(use_case=single_feature)
for single_scenario in ref_scenarios:
for single_test in single_scenario.tests:
ref_test = Test.objects.get(id=single_test.id)
if data.get("tool") in ref_test.tools:
ref_test.executed = True
ref_test.save()
return respond(
True,
False,
message="successfully created scan",
data={"name": new_scan.name},
)
except Exception as ex:
logger.error(ex)
return respond(False, True, message="Unable to create Scan")
@app.route("/api/vulnerability/create", methods=["POST"])
@validate_user
@swag_from("swagger/vulnerability-create.yml")
def create_vulnerability():
data = request.get_json()
if "name" not in data and "scan" not in data:
return (
respond(
False, True, message="Mandatory field 'name' and 'scan' not in request"
),
400,
)
else:
scan = data.get("scan")
try:
ref_scan = Scan.objects.get(name=scan)
except Exception:
return respond(False, True, message="Unable to find scan"), 404
try:
ref_target = Target.objects.get(id=ref_scan.target.id)
ref_project = Project.objects.get(id=ref_target.project.id)
except Exception:
return respond(False, True, message="Unable to find target"), 404
name = data.get("name")
severity = data.get("severity", 1)
cwe = data.get("cwe", 0)
new_vul = Vulnerability(name=name, severity=severity, cwe=cwe)
new_vul.scan = ref_scan
new_vul.target = ref_target
if "description" in data:
new_vul.description = data.get("description")
if "observation" in data:
new_vul.description = data.get("observation")
if "vul_name" in data:
new_vul.description = data.get("vul_name")
if "remediation" in data:
new_vul.description = data.get("remediation")
try:
new_vul.save()
if (
"evidences" in data
and isinstance(data.get("evidences"), list)
and data.get("evidences")
):
all_evidences = data.get("evidences")
for single in all_evidences:
new_evid = VulnerabilityEvidence()
new_evid.evidence_type = ref_scan.scan_type
if "log" in single:
new_evid.log = single.get("log")
if "url" in single:
new_evid.url = single.get("url")
if "param" in single:
new_evid.param = single.get("param")
if "line_num" in single:
new_evid.line_num = single.get("line_num")
if "attack" in single:
new_evid.attack = single.get("attack")
if "info" in single:
new_evid.info = single.get("info")
new_evid.vuln = new_vul
try:
new_evid.save()
if new_evid not in new_vul.evidences:
new_vul.evidences.append(new_evid)
new_vul.save()
except Exception as ev_e:
logger.error(ev_e)
return (
respond(False, True, message="Unable to save evidence"),
500,
)
return respond(
True,
False,
message="Vulnerability successfully created",
data={"name": name},
)
except Exception as vul_ex:
logger.error(vul_ex)
return (
respond(
False,
True,
"Unable to save vulnerability with name '{}'".format(name),
),
500,
)
@app.route("/api/project/read", methods=["GET", "POST"])
@app.route("/api/project/read/<page_num>", methods=["GET", "POST"])
@validate_user
@swag_from("swagger/get-project.yml")
def get_project(page_num=1):
if request.method == "GET":
num_pages = (Project.objects.count() % items_per_page) + 1
if num_pages > 1 and page_num:
if page_num == 1:
project_list = json.loads(
Project.objects.limit(items_per_page).to_json()
)
return respond(
True,
False,
message="Successfully retrieved data",
data=project_list,
)
else:
offset = (page_num - 1) * items_per_page
project_list = json.loads(
Project.objects.skip(offset).limit(items_per_page).to_json()
)
return respond(
True,
False,
message="Successfully retrieved data",
data=project_list,
)
else:
project_list = json.loads(Project.objects().to_json())
return respond(True, False, data=project_list)
if request.method == "POST":
data = request.get_json()
if "name" in data:
try:
ref_project = json.loads(
Project.objects.get(name=data.get("name")).to_json()
)
return respond(True, False, data=ref_project)
except Exception as e:
logger.exception(e)
return respond(False, True, message="Unable to find the project"), 404
@app.route("/api/feature/read", methods=["GET", "POST"])
@validate_user
@swag_from("swagger/get-feature.yml")
def get_features():
if request.method == "GET":
user_story_list = json.loads(UseCase.objects().to_json())
return respond(True, False, data=user_story_list)
elif request.method == "POST":
data = request.get_json()
if "project" in data:
try:
ref_project = Project.objects.get(name=data.get("project"))
except Exception:
return respond(False, True, message="Project does not exist"), 404
if "short_name" in data:
try:
ref_feature = json.loads(
UseCase.objects.get(
short_name=data.get("short_name"), project=ref_project
).to_json()
)
return respond(True, False, data=ref_feature)
except Exception as e:
logger.exception(e)
return (
respond(
False,
True,
message="Unable to fetch the referenced user story",
),
404,
)
else:
if "page" in data:
page_num = data.get("page")
num_pages = (UseCase.objects.count() % items_per_page) + 1
if num_pages > 1 and page_num:
if page_num == 1:
feature_list = json.loads(
UseCase.objects(project=ref_project)
.limit(items_per_page)
.to_json()
)
return respond(
True,
False,
message="Successfully retrieved data",
data=feature_list,
)
else:
offset = (page_num - 1) * items_per_page
feature_list = json.loads(
UseCase.objects(project=ref_project)
.skip(offset)
.limit(items_per_page)
.to_json()
)
return respond(
True,
False,
message="Successfully retrieved data",
data=feature_list,
)
else:
feature_list = json.loads(
UseCase.objects(project=ref_project).to_json()
)
return respond(
True,
False,
message="Successfully retrieved data",
data=feature_list,
)
else:
return respond(False, True, message="Unable to find User Stories/Features"), 404
@app.route("/api/abuses/read", methods=["POST"])
@validate_user
@swag_from("swagger/get-abuse.yml")
def get_abuser_story():
data = request.get_json()
if "user_story" in data:
try:
ref_use_case = UseCase.objects.get(short_name=data.get("user_story"))
except Exception:
return respond(False, True, message="User Story does not exist"), 404
if "short_name" in data:
try:
ref_abuse = json.loads(
AbuseCase.objects.get(
short_name=data.get("short_name"), use_case=ref_use_case
).to_json()
)
return respond(True, False, data=ref_abuse)
except Exception as e:
logger.exception(e)
return (
respond(
False,
True,
message="Unable to fetch the referenced abuser story",
),
404,
)
else:
if "page" in data:
page_num = data.get("page")
num_pages = (AbuseCase.objects.count() % items_per_page) + 1
if num_pages > 1 and page_num:
if page_num == 1:
feature_list = json.loads(
AbuseCase.objects(use_case=ref_use_case)
.limit(items_per_page)
.to_json()
)
return respond(
True,
False,
message="Successfully retrieved data",
data=feature_list,
)
else:
offset = (page_num - 1) * items_per_page
feature_list = json.loads(
AbuseCase.objects(use_case=ref_use_case)
.skip(offset)
.limit(items_per_page)
.to_json()
)
return respond(
True,
False,
message="Successfully retrieved data",
data=feature_list,
)
else:
feature_list = json.loads(
AbuseCase.objects(use_case=ref_use_case).to_json()
)
return respond(
True,
False,
message="Successfully retrieved data",
data=feature_list,
)
return (
respond(
False,
True,
message="Unable to find Abuser Stories. You need to provide a reference feature/user story",
),
404,
)
@app.route("/api/scenarios/read", methods=["GET", "POST"])
@validate_user
@swag_from("swagger/get-scenario.yml")
def get_threat_scenario():
if request.method == "GET":
threat_scenario_list = json.loads(ThreatModel.objects().to_json())
return respond(True, False, data=threat_scenario_list)
elif request.method == "POST":
data = request.get_json()
if "abuser_story" in data:
try:
ref_abuse = AbuseCase.objects.get(short_name=data.get("abuser_story"))
except Exception:
return respond(False, True, message="Abuser Story does not exist"), 404
if "name" in data:
try:
ref_scenario = json.loads(
ThreatModel.objects.get(
name=data.get("name"), abuse_case=ref_abuse
).to_json()
)
return respond(True, False, data=ref_scenario)
except Exception as e:
logger.exception(e)
return (
respond(
False,
True,
message="Unable to fetch the referenced threat scenario",
),
404,
)
else:
if "page" in data:
page_num = data.get("page")
num_pages = (ThreatModel.objects.count() % items_per_page) + 1
if num_pages > 1 and page_num:
if page_num == 1:
feature_list = json.loads(
ThreatModel.objects(abuse_case=ref_abuse)
.limit(items_per_page)
.to_json()
)
return respond(
True,
False,
message="Successfully retrieved data",
data=feature_list,
)
else:
offset = (page_num - 1) * items_per_page
feature_list = json.loads(
ThreatModel.objects(abuse_case=ref_abuse)
.skip(offset)
.limit(items_per_page)
.to_json()
)
return respond(
True,
False,
message="Successfully retrieved data",
data=feature_list,
)
else:
feature_list = json.loads(
ThreatModel.objects(abuse_case=ref_abuse).to_json()
)
return respond(
True,
False,
message="Successfully retrieved data",
data=feature_list,
)
else:
return respond(False, True, message="Unable to find Threat Scenarios"), 404
@app.route("/api/test/read", methods=["POST"])
@validate_user
@swag_from("swagger/get-tests.yml")
def get_test_case():
data = request.get_json()
if "scenario" in data:
try:
ref_scenario = ThreatModel.objects.get(name=data.get("scenario"))
except Exception:
return respond(False, True, message="Abuser Story does not exist"), 404
if "name" in data:
try:
ref_test = json.loads(
Test.objects.get(
name=data.get("name"), scenario=ref_scenario
).to_json()
)
return respond(True, False, data=ref_test)
except Exception as e:
logger.exception(e)
return (
respond(
False, True, message="Unable to fetch the referenced test-case",
),
404,
)
else:
if "page" in data:
page_num = data.get("page")
num_pages = (Test.objects.count() % items_per_page) + 1
if num_pages > 1 and page_num:
if page_num == 1:
feature_list = json.loads(
Test.objects(abuse_case=ref_scenario)
.limit(items_per_page)
.to_json()
)
return respond(
True,
False,
message="Successfully retrieved data",
data=feature_list,
)
else:
offset = (page_num - 1) * items_per_page
feature_list = json.loads(
Test.objects(abuse_case=ref_scenario)
.skip(offset)
.limit(items_per_page)
.to_json()
)
return respond(
True,
False,
message="Successfully retrieved data",
data=feature_list,
)
else:
feature_list = json.loads(Test.objects(scenario=ref_scenario).to_json())
return respond(
True,
False,
message="Successfully retrieved data",
data=feature_list,
)
return respond(False, True, message="Unable to find Threat Scenarios"), 404
@app.route("/api/scenario/vuln/", methods=["POST"])
@validate_user
def map_threat_scenario_vul():
data = request.get_json()
if "id" not in data:
return respond(False, True, message="Mandatory param 'id' not in request"), 400
else:
try:
ref_scenario = ThreatModel.objects.get(id=data.get("id"))
except Exception:
return respond(False, True, message="Unable to find Threat Scenario")
if ref_scenario.cwe:
ref_abuse = AbuseCase.objects.get(id=ref_scenario.abuse.id)
ref_use_case = UseCase.objects.get(id=ref_abuse.use_case.id)
ref_project = Project.objects.get(id=ref_use_case.project.id)
ref_targets = Target.objects(project=ref_project)
for single_target in ref_targets:
ref_vulns = Vulnerability.objects(target=single_target)
if ref_vulns:
return respond(
True,
False,
message="successfully returned mapped objects",
data={
"threat_scenario": json.loads(ref_scenario.to_json()),
"vulnerabilities": json.loads(ref_vulns.to_json()),
},
)
@app.route("/api/scenario/severity", methods=["GET"])
@validate_user
def threat_scenario_severity():
if request.method == "GET":
try:
scenario_severity_list = json.loads(
ThreatModel.objects().values_list("severity").to_json()
)
return respond(
True,
False,
message="Successfully retrieved data",
data=scenario_severity_list,
)
except Exception as e:
logger.exception(e)
return respond(False, True, message="Therat Scenario does not exist"), 404
else:
return (
respond(False, True, message="Unable to find Threat Scenarios severity"),
404,
)
@app.route("/api/vulnerability/severity", methods=["GET"])
@validate_user
def vulnerability_severity():
if request.method == "GET":
try:
scenario_severity_list = json.loads(
Vulnerability.objects().values_list("severity").to_json()
)
return respond(
True,
False,
message="Successfully retrieved data",
data=scenario_severity_list,
)
except Exception as e:
logger.exception(e)
return respond(False, True, message="Therat Scenario does not exist"), 404
else:
return (
respond(False, True, message="Unable to find Threat Scenarios severity"),
404,
)
### Select APIs that we need
# Get Vulnerabilities by Target
@app.route("/api/target/read", methods=["GET", "POST"])
@validate_user
def get_target(page_num=1):
if request.method == "GET":
num_pages = (Target.objects.count() % items_per_page) + 1
if num_pages > 1 and page_num:
if page_num == 1:
target_list = json.loads(Target.objects.limit(items_per_page).to_json())
return respond(
True,
False,
message="Successfully retrieved data",
data=target_list,
)
else:
offset = (page_num - 1) * items_per_page
target_list = json.loads(
Target.objects.skip(offset).limit(items_per_page).to_json()
)
return respond(
True,
False,
message="Successfully retrieved data",
data=target_list,
)
else:
target_list = json.loads(Scan.objects().to_json())
return respond(True, False, data=scan_list)
if request.method == "POST":
data = request.get_json()
if "project" in data:
ref_project = Project.objects.get(name = data.get('project'))
targets_for_project = json.loads(
Target.objects(project=ref_project).to_json()
)
return respond(True, False, data = targets_for_project)
if "name" in data:
specific_target = json.loads(Target.objects.get(name = data.get('name')).to_json())
return respond(True, False, data = specific_target)
@app.route("/api/scan/read", methods=["GET", "POST"])
@validate_user
def get_scan(page_num=1):
if request.method == "GET":
num_pages = (Scan.objects.count() % items_per_page) + 1
if num_pages > 1 and page_num:
if page_num == 1:
scan_list = json.loads(Scan.objects.limit(items_per_page).to_json())
return respond(
True, False, message="Successfully retrieved data", data=scan_list,
)
else:
offset = (page_num - 1) * items_per_page
scan_list = json.loads(
Scan.objects.skip(offset).limit(items_per_page).to_json()
)
return respond(
True, False, message="Successfully retrieved data", data=scan_list,
)
else:
scan_list = json.loads(Scan.objects().to_json())
return respond(True, False, data=scan_list)
if request.method == "POST":
data = request.get_json()
if "name" in data:
try:
ref_scan = json.loads(Scan.objects.get(name=data.get("name")).to_json())
return respond(True, False, data=ref_scan)
except Exception as e:
logger.exception(e)
return respond(False, True, message="Unable to find the scan"), 404
@app.route("/api/scenarios/project", methods=["POST"])
@validate_user
def get_threat_scenario_by_project():
data = request.get_json()
if "project" in data:
try:
ref_project = Project.objects.get(name=data.get("project"))
except Exception:
return respond(False, True, message="Project does not exist"), 404
user_story = UseCase.objects(project=ref_project).to_json()
d = json.loads(user_story)
try:
user_stories_list = [a.get("_id").get("$oid") for a in d]
ref_threatScenario = json.loads(
ThreatModel.objects.filter(use_case__in=user_stories_list).to_json()
)
return respond(True, False, data=ref_threatScenario)
except Exception as e:
return respond(False, True, message="Scenario does not exist"), 404
else:
return respond(False, True, message="Project does not exist"), 404
return respond(False, True, message="Scenario does not exist"), 404
@app.route("/api/vulnerability/read", methods=["GET", "POST"])
@validate_user
def get_vulnerability(page_num=1):
if request.method == "GET":
num_pages = (Vulnerability.objects.count() % items_per_page) + 1
if num_pages > 1 and page_num:
if page_num == 1:
vul_list = json.loads(
Vulnerability.objects.limit(items_per_page).to_json()
)
return respond(
True, False, message="Successfully retrieved data", data=vul_list,
)
else:
offset = (page_num - 1) * items_per_page
vul_list = json.loads(
Vulnerability.objects.skip(offset).limit(items_per_page).to_json()
)
return respond(
True, False, message="Successfully retrieved data", data=vul_list,
)
else:
vul_list = json.loads(Vulnerability.objects().to_json())
return respond(True, False, data=vul_list)
if request.method == "POST":
data = request.get_json()
if "name" in data:
try:
ref_scan = json.loads(
Vulnerability.objects.get(name=data.get("name")).to_json()
)
return respond(True, False, data=ref_scan)
except Exception as e:
logger.exception(e)
return (
respond(False, True, message="Unable to find the vulnerability"),
404,
)
@app.route("/api/vulnerability/project", methods=["POST"])
@validate_user
def get_vulnerability_by_project():
data = request.get_json()
if "project" in data:
vul_dict = {}
try:
ref_project = Project.objects.get(name=data.get("project"))
except Exception:
return respond(False, True, message="Project does not exist"), 404
try:
target_obj = Target.objects(project=ref_project)
except Exception:
return respond(False, True, message="Target does not exist"), 404
try:
for single_target in target_obj:
ref_vuls = json.loads(Vulnerability.objects(target=single_target).to_json())
vul_dict['data'] = ref_vuls
return respond(True, False, data=vul_dict)
except Exception as e:
return respond(False, True, message="Vulnerability does not exist"), 404
else:
return respond(False, True, message="Project does not exist"), 404
return respond(False, True, message="Vulnerability does not exist"), 404
@app.route("/api/scan/project", methods=["POST"])
@validate_user
def get_scan_by_project():
data = request.get_json()
if "project" in data:
resp_dict = {}
try:
ref_project = Project.objects.get(name=data.get("project"))
resp_dict['project'] = ref_project.name
except Exception:
return respond(False, True, message="Project does not exist"), 404
try:
target_obj = Target.objects(project=ref_project)
except Exception:
return respond(False, True, message="Target does not exist"), 404
try:
resp_dict['data'] = []
for single_target in target_obj:
ref_scans = Scan.objects(target=single_target)
for single_scan in ref_scans:
data_dict = {
"name": single_scan.name,
"target": single_target.name,
"tool": single_scan.tool
}
resp_dict['data'].append(data_dict)
return respond(True, False, data=resp_dict)
except Exception as e:
return respond(False, True, message="Scans does not exist"), 404
else:
return respond(False, True, message="Project does not exist"), 404
return respond(False, True, message="Scans does not exist"), 404
@app.route("/api/user-story/project", methods=["POST"])
@validate_user
def get_user_story_tree_by_project():
data = request.get_json()
user_story_tree = []
if "project" in data:
try:
ref_project = Project.objects.get(name=data.get("project"))
except Exception:
return respond(False, True, message="Project does not exist"), 404
try:
usecases_obj = UseCase.objects(project=ref_project.id)
except Exception:
return respond(False, True, message="Target does not exist"), 404
for usecase in usecases_obj:
userStory_dict = {}
userStory_dict["name"] = usecase.short_name
userStory_dict["description"] = usecase.description
userStory_dict["children"] = []
userStory_dict["type"] = "us"
userStory_dict["title"] = "User Story"
for abuses in usecase.abuses:
abuserStory_dict = {}
abuserStory_dict["name"] = abuses.short_name
abuserStory_dict["description"] = abuses.description
abuserStory_dict["children"] = []
abuserStory_dict["type"] = "as"
abuserStory_dict["title"] = "Abuser Story"
userStory_dict["children"].append(abuserStory_dict)
for scenario in abuses.scenarios:
threat_scenario_dict = {}
threat_scenario_dict["name"] = scenario.name
threat_scenario_dict["description"] = scenario.description
threat_scenario_dict["vul_name"] = scenario.vul_name
threat_scenario_dict["severity"] = scenario.severity
threat_scenario_dict["cwe"] = scenario.cwe
threat_scenario_dict["children"] = []
threat_scenario_dict["type"] = "sce"
threat_scenario_dict["title"] = "Threat Scenario"
abuserStory_dict["children"].append(threat_scenario_dict)
for test in scenario.tests:
test_dict = {}
test_dict["name"] = test.name
test_dict["test_case"] = test.test_case
test_dict["tools"] = test.tools
test_dict["test_type"] = test.test_type
test_dict["executed"] = test.executed
test_dict["type"] = "tc"
test_dict["title"] = "Test Case"
threat_scenario_dict["children"].append(test_dict)
user_story_tree.append(userStory_dict)
try:
ref_scans = json.loads(json.dumps(user_story_tree))
return respond(True, False, data=ref_scans)
except Exception as e:
return respond(False, True, message="UserStory does not exist"), 404
else:
return respond(False, True, message="Project does not exist"), 404
return respond(False, True, message="UserStory does not exist"), 404
@app.route("/api/abuser-story/project", methods=["POST"])
@validate_user
def get_abuser_story_tree_by_project():
data = request.get_json()
abuser_story_tree = []
if "project" in data:
try:
ref_project = Project.objects.get(name=data.get("project"))
except Exception:
return respond(False, True, message="Project does not exist"), 404
try:
usecases_obj = UseCase.objects(project=ref_project.id)
except Exception:
return respond(False, True, message="Target does not exist"), 404
for usecase in usecases_obj:
for abuses in usecase.abuses:
abuserStory_dict = {}
abuserStory_dict["name"] = abuses.short_name
abuserStory_dict["description"] = abuses.description
abuserStory_dict["children"] = []
abuserStory_dict["type"] = "as"
abuserStory_dict["title"] = "Abuser Story"
# userStory_dict['children'].append(abuserStory_dict)
for scenario in abuses.scenarios:
threat_scenario_dict = {}
threat_scenario_dict["name"] = scenario.name
threat_scenario_dict["description"] = scenario.description
threat_scenario_dict["vul_name"] = scenario.vul_name
threat_scenario_dict["severity"] = scenario.severity
threat_scenario_dict["cwe"] = scenario.cwe
threat_scenario_dict["children"] = []
threat_scenario_dict["type"] = "sce"
threat_scenario_dict["title"] = "Threat Scenario"
abuserStory_dict["children"].append(threat_scenario_dict)
for test in scenario.tests:
test_dict = {}
test_dict["name"] = test.name
test_dict["test_case"] = test.test_case
test_dict["executed"] = test.executed
test_dict["tools"] = test.tools
test_dict["test_type"] = test.test_type
test_dict["type"] = "tc"
test_dict["title"] = "Test Case"
threat_scenario_dict["children"].append(test_dict)
abuser_story_tree.append(abuserStory_dict)
try:
ref_scans = json.loads(json.dumps(abuser_story_tree))
return respond(True, False, data=ref_scans)
except Exception as e:
return respond(False, True, message="AbuserStory does not exist"), 404
else:
return respond(False, True, message="Project does not exist"), 404
return respond(False, True, message="AbuserStory does not exist"), 404
@app.route("/api/threat-scenario/project", methods=["POST"])
@validate_user
def get_threat_scenario_tree_by_project():
data = request.get_json()
threat_scenario_tree = []
if "project" in data:
try:
ref_project = Project.objects.get(name=data.get("project"))
except Exception:
return respond(False, True, message="Project does not exist"), 404
try:
usecases_obj = UseCase.objects(project=ref_project.id)
except Exception:
return respond(False, True, message="Target does not exist"), 404
for usecase in usecases_obj:
for abuses in usecase.abuses:
for scenario in abuses.scenarios:
threat_scenario_dict = {}
threat_scenario_dict["name"] = scenario.name
threat_scenario_dict["description"] = scenario.description
threat_scenario_dict["vul_name"] = scenario.vul_name
threat_scenario_dict["severity"] = scenario.severity
threat_scenario_dict["cwe"] = scenario.cwe
threat_scenario_dict["children"] = []
threat_scenario_dict["type"] = "sce"
threat_scenario_dict["title"] = "Threat Scenario"
for test in scenario.tests:
test_dict = {}
test_dict["name"] = test.name
test_dict["test_case"] = test.test_case
test_dict["tools"] = test.tools
test_dict["test_type"] = test.test_type
test_dict["executed"] = test.executed
test_dict["type"] = "tc"
test_dict["title"] = "Test Case"
threat_scenario_dict["children"].append(test_dict)
threat_scenario_tree.append(threat_scenario_dict)
try:
ref_scans = json.loads(json.dumps(threat_scenario_tree))
return respond(True, False, data=ref_scans)
except Exception as e:
return respond(False, True, message="ThreatScenario does not exist"), 404
else:
return respond(False, True, message="Project does not exist"), 404
return respond(False, True, message="ThreatScenario does not exist"), 404
@app.route("/api/threatmap/project", methods=["POST"])
@validate_user
def get_threatmap_by_project():
data = request.get_json()
threat_map = {}
if "project" in data:
try:
ref_project = Project.objects.get(name=data.get("project"))
threat_map["name"] = ref_project.name
threat_map["children"] = []
threat_map["type"] = "Project"
threat_map["id"] = 1
except Exception:
return respond(False, True, message="Project does not exist"), 404
try:
usecases_obj = UseCase.objects(project=ref_project.id)
except Exception:
return respond(False, True, message="Target does not exist"), 404
for usecase in usecases_obj:
userStory_id = str(uuid.uuid4())
userStory_dict = {}
userStory_dict["id"] = userStory_id
userStory_dict["name"] = usecase.short_name
userStory_dict["title"] = usecase.description
userStory_dict["type"] = "Feature"
userStory_dict["children"] = []
threat_map["children"].append(userStory_dict)
for abuses in usecase.abuses:
abuserStory_id = str(uuid.uuid4())
abuserStory_dict = {}
abuserStory_dict["id"] = abuserStory_id
abuserStory_dict["name"] = abuses.short_name
abuserStory_dict["title"] = abuses.description
abuserStory_dict["children"] = []
abuserStory_dict["type"] = "Abuses"
userStory_dict["children"].append(abuserStory_dict)
for scenario in abuses.scenarios:
scenario_id = str(uuid.uuid4())
threat_scenario_dict = {}
threat_scenario_dict["id"] = scenario_id
threat_scenario_dict["name"] = scenario.name
threat_scenario_dict["title"] = scenario.description
threat_scenario_dict["vul_name"] = scenario.vul_name
threat_scenario_dict["severity"] = scenario.severity
threat_scenario_dict["cwe"] = scenario.cwe
threat_scenario_dict["children"] = []
threat_scenario_dict["type"] = "Scenarios"
abuserStory_dict["children"].append(threat_scenario_dict)
for test in scenario.tests:
test_id = str(uuid.uuid4())
test_dict = {}
test_dict["id"] = test_id
test_dict["name"] = test.name
test_dict["title"] = test.test_case
test_dict["tools"] = test.tools
test_dict["test_type"] = test.test_type
test_dict["executed"] = test.executed
test_dict["type"] = "Test Cases"
threat_scenario_dict["children"].append(test_dict)
try:
ref_threatmap = json.loads(json.dumps(threat_map))
return respond(True, False, data=ref_threatmap)
except Exception as e:
return respond(False, True, message="THreatMap does not exist"), 404
else:
return respond(False, True, message="Project does not exist"), 404
return respond(False, True, message="THreatMap does not exist"), 404
@app.route("/api/scan-vuls/project", methods=["POST"])
@validate_user
def get_individual_scan_vuls():
data = request.get_json()
if "name" in data:
try:
ref_scans = Scan.objects.get(name=data.get("name"))
ref_vuls = json.loads(Vulnerability.objects(scan=ref_scans.id).to_json())
return respond(True, False, data=ref_vuls)
except Exception as e:
return respond(False, True, message="Scans does not exist"), 404
else:
return respond(False, True, message="Project does not exist"), 404
return respond(False, True, message="Scans does not exist"), 404
@app.route("/api/asvs", methods=["POST"])
@validate_user
def get_asvs_vuls():
data = request.get_json()
if "cwe" in data:
try:
ref_asvs = json.loads(ASVS.objects(cwe=data.get("cwe")).to_json())
return respond(True, False, data=ref_asvs)
except Exception as e:
return respond(False, True, message="ASVS does not exist"), 404
else:
return respond(False, True, message="Project does not exist"), 404
return respond(False, True, message="ASVS does not exist"), 404
@app.route("/api/delete/feature", methods=["POST"])
@validate_user
def delete_feature():
data = request.get_json()
if "name" not in data and "project" not in data:
return (
respond(
False,
True,
message="Mandatory fields 'name' and 'project' not in request",
),
400,
)
try:
ref_project = Project.objects.get(name=data.get("project"))
ref_use_case = UseCase.objects.get(
short_name=data.get("name"), project=ref_project
)
ref_use_case.delete()
return respond(
True,
False,
message="Successfully deleted Feature: {}".format(data.get("name")),
)
except Exception as del_e:
logger.error(del_e)
return respond(False, True, message="Unable to delete Use-Case"), 500
@app.route("/api/delete/abuser-story", methods=["POST"])
@validate_user
def delete_abuse_case():
data = request.get_json()
if "name" not in data and "feature" not in data:
return (
respond(
False,
True,
message="Mandatory fields 'name' and 'feature' not in request",
),
400,
)
try:
ref_use_case = UseCase.objects.get(short_name=data.get("feature"))
ref_abuse = AbuseCase.objects.get(
short_name=data.get("name"), use_case=ref_use_case
)
ref_abuse.delete()
return respond(
True,
False,
message="Successfully deleted Abuser Story: {}".format(data.get("name")),
)
except Exception as del_e:
logger.error(del_e)
return respond(False, True, message="Unable to delete Abuser Story"), 500
@app.route("/api/delete/scenario", methods=["POST"])
@validate_user
def delete_scenario():
data = request.get_json()
if "name" not in data and "abuser_story" not in data:
return (
respond(
False,
True,
message="Mandatory fields 'name' and 'abuser_story' not in request",
),
400,
)
try:
ref_abuse_case = AbuseCase.objects.get(short_name=data.get("abuser_story"))
ref_scenario = ThreatModel.objects.get(
name=data.get("name"), abuse_case=ref_abuse_case
)
ref_scenario.delete()
return respond(
True,
False,
message="Successfully deleted Threat Scenario: {}".format(data.get("name")),
)
except Exception as del_e:
logger.error(del_e)
return respond(False, True, message="Unable to delete Threat Scenario"), 500
@app.route("/api/delete/test", methods=["POST"])
@validate_user
def delete_test():
data = request.get_json()
if "name" not in data and "scenario" not in data:
return (
respond(
False,
True,
message="Mandatory fields 'name' and 'scenario' not in request",
),
400,
)
try:
ref_scenario = ThreatModel.objects.get(name=data.get("scenario"))
ref_test = Test.objects.get(name=data.get("name"), scenario=ref_scenario)
ref_scenario.delete()
return respond(
True,
False,
message="Successfully deleted Test-Case: {}".format(data.get("name")),
)
except Exception as del_e:
logger.error(del_e)
return respond(False, True, message="Unable to delete Test Case"), 500
@app.route("/api/delete/project", methods=["POST"])
@validate_user
def delete_project():
data = request.get_json()
if "name" not in data:
return (
respond(False, True, message="Mandatory fields 'name' not in request"),
400,
)
try:
ref_project = Project.objects.get(name=data.get("name"))
ref_project.delete()
return respond(
True,
False,
message="Successfully deleted Project {}".format(data.get("name")),
)
except Exception as del_e:
logger.error(del_e)
return respond(False, True, message="Unable to delete Project"), 500
if __name__ == "__main__":
app.run(host="0.0.0.0", debug=True)
================================================
FILE: api/tp_api/asvs/asvs.csv
================================================
V1,Architecture,1.1.1,Verify the use of a secure software development lifecycle that addresses security in all stages of development. ([C1](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),,X,X,,
V1,Architecture,1.1.2,"Verify the use of threat modeling for every design change or sprint planning to identify threats, plan for countermeasures, facilitate appropriate risk responses, and guide security testing.",,X,X,1053,
V1,Architecture,1.1.3,"Verify that all user stories and features contain functional security constraints, such as ""As a user, I should be able to view and edit my profile. I should not be able to view or edit anyone else's profile""",,X,X,1110,
V1,Architecture,1.1.4,"Verify documentation and justification of all the application's trust boundaries, components, and significant data flows.",,X,X,1059,
V1,Architecture,1.1.5,Verify definition and security analysis of the application's high-level architecture and all connected remote services. ([C1](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),,X,X,1059,
V1,Architecture,1.1.6,"Verify implementation of centralized, simple (economy of design), vetted, secure, and reusable security controls to avoid duplicate, missing, ineffective, or insecure controls. ([C10](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",,X,X,637,
V1,Architecture,1.1.7,"Verify availability of a secure coding checklist, security requirements, guideline, or policy to all developers and testers.",,X,X,637,
V1,Architecture,1.10.1,"Verify that a source code control system is in use, with procedures to ensure that check-ins are accompanied by issues or change tickets. The source code control system should have access control and identifiable users to allow traceability of any changes.",,X,X,284,
V1,Architecture,1.11.1,Verify the definition and documentation of all application components in terms of the business or security functions they provide.,,X,X,1059,
V1,Architecture,1.11.2,"Verify that all high-value business logic flows, including authentication, session management and access control, do not share unsynchronized state.",,X,X,362,
V1,Architecture,1.11.3,"Verify that all high-value business logic flows, including authentication, session management and access control are thread safe and resistant to time-of-check and time-of-use race conditions.",,,X,367,
V1,Architecture,1.12.1,Verify that user-uploaded files are stored outside of the web root.,,X,X,552,
V1,Architecture,1.12.2,"Verify that user-uploaded files - if required to be displayed or downloaded from the application - are served by either octet stream downloads, or from an unrelated domain, such as a cloud file storage bucket. Implement a suitable content security policy to reduce the risk from XSS vectors or other attacks from the uploaded file.",,X,X,646,
V1,Architecture,1.14.1,"Verify the segregation of components of differing trust levels through well-defined security controls, firewall rules, API gateways, reverse proxies, cloud-based security groups, or similar mechanisms.",,X,X,923,
V1,Architecture,1.14.2,"Verify that if deploying binaries to untrusted devices makes use of binary signatures, trusted connections, and verified endpoints.",,X,X,494,
V1,Architecture,1.14.3,Verify that the build pipeline warns of out-of-date or insecure components and takes appropriate actions.,,X,X,1104,
V1,Architecture,1.14.4,"Verify that the build pipeline contains a build step to automatically build and verify the secure deployment of the application, particularly if the application infrastructure is software defined, such as cloud environment build scripts.",,X,X,,
V1,Architecture,1.14.5,"Verify that application deployments adequately sandbox, containerize and/or isolate at the network level to delay and deter attackers from attacking other applications, especially when they are performing sensitive or dangerous actions such as deserialization. ([C5](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",,X,X,265,
V1,Architecture,1.14.6,"Verify the application does not use unsupported, insecure, or deprecated client-side technologies such as NSAPI plugins, Flash, Shockwave, ActiveX, Silverlight, NACL, or client-side Java applets.",,X,X,477,
V1,Architecture,1.2.1,"Verify the use of unique or special low-privilege operating system accounts for all application components, services, and servers. ([C3](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",,X,X,250,
V1,Architecture,1.2.2,"Verify that communications between application components, including APIs, middleware and data layers, are authenticated. Components should have the least necessary privileges needed. ([C3](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",,X,X,306,
V1,Architecture,1.2.3,"Verify that the application uses a single vetted authentication mechanism that is known to be secure, can be extended to include strong authentication, and has sufficient logging and monitoring to detect account abuse or breaches.",,X,X,306,
V1,Architecture,1.2.4,"Verify that all authentication pathways and identity management APIs implement consistent authentication security control strength, such that there are no weaker alternatives per the risk of the application.",,X,X,306,
V1,Architecture,1.4.1,"Verify that trusted enforcement points such as at access control gateways, servers, and serverless functions enforce access controls. Never enforce access controls on the client.",,X,X,602,
V1,Architecture,1.4.2,Verify that the chosen access control solution is flexible enough to meet the application's needs.,,X,X,284,
V1,Architecture,1.4.3,"Verify enforcement of the principle of least privilege in functions, data files, URLs, controllers, services, and other resources. This implies protection against spoofing and elevation of privilege.",,X,X,272,
V1,Architecture,1.4.4,Verify the application uses a single and well-vetted access control mechanism for accessing protected data and resources. All requests must pass through this single mechanism to avoid copy and paste or insecure alternative paths. ([C7](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),,X,X,284,
V1,Architecture,1.4.5,Verify that attribute or feature-based access control is used whereby the code checks the user's authorization for a feature/data item rather than just their role. Permissions should still be allocated using roles. ([C7](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),,X,X,275,
V1,Architecture,1.5.1,"Verify that input and output requirements clearly define how to handle and process data based on type, content, and applicable laws, regulations, and other policy compliance.",,X,X,1029,
V1,Architecture,1.5.2,"Verify that serialization is not used when communicating with untrusted clients. If this is not possible, ensure that adequate integrity controls (and possibly encryption if sensitive data is sent) are enforced to prevent deserialization attacks including object injection.",,X,X,502,
V1,Architecture,1.5.3,Verify that input validation is enforced on a trusted service layer. ([C5](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),,X,X,602,
V1,Architecture,1.5.4,Verify that output encoding occurs close to or by the interpreter for which it is intended. ([C4](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),,X,X,116,
V1,Architecture,1.6.1,Verify that there is an explicit policy for management of cryptographic keys and that a cryptographic key lifecycle follows a key management standard such as NIST SP 800-57.,,X,X,320,
V1,Architecture,1.6.2,Verify that consumers of cryptographic services protect key material and other secrets by using key vaults or API based alternatives.,,X,X,320,
V1,Architecture,1.6.3,Verify that all keys and passwords are replaceable and are part of a well-defined process to re-encrypt sensitive data.,,X,X,320,
V1,Architecture,1.6.4,"Verify that symmetric keys, passwords, or API secrets generated by or shared with clients are used only in protecting low risk secrets, such as encrypting local storage, or temporary ephemeral uses such as parameter obfuscation. Sharing secrets with clients is clear-text equivalent and architecturally should be treated as such.",,X,X,320,
V1,Architecture,1.7.1,Verify that a common logging format and approach is used across the system. ([C9](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),,X,X,1009,
V1,Architecture,1.7.2,"Verify that logs are securely transmitted to a preferably remote system for analysis, detection, alerting, and escalation. ([C9](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",,X,X,,
V1,Architecture,1.8.1,Verify that all sensitive data is identified and classified into protection levels.,,X,X,,
V1,Architecture,1.8.2,"Verify that all protection levels have an associated set of protection requirements, such as encryption requirements, integrity requirements, retention, privacy and other confidentiality requirements, and that these are applied in the architecture.",,X,X,,
V1,Architecture,1.9.1,"Verify the application encrypts communications between components, particularly when these components are in different containers, systems, sites, or cloud providers. ([C3](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",,X,X,319,
V1,Architecture,1.9.2,"Verify that application components verify the authenticity of each side in a communication link to prevent person-in-the-middle attacks. For example, application components should validate TLS certificates and chains.",,X,X,295,
V2,Authentication,2.1.1,Verify that user set passwords are at least 12 characters in length. ([C6](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),X,X,X,521,5.1.1.2
V2,Authentication,2.1.10,Verify that there are no periodic credential rotation or password history requirements.,X,X,X,263,5.1.1.2
V2,Authentication,2.1.11,"Verify that ""paste"" functionality, browser password helpers, and external password managers are permitted.",X,X,X,521,5.1.1.2
V2,Authentication,2.1.12,"Verify that the user can choose to either temporarily view the entire masked password, or temporarily view the last typed character of the password on platforms that do not have this as native functionality.",X,X,X,521,5.1.1.2
V2,Authentication,2.1.2,Verify that passwords 64 characters or longer are permitted. ([C6](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),X,X,X,521,5.1.1.2
V2,Authentication,2.1.3,Verify that passwords can contain spaces and truncation is not performed. Consecutive multiple spaces MAY optionally be coalesced. ([C6](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),X,X,X,521,5.1.1.2
V2,Authentication,2.1.4,"Verify that Unicode characters are permitted in passwords. A single Unicode code point is considered a character, so 12 emoji or 64 kanji characters should be valid and permitted.",X,X,X,521,5.1.1.2
V2,Authentication,2.1.5,Verify users can change their password.,X,X,X,620,5.1.1.2
V2,Authentication,2.1.6,Verify that password change functionality requires the user's current and new password.,X,X,X,620,5.1.1.2
V2,Authentication,2.1.7,"Verify that passwords submitted during account registration, login, and password change are checked against a set of breached passwords either locally (such as the top 1,000 or 10,000 most common passwords which match the system's password policy) or using an external API. If using an API a zero knowledge proof or other mechanism should be used to ensure that the plain text password is not sent or used in verifying the breach status of the password. If the password is breached, the application must require the user to set a new non-breached password. ([C6](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",X,X,X,521,5.1.1.2
V2,Authentication,2.1.8,Verify that a password strength meter is provided to help users set a stronger password.,X,X,X,521,5.1.1.2
V2,Authentication,2.1.9,Verify that there are no password composition rules limiting the type of characters permitted. There should be no requirement for upper or lower case or numbers or special characters. ([C6](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),X,X,X,521,5.1.1.2
V2,Authentication,2.10.1,"Verify that integration secrets do not rely on unchanging passwords, such as API keys or shared privileged accounts.",,OS assisted,HSM,287,5.1.1.1
V2,Authentication,2.10.2,"Verify that if passwords are required, the credentials are not a default account.",,OS assisted,HSM,255,5.1.1.1
V2,Authentication,2.10.3,"Verify that passwords are stored with sufficient protection to prevent offline recovery attacks, including local system access.",,OS assisted,HSM,522,5.1.1.1
V2,Authentication,2.10.4,"Verify passwords, integrations with databases and third-party systems, seeds and internal secrets, and API keys are managed securely and not included in the source code or stored within source code repositories. Such storage SHOULD resist offline attacks. The use of a secure software key store (L1), hardware trusted platform module (TPM), or a hardware security module (L3) is recommended for password storage.",,OS assisted,HSM,798,
V2,Authentication,2.2.1,"Verify that anti-automation controls are effective at mitigating breached credential testing, brute force, and account lockout attacks. Such controls include blocking the most common breached passwords, soft lockouts, rate limiting, CAPTCHA, ever increasing delays between attempts, IP address restrictions, or risk-based restrictions such as location, first login on a device, recent attempts to unlock the account, or similar. Verify that no more than 100 failed attempts per hour is possible on a single account.",X,X,X,307,5.2.2 / 5.1.1.2 / 5.1.4.2 / 5.1.5.2
V2,Authentication,2.2.2,"Verify that the use of weak authenticators (such as SMS and email) is limited to secondary verification and transaction approval and not as a replacement for more secure authentication methods. Verify that stronger methods are offered before weak methods, users are aware of the risks, or that proper measures are in place to limit the risks of account compromise.",X,X,X,304,5.2.10
V2,Authentication,2.2.3,"Verify that secure notifications are sent to users after updates to authentication details, such as credential resets, email or address changes, logging in from unknown or risky locations. The use of push notifications - rather than SMS or email - is preferred, but in the absence of push notifications, SMS or email is acceptable as long as no sensitive information is disclosed in the notification.",X,X,X,620,
V2,Authentication,2.2.4,"Verify impersonation resistance against phishing, such as the use of multi-factor authentication, cryptographic devices with intent (such as connected keys with a push to authenticate), or at higher AAL levels, client-side certificates.",,,X,308,5.2.5
V2,Authentication,2.2.5,"Verify that where a credential service provider (CSP) and the application verifying authentication are separated, mutually authenticated TLS is in place between the two endpoints.",,,X,319,5.2.6
V2,Authentication,2.2.6,"Verify replay resistance through the mandated use of OTP devices, cryptographic authenticators, or lookup codes.",,,X,308,5.2.8
V2,Authentication,2.2.7,Verify intent to authenticate by requiring the entry of an OTP token or user-initiated action such as a button press on a FIDO hardware key.,,,X,308,5.2.9
V2,Authentication,2.3.1,"Verify system generated initial passwords or activation codes SHOULD be securely randomly generated, SHOULD be at least 6 characters long, and MAY contain letters and numbers, and expire after a short period of time. These initial secrets must not be permitted to become the long term password.",X,X,X,330,5.1.1.2 / A.3
V2,Authentication,2.3.2,"Verify that enrollment and use of subscriber-provided authentication devices are supported, such as a U2F or FIDO tokens.",,X,X,308,6.1.3
V2,Authentication,2.3.3,Verify that renewal instructions are sent with sufficient time to renew time bound authenticators.,,X,X,287,6.1.4
V2,Authentication,2.4.1,"Verify that passwords are stored in a form that is resistant to offline attacks. Passwords SHALL be salted and hashed using an approved one-way key derivation or password hashing function. Key derivation and password hashing functions take a password, a salt, and a cost factor as inputs when generating a password hash. ([C6](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",,X,X,916,5.1.1.2
V2,Authentication,2.4.2,"Verify that the salt is at least 32 bits in length and be chosen arbitrarily to minimize salt value collisions among stored hashes. For each credential, a unique salt value and the resulting hash SHALL be stored. ([C6](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",,X,X,916,5.1.1.2
V2,Authentication,2.4.3,"Verify that if PBKDF2 is used, the iteration count SHOULD be as large as verification server performance will allow, typically at least 100,000 iterations. ([C6](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",,X,X,916,5.1.1.2
V2,Authentication,2.4.4,"Verify that if bcrypt is used, the work factor SHOULD be as large as verification server performance will allow, typically at least 13. ([C6](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",,X,X,916,5.1.1.2
V2,Authentication,2.4.5,"Verify that an additional iteration of a key derivation function is performed, using a salt value that is secret and known only to the verifier. Generate the salt value using an approved random bit generator [SP 800-90Ar1] and provide at least the minimum security strength specified in the latest revision of SP 800-131A. The secret salt value SHALL be stored separately from the hashed passwords (e.g., in a specialized device like a hardware security module).",,X,X,916,5.1.1.2
V2,Authentication,2.5.1,Verify that a system generated initial activation or recovery secret is not sent in clear text to the user. ([C6](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),X,X,X,640,5.1.1.2
V2,Authentication,2.5.2,"Verify password hints or knowledge-based authentication (so-called ""secret questions"") are not present.",X,X,X,640,5.1.1.2
V2,Authentication,2.5.3,Verify password credential recovery does not reveal the current password in any way. ([C6](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),X,X,X,640,5.1.1.2
V2,Authentication,2.5.4,"Verify shared or default accounts are not present (e.g. ""root"", ""admin"", or ""sa"").",X,X,X,16,5.1.1.2 / A.3
V2,Authentication,2.5.5,"Verify that if an authentication factor is changed or replaced, that the user is notified of this event.",X,X,X,304,6.1.2.3
V2,Authentication,2.5.6,"Verify forgotten password, and other recovery paths use a secure recovery mechanism, such as TOTP or other soft token, mobile push, or another offline recovery mechanism. ([C6](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",X,X,X,640,5.1.1.2
V2,Authentication,2.5.7,"Verify that if OTP or multi-factor authentication factors are lost, that evidence of identity proofing is performed at the same level as during enrollment.",,X,X,308,6.1.2.3
V2,Authentication,2.6.1,Verify that lookup secrets can be used only once.,,X,X,308,5.1.2.2
V2,Authentication,2.6.2,"Verify that lookup secrets have sufficient randomness (112 bits of entropy), or if less than 112 bits of entropy, salted with a unique and random 32-bit salt and hashed with an approved one-way hash.",,X,X,330,5.1.2.2
V2,Authentication,2.6.3,"Verify that lookup secrets are resistant to offline attacks, such as predictable values.",,X,X,310,5.1.2.2
V2,Authentication,2.7.1,"Verify that clear text out of band (NIST ""restricted"") authenticators, such as SMS or PSTN, are not offered by default, and stronger alternatives such as push notifications are offered first.",X,X,X,287,5.1.3.2
V2,Authentication,2.7.2,"Verify that the out of band verifier expires out of band authentication requests, codes, or tokens after 10 minutes.",X,X,X,287,5.1.3.2
V2,Authentication,2.7.3,"Verify that the out of band verifier authentication requests, codes, or tokens are only usable once, and only for the original authentication request.",X,X,X,287,5.1.3.2
V2,Authentication,2.7.4,Verify that the out of band authenticator and verifier communicates over a secure independent channel.,X,X,X,523,5.1.3.2
V2,Authentication,2.7.5,Verify that the out of band verifier retains only a hashed version of the authentication code.,,X,X,256,5.1.3.2
V2,Authentication,2.7.6,"Verify that the initial authentication code is generated by a secure random number generator, containing at least 20 bits of entropy (typically a six digital random number is sufficient).",,X,X,310,5.1.3.2
V2,Authentication,2.8.1,Verify that time-based OTPs have a defined lifetime before expiring.,X,X,X,613,5.1.4.2 / 5.1.5.2
V2,Authentication,2.8.2,"Verify that symmetric keys used to verify submitted OTPs are highly protected, such as by using a hardware security module or secure operating system based key storage.",,X,X,320,5.1.4.2 / 5.1.5.2
V2,Authentication,2.8.3,"Verify that approved cryptographic algorithms are used in the generation, seeding, and verification.",,X,X,326,5.1.4.2 / 5.1.5.2
V2,Authentication,2.8.4,Verify that time-based OTP can be used only once within the validity period.,,X,X,287,5.1.4.2 / 5.1.5.2
V2,Authentication,2.8.5,"Verify that if a time-based multi factor OTP token is re-used during the validity period, it is logged and rejected with secure notifications being sent to the holder of the device.",,X,X,287,5.1.5.2
V2,Authentication,2.8.6,"Verify physical single factor OTP generator can be revoked in case of theft or other loss. Ensure that revocation is immediately effective across logged in sessions, regardless of location.",,X,X,613,5.2.1
V2,Authentication,2.8.7,Verify that biometric authenticators are limited to use only as secondary factors in conjunction with either something you have and something you know.,,o,X,308,5.2.3
V2,Authentication,2.9.1,"Verify that cryptographic keys used in verification are stored securely and protected against disclosure, such as using a TPM or HSM, or an OS service that can use this secure storage.",,X,X,320,5.1.7.2
V2,Authentication,2.9.2,"Verify that the challenge nonce is at least 64 bits in length, and statistically unique or unique over the lifetime of the cryptographic device.",,X,X,330,5.1.7.2
V2,Authentication,2.9.3,"Verify that approved cryptographic algorithms are used in the generation, seeding, and verification.",,X,X,327,5.1.7.2
V3,Session,3.1.1,Verify the application never reveals session tokens in URL parameters or error messages.,X,X,X,598,
V3,Session,3.2.1,Verify the application generates a new session token on user authentication. ([C6](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),X,X,X,384,7.1
V3,Session,3.2.2,Verify that session tokens possess at least 64 bits of entropy. ([C6](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),X,X,X,331,7.1
V3,Session,3.2.3,Verify the application only stores session tokens in the browser using secure methods such as appropriately secured cookies (see section 3.4) or HTML 5 session storage.,X,X,X,539,7.1
V3,Session,3.2.4,Verify that session token are generated using approved cryptographic algorithms. ([C6](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),,X,X,331,7.1
V3,Session,3.3.1,"Verify that logout and expiration invalidate the session token, such that the back button or a downstream relying party does not resume an authenticated session, including across relying parties. ([C6](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",X,X,X,613,7.1
V3,Session,3.3.2,"If authenticators permit users to remain logged in, verify that re-authentication occurs periodically both when actively used or after an idle period. ([C6](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",30 days,"12 hours or 30 minutes of inactivity, 2FA optional","12 hours or 15 minutes of inactivity, with 2FA",613,7.2
V3,Session,3.3.3,"Verify that the application terminates all other active sessions after a successful password change, and that this is effective across the application, federated login (if present), and any relying parties.",,X,X,613,
V3,Session,3.3.4,Verify that users are able to view and log out of any or all currently active sessions and devices.,,X,X,613,7.1
V3,Session,3.4.1,Verify that cookie-based session tokens have the 'Secure' attribute set. ([C6](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),X,X,X,614,7.1.1
V3,Session,3.4.2,Verify that cookie-based session tokens have the 'HttpOnly' attribute set. ([C6](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),X,X,X,1004,7.1.1
V3,Session,3.4.3,Verify that cookie-based session tokens utilize the 'SameSite' attribute to limit exposure to cross-site request forgery attacks. ([C6](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),X,X,X,16,7.1.1
V3,Session,3.4.4,"Verify that cookie-based session tokens use ""__Host-"" prefix (see references) to provide session cookie confidentiality.",X,X,X,16,7.1.1
V3,Session,3.4.5,"Verify that if the application is published under a domain name with other applications that set or use session cookies that might override or disclose the session cookies, set the path attribute in cookie-based session tokens using the most precise path possible. ([C6](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",X,X,X,16,7.1.1
V3,Session,3.5.1,Verify the application does not treat OAuth and refresh tokens — on their own — as the presence of the subscriber and allows users to terminate trust relationships with linked applications.,,X,X,290,7.1.2
V3,Session,3.5.2,"Verify the application uses session tokens rather than static API secrets and keys, except with legacy implementations.",,X,X,798,
V3,Session,3.5.3,"Verify that stateless session tokens use digital signatures, encryption, and other countermeasures to protect against tampering, enveloping, replay, null cipher, and key substitution attacks.",,X,X,345,
V3,Session,3.6.1,Verify that relying parties specify the maximum authentication time to CSPs and that CSPs re-authenticate the subscriber if they haven't used a session within that period.,,,X,613,7.2.1
V3,Session,3.6.2,"Verify that CSPs inform relying parties of the last authentication event, to allow RPs to determine if they need to re-authenticate the user.",,,X,613,7.2.1
V3,Session,3.7.1,Verify the application ensures a valid login session or requires re-authentication or secondary verification before allowing any sensitive transactions or account modifications.,X,X,X,778,
V4,Access,4.1.1,"Verify that the application enforces access control rules on a trusted service layer, especially if client-side access control is present and could be bypassed.",X,X,X,602,
V4,Access,4.1.2,Verify that all user and data attributes and policy information used by access controls cannot be manipulated by end users unless specifically authorized.,X,X,X,639,
V4,Access,4.1.3,"Verify that the principle of least privilege exists - users should only be able to access functions, data files, URLs, controllers, services, and other resources, for which they possess specific authorization. This implies protection against spoofing and elevation of privilege. ([C7](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",X,X,X,285,
V4,Access,4.1.4,Verify that the principle of deny by default exists whereby new users/roles start with minimal or no permissions and users/roles do not receive access to new features until access is explicitly assigned. ([C7](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),X,X,X,276,
V4,Access,4.1.5,Verify that access controls fail securely including when an exception occurs. ([C10](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),X,X,X,285,
V4,Access,4.2.1,"Verify that sensitive data and APIs are protected against direct object attacks targeting creation, reading, updating and deletion of records, such as creating or updating someone else's record, viewing everyone's records, or deleting all records.",X,X,X,639,
V4,Access,4.2.2,"Verify that the application or framework enforces a strong anti-CSRF mechanism to protect authenticated functionality, and effective anti-automation or anti-CSRF protects unauthenticated functionality.",X,X,X,352,
V4,Access,4.3.1,Verify administrative interfaces use appropriate multi-factor authentication to prevent unauthorized use.,X,X,X,419,
V4,Access,4.3.2,"Verify that directory browsing is disabled unless deliberately desired. Additionally, applications should not allow discovery or disclosure of file or directory metadata, such as Thumbs.db, .DS_Store, .git or .svn folders.",X,X,X,548,
V4,Access,4.3.3,"Verify the application has additional authorization (such as step up or adaptive authentication) for lower value systems, and / or segregation of duties for high value applications to enforce anti-fraud controls as per the risk of application and past fraud.",,X,X,732,
V5,Validation,5.1.1,"Verify that the application has defenses against HTTP parameter pollution attacks, particularly if the application framework makes no distinction about the source of request parameters (GET, POST, cookies, headers, or environment variables).",X,X,X,235,
V5,Validation,5.1.2,"Verify that frameworks protect against mass parameter assignment attacks, or that the application has countermeasures to protect against unsafe parameter assignment, such as marking fields private or similar. ([C5](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",X,X,X,915,
V5,Validation,5.1.3,"Verify that all input (HTML form fields, REST requests, URL parameters, HTTP headers, cookies, batch files, RSS feeds, etc) is validated using positive validation (whitelisting). ([C5](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",X,X,X,20,
V5,Validation,5.1.4,"Verify that structured data is strongly typed and validated against a defined schema including allowed characters, length and pattern (e.g. credit card numbers or telephone, or validating that two related fields are reasonable, such as checking that suburb and zip/postcode match). ([C5](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",X,X,X,20,
V5,Validation,5.1.5,"Verify that URL redirects and forwards only allow whitelisted destinations, or show a warning when redirecting to potentially untrusted content.",X,X,X,601,
V5,Validation,5.2.1,Verify that all untrusted HTML input from WYSIWYG editors or similar is properly sanitized with an HTML sanitizer library or framework feature. ([C5](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),X,X,X,116,
V5,Validation,5.2.2,Verify that unstructured data is sanitized to enforce safety measures such as allowed characters and length.,X,X,X,138,
V5,Validation,5.2.3,Verify that the application sanitizes user input before passing to mail systems to protect against SMTP or IMAP injection.,X,X,X,147,
V5,Validation,5.2.4,"Verify that the application avoids the use of eval() or other dynamic code execution features. Where there is no alternative, any user input being included must be sanitized or sandboxed before being executed.",X,X,X,95,
V5,Validation,5.2.5,Verify that the application protects against template injection attacks by ensuring that any user input being included is sanitized or sandboxed.,X,X,X,94,
V5,Validation,5.2.6,"Verify that the application protects against SSRF attacks, by validating or sanitizing untrusted data or HTTP file metadata, such as filenames and URL input fields, use whitelisting of protocols, domains, paths and ports.",X,X,X,918,
V5,Validation,5.2.7,"Verify that the application sanitizes, disables, or sandboxes user-supplied SVG scriptable content, especially as they relate to XSS resulting from inline scripts, and foreignObject.",X,X,X,159,
V5,Validation,5.2.8,"Verify that the application sanitizes, disables, or sandboxes user-supplied scriptable or expression template language content, such as Markdown, CSS or XSL stylesheets, BBCode, or similar.",X,X,X,94,
V5,Validation,5.3.1,"Verify that output encoding is relevant for the interpreter and context required. For example, use encoders specifically for HTML values, HTML attributes, JavaScript, URL Parameters, HTTP headers, SMTP, and others as the context requires, especially from untrusted inputs (e.g. names with Unicode or apostrophes, such as ねこ or O'Hara). ([C4](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",X,X,X,116,
V5,Validation,5.3.10,Verify that the application protects against XPath injection or XML injection attacks. ([C4](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),X,X,X,643,
V5,Validation,5.3.2,"Verify that output encoding preserves the user's chosen character set and locale, such that any Unicode character point is valid and safely handled. ([C4](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",X,X,X,176,
V5,Validation,5.3.3,"Verify that context-aware, preferably automated - or at worst, manual - output escaping protects against reflected, stored, and DOM based XSS. ([C4](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",X,X,X,79,
V5,Validation,5.3.4,"Verify that data selection or database queries (e.g. SQL, HQL, ORM, NoSQL) use parameterized queries, ORMs, entity frameworks, or are otherwise protected from database injection attacks. ([C3](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",X,X,X,89,
V5,Validation,5.3.5,"Verify that where parameterized or safer mechanisms are not present, context-specific output encoding is used to protect against injection attacks, such as the use of SQL escaping to protect against SQL injection. ([C3, C4](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",X,X,X,89,
V5,Validation,5.3.6,"Verify that the application projects against JavaScript or JSON injection attacks, including for eval attacks, remote JavaScript includes, CSP bypasses, DOM XSS, and JavaScript expression evaluation. ([C4](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",X,X,X,830,
V5,Validation,5.3.7,"Verify that the application protects against LDAP Injection vulnerabilities, or that specific security controls to prevent LDAP Injection have been implemented. ([C4](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",X,X,X,943,
V5,Validation,5.3.8,Verify that the application protects against OS command injection and that operating system calls use parameterized OS queries or use contextual command line output encoding. ([C4](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),X,X,X,78,
V5,Validation,5.3.9,Verify that the application protects against Local File Inclusion (LFI) or Remote File Inclusion (RFI) attacks.,X,X,X,829,
V5,Validation,5.4.1,"Verify that the application uses memory-safe string, safer memory copy and pointer arithmetic to detect or prevent stack, buffer, or heap overflows.",,X,X,120,
V5,Validation,5.4.2,"Verify that format strings do not take potentially hostile input, and are constant.",,X,X,134,
V5,Validation,5.4.3,"Verify that sign, range, and input validation techniques are used to prevent integer overflows.",,X,X,190,
V5,Validation,5.5.1,Verify that serialized objects use integrity checks or are encrypted to prevent hostile object creation or data tampering. ([C5](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),X,X,X,502,
V5,Validation,5.5.2,Verify that the application correctly restricts XML parsers to only use the most restrictive configuration possible and to ensure that unsafe features such as resolving external entities are disabled to prevent XXE.,X,X,X,611,
V5,Validation,5.5.3,"Verify that deserialization of untrusted data is avoided or is protected in both custom code and third-party libraries (such as JSON, XML and YAML parsers).",X,X,X,502,
V5,Validation,5.5.4,"Verify that when parsing JSON in browsers or JavaScript-based backends, JSON.parse is used to parse the JSON document. Do not use eval() to parse JSON.",X,X,X,95,
V6,Cryptography,6.1.1,"Verify that regulated private data is stored encrypted while at rest, such as personally identifiable information (PII), sensitive personal information, or data assessed likely to be subject to EU's GDPR.",,X,X,311,
V6,Cryptography,6.1.2,"Verify that regulated health data is stored encrypted while at rest, such as medical records, medical device details, or de-anonymized research records.",,X,X,311,
V6,Cryptography,6.1.3,"Verify that regulated financial data is stored encrypted while at rest, such as financial accounts, defaults or credit history, tax records, pay history, beneficiaries, or de-anonymized market or research records.",,X,X,311,
V6,Cryptography,6.2.1,"Verify that all cryptographic modules fail securely, and errors are handled in a way that does not enable Padding Oracle attacks.",X,X,X,310,
V6,Cryptography,6.2.2,"Verify that industry proven or government approved cryptographic algorithms, modes, and libraries are used, instead of custom coded cryptography. ([C8](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",,X,X,327,
V6,Cryptography,6.2.3,"Verify that encryption initialization vector, cipher configuration, and block modes are configured securely using the latest advice.",,X,X,326,
V6,Cryptography,6.2.4,"Verify that random number, encryption or hashing algorithms, key lengths, rounds, ciphers or modes, can be reconfigured, upgraded, or swapped at any time, to protect against cryptographic breaks. ([C8](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",,X,X,326,
V6,Cryptography,6.2.5,"Verify that known insecure block modes (i.e. ECB, etc.), padding modes (i.e. PKCS#1 v1.5, etc.), ciphers with small block sizes (i.e. Triple-DES, Blowfish, etc.), and weak hashing algorithms (i.e. MD5, SHA1, etc.) are not used unless required for backwards compatibility.",,X,X,326,
V6,Cryptography,6.2.6,"Verify that nonces, initialization vectors, and other single use numbers must not be used more than once with a given encryption key. The method of generation must be appropriate for the algorithm being used.",,X,X,326,
V6,Cryptography,6.2.7,"Verify that encrypted data is authenticated via signatures, authenticated cipher modes, or HMAC to ensure that ciphertext is not altered by an unauthorized party.",,,X,326,
V6,Cryptography,6.2.8,"Verify that all cryptographic operations are constant-time, with no 'short-circuit' operations in comparisons, calculations, or returns, to avoid leaking information.",,,X,385,
V6,Cryptography,6.3.1,"Verify that all random numbers, random file names, random GUIDs, and random strings are generated using the cryptographic module's approved cryptographically secure random number generator when these random values are intended to be not guessable by an attacker.",,X,X,338,
V6,Cryptography,6.3.2,"Verify that random GUIDs are created using the GUID v4 algorithm, and a cryptographically-secure pseudo-random number generator (CSPRNG). GUIDs created using other pseudo-random number generators may be predictable.",,X,X,338,
V6,Cryptography,6.3.3,"Verify that random numbers are created with proper entropy even when the application is under heavy load, or that the application degrades gracefully in such circumstances.",,,X,338,
V6,Cryptography,6.4.1,"Verify that a secrets management solution such as a key vault is used to securely create, store, control access to and destroy secrets. ([C8](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",,X,X,798,
V6,Cryptography,6.4.2,Verify that key material is not exposed to the application but instead uses an isolated security module like a vault for cryptographic operations. ([C8](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),,X,X,320,
V7,Error,7.1.1,"Verify that the application does not log credentials or payment details. Session tokens should only be stored in logs in an irreversible, hashed form. ([C9, C10](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",X,X,X,532,
V7,Error,7.1.2,Verify that the application does not log other sensitive data as defined under local privacy laws or relevant security policy. ([C9](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),X,X,X,532,
V7,Error,7.1.3,"Verify that the application logs security relevant events including successful and failed authentication events, access control failures, deserialization failures and input validation failures. ([C5, C7](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",,X,X,778,
V7,Error,7.1.4,Verify that each log event includes necessary information that would allow for a detailed investigation of the timeline when an event happens. ([C9](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),,X,X,778,
V7,Error,7.2.1,"Verify that all authentication decisions are logged, without storing sensitive session identifiers or passwords. This should include requests with relevant metadata needed for security investigations.",,X,X,778,
V7,Error,7.2.2,Verify that all access control decisions can be logged and all failed decisions are logged. This should include requests with relevant metadata needed for security investigations.,,X,X,285,
V7,Error,7.3.1,Verify that the application appropriately encodes user-supplied data to prevent log injection. ([C9](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),,X,X,117,
V7,Error,7.3.2,Verify that all events are protected from injection when viewed in log viewing software. ([C9](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),,X,X,117,
V7,Error,7.3.3,Verify that security logs are protected from unauthorized access and modification. ([C9](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),,X,X,200,
V7,Error,7.3.4,Verify that time sources are synchronized to the correct time and time zone. Strongly consider logging only in UTC if systems are global to assist with post-incident forensic analysis. ([C9](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),,X,X,,
V7,Error,7.4.1,"Verify that a generic message is shown when an unexpected or security sensitive error occurs, potentially with a unique ID which support personnel can use to investigate. ([C10](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",X,X,X,210,
V7,Error,7.4.2,Verify that exception handling (or a functional equivalent) is used across the codebase to account for expected and unexpected error conditions. ([C10](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),,X,X,544,
V7,Error,7.4.3,"Verify that a ""last resort"" error handler is defined which will catch all unhandled exceptions. ([C10](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",,X,X,460,
V8,Data,8.1.1,Verify the application protects sensitive data from being cached in server components such as load balancers and application caches.,,X,X,524,
V8,Data,8.1.2,Verify that all cached or temporary copies of sensitive data stored on the server are protected from unauthorized access or purged/invalidated after the authorized user accesses the sensitive data.,,X,X,524,
V8,Data,8.1.3,"Verify the application minimizes the number of parameters in a request, such as hidden fields, Ajax variables, cookies and header values.",,X,X,233,
V8,Data,8.1.4,"Verify the application can detect and alert on abnormal numbers of requests, such as by IP, user, total per hour or day, or whatever makes sense for the application.",,X,X,770,
V8,Data,8.1.5,Verify that regular backups of important data are performed and that test restoration of data is performed.,,,X,19,
V8,Data,8.1.6,Verify that backups are stored securely to prevent data from being stolen or corrupted.,,,X,19,
V8,Data,8.2.1,Verify the application sets sufficient anti-caching headers so that sensitive data is not cached in modern browsers.,X,X,X,525,
V8,Data,8.2.2,"Verify that data stored in client side storage (such as HTML5 local storage, session storage, IndexedDB, regular cookies or Flash cookies) does not contain sensitive data or PII.",X,X,X,922,
V8,Data,8.2.3,"Verify that authenticated data is cleared from client storage, such as the browser DOM, after the client or session is terminated.",X,X,X,922,
V8,Data,8.3.1,"Verify that sensitive data is sent to the server in the HTTP message body or headers, and that query string parameters from any HTTP verb do not contain sensitive data.",X,X,X,319,
V8,Data,8.3.2,Verify that users have a method to remove or export their data on demand.,X,X,X,212,
V8,Data,8.3.3,Verify that users are provided clear language regarding collection and use of supplied personal information and that users have provided opt-in consent for the use of that data before it is used in any way.,X,X,X,285,
V8,Data,8.3.4,"Verify that all sensitive data created and processed by the application has been identified, and ensure that a policy is in place on how to deal with sensitive data. ([C8](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",X,X,X,200,
V8,Data,8.3.5,"Verify accessing sensitive data is audited (without logging the sensitive data itself), if the data is collected under relevant data protection directives or where logging of access is required.",,X,X,532,
V8,Data,8.3.6,"Verify that sensitive information contained in memory is overwritten as soon as it is no longer required to mitigate memory dumping attacks, using zeroes or random data.",,X,X,226,
V8,Data,8.3.7,"Verify that sensitive or private information that is required to be encrypted, is encrypted using approved algorithms that provide both confidentiality and integrity. ([C8](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",,X,X,327,
V8,Data,8.3.8,"Verify that sensitive personal information is subject to data retention classification, such that old or out of date data is deleted automatically, on a schedule, or as the situation requires.",,X,X,285,
V9,Communications,9.1.1,"Verify that secured TLS is used for all client connectivity, and does not fall back to insecure or unencrypted protocols. ([C8](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",X,X,X,319,
V9,Communications,9.1.2,"Verify using online or up to date TLS testing tools that only strong algorithms, ciphers, and protocols are enabled, with the strongest algorithms and ciphers set as preferred.",X,X,X,326,
V9,Communications,9.1.3,"Verify that old versions of SSL and TLS protocols, algorithms, ciphers, and configuration are disabled, such as SSLv2, SSLv3, or TLS 1.0 and TLS 1.1. The latest version of TLS should be the preferred cipher suite.",X,X,X,326,
V9,Communications,9.2.1,"Verify that connections to and from the server use trusted TLS certificates. Where internally generated or self-signed certificates are used, the server must be configured to only trust specific internal CAs and specific self-signed certificates. All others should be rejected.",,X,X,295,
V9,Communications,9.2.2,"Verify that encrypted communications such as TLS is used for all inbound and outbound connections, including for management ports, monitoring, authentication, API, or web service calls, database, cloud, serverless, mainframe, external, and partner connections. The server must not fall back to insecure or unencrypted protocols.",,X,X,319,
V9,Communications,9.2.3,Verify that all encrypted connections to external systems that involve sensitive information or functions are authenticated.,,X,X,287,
V9,Communications,9.2.4,"Verify that proper certification revocation, such as Online Certificate Status Protocol (OCSP) Stapling, is enabled and configured.",,X,X,299,
V9,Communications,9.2.5,Verify that backend TLS connection failures are logged.,,,X,544,
V10,Malicious,10.1.1,"Verify that a code analysis tool is in use that can detect potentially malicious code, such as time functions, unsafe file operations and network connections.",,,X,749,
V10,Malicious,10.2.1,"Verify that the application source code and third party libraries do not contain unauthorized phone home or data collection capabilities. Where such functionality exists, obtain the user's permission for it to operate before collecting any data.",,X,X,359,
V10,Malicious,10.2.2,"Verify that the application does not ask for unnecessary or excessive permissions to privacy related features or sensors, such as contacts, cameras, microphones, or location.",,X,X,272,
V10,Malicious,10.2.3,"Verify that the application source code and third party libraries do not contain back doors, such as hard-coded or additional undocumented accounts or keys, code obfuscation, undocumented binary blobs, rootkits, or anti-debugging, insecure debugging features, or otherwise out of date, insecure, or hidden functionality that could be used maliciously if discovered.",,,X,507,
V10,Malicious,10.2.4,Verify that the application source code and third party libraries does not contain time bombs by searching for date and time related functions.,,,X,511,
V10,Malicious,10.2.5,"Verify that the application source code and third party libraries does not contain malicious code, such as salami attacks, logic bypasses, or logic bombs.",,,X,511,
V10,Malicious,10.2.6,Verify that the application source code and third party libraries do not contain Easter eggs or any other potentially unwanted functionality.,,,X,507,
V10,Malicious,10.3.1,"Verify that if the application has a client or server auto-update feature, updates should be obtained over secure channels and digitally signed. The update code must validate the digital signature of the update before installing or executing the update.",X,X,X,16,
V10,Malicious,10.3.2,"Verify that the application employs integrity protections, such as code signing or sub-resource integrity. The application must not load or execute code from untrusted sources, such as loading includes, modules, plugins, code, or libraries from untrusted sources or the Internet.",X,X,X,353,
V10,Malicious,10.3.3,"Verify that the application has protection from sub-domain takeovers if the application relies upon DNS entries or DNS sub-domains, such as expired domain names, out of date DNS pointers or CNAMEs, expired projects at public source code repos, or transient cloud APIs, serverless functions, or storage buckets (autogen-bucket-id.cloud.example.com) or similar. Protections can include ensuring that DNS names used by applications are regularly checked for expiry or change.",X,X,X,350,
V11,BusLogic,11.1.1,Verify the application will only process business logic flows for the same user in sequential step order and without skipping steps.,X,X,X,841,
V11,BusLogic,11.1.2,"Verify the application will only process business logic flows with all steps being processed in realistic human time, i.e. transactions are not submitted too quickly.",X,X,X,779,
V11,BusLogic,11.1.3,Verify the application has appropriate limits for specific business actions or transactions which are correctly enforced on a per user basis.,X,X,X,770,
V11,BusLogic,11.1.4,"Verify the application has sufficient anti-automation controls to detect and protect against data exfiltration, excessive business logic requests, excessive file uploads or denial of service attacks.",X,X,X,770,
V11,BusLogic,11.1.5,"Verify the application has business logic limits or validation to protect against likely business risks or threats, identified using threat modelling or similar methodologies.",X,X,X,841,
V11,BusLogic,11.1.6,"Verify the application does not suffer from ""time of check to time of use"" (TOCTOU) issues or other race conditions for sensitive operations.",,X,X,367,
V11,BusLogic,11.1.7,"Verify the application monitors for unusual events or activity from a business logic perspective. For example, attempts to perform actions out of order or actions which a normal user would never attempt. ([C9](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",,X,X,754,
V11,BusLogic,11.1.8,Verify the application has configurable alerting when automated attacks or unusual activity is detected.,,X,X,390,
V12,Files,12.1.1,Verify that the application will not accept large files that could fill up storage or cause a denial of service attack.,X,X,X,400,
V12,Files,12.1.2,"Verify that compressed files are checked for ""zip bombs"" - small input files that will decompress into huge files thus exhausting file storage limits.",,X,X,409,
V12,Files,12.1.3,"Verify that a file size quota and maximum number of files per user is enforced to ensure that a single user cannot fill up the storage with too many files, or excessively large files.",,X,X,770,
V12,Files,12.2.1,Verify that files obtained from untrusted sources are validated to be of expected type based on the file's content.,,X,X,434,
V12,Files,12.3.1,Verify that user-submitted filename metadata is not used directly with system or framework file and URL API to protect against path traversal.,X,X,X,22,
V12,Files,12.3.2,"Verify that user-submitted filename metadata is validated or ignored to prevent the disclosure, creation, updating or removal of local files (LFI).",X,X,X,73,
V12,Files,12.3.3,"Verify that user-submitted filename metadata is validated or ignored to prevent the disclosure or execution of remote files (RFI), which may also lead to SSRF.",X,X,X,98,
V12,Files,12.3.4,"Verify that the application protects against reflective file download (RFD) by validating or ignoring user-submitted filenames in a JSON, JSONP, or URL parameter, the response Content-Type header should be set to text/plain, and the Content-Disposition header should have a fixed filename.",X,X,X,641,
V12,Files,12.3.5,"Verify that untrusted file metadata is not used directly with system API or libraries, to protect against OS command injection.",X,X,X,78,
V12,Files,12.3.6,"Verify that the application does not include and execute functionality from untrusted sources, such as unverified content distribution networks, JavaScript libraries, node npm libraries, or server-side DLLs.",,X,X,829,
V12,Files,12.4.1,"Verify that files obtained from untrusted sources are stored outside the web root, with limited permissions, preferably with strong validation.",X,X,X,922,
V12,Files,12.4.2,Verify that files obtained from untrusted sources are scanned by antivirus scanners to prevent upload of known malicious content.,X,X,X,509,
V12,Files,12.5.1,"Verify that the web tier is configured to serve only files with specific file extensions to prevent unintentional information and source code leakage. For example, backup files (e.g. .bak), temporary working files (e.g. .swp), compressed files (.zip, .tar.gz, etc) and other extensions commonly used by editors should be blocked unless required.",X,X,X,552,
V12,Files,12.5.2,Verify that direct requests to uploaded files will never be executed as HTML/JavaScript content.,X,X,X,434,
V12,Files,12.6.1,Verify that the web or application server is configured with a whitelist of resources or systems to which the server can send requests or load data/files from.,X,X,X,918,
V13,API,13.1.1,Verify that all application components use the same encodings and parsers to avoid parsing attacks that exploit different URI or file parsing behavior that could be used in SSRF and RFI attacks.,X,X,X,116,
V13,API,13.1.2,Verify that access to administration and management functions is limited to authorized administrators.,X,X,X,419,
V13,API,13.1.3,"Verify API URLs do not expose sensitive information, such as the API key, session tokens etc.",X,X,X,598,
V13,API,13.1.4,"Verify that authorization decisions are made at both the URI, enforced by programmatic or declarative security at the controller or router, and at the resource level, enforced by model-based permissions.",,X,X,285,
V13,API,13.1.5,Verify that requests containing unexpected or missing content types are rejected with appropriate headers (HTTP response status 406 Unacceptable or 415 Unsupported Media Type).,,X,X,434,
V13,API,13.2.1,"Verify that enabled RESTful HTTP methods are a valid choice for the user or action, such as preventing normal users using DELETE or PUT on protected API or resources.",X,X,X,650,
V13,API,13.2.2,Verify that JSON schema validation is in place and verified before accepting input.,X,X,X,20,
V13,API,13.2.3,"Verify that RESTful web services that utilize cookies are protected from Cross-Site Request Forgery via the use of at least one or more of the following: triple or double submit cookie pattern (see [references](https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet)), CSRF nonces, or ORIGIN request header checks.",X,X,X,352,
V13,API,13.2.4,"Verify that REST services have anti-automation controls to protect against excessive calls, especially if the API is unauthenticated.",,X,X,779,
V13,API,13.2.5,"Verify that REST services explicitly check the incoming Content-Type to be the expected one, such as application/xml or application/JSON.",,X,X,436,
V13,API,13.2.6,Verify that the message headers and payload are trustworthy and not modified in transit. Requiring strong encryption for transport (TLS only) may be sufficient in many cases as it provides both confidentiality and integrity protection. Per-message digital signatures can provide additional assurance on top of the transport protections for high-security applications but bring with them additional complexity and risks to weigh against the benefits.,,X,X,345,
V13,API,13.3.1,"Verify that XSD schema validation takes place to ensure a properly formed XML document, followed by validation of each input field before any processing of that data takes place.",X,X,X,20,
V13,API,13.3.2,Verify that the message payload is signed using WS-Security to ensure reliable transport between client and service.,,X,X,345,
V13,API,13.4.1,"Verify that query whitelisting or a combination of depth limiting and amount limiting should be used to prevent GraphQL or data layer expression denial of service (DoS) as a result of expensive, nested queries. For more advanced scenarios, query cost analysis should be used.",,X,X,770,
V13,API,13.4.2,Verify that GraphQL or other data layer authorization logic should be implemented at the business logic layer instead of the GraphQL layer.,,X,X,285,
V14,Config,14.1.1,"Verify that the application build and deployment processes are performed in a secure and repeatable way, such as CI / CD automation, automated configuration management, and automated deployment scripts.",,X,X,,
V14,Config,14.1.2,"Verify that compiler flags are configured to enable all available buffer overflow protections and warnings, including stack randomization, data execution prevention, and to break the build if an unsafe pointer, memory, format string, integer, or string operations are found.",,X,X,120,
V14,Config,14.1.3,Verify that server configuration is hardened as per the recommendations of the application server and frameworks in use.,,X,X,16,
V14,Config,14.1.4,"Verify that the application, configuration, and all dependencies can be re-deployed using automated deployment scripts, built from a documented and tested runbook in a reasonable time, or restored from backups in a timely fashion.",,X,X,,
V14,Config,14.1.5,Verify that authorized administrators can verify the integrity of all security-relevant configurations to detect tampering.,,,X,,
V14,Config,14.2.1,"Verify that all components are up to date, preferably using a dependency checker during build or compile time. ([C2](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",X,X,X,1026,
V14,Config,14.2.2,"Verify that all unneeded features, documentation, samples, configurations are removed, such as sample applications, platform documentation, and default or example users.",X,X,X,1002,
V14,Config,14.2.3,"Verify that if application assets, such as JavaScript libraries, CSS stylesheets or web fonts, are hosted externally on a content delivery network (CDN) or external provider, Subresource Integrity (SRI) is used to validate the integrity of the asset.",X,X,X,714,
V14,Config,14.2.4,"Verify that third party components come from pre-defined, trusted and continually maintained repositories. ([C2](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering))",,X,X,829,
V14,Config,14.2.5,Verify that an inventory catalog is maintained of all third party libraries in use. ([C2](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),,X,X,,
V14,Config,14.2.6,Verify that the attack surface is reduced by sandboxing or encapsulating third party libraries to expose only the required behaviour into the application. ([C2](https://www.owasp.org/index.php/OWASP_Proactive_Controls#tab=Formal_Numbering)),,X,X,265,
V14,Config,14.3.1,"Verify that web or application server and framework error messages are configured to deliver user actionable, customized responses to eliminate any unintended security disclosures.",X,X,X,209,
V14,Config,14.3.2,"Verify that web or application server and application framework debug modes are disabled in production to eliminate debug features, developer consoles, and unintended security disclosures.",X,X,X,497,
V14,Config,14.3.3,Verify that the HTTP headers or any part of the HTTP response do not expose detailed version information of system components.,X,X,X,200,
V14,Config,14.4.1,"Verify that every HTTP response contains a content type header specifying a safe character set (e.g., UTF-8, ISO 8859-1).",X,X,X,173,
V14,Config,14.4.2,"Verify that all API responses contain Content-Disposition: attachment; filename=""api.json"" (or other appropriate filename for the content type).",X,X,X,116,
V14,Config,14.4.3,"Verify that a content security policy (CSPv2) is in place that helps mitigate impact for XSS attacks like HTML, DOM, JSON, and JavaScript injection vulnerabilities.",X,X,X,1021,
V14,Config,14.4.4,Verify that all responses contain X-Content-Type-Options: nosniff.,X,X,X,116,
V14,Config,14.4.5,"Verify that HTTP Strict Transport Security headers are included on all responses and for all subdomains, such as Strict-Transport-Security: max-age=15724800; includeSubdomains.",X,X,X,523,
V14,Config,14.4.6,"Verify that a suitable ""Referrer-Policy"" header is included, such as ""no-referrer"" or ""same-origin"".",X,X,X,116,
V14,Config,14.4.7,Verify that a suitable X-Frame-Options or Content-Security-Policy: frame-ancestors header is in use for sites where content should not be embedded in a third-party site.,X,X,X,346,
V14,Config,14.5.1,"Verify that the application server only accepts the HTTP methods in use by the application or API, including pre-flight OPTIONS.",X,X,X,749,
V14,Config,14.5.2,"Verify that the supplied Origin header is not used for authentication or access control decisions, as the Origin header can easily be changed by an attacker.",X,X,X,346,
V14,Config,14.5.3,"Verify that the cross-domain resource sharing (CORS) Access-Control-Allow-Origin header uses a strict white-list of trusted domains to match against and does not support the ""null"" origin.",X,X,X,346,
V14,Config,14.5.4,"Verify that HTTP headers added by a trusted proxy or SSO devices, such as a bearer token, are authenticated by the application.",,X,X,306,
================================================
FILE: api/tp_api/models.py
================================================
from mongoengine import *
import datetime
from uuid import uuid4
from hashlib import sha256
from mongoengine import signals
def random_scan_name():
return str(uuid4())
class Project(Document):
name = StringField(max_length=100, required=True, unique=True)
orchy_webhook = StringField(required=False)
features = ListField(ReferenceField("UseCase"), required=False)
class RepoTestCase(Document):
name = StringField()
test_case = StringField()
executed = BooleanField(default=False)
tools = ListField(StringField())
type = StringField(max_length=20)
tags = ListField(StringField())
class Repo(Document):
short_name = StringField(required=True)
name = StringField(required=True)
cwe = IntField(required=True)
description = StringField()
variants = ListField(StringField())
categories = ListField(StringField())
mitigations = ListField(DictField())
risks = ListField(DictField())
tests = ListField(ReferenceField(RepoTestCase))
related_cwes = ListField(IntField())
class Interaction(Document):
nature_choices = (("I", "Internal"), ("E", "External"))
nature = StringField(choices=nature_choices)
endpoint = StringField()
data_flow = StringField()
project = ReferenceField(Project, reverse_delete_rule=CASCADE)
class UseCase(Document):
short_name = StringField(unique=True)
description = StringField()
project = ReferenceField(Project, reverse_delete_rule=CASCADE, required=True)
relations = ListField(ReferenceField(Interaction))
boundary = StringField()
abuses = ListField(ReferenceField("AbuseCase"))
class AbuseCase(Document):
short_name = StringField(max_length=100, unique=True)
description = StringField()
use_case = ReferenceField(UseCase, reverse_delete_rule=CASCADE, required=True)
scenarios = ListField(ReferenceField("ThreatModel"), required=False)
model_type_choices = (("repo", "repo"), ("inline", "inline"))
class Mitigations(EmbeddedDocument):
phase = StringField()
strategy = StringField()
description = StringField()
code = StringField()
class Risk(EmbeddedDocument):
description = StringField()
phase = StringField()
class ThreatModel(Document):
# meta = {'collection': 'threat_model'}
name = StringField()
vul_name = StringField()
description = StringField(required=True)
severity = IntField()
model_type = StringField(max_length=6, choices=model_type_choices)
repo_vul_name = ReferenceField(Repo)
use_case = ReferenceField(UseCase, reverse_delete_rule=CASCADE)
abuse_case = ReferenceField(AbuseCase, reverse_delete_rule=CASCADE)
cwe = IntField()
risks = EmbeddedDocumentListField(Risk)
categories = ListField(StringField(max_length=30))
mitigations = EmbeddedDocumentListField(Mitigations)
tests = ListField(ReferenceField("Test"))
class Test(Document):
name = StringField()
test_case = StringField()
executed = BooleanField(default=False)
tools = ListField(StringField())
test_type = StringField()
tags = ListField(StringField())
scenario = ReferenceField(ThreatModel, reverse_delete_rule=CASCADE)
class Risk(EmbeddedDocument):
consequence = StringField()
risk_type = StringField()
class VulnerabilityEvidence(Document):
evidence_type = StringField()
log = StringField()
url = StringField()
line_num = IntField()
param = StringField()
attack = StringField()
info = StringField()
vuln = ReferenceField("Vulnerability")
class Vulnerability(Document):
severity_choices = ((3, "High"), (2, "Medium"), (1, "Low"), (0, "Info"))
tool = StringField()
name = StringField()
cwe = IntField()
severity = IntField(choices=severity_choices)
description = StringField()
observation = StringField()
remediation = StringField()
evidences = ListField(ReferenceField(VulnerabilityEvidence))
created_on = DateTimeField(default=datetime.datetime.utcnow)
scan = ReferenceField("Scan")
target = ReferenceField("Target")
class Scan(Document):
created_on = DateTimeField(default=datetime.datetime.utcnow)
name = StringField(unique=True)
vulnerabilities = ListField(ReferenceField("Vulnerability"))
target = ReferenceField("Target")
tool = StringField()
scan_type = StringField(
choices=(
("SAST", "Static Analysis"),
("DAST", "Dynamic Analysis"),
("SCA", "Source Composition Analysis"),
("IAST", "Interactive Analysis"),
("Manual", "Manual Scan"),
)
)
@classmethod
def pre_save(cls, sender, document, **kwargs):
document.name = "{}-scan-{}-{}@{}".format(
document.tool,
document.target.name,
document.target.project.name,
datetime.datetime.utcnow().isoformat(),
)
class Target(Document):
name = StringField(unique=True)
url = StringField()
project = ReferenceField(Project, reverse_delete_rule=CASCADE)
scans = ListField(ReferenceField(Scan))
class User(Document):
user_type_choices = (("super", "superuser"), ("user", "user"))
email = StringField(max_length=100, unique=True)
password = StringField(max_length=100)
user_type = StringField(choices=user_type_choices, max_length=6, default="user")
default_password = BooleanField(default=True)
class Settings(Document):
orchy_url = StringField()
orchy_user = StringField()
orchy_password = StringField()
class ASVS(Document):
section = StringField()
name = StringField()
item = StringField()
description = StringField()
l1 = BooleanField(default=False)
l2 = BooleanField(default=False)
l3 = BooleanField(default=False)
cwe = IntField()
nist = StringField()
signals.pre_save.connect(Scan.pre_save, sender = Scan)
================================================
FILE: api/tp_api/repo/aws_s3.yaml
================================================
name: Misconfigured AWS S3 Bucket
cwe: 16
description: Misconfigured Amazon AWS S3 Bucket(s) might allow unauthorized users to read/write files in the specific
S3 buckets
mitigations:
- description: Ensure that IAM Policies are set for AWS S3 to protect against public/unauthorized access to unauthorized users
phase: Implementation
- description: Consider implementation of encryption for data stored in AWS S3
phase: Implementation
risk:
- consequence: Unauthorized Users may gain access to files with sensitive information in the AWS S3 bucket(s)
type: Confidentiality
- consequence: Unauthorized Users may write/modify data in the AWS S3 bucket(s)
type: Integrity
test-cases:
- name: automated-vulnerability-scanning
test: run automated vulnerability discovery tools to identify misconfigured AWS S3 buckets
tools: [scout2,prowler,weirdaal,burpsuite]
type: discovery
- name: manual
test: test for misconfigured AWS S3 Buckets manually, as part of a Pentest or Bug-bounty
type: manual
categories: [cloud]
================================================
FILE: api/tp_api/repo/cert_validation.yaml
================================================
name: Improper Certificate Validation
description: The software does not validate, or incorrectly validates, a certificate.
cwe: 295
categories: [app_vulns,owasp]
mitigations:
- description: Certificates should be carefully managed and checked to assure that
data are encrypted with the intended owner's public key.
phase: Architecture and Design
- description: Certificates should be deployed with strong CipherSuite Specs and Perfect Forward Secrecy for highest
levels of protection
phase: Implementation
risk:
- consequence: Attacker may be able to leverage a weak SSL Implementation to compromise the master key/keying materials,
thereby compromising the transmission of sensitive information
type: Confidentiality
test-cases:
- name: ssl-test
test: Check for SSL/TLS implementation with automated tools
tools: [ssllabs.com,testssl.sh,sslyze,sslscan,nmap]
- name: source-composition-scanning
test: Run Source Composition Scanners against the libraries being used by the application, to identify instances of misconfigured SSL/TLS Implementation or Plaintext Data Transmission
tools: [retirejs,npm-audit,owasp-dependency-checker,blackduck,whitesource,snyk,safety]
type: sca
- name: static-analysis
test: Run Static Analysis tools to identify instances that relate to misconfigured SSL/TLS Implementation or Plaintext Data Transmission
tools: [checkmarx,brakeman,bandit,pyt,security-code-scan,veracode,nodejsscan,coverity]
type: sast
================================================
FILE: api/tp_api/repo/code_injection.yaml
================================================
name: Code Injection
description: The software constructs all or part of a code segment using externally-influenced
input from an upstream component, but it does not neutralize or incorrectly neutralizes
special elements that could modify the syntax or behavior of the intended code segment.
categories: [app_vulns,owasp]
cwe: 94
mitigations:
- description: Refactor your program so that you do not have to dynamically generate
code.
phase: Architecture and Design
- description: To reduce the likelihood of code injection, use stringent whitelists
that limit which constructs are allowed. If you are dynamically constructing code
that invokes a function, then verifying that the input is alphanumeric might be
insufficient. An attacker might still be able to reference a dangerous function
that you did not intend to allow, such as system(), exec(), or exit().
phase: Implementation
- description: Use automated static analysis tools that target this type of weakness.
Many modern techniques use data flow analysis to minimize the number of false
positives. This is not a perfect solution, since 100% accuracy and coverage are
not feasible.
phase: Testing
- description: Use dynamic tools and techniques that interact with the software using
large test suites with many diverse inputs, such as fuzz testing (fuzzing), robustness
testing, and fault injection. The software's operation may slow down, but it should
not become unstable, crash, or generate incorrect results.
phase: Testing
- description: Run the code in an environment that performs automatic taint propagation
and prevents any command execution that uses tainted variables, such as Perl's
"-T" switch. This will force the program to perform validation steps that remove
the taint, although you must be careful to correctly validate your inputs so that
you do not accidentally mark dangerous inputs as untainted (see CWE-183 and CWE-184).
phase: Operation
- description: Identify vulnerabilities in underlying libraries with Source Composition Scanning
phase: Testing
- description: Consider using low-logic templating systems, if you are using Templating Frameworks. Low-Logic
Templating Systems like Mustache cannot expand objects and data-structures, thereby ensuring that remote code
execution through Template Variables, does not happen
phase: Implementation
risk:
- consequence: In some cases, injectable code controls authentication; this may lead
to a remote vulnerability.
type: Access_Control
- consequence: Injected code can access resources that the attacker is directly prevented
from accessing.
type: Access_Control
- consequence: Code injection attacks can lead to loss of data integrity in nearly
all cases as the control-plane data injected is always incidental to data recall
or writing. Additionally, code injection can often result in the execution of
arbitrary code.
type: Integrity
- consequence: Often the actions performed by injected control code are unlogged.
type: Non-Repudiation
variants:
- Server-Side Eval Injection
- Server-Side Template Injection
test-cases:
- name: automated-vulnerability-scanning
test: run automated vulnerability discovery tools and its Injection payloads against the application
tools: [zap,burpsuite,arachni,acunetix,netsparker,appspider,w3af]
type: discovery
- name: manual
test: test for Code Injection variants manually with pentesters, bug-bounty
type: manual
- name: exploit
test: Run exploit tools to identify and exploit Code Injections in the application
type: exploit
tools: [sqlmap,netsparker,jsqli]
- name: source-composition-scanning
test: Run Source Composition Scanners against the libraries being used by the application, to identify instances of Code Injection
tools: [retirejs,npm-audit,owasp-dependency-checker,blackduck,whitesource,snyk,safety]
type: sca
- name: static-analysis
test: Run Static Analysis tools to identify instances of dynamic queries or stored procedures that are vulnerable to Code Injection
tools: [checkmarx,brakeman,bandit,pyt,security-code-scan,veracode,nodejsscan,coverity]
type: sast
related_cwes:
- 95
- 96
================================================
FILE: api/tp_api/repo/idor_pk.yaml
================================================
name: Insecure Direct Object Reference - Primary Key
cwe: 639
description: The system's authorization functionality does not prevent one user from
gaining access to another user's data or record by modifying the key value identifying
the data.
mitigations:
- description: For each and every data access, ensure that the user has sufficient
privilege to access the record that is being requested.
phase: Architecture and Design
- description: Make sure that the key that is used in the lookup of a specific user's
record is not controllable externally by the user or that any tampering can be
detected.
phase: Architecture and Design
- description: Use encryption in order to make it more difficult to guess other legitimate
values of the key or associate a digital signature with the key so that the server
can verify that there has been no tampering.
phase: Architecture and Design
risk:
- consequence: Access control checks for specific user data or functionality can be
bypassed.
type: Access_Control
- consequence: Horizontal escalation of privilege is possible (one user can view/modify
information of another user).
type: Access_Control
- consequence: Vertical escalation of privilege is possible if the user-controlled
key is actually a flag that indicates administrator status, allowing the attacker
to gain administrative access.
type: Access_Control
categories: [app_vulns]
test-cases:
- name: manual
test: test for Insecure Direct Object References variants manually with pentesters, bug-bounty
type: manual
- name: fuzzing
test: test for IDORs with Fuzzing with Automated tools
tools: [burpsuite,owasp-zap,wfuzz,mitmproxy]
type: automated
- name: static-analysis
test: Run Static Analysis tools to identify instances of improper input validation and output encoding for Insecure Deserialization
tools: [checkmarx,brakeman,bandit,pyt,security-code-scan,veracode,nodejsscan,coverity]
type: sast
- name: source-composition-scanning
test: Run Source Composition Scanners against the libraries being used by the application, to identify instances of Insecure Deserialization
tools: [retirejs,npm-audit,owasp-dependency-checker,blackduck,whitesource,snyk,safety]
type: sca
related_cwes:
- 284
- 285
================================================
FILE: api/tp_api/repo/insecure_deserialization.yaml
================================================
name: Insecure Deserialization
description: The application deserializes untrusted data without sufficiently verifying
that the resulting data will be valid.
cwe: 502
mitigations:
- description: If available, use the signing/sealing features of the programming language
to assure that deserialized data has not been tainted. For example, a hash-based
message authentication code (HMAC) could be used to ensure that data has not been
modified.
phase: Architecture and Design
- description: When deserializing data, populate a new object rather than just deserializing.
The result is that the data flows through safe input validation and that the functions
are safe.
phase: Implementation
- description: An attempt to serialize and then deserialize a class containing transient
fields will result in NULLs where the transient data should be. This is an excellent
way to prevent time, environment-based, or sensitive variables from being carried
over and used improperly.
phase: Architecture and Design
- description: Avoid having unnecessary types or gadgets available that can be leveraged
for malicious ends. This limits the potential for unintended or unauthorized types
and gadgets to be leveraged by the attacker. Whitelist acceptable classes. Note-
new gadgets are constantly being discovered, so this alone is not a sufficient
mitigation.
phase: Implementation
risk:
- consequence: The consequences can vary widely, because it depends on which objects
or methods are being deserialized, and how they are used.
- consequence: Attackers can modify unexpected objects or data that was assumed to
be safe from modification.
type: Integrity
- consequence: If a function is making an assumption on when to terminate, based on
a sentry in a string, it could easily never terminate.
type: Availability
- consequence: Code could potentially make the assumption that information in the
deserialized object is valid. Functions that make this dangerous assumption could
be exploited.
type: Authorization
categories: [app_vulns,owasp]
test-cases:
- name: automated-vulnerability-scanning
test: run automated vulnerability discovery tools and its Insecure Deserialization payloads against the application
tools: [zap,burpsuite,arachni,acunetix,netsparker,appspider,w3af]
type: discovery
- name: manual
test: test for Insecure Deserialization variants manually with pentesters, bug-bounty
type: manual
- name: static-analysis
test: Run Static Analysis tools to identify instances of improper input validation and output encoding for Insecure Deserialization
tools: [checkmarx,brakeman,bandit,pyt,security-code-scan,veracode,nodejsscan,coverity,]
type: sast
- name: source-composition-scanning
test: Run Source Composition Scanners against the libraries being used by the application, to identify instances of Insecure Deserialization
tools: [retirejs,npm-audit,owasp-dependency-checker,blackduck,whitesource,snyk,safety]
type: sca
================================================
FILE: api/tp_api/repo/password-bruteforce.yaml
================================================
name: Bruteforce Passwords
cwe: 307
categories: [attack]
description: The application allows multiple/consecutive attempts at authentication (bruteforce).
mitigations:
- description: Ensure that users are locked out for a certain timeframe/till administrator's intervention when multiple
authentication attempts are encountered.
phase: Architecture and Design
- description: Log invalid access attempts to ensure that potentially malicious bruteforce attempts are logged
phase: Architecture and Design
test-cases:
- name: automated-vulnerability-scanning
test: run automated vulnerability discovery tools and bruteforce against the application
tools: [zap,burpsuite,arachni,acunetix,netsparker,appspider,w3af]
type: discovery
================================================
FILE: api/tp_api/repo/plaintext-transmission.yaml
================================================
name: Plaintext transmission of sensitive data
cwe: 319
categories: [app_vulns,owasp]
description: The software transmits sensitive or security-critical data in cleartext
in a communication channel that can be sniffed by unauthorized actors.
mitigations:
- description: Encrypt the data with a reliable encryption scheme before transmitting.
phase: Architecture and Design
- description: When using web applications with SSL, use SSL for the entire session
from login to logout, not just for the initial login page.
phase: Implementation
- description: Use tools and techniques that require manual (human) analysis, such
as penetration testing, threat modeling, and interactive tools that allow the
tester to record and modify an active session. These may be more effective than
strictly automated techniques. This is especially the case with weaknesses that
are related to design and business rules.
phase: Testing
- description: Configure servers to use encrypted channels for communication, which
may include SSL or other secure protocols.
phase: Operation
risk:
- consequence: Anyone can read the information by gaining access to the channel being
used for communication.
type: Confidentiality
test-cases:
- name: ssl-test
test: Check for SSL/TLS implementation with automated tools
tools: [ssllabs.com,testssl.sh,sslyze,sslscan,nmap]
type: discovery
- name: source-composition-scanning
test: Run Source Composition Scanners against the libraries being used by the application, to identify instances of misconfigured SSL/TLS Implementation or Plaintext Data Transmission
tools: [retirejs,npm-audit,owasp-dependency-checker,blackduck,whitesource,snyk,safety]
type: sca
- name: static-analysis
test: Run Static Analysis tools to identify instances that relate to misconfigured SSL/TLS Implementation or Plaintext Data Transmission
tools: [checkmarx,brakeman,bandit,pyt,security-code-scan,veracode,nodejsscan,coverity]
type: sast
related_cwes:
- 311
================================================
FILE: api/tp_api/repo/sql_injection.yaml
================================================
name: SQL Injection
cwe: 89
description: The software constructs all or part of an SQL command using externally-influenced
input from an upstream component, but it does not neutralize or incorrectly neutralizes
special elements that could modify the intended SQL command when it is sent to a
downstream component.
mitigations:
- description: Consider using ORMs (Object to Relation Mappers) to protect against SQL Injection.
Nearly all of them perform Parameterized Queries and Query Encoding.
phase: Architecture and Design
strategy: Libraries or Frameworks
- description: Process SQL queries using prepared statements, parameterized queries.
Do not dynamically construct and execute query strings within these features using "exec" or similar functionality,
since this may re-introduce the possibility of SQL injection.
phase: Implementation
- description: Specifically, follow the principle of least privilege when creating
user accounts to a SQL database. The database users should only have the minimum
privileges necessary to use their account.
phase: Architecture and Design
- description: In the context of SQL Injection, error messages revealing the structure
of a SQL query can help attackers tailor successful attack strings.
phase: Implementation
- description: Use an application firewall that can detect attacks against this weakness.
It can be beneficial in cases in which the code cannot be fixed,as an emergency prevention measure while
more comprehensive software assurance measures are applied, or to provide defense in depth.
phase: Operation
risk:
- consequence: Since SQL databases generally hold sensitive data, loss of confidentiality
is a frequent problem with SQL injection vulnerabilities.
type: Confidentiality
- consequence: If poor SQL commands are used to check user names and passwords, it
may be possible to connect to a system as another user with no previous knowledge
of the password.
type: Access_Control
- consequence: If authorization information is held in a SQL database, it may be possible
to change this information through the successful exploitation of a SQL injection
vulnerability.
type: Access_Control
- consequence: Just as it may be possible to read sensitive information, it is also
possible to make changes or even delete this information with a SQL injection
attack.
type: Integrity
categories: [app_vulns,owasp]
variants:
- Blind SQL Injection
- Time-Based SQL Injection
- Union-Based SQL Injection
- Error-Based SQL Injection
- Second-Order SQL Injection
test-cases:
- name: automated-vulnerability-scanning
test: run automated vulnerability discovery tools and its Injection payloads against the application
tools: [zap,burpsuite,arachni,acunetix,netsparker,appspider,w3af]
type: discovery
- name: manual
test: test for SQL Injection variants manually with pentesters, bug-bounty
type: manual
- name: exploit
test: Run exploit tools to identify and exploit SQL Injections in the application
type: exploit
tools: [sqlmap,netsparker,jsqli]
- name: source-composition-scanning
test: Run Source Composition Scanners against the libraries being used by the application, to identify instances of SQL Injection
tools: [retirejs,npm-audit,owasp-dependency-checker,blackduck,whitesource,snyk,safety]
type: sca
- name: static-analysis
test: Run Static Analysis tools to identify instances of dynamic queries or stored procedures that are vulnerable to SQL Injection
tools: [checkmarx,brakeman,bandit,pyt,security-code-scan,veracode,nodejsscan,coverity]
type: sast
================================================
FILE: api/tp_api/repo/ssrf.yaml
================================================
name: Server-Side Request Forgery
cwe: 918
description: The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.
mitigations:
- description: Consider scanning dependencies for SSRF vulnerabilities, including infrastructure components like Apache
phase: Implementation
- description: Consider implementing a URL whitelist to reduce the possibility of an attacker-controlled URL being resolved by your application
phase: Implementation
- description: Consider implementing additional Header validation to sensitive paths like EC2 Metadata, etc to mitigate the effects of an existing SSRF flaw
phase: Implementation
risk:
- consequence: Unauthorized users may be able to gain access to sensitive information in internal/protected system components
type: Confidentiality
test-cases:
- name: automated-vulnerability-scanning
test: run automated vulnerability discovery tools to identify SSRF
tools: [burpsuite,zap]
type: discovery
- name: manual
test: test for misconfigured AWS S3 Buckets manually, as part of a Pentest or Bug-bounty
type: manual
categories: [cloud]
================================================
FILE: api/tp_api/repo/weak-default-password.yaml
================================================
name: Weak/Default Passwords
cwe: 521
categories: [app_vulns,owasp]
description: The application allows the users to set default or weak passwords
mitigations:
- description: Ensure that passwords set in the application are mandatorily strong.
phase: Architecture and Design
- description: Prevent Credential Stuffing by validating user passwords against Database of compromised passwords
phase: Architecture and Design
test-cases:
- name: automated-vulnerability-scanning
test: run automated vulnerability discovery tools and bruteforce against the application
tools: [zap,burpsuite,arachni,acunetix,netsparker,appspider,w3af]
type: discovery
================================================
FILE: api/tp_api/repo/xss.yaml
================================================
name: Cross-Site Scripting
cwe: 79
description: The software does not neutralize or incorrectly neutralizes user-controllable
input before it is placed in output that is used as a web page that is served to
other users.
mitigations:
- description: Examples of libraries and frameworks that make it easier to generate
properly encoded output include Microsoft's Anti-XSS library, the OWASP ESAPI
Encoding module, and Apache Wicket.
phase: Architecture and Design
- description: Understand all the potential areas where untrusted inputs can enter
your software. Parameters or arguments, cookies, anything read from the network,
environment variables, reverse DNS lookups, query results, request headers, URL
components, e-mail, files, filenames, databases, and any external systems that
provide data to the application. Remember that such inputs may be obtained indirectly
through API calls.
phase: Architecture and Design
- description: For any security checks that are performed on the client side, ensure
that these checks are duplicated on the server side.
phase: Architecture and Design
- description: If available, use structured mechanisms that automatically enforce
the separation between data and code. These mechanisms may be able to provide
the relevant quoting, encoding, and validation automatically, instead of relying
on the developer to provide this capability at every point where output is generated.
phase: Architecture and Design
- description: The problem of inconsistent output encodings often arises in web pages.
If an encoding is not specified in an HTTP header, web browsers often guess about
which encoding is being used. This can open up the browser to subtle XSS attacks.
phase: Implementation
- description: To help mitigate XSS attacks against the user's session cookie, set
the session cookie to be HttpOnly. In browsers that support the HttpOnly feature
(such as more recent versions of Internet Explorer and Firefox), this attribute
can prevent the user's session cookie from being accessible to malicious client-side
scripts that use document.cookie. This is not a complete solution, since HttpOnly
is not supported by all browsers. More importantly, XMLHTTPRequest and other powerful
browser technologies provide read access to HTTP headers, including the Set-Cookie
header in which the HttpOnly flag is set.
phase: Implementation
- description: Ensure that you perform input validation at well-defined interfaces
within the application. This will help protect the application even if a component
is reused or moved elsewhere.
phase: Implementation
- description: When the set of acceptable objects, such as filenames or URLs, is limited
or known, create a mapping from a set of fixed input values (such as numeric IDs)
to the actual filenames or URLs, and reject all other inputs.
phase: Architecture and Design
- description: Use an application firewall that can detect attacks against this weakness.
It can be beneficial in cases in which the code cannot be fixed (because it is
controlled by a third party), as an emergency prevention measure while more comprehensive
software assurance measures are applied, or to provide defense in depth.
phase: Operation
- description: Use a Content-Security-Policy Header for your application that is honored by a modern browser.
Content Security Policy allows you to define specific execution scopes for attributes and elements that can be used
to perform Cross-Site Scripting.
phase: Implementation
- description: Deploy a Cross-Origin-Resource Sharing implementation to prevent your application's front-end from accessing
unauthorized third-party URLs that may be part of an attacker's Cross-Site Scripting Attack
phase: Implementation
categories: [app_vulns,owasp]
risk:
- consequence: The most common attack performed with cross-site scripting involves
the disclosure of information stored in user cookies. Typically, a malicious user
will craft a client-side script, which -- when parsed by a web browser -- performs
some activity (such as sending all site cookies to a given E-mail address). This
script will be loaded and run by each user visiting the web site. Since the site
requesting to run the script has access to the cookies in question, the malicious
script does also.
type: Access_Control
- consequence: In some circumstances it may be possible to run arbitrary code on a
victim's computer when cross-site scripting is combined with other flaws.
type: Integrity
- consequence: The consequence of an XSS attack is the same regardless of whether
it is stored or reflected. The difference is in how the payload arrives at the
server.
type: Confidentiality
variants:
- Persistent Cross-Site Scripting
- Reflected Cross-Site Scripting
- DOM-Based Cross Site Scripting
test-cases:
- name: automated-vulnerability-scanning
test: run automated vulnerability discovery tools and its XSS payloads against the application
tools: [zap,burpsuite,arachni,acunetix,netsparker,appspider,w3af]
type: discovery
- name: manual
test: test for XSS variants manually with pentesters, bug-bounty
type: manual
- name: content-security-policy
test: Look for Content Security Policy headers in the Application and validate if the application enforces content-security-policy headers with optimal efficacy
type: recon
- name: cors
test: Look for Cross-Origin Resource Sharing to ensure that the application is unable to make calls to URLs outside a specific set of whitelisted URLs and domains
type: discovery
- name: static-analysis
test: Run Static Analysis tools to identify instances of improper input validation and output encoding for Cross-Site Scripting
tools: [checkmarx,brakeman,bandit,pyt,security-code-scan,veracode,nodejsscan,coverity,]
type: sast
- name: source-composition-scanning
test: Run Source Composition Scanners against the libraries being used by the application, to identify instances of Cross-Site Scripting
tools: [retirejs,npm-audit,owasp-dependency-checker,blackduck,whitesource,snyk,safety]
type: sca
related_cwes:
- 80
- 116
================================================
FILE: api/tp_api/repo/xxe.yaml
================================================
name: XML External Entities
cwe: 611
description: The software processes an XML document that can contain XML entities
with URIs that resolve to documents outside of the intended sphere of control, causing
the product to embed incorrect documents into its output.
categories: [app_vulns,owasp]
mitigations:
- description: XML parsers and validators must be configured to disable external
entity expansion, general entities and parameter entity resolution
phase: Implementation
risk:
- consequence: If the attacker is able to include a crafted DTD and a default entity
resolver is enabled, the attacker may be able to access arbitrary files on the
system.
type: Confidentiality
- consequence: The DTD may include arbitrary HTTP requests that the server may execute.
This could lead to other attacks leveraging the server's trust relationship with
other entities.
type: Integrity
- consequence: The software could consume excessive CPU cycles or memory using a URI
that points to a large file, or a device that always returns data such as /dev/random.
Alternately, the URI could reference a file that contains many nested or recursive
entity references to further slow down parsing.
type: Availability
test-cases:
- name: automated-vulnerability-scanning
test: run automated vulnerability discovery tools and its XXE payloads against the application
tools: [zap,burpsuite,arachni,acunetix,netsparker,appspider,w3af]
type: discovery
- name: manual
test: test for XXE variants manually with pentesters, bug-bounty
type: manual
- name: source-composition-scanning
test: Run Source Composition Scanners against the libraries being used by the application, to identify instances of XXE
tools: [retirejs,npm-audit,owasp-dependency-checker,blackduck,whitesource,snyk,safety]
type: sca
- name: static-analysis
test: Run Static Analysis tools to identify instances of dynamic queries or stored procedures that are vulnerable to XXE
tools: [checkmarx,brakeman,bandit,pyt,security-code-scan,veracode,nodejsscan,coverity]
type: sast
================================================
FILE: api/tp_api/swagger/abuse-create.yml
================================================
This is the API Endpoint that is used to create/update Abuser Stories linked to Feature/User Story
---
parameters:
- name: body
in: body
required: true
schema:
id: Abuser Story
type: object
required:
- short_name
- description
- feature
properties:
short_name:
type: string
description:
type: string
feature:
type: string
responses:
200:
description: Abuser Story successfully created
400:
description: Input Validation Errors or other client Errors
404:
description: Unable to find Feature/User Story
================================================
FILE: api/tp_api/swagger/change-password.yml
================================================
This is the API Endpoint that is used to change an existing user's password in ThreatPlaybook
---
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
email:
type: string
old_password:
type: string
new_password:
type: string
verify_password:
type: string
================================================
FILE: api/tp_api/swagger/feature-create.yml
================================================
This is the API Endpoint that is used to create and update a User Story/Feature.
---
parameters:
- name: body
in: body
required: true
schema:
id: Feature
type: object
required:
- short_name
- description
- project
properties:
short_name:
type: string
description:
type: string
project:
type: string
responses:
200:
description: Feature/User Story successfully created
400:
description: Input Validation Errors or other client Errors
404:
description: Unable to find Project
================================================
FILE: api/tp_api/swagger/get-abuse.yml
================================================
This is the API Endpoint that is used retrieve a single Abuser Story or multiple Abuser Stories
---
parameters:
- name: body
in: body
required: true
schema:
id: Abuser Story
type: object
required:
- feature
properties:
name:
type: string
page:
type: integer
feature:
type: string
responses:
200:
description: Project or Projects successfully retrieved
404:
description: Unable to find Scan or Target
================================================
FILE: api/tp_api/swagger/get-feature.yml
================================================
This is the API Endpoint that is used retrieve a single Feature/User Story or multiple Features/User Stories
---
parameters:
- name: body
in: body
schema:
id: Feature
type: object
properties:
name:
type: string
page:
type: integer
project:
type: string
responses:
200:
description: Project or Projects successfully retrieved
404:
description: Unable to find Scan or Target
================================================
FILE: api/tp_api/swagger/get-project.yml
================================================
This is the API Endpoint that is used retrieve a single Project or multiple Projects
---
parameters:
- name: body
in: body
schema:
id: Project
type: object
properties:
name:
type: string
responses:
200:
description: Project or Projects successfully retrieved
404:
description: Unable to find Scan or Target
================================================
FILE: api/tp_api/swagger/get-scenario.yml
================================================
This is the API Endpoint that is used retrieve a single Abuser Story or multiple Abuser Stories
---
parameters:
- name: body
in: body
required: true
schema:
id: Threat Scenario
type: object
required:
- abuser_story
properties:
name:
type: string
page:
type: integer
abuser_story:
type: string
responses:
200:
description: Threat Scenario or Scenarios successfully retrieved
404:
description: Unable to find Threat Scenario or Abuser Story
================================================
FILE: api/tp_api/swagger/get-tests.yml
================================================
This is the API Endpoint that is used retrieve a single Abuser Story or multiple Abuser Stories
---
parameters:
- name: body
in: body
required: true
schema:
id: Security Test Case
type: object
required:
- scenario
properties:
name:
type: string
page:
type: integer
scenario:
type: string
responses:
200:
description: Project or Projects successfully retrieved
404:
description: Unable to find Threat Scenario or Test Cases
================================================
FILE: api/tp_api/swagger/scan-create.yml
================================================
This is the API Endpoint that is used to create a scan for storing Vulnerability Results in the Database
---
parameters:
- name: body
in: body
required: true
schema:
id: Scan
type: object
required:
- tool
- target
properties:
tool:
type: string
target:
type: string
scan_type:
type: string
responses:
200:
description: Scan successfully created
400:
description: Input Validation Errors or other client Errors
404:
description: Unable to find Target
================================================
FILE: api/tp_api/swagger/scenario-inline.yml
================================================
This is the API Endpoint that is used to create and update Inline Threat Scenarios that are NOT linked to existing Vulnerability Repositories
---
parameters:
- name: body
in: body
required: true
schema:
id: Threat Scenario
type: object
required:
- name
- abuser_story
- feature
- type
- cwe
- description
- severity
- vul_name
properties:
name:
type: string
description:
type: string
feature:
type: string
abuser_story:
type: string
type:
type: string
vul_name:
type: string
severity:
type: integer
cwe:
type: integer
responses:
200:
description: Threat Scenario successfully created
400:
description: Input Validation Errors or other client Errors
404:
description: Unable to find User Story OR Abuser Story OR Repo Item
================================================
FILE: api/tp_api/swagger/scenario-repo.yml
================================================
This is the API Endpoint that is used to create and update Threat Scenarios that are linked to existing Vulnerability Repositories
---
parameters:
- name: body
in: body
required: true
schema:
id: Threat Scenario
type: object
required:
- name
- abuser_story
- feature
- type
- repo_name
- description
properties:
name:
type: string
description:
type: string
feature:
type: string
abuser_story:
type: string
type:
type: string
repo_name:
type: string
responses:
200:
description: Threat Scenario successfully created
400:
description: Input Validation Errors or other client Errors
404:
description: Unable to find User Story OR Abuser Story OR Repo Item
================================================
FILE: api/tp_api/swagger/target-create-update.yml
================================================
This is the API Endpoint to create and update Targets for Vulnerability Scanning and Management
---
securitySchemes:
bearerAuth:
type: http
scheme: bearer
format: JWT
parameters:
- name: body
in: body
required: true
schema:
id: Target
type: object
required:
- name
- url
- project
properties:
name:
type: string
url:
type: string
project:
type: string
responses:
200:
description: Target successfully created
400:
description: Input Validation Errors or other client Errors
404:
description: Unable to find Project
================================================
FILE: api/tp_api/swagger/test-case-create.yml
================================================
This is the API Endpoint to create and update Security Test Cases a.k.a Test Cases
---
parameters:
- name: body
in: body
required: true
schema:
id: Security Test Case
type: object
required:
- test_case
- name
- threat_scenario
- tools
- tags
- executed
- test_type
properties:
name:
type: string
test_case:
type: string
threat_scenario:
type: string
tools:
type: array
items:
type: string
tags:
gitextract_ntphgy1z/
├── .dockerignore
├── .github/
│ └── workflows/
│ └── main.yml
├── .gitignore
├── README.md
├── api/
│ ├── .vscode/
│ │ └── settings.json
│ ├── Dockerfile
│ ├── conftest.py
│ ├── requirements.txt
│ ├── tests/
│ │ └── test_flask.py
│ └── tp_api/
│ ├── __init__.py
│ ├── app.py
│ ├── asvs/
│ │ └── asvs.csv
│ ├── models.py
│ ├── repo/
│ │ ├── aws_s3.yaml
│ │ ├── cert_validation.yaml
│ │ ├── code_injection.yaml
│ │ ├── idor_pk.yaml
│ │ ├── insecure_deserialization.yaml
│ │ ├── password-bruteforce.yaml
│ │ ├── plaintext-transmission.yaml
│ │ ├── sql_injection.yaml
│ │ ├── ssrf.yaml
│ │ ├── weak-default-password.yaml
│ │ ├── xss.yaml
│ │ └── xxe.yaml
│ ├── swagger/
│ │ ├── abuse-create.yml
│ │ ├── change-password.yml
│ │ ├── feature-create.yml
│ │ ├── get-abuse.yml
│ │ ├── get-feature.yml
│ │ ├── get-project.yml
│ │ ├── get-scenario.yml
│ │ ├── get-tests.yml
│ │ ├── scan-create.yml
│ │ ├── scenario-inline.yml
│ │ ├── scenario-repo.yml
│ │ ├── target-create-update.yml
│ │ ├── test-case-create.yml
│ │ └── vulnerability-create.yml
│ ├── utils.py
│ └── wait-for
├── docker-compose.yml
├── documentation/
│ ├── .gitignore
│ ├── README.md
│ ├── babel.config.js
│ ├── docs/
│ │ ├── client-ui.md
│ │ ├── configure-cli.md
│ │ ├── create-project.md
│ │ ├── install-client.md
│ │ ├── overview.md
│ │ ├── quick-installation.md
│ │ ├── story-driven.md
│ │ ├── tutorial-client-ui.md
│ │ └── tutorial.md
│ ├── docusaurus.config.js
│ ├── package.json
│ ├── sidebars.js
│ ├── src/
│ │ ├── css/
│ │ │ └── custom.css
│ │ └── pages/
│ │ ├── index.js
│ │ └── styles.module.css
│ └── static/
│ └── .nojekyll
├── frontend/
│ └── Playbook-Frontend/
│ ├── .babelrc
│ ├── .editorconfig
│ ├── .gitignore
│ ├── Dockerfile
│ ├── README.md
│ ├── assets/
│ │ └── variables.scss
│ ├── components/
│ │ ├── Logo.vue
│ │ ├── README.md
│ │ ├── VuetifyLogo.vue
│ │ ├── project/
│ │ │ ├── Content.vue
│ │ │ └── Header.vue
│ │ └── projects/
│ │ └── ProjectsPage.vue
│ ├── jest.config.js
│ ├── jsconfig.json
│ ├── layouts/
│ │ ├── default.vue
│ │ ├── error.vue
│ │ └── main.vue
│ ├── middleware/
│ │ └── README.md
│ ├── nuxt.config.js
│ ├── package.json
│ ├── pages/
│ │ ├── home/
│ │ │ └── index.vue
│ │ ├── index.vue
│ │ ├── projects/
│ │ │ ├── _name/
│ │ │ │ ├── abuser-story.vue
│ │ │ │ ├── project.vue
│ │ │ │ ├── threat-map.vue
│ │ │ │ ├── threat-scenario.vue
│ │ │ │ ├── user-story.vue
│ │ │ │ └── vulnerabilities.vue
│ │ │ └── index.vue
│ │ └── scan/
│ │ └── _name.vue
│ ├── plugins/
│ │ ├── README.md
│ │ ├── vue-apexchart.js
│ │ └── vue-organization-chart.js
│ ├── store/
│ │ ├── abuserStory.js
│ │ ├── home.js
│ │ ├── index.js
│ │ ├── login.js
│ │ ├── projects.js
│ │ ├── scan.js
│ │ ├── threatScenario.js
│ │ ├── threatmap.js
│ │ ├── userStory.js
│ │ └── vulnerability.js
│ └── test/
│ └── Logo.spec.js
└── nginx/
├── Dockerfile
├── alpine.df
└── sites-enabled/
└── tp_nginx
SYMBOL INDEX (206 symbols across 17 files)
FILE: api/tests/test_flask.py
function client (line 18) | def client():
function test_change_password (line 23) | def test_change_password(client):
function test_login (line 42) | def test_login(client):
function test_create_project (line 57) | def test_create_project(client):
function test_create_feature (line 73) | def test_create_feature(client):
function test_create_abuser_story (line 94) | def test_create_abuser_story(client):
function test_create_threat_scenario_repo (line 115) | def test_create_threat_scenario_repo(client):
function test_create_threat_scenario (line 138) | def test_create_threat_scenario(client):
function test_create_test_case (line 162) | def test_create_test_case(client):
function test_create_target (line 181) | def test_create_target(client):
function test_create_scan (line 202) | def test_create_scan(client):
function test_create_vulnerability (line 223) | def test_create_vulnerability(client):
function test_get_project (line 253) | def test_get_project(client):
function test_get_project_specific (line 260) | def test_get_project_specific(client):
function test_get_feature_by_project (line 274) | def test_get_feature_by_project(client):
function test_get_abuse_case_specific (line 288) | def test_get_abuse_case_specific(client):
function test_get_threat_scenario (line 302) | def test_get_threat_scenario(client):
function test_get_test_case (line 316) | def test_get_test_case(client):
function test_threat_scenario_severity (line 330) | def test_threat_scenario_severity(client):
function test_vulnerability_severity (line 338) | def test_vulnerability_severity(client):
function test_get_scan (line 346) | def test_get_scan(client):
function test_get_threat_scenario_by_project (line 354) | def test_get_threat_scenario_by_project(client):
function test_get_vulnerability (line 367) | def test_get_vulnerability(client):
function test_get_vulnerability_by_project (line 376) | def test_get_vulnerability_by_project(client):
function test_get_scan_by_project (line 389) | def test_get_scan_by_project(client):
function test_get_user_story_tree_by_project (line 402) | def test_get_user_story_tree_by_project(client):
function test_get_abuser_story_tree_by_project (line 415) | def test_get_abuser_story_tree_by_project(client):
function test_get_threat_scenario_tree_by_project (line 428) | def test_get_threat_scenario_tree_by_project(client):
function test_get_threatmap_by_project (line 441) | def test_get_threatmap_by_project(client):
function test_get_individual_scan_vuls (line 454) | def test_get_individual_scan_vuls(client):
function test_get_asvs_vuls (line 467) | def test_get_asvs_vuls(client):
FILE: api/tp_api/app.py
function validate_user (line 35) | def validate_user(f):
function change_password (line 60) | def change_password():
function login (line 143) | def login():
function create_project (line 179) | def create_project():
function create_user_story (line 206) | def create_user_story():
function create_abuser_story (line 257) | def create_abuser_story():
function create_repo_scenario (line 309) | def create_repo_scenario():
function create_threat_scenario (line 398) | def create_threat_scenario():
function create_test_case (line 486) | def create_test_case():
function create_target (line 565) | def create_target():
function create_scan (line 598) | def create_scan():
function create_vulnerability (line 647) | def create_vulnerability():
function get_project (line 743) | def get_project(page_num=1):
function get_features (line 788) | def get_features():
function get_abuser_story (line 866) | def get_abuser_story():
function get_threat_scenario (line 947) | def get_threat_scenario():
function get_test_case (line 1025) | def get_test_case():
function map_threat_scenario_vul (line 1094) | def map_threat_scenario_vul():
function threat_scenario_severity (line 1125) | def threat_scenario_severity():
function vulnerability_severity (line 1149) | def vulnerability_severity():
function get_target (line 1177) | def get_target(page_num=1):
function get_scan (line 1220) | def get_scan(page_num=1):
function get_threat_scenario_by_project (line 1254) | def get_threat_scenario_by_project():
function get_vulnerability (line 1278) | def get_vulnerability(page_num=1):
function get_vulnerability_by_project (line 1319) | def get_vulnerability_by_project():
function get_scan_by_project (line 1346) | def get_scan_by_project():
function get_user_story_tree_by_project (line 1381) | def get_user_story_tree_by_project():
function get_abuser_story_tree_by_project (line 1442) | def get_abuser_story_tree_by_project():
function get_threat_scenario_tree_by_project (line 1497) | def get_threat_scenario_tree_by_project():
function get_threatmap_by_project (line 1544) | def get_threatmap_by_project():
function get_individual_scan_vuls (line 1613) | def get_individual_scan_vuls():
function get_asvs_vuls (line 1629) | def get_asvs_vuls():
function delete_feature (line 1645) | def delete_feature():
function delete_abuse_case (line 1675) | def delete_abuse_case():
function delete_scenario (line 1705) | def delete_scenario():
function delete_test (line 1735) | def delete_test():
function delete_project (line 1763) | def delete_project():
FILE: api/tp_api/models.py
function random_scan_name (line 8) | def random_scan_name():
class Project (line 12) | class Project(Document):
class RepoTestCase (line 18) | class RepoTestCase(Document):
class Repo (line 27) | class Repo(Document):
class Interaction (line 40) | class Interaction(Document):
class UseCase (line 48) | class UseCase(Document):
class AbuseCase (line 57) | class AbuseCase(Document):
class Mitigations (line 67) | class Mitigations(EmbeddedDocument):
class Risk (line 74) | class Risk(EmbeddedDocument):
class ThreatModel (line 79) | class ThreatModel(Document):
class Test (line 96) | class Test(Document):
class Risk (line 106) | class Risk(EmbeddedDocument):
class VulnerabilityEvidence (line 111) | class VulnerabilityEvidence(Document):
class Vulnerability (line 122) | class Vulnerability(Document):
class Scan (line 137) | class Scan(Document):
method pre_save (line 154) | def pre_save(cls, sender, document, **kwargs):
class Target (line 163) | class Target(Document):
class User (line 170) | class User(Document):
class Settings (line 178) | class Settings(Document):
class ASVS (line 184) | class ASVS(Document):
FILE: api/tp_api/utils.py
function respond (line 16) | def respond(success, error, message="", data=None):
function connect_db (line 30) | def connect_db():
function load_reload_asvs_db (line 50) | def load_reload_asvs_db():
function load_reload_repo_db (line 75) | def load_reload_repo_db():
function initialize_superuser (line 115) | def initialize_superuser():
FILE: documentation/src/pages/index.js
function Feature (line 42) | function Feature({imageUrl, title, description}) {
function Home (line 57) | function Home() {
FILE: frontend/Playbook-Frontend/nuxt.config.js
method extend (line 91) | extend(config, ctx) {
FILE: frontend/Playbook-Frontend/plugins/vue-apexchart.js
method install (line 5) | install(Vue, options) {
FILE: frontend/Playbook-Frontend/plugins/vue-organization-chart.js
method install (line 6) | install(Vue, options) {
FILE: frontend/Playbook-Frontend/store/abuserStory.js
method IS_PAGE_LOADING (line 9) | IS_PAGE_LOADING(state, data) {
method FETCH_PROJECT_ABUSER_STORY_TREE (line 12) | FETCH_PROJECT_ABUSER_STORY_TREE(state, data) {
method showPageLoading (line 17) | showPageLoading({ commit }, data) {
method fetchAbuserStoryTreeByProject (line 20) | fetchAbuserStoryTreeByProject({ commit }, payload) {
method isPageLoading (line 41) | isPageLoading(state) {
method getAbuserStoryProjectTree (line 44) | getAbuserStoryProjectTree(state) {
FILE: frontend/Playbook-Frontend/store/home.js
method IS_PAGE_LOADING (line 12) | IS_PAGE_LOADING(state, data) {
method FETCH_DATA (line 15) | FETCH_DATA(state, data) {
method FETCH_PROJECT_COUNT (line 18) | FETCH_PROJECT_COUNT(state, data) {
method FETCH_USER_STORIES_COUNT (line 21) | FETCH_USER_STORIES_COUNT(state, data) {
method FETCH_THREAT_SCENARIO_COUNT (line 24) | FETCH_THREAT_SCENARIO_COUNT(state, data) {
method FETCH_SCAN_COUNT (line 27) | FETCH_SCAN_COUNT(state, data) {
method FETCH_THREAT_SCENARIO_SEVERITY_CHART (line 30) | FETCH_THREAT_SCENARIO_SEVERITY_CHART(state, data) {
method FETCH_SEVERITY_CHART (line 33) | FETCH_SEVERITY_CHART(state, data) {
method showPageLoading (line 38) | showPageLoading({ commit }, data) {
method fetchData (line 41) | fetchData({ commit }) {
method isPageLoading (line 46) | isPageLoading(state) {
method getProjectCount (line 49) | getProjectCount(state) {
method getUserStoriesCount (line 54) | getUserStoriesCount(state) {
method getThreatScenarioCount (line 59) | getThreatScenarioCount(state) {
method getScanCount (line 64) | getScanCount(state) {
method getCountList (line 69) | getCountList(state) {
method fetchThreatScenarioSevChartData (line 74) | fetchThreatScenarioSevChartData(state) {
method fetchSeverityChartData (line 79) | fetchSeverityChartData(state) {
FILE: frontend/Playbook-Frontend/store/login.js
method PAGE_LOADING (line 12) | PAGE_LOADING(state, data) {
method STORE_TOKEN (line 15) | STORE_TOKEN(state, data) {
method ERROR_MESSAGE (line 19) | ERROR_MESSAGE(state, data) {
method ERROR_MESSAGE_STATUS (line 22) | ERROR_MESSAGE_STATUS(state, data) {
method pageLoadingError (line 28) | pageLoadingError({ commit }, data) {
method pageLoading (line 31) | pageLoading({ commit }, data) {
method loginUser (line 34) | loginUser({ commit }, data) {
method isPageLoading (line 79) | isPageLoading(state) {
method userToken (line 84) | userToken(state) {
method loginErrorMessage (line 89) | loginErrorMessage(state) {
method isLoginError (line 94) | isLoginError(state) {
FILE: frontend/Playbook-Frontend/store/projects.js
method IS_PAGE_LOADING (line 9) | IS_PAGE_LOADING(state, data) {
method FETCH_DATA (line 12) | FETCH_DATA(state, data) {
method showPageLoading (line 17) | showPageLoading({ commit }, data) {
method fetchProjectData (line 20) | fetchProjectData({ commit }) {
method isPageLoading (line 46) | isPageLoading(state) {
method getProjectCount (line 49) | getProjectCount(state) {
method getProjectData (line 54) | getProjectData(state) {
FILE: frontend/Playbook-Frontend/store/scan.js
method IS_PAGE_LOADING (line 11) | IS_PAGE_LOADING(state, data) {
method FETCH_DATA (line 14) | FETCH_DATA(state, data) {
method FETCH_SCAN_DATA_PROJECT (line 17) | FETCH_SCAN_DATA_PROJECT(state, data) {
method FETCH_INDIVIDUAL_DATA (line 20) | FETCH_INDIVIDUAL_DATA(state, data) {
method showPageLoading (line 25) | showPageLoading({ commit }, data) {
method fetchScanData (line 28) | fetchScanData({ commit }) {
method fetchIndividualScanData (line 52) | fetchIndividualScanData({ commit }, payload) {
method fetchScanbyProject (line 81) | fetchScanbyProject({ commit }, payload) {
method isPageLoading (line 111) | isPageLoading(state) {
method getScanCount (line 114) | getScanCount(state) {
method getScanProjectData (line 119) | getScanProjectData(state) {
method getScanIndividualData (line 124) | getScanIndividualData(state) {
FILE: frontend/Playbook-Frontend/store/threatScenario.js
method IS_PAGE_LOADING (line 12) | IS_PAGE_LOADING(state, data) {
method FETCH_DATA (line 15) | FETCH_DATA(state, data) {
method FETCH_SEV_DATA (line 18) | FETCH_SEV_DATA(state, data) {
method FETCH_PROJECT_THREAT_SCENARIO_DATA (line 21) | FETCH_PROJECT_THREAT_SCENARIO_DATA(state, data) {
method FETCH_PROJECT_THREAT_SCENARIO_TREE (line 24) | FETCH_PROJECT_THREAT_SCENARIO_TREE(state, data) {
method showPageLoading (line 29) | showPageLoading({ commit }, data) {
method fetchThreatScenarioData (line 32) | fetchThreatScenarioData({ commit }) {
method fetchThreatScenarioSevData (line 56) | fetchThreatScenarioSevData({ commit }) {
method fetchProjectThreatScenarioData (line 92) | fetchProjectThreatScenarioData({ commit }, payload) {
method fetchThreatScenarioTreeByProject (line 118) | fetchThreatScenarioTreeByProject({ commit }, payload) {
method get_project_scenario_count (line 139) | get_project_scenario_count(state) {
method isPageLoading (line 144) | isPageLoading(state) {
method getThreatScenarioCount (line 147) | getThreatScenarioCount(state) {
method getThreatScenarioSevData (line 152) | getThreatScenarioSevData(state) {
method getThreatScenarioProjectTree (line 157) | getThreatScenarioProjectTree(state) {
FILE: frontend/Playbook-Frontend/store/threatmap.js
method IS_PAGE_LOADING (line 9) | IS_PAGE_LOADING(state, data) {
method FETCH_THREAT_MAP_PROJECT (line 12) | FETCH_THREAT_MAP_PROJECT(state, data) {
method showPageLoading (line 17) | showPageLoading({ commit }, data) {
method fetchThreatMapbyProject (line 20) | fetchThreatMapbyProject({ commit }, payload) {
method isPageLoading (line 42) | isPageLoading(state) {
method getThreatMapProjectData (line 45) | getThreatMapProjectData(state) {
FILE: frontend/Playbook-Frontend/store/userStory.js
method IS_PAGE_LOADING (line 14) | IS_PAGE_LOADING(state, data) {
method FETCH_DATA (line 17) | FETCH_DATA(state, data) {
method FETCH_PROJECT_USER_STORY_DATA (line 20) | FETCH_PROJECT_USER_STORY_DATA(state, data) {
method FETCH_PROJECT_ABUSER_STORY_COUNT (line 23) | FETCH_PROJECT_ABUSER_STORY_COUNT(state, data) {
method FETCH_PROJECT_USER_STORY_ID (line 26) | FETCH_PROJECT_USER_STORY_ID(state, data) {
method FETCH_PROJECT_USER_STORY_TREE (line 29) | FETCH_PROJECT_USER_STORY_TREE(state, data) {
method showPageLoading (line 34) | showPageLoading({ commit }, data) {
method fetchUserStoryData (line 37) | fetchUserStoryData({ commit }) {
method fetchUserStoryByProject (line 63) | fetchUserStoryByProject({ commit }, payload) {
method fetchUserStoryTreeByProject (line 96) | fetchUserStoryTreeByProject({ commit }, payload) {
method isPageLoading (line 117) | isPageLoading(state) {
method getUserStoryCount (line 120) | getUserStoryCount(state) {
method getUserStoryProjectCount (line 125) | getUserStoryProjectCount(state) {
method getUserStoryProjectdata (line 130) | getUserStoryProjectdata(state) {
method getAbuserStoryProjectCount (line 135) | getAbuserStoryProjectCount(state) {
method getUserStoryProjectID (line 140) | getUserStoryProjectID(state) {
method getUserStoryProjectTree (line 145) | getUserStoryProjectTree(state) {
FILE: frontend/Playbook-Frontend/store/vulnerability.js
method IS_PAGE_LOADING (line 14) | IS_PAGE_LOADING(state, data) {
method FETCH_DATA (line 17) | FETCH_DATA(state, data) {
method FETCH_SEV_DATA (line 20) | FETCH_SEV_DATA(state, data) {
method FETCH_VULS_PROJECT (line 23) | FETCH_VULS_PROJECT(state, data) {
method FETCH_VULS_SEV_PROJECT (line 26) | FETCH_VULS_SEV_PROJECT(state, data) {
method FETCH_ASVS_DATA (line 29) | FETCH_ASVS_DATA(state, data) {
method showPageLoading (line 35) | showPageLoading({ commit }, data) {
method fetchVulnerabilitySevData (line 38) | fetchVulnerabilitySevData({ commit }) {
method fetchVulnerabilitybyProject (line 75) | fetchVulnerabilitybyProject({ commit }, payload) {
method fetchASVSbyProject (line 120) | fetchASVSbyProject({ commit }, payload) {
method isPageLoading (line 155) | isPageLoading(state) {
method getVulnerabilitySevData (line 158) | getVulnerabilitySevData(state) {
method getVulnerabilityProjectCount (line 163) | getVulnerabilityProjectCount(state) {
method getVulnerabilityProjectSev (line 168) | getVulnerabilityProjectSev(state) {
method getVulnerabilityProjectData (line 173) | getVulnerabilityProjectData(state) {
method getASVSData (line 178) | getASVSData(state) {
Condensed preview — 108 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (353K chars).
[
{
"path": ".dockerignore",
"chars": 21,
"preview": "*/node_modules\n*.log\n"
},
{
"path": ".github/workflows/main.yml",
"chars": 662,
"preview": "name: CI\n\non: [push]\n\njobs:\n build:\n\n runs-on: ubuntu-latest\n \n steps:\n - uses: actions/checkout@v1\n - n"
},
{
"path": ".gitignore",
"chars": 2303,
"preview": "example/*.html\nexample/*.xml\nexample/*.json\nexample/*.png\nexample/*.txt\nexample/*.mmd\nexample/*.md\nresults/\ntv/\nThreatPl"
},
{
"path": "README.md",
"chars": 807,
"preview": "# ThreatPlaybook\n\n> This is version 3 (beta)\n\n### What it was: \nA (relatively) Unopinionated framework that faciliates T"
},
{
"path": "api/.vscode/settings.json",
"chars": 89,
"preview": "{\n \"python.formatting.provider\": \"black\",\n \"python.pythonPath\": \"venv/bin/python\"\n}"
},
{
"path": "api/Dockerfile",
"chars": 479,
"preview": "FROM python:alpine3.7\nCOPY tp_api/ /app\nCOPY requirements.txt /app\nADD https://github.com/ufoscout/docker-compose-wait/r"
},
{
"path": "api/conftest.py",
"chars": 0,
"preview": ""
},
{
"path": "api/requirements.txt",
"chars": 737,
"preview": "appdirs==1.4.3\nattrs==19.3.0\nbcrypt==3.1.7\nblack==19.10b0\nblinker==1.4\ncffi==1.14.0\nclick==7.1.1\nentrypoints==0.3\nflake8"
},
{
"path": "api/tests/test_flask.py",
"chars": 14065,
"preview": "import pytest\nfrom tp_api.app import app\nimport json\nimport secrets\n\n\ntoken = \"\"\nproject_name = \"\"\nuse_case = \"\"\nabuse_c"
},
{
"path": "api/tp_api/__init__.py",
"chars": 0,
"preview": ""
},
{
"path": "api/tp_api/app.py",
"chars": 68508,
"preview": "from flask import Flask, jsonify, request\nimport jwt\nfrom secrets import token_urlsafe\nfrom os import getenv\nfrom utils "
},
{
"path": "api/tp_api/asvs/asvs.csv",
"chars": 64837,
"preview": "V1,Architecture,1.1.1,Verify the use of a secure software development lifecycle that addresses security in all stages of"
},
{
"path": "api/tp_api/models.py",
"chars": 5889,
"preview": "from mongoengine import *\nimport datetime\nfrom uuid import uuid4\nfrom hashlib import sha256\nfrom mongoengine import sign"
},
{
"path": "api/tp_api/repo/aws_s3.yaml",
"chars": 1028,
"preview": "name: Misconfigured AWS S3 Bucket\ncwe: 16\ndescription: Misconfigured Amazon AWS S3 Bucket(s) might allow unauthorized us"
},
{
"path": "api/tp_api/repo/cert_validation.yaml",
"chars": 1469,
"preview": "name: Improper Certificate Validation\ndescription: The software does not validate, or incorrectly validates, a certifica"
},
{
"path": "api/tp_api/repo/code_injection.yaml",
"chars": 4214,
"preview": "name: Code Injection\ndescription: The software constructs all or part of a code segment using externally-influenced\n in"
},
{
"path": "api/tp_api/repo/idor_pk.yaml",
"chars": 2280,
"preview": "name: Insecure Direct Object Reference - Primary Key\ncwe: 639\ndescription: The system's authorization functionality does"
},
{
"path": "api/tp_api/repo/insecure_deserialization.yaml",
"chars": 3026,
"preview": "name: Insecure Deserialization\ndescription: The application deserializes untrusted data without sufficiently verifying\n "
},
{
"path": "api/tp_api/repo/password-bruteforce.yaml",
"chars": 740,
"preview": "name: Bruteforce Passwords\ncwe: 307\ncategories: [attack]\ndescription: The application allows multiple/consecutive attemp"
},
{
"path": "api/tp_api/repo/plaintext-transmission.yaml",
"chars": 2009,
"preview": "name: Plaintext transmission of sensitive data\ncwe: 319\ncategories: [app_vulns,owasp]\ndescription: The software transmit"
},
{
"path": "api/tp_api/repo/sql_injection.yaml",
"chars": 3623,
"preview": "name: SQL Injection\ncwe: 89\ndescription: The software constructs all or part of an SQL command using externally-influenc"
},
{
"path": "api/tp_api/repo/ssrf.yaml",
"chars": 1236,
"preview": "name: Server-Side Request Forgery\ncwe: 918\ndescription: The web server receives a URL or similar request from an upstrea"
},
{
"path": "api/tp_api/repo/weak-default-password.yaml",
"chars": 653,
"preview": "name: Weak/Default Passwords\ncwe: 521\ncategories: [app_vulns,owasp]\ndescription: The application allows the users to set"
},
{
"path": "api/tp_api/repo/xss.yaml",
"chars": 6241,
"preview": "name: Cross-Site Scripting\ncwe: 79\ndescription: The software does not neutralize or incorrectly neutralizes user-control"
},
{
"path": "api/tp_api/repo/xxe.yaml",
"chars": 2084,
"preview": "name: XML External Entities\ncwe: 611\ndescription: The software processes an XML document that can contain XML entities\n "
},
{
"path": "api/tp_api/swagger/abuse-create.yml",
"chars": 641,
"preview": "This is the API Endpoint that is used to create/update Abuser Stories linked to Feature/User Story\n---\nparameters:\n - n"
},
{
"path": "api/tp_api/swagger/change-password.yml",
"chars": 413,
"preview": "This is the API Endpoint that is used to change an existing user's password in ThreatPlaybook\n---\nrequestBody:\n require"
},
{
"path": "api/tp_api/swagger/feature-create.yml",
"chars": 613,
"preview": "This is the API Endpoint that is used to create and update a User Story/Feature.\n---\nparameters:\n - name: body\n in: "
},
{
"path": "api/tp_api/swagger/get-abuse.yml",
"chars": 517,
"preview": "This is the API Endpoint that is used retrieve a single Abuser Story or multiple Abuser Stories\n---\nparameters:\n - name"
},
{
"path": "api/tp_api/swagger/get-feature.yml",
"chars": 472,
"preview": "This is the API Endpoint that is used retrieve a single Feature/User Story or multiple Features/User Stories\n---\nparamet"
},
{
"path": "api/tp_api/swagger/get-project.yml",
"chars": 370,
"preview": "This is the API Endpoint that is used retrieve a single Project or multiple Projects\n---\nparameters:\n - name: body\n "
},
{
"path": "api/tp_api/swagger/get-scenario.yml",
"chars": 556,
"preview": "This is the API Endpoint that is used retrieve a single Abuser Story or multiple Abuser Stories\n---\nparameters:\n - name"
},
{
"path": "api/tp_api/swagger/get-tests.yml",
"chars": 540,
"preview": "This is the API Endpoint that is used retrieve a single Abuser Story or multiple Abuser Stories\n---\nparameters:\n - name"
},
{
"path": "api/tp_api/swagger/scan-create.yml",
"chars": 581,
"preview": "This is the API Endpoint that is used to create a scan for storing Vulnerability Results in the Database\n---\nparameters:"
},
{
"path": "api/tp_api/swagger/scenario-inline.yml",
"chars": 991,
"preview": "This is the API Endpoint that is used to create and update Inline Threat Scenarios that are NOT linked to existing Vulne"
},
{
"path": "api/tp_api/swagger/scenario-repo.yml",
"chars": 870,
"preview": "This is the API Endpoint that is used to create and update Threat Scenarios that are linked to existing Vulnerability Re"
},
{
"path": "api/tp_api/swagger/target-create-update.yml",
"chars": 670,
"preview": "This is the API Endpoint to create and update Targets for Vulnerability Scanning and Management\n---\nsecuritySchemes: \n "
},
{
"path": "api/tp_api/swagger/test-case-create.yml",
"chars": 938,
"preview": "This is the API Endpoint to create and update Security Test Cases a.k.a Test Cases\n---\nparameters:\n - name: body\n in"
},
{
"path": "api/tp_api/swagger/vulnerability-create.yml",
"chars": 1213,
"preview": "This is the API Endpoint that is used to create a scan for storing Vulnerability Results in the Database\n---\nparameters:"
},
{
"path": "api/tp_api/utils.py",
"chars": 4519,
"preview": "from mongoengine import *\nfrom loguru import logger\nfrom sys import exit\nimport os\nfrom models import *\nfrom glob import"
},
{
"path": "api/tp_api/wait-for",
"chars": 1374,
"preview": "#!/bin/sh\n\nTIMEOUT=90\nQUIET=0\n\nechoerr() {\n if [ \"$QUIET\" -ne 1 ]; then printf \"%s\\n\" \"$*\" 1>&2; fi\n}\n\nusage() {\n exit"
},
{
"path": "docker-compose.yml",
"chars": 1209,
"preview": "version: '3'\nservices:\n nginx:\n image: we45/threatplaybook-nginx:latest\n ports:\n - \"80:80\"\n depends_on:"
},
{
"path": "documentation/.gitignore",
"chars": 233,
"preview": "# Dependencies\n/node_modules\n\n# Production\n/build\n\n# Generated files\n.docusaurus\n.cache-loader\n\n# Misc\n.DS_Store\n.env.lo"
},
{
"path": "documentation/README.md",
"chars": 721,
"preview": "# Website\n\nThis website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator.\n\n##"
},
{
"path": "documentation/babel.config.js",
"chars": 89,
"preview": "module.exports = {\n presets: [require.resolve('@docusaurus/core/lib/babel/preset')],\n};\n"
},
{
"path": "documentation/docs/client-ui.md",
"chars": 272,
"preview": "---\nid: client-ui\ntitle: Web UI\nsidebar_label: Web UI\n---\n\n#### Open Addressable IP Address on the browser\n\n Unopinionated framework that faciliates Th"
},
{
"path": "documentation/package.json",
"chars": 650,
"preview": "{\n \"name\": \"documentation\",\n \"version\": \"0.0.0\",\n \"private\": true,\n \"scripts\": {\n \"start\": \"docusaurus start\",\n "
},
{
"path": "documentation/sidebars.js",
"chars": 265,
"preview": "module.exports = {\n someSidebar: {\n QuickStart: [\n \"overview\",\n \"installation\",\n \"client-install\",\n "
},
{
"path": "documentation/src/css/custom.css",
"chars": 836,
"preview": "/* stylelint-disable docusaurus/copyright-header */\n/**\n * Any CSS included here will be global. The classic template\n *"
},
{
"path": "documentation/src/pages/index.js",
"chars": 2796,
"preview": "import React from 'react';\nimport clsx from 'clsx';\nimport Layout from '@theme/Layout';\nimport Link from '@docusaurus/Li"
},
{
"path": "documentation/src/pages/styles.module.css",
"chars": 559,
"preview": "/* stylelint-disable docusaurus/copyright-header */\n\n/**\n * CSS files with the .module.css suffix will be treated as CSS"
},
{
"path": "documentation/static/.nojekyll",
"chars": 0,
"preview": ""
},
{
"path": "frontend/Playbook-Frontend/.babelrc",
"chars": 212,
"preview": "{\n \"env\": {\n \"test\": {\n \"presets\": [\n [\n \"@babel/preset-env\",\n {\n \"targets\""
},
{
"path": "frontend/Playbook-Frontend/.editorconfig",
"chars": 207,
"preview": "# editorconfig.org\nroot = true\n\n[*]\nindent_style = space\nindent_size = 2\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_"
},
{
"path": "frontend/Playbook-Frontend/.gitignore",
"chars": 1253,
"preview": "# Created by .ignore support plugin (hsz.mobi)\n### Node template\n# Logs\n/logs\n*.log\nnpm-debug.log*\nyarn-debug.log*\nyarn-"
},
{
"path": "frontend/Playbook-Frontend/Dockerfile",
"chars": 93,
"preview": "FROM node:12\n\nCOPY dist ./dist\n\nRUN npm install -g serve\nENV PORT=80\nCMD serve -s dist -p 80\n"
},
{
"path": "frontend/Playbook-Frontend/README.md",
"chars": 372,
"preview": "# Playbook-Frontend\n\n> My swell Nuxt.js project\n\n## Build Setup\n\n```bash\n# install dependencies\n$ yarn install\n\n# serve "
},
{
"path": "frontend/Playbook-Frontend/assets/variables.scss",
"chars": 345,
"preview": "// Ref: https://github.com/nuxt-community/vuetify-module#customvariables\n//\n// The variables you want to modify\n// $font"
},
{
"path": "frontend/Playbook-Frontend/components/Logo.vue",
"chars": 1473,
"preview": "<template>\n <div class=\"VueToNuxtLogo\">\n <div class=\"Triangle Triangle--two\" />\n <div class=\"Triangle Triangle--o"
},
{
"path": "frontend/Playbook-Frontend/components/README.md",
"chars": 205,
"preview": "# COMPONENTS\n\n**This directory is not required, you can delete it if you don't want to use it.**\n\nThe components directo"
},
{
"path": "frontend/Playbook-Frontend/components/VuetifyLogo.vue",
"chars": 303,
"preview": "<template>\n <img class=\"VuetifyLogo\" alt=\"Vuetify Logo\" src=\"/vuetify-logo.svg\" />\n</template>\n\n<style>\n.VuetifyLogo {\n"
},
{
"path": "frontend/Playbook-Frontend/components/project/Content.vue",
"chars": 1847,
"preview": "<template>\n <div>\n <v-row>\n <v-col cols=\"6\">\n <v-card>\n <v-card-title class=\"subtitle-1\"\n "
},
{
"path": "frontend/Playbook-Frontend/components/project/Header.vue",
"chars": 4471,
"preview": "<template>\n <div>\n <v-card>\n <v-card-title\n class=\"display-2 justify-center\"\n v-text=\"name\"\n "
},
{
"path": "frontend/Playbook-Frontend/components/projects/ProjectsPage.vue",
"chars": 3671,
"preview": "<template>\n <v-card>\n <v-card-title>\n Projects\n <v-spacer></v-spacer>\n <v-text-field\n v-model="
},
{
"path": "frontend/Playbook-Frontend/jest.config.js",
"chars": 416,
"preview": "module.exports = {\n moduleNameMapper: {\n '^@/(.*)$': '<rootDir>/$1',\n '^~/(.*)$': '<rootDir>/$1',\n '^vue$': 'v"
},
{
"path": "frontend/Playbook-Frontend/jsconfig.json",
"chars": 209,
"preview": "{\n \"compilerOptions\": {\n \"baseUrl\": \".\",\n \"paths\": {\n \"~/*\": [\"./*\"],\n \"@/*\": [\"./*\"],\n \"~~/*\": [\""
},
{
"path": "frontend/Playbook-Frontend/layouts/default.vue",
"chars": 330,
"preview": "<template>\n <v-app light>\n <v-content>\n <v-container class=\"fill-height\" fluid>\n <nuxt />\n </v-cont"
},
{
"path": "frontend/Playbook-Frontend/layouts/error.vue",
"chars": 624,
"preview": "<template>\n <v-app dark>\n <h1 v-if=\"error.statusCode === 404\">{{ pageNotFound }}</h1>\n <h1 v-else>{{ otherError }"
},
{
"path": "frontend/Playbook-Frontend/layouts/main.vue",
"chars": 4033,
"preview": "<template>\n <v-app id=\"inspire\">\n <v-navigation-drawer\n v-model=\"drawer\"\n :clipped=\"$vuetify.breakpoint.lg"
},
{
"path": "frontend/Playbook-Frontend/middleware/README.md",
"chars": 383,
"preview": "# MIDDLEWARE\n\n**This directory is not required, you can delete it if you don't want to use it.**\n\nThis directory contain"
},
{
"path": "frontend/Playbook-Frontend/nuxt.config.js",
"chars": 2439,
"preview": "import colors from \"vuetify/es5/util/colors\";\nexport default {\n mode: \"universal\",\n /*\n ** Headers of the page\n */"
},
{
"path": "frontend/Playbook-Frontend/package.json",
"chars": 726,
"preview": "{\n \"name\": \"Playbook-Frontend\",\n \"version\": \"1.0.0\",\n \"description\": \"My swell Nuxt.js project\",\n \"author\": \"Tilak T"
},
{
"path": "frontend/Playbook-Frontend/pages/home/index.vue",
"chars": 5009,
"preview": "<template>\n <div>\n <v-breadcrumbs :items=\"breadcrumbData\">\n <template v-slot:divider>\n <v-icon>mdi-forwa"
},
{
"path": "frontend/Playbook-Frontend/pages/index.vue",
"chars": 3570,
"preview": "<template>\n <v-row align=\"center\" justify=\"center\">\n <v-col cols=\"12\" sm=\"8\" md=\"4\">\n <center>\n <img src"
},
{
"path": "frontend/Playbook-Frontend/pages/projects/_name/abuser-story.vue",
"chars": 9983,
"preview": "/* eslint-disable no-var */\n<template>\n <div>\n <v-breadcrumbs :items=\"breadcrumbData\">\n <template v-slot:divide"
},
{
"path": "frontend/Playbook-Frontend/pages/projects/_name/project.vue",
"chars": 3475,
"preview": "<template>\n <div>\n <v-breadcrumbs :items=\"breadcrumbData\">\n <template v-slot:divider>\n <v-icon>mdi-forwa"
},
{
"path": "frontend/Playbook-Frontend/pages/projects/_name/threat-map.vue",
"chars": 8139,
"preview": "<template>\n <div>\n <v-breadcrumbs :items=\"breadcrumbData\">\n <template v-slot:divider>\n <v-icon>mdi-forwa"
},
{
"path": "frontend/Playbook-Frontend/pages/projects/_name/threat-scenario.vue",
"chars": 9836,
"preview": "/* eslint-disable no-var */\n<template>\n <div>\n <v-breadcrumbs :items=\"breadcrumbData\">\n <template v-slot:divide"
},
{
"path": "frontend/Playbook-Frontend/pages/projects/_name/user-story.vue",
"chars": 9650,
"preview": "/* eslint-disable no-var */\n<template>\n <div>\n <v-breadcrumbs :items=\"breadcrumbData\">\n <template v-slot:divide"
},
{
"path": "frontend/Playbook-Frontend/pages/projects/_name/vulnerabilities.vue",
"chars": 2703,
"preview": "/* eslint-disable no-var */\n<template>\n <div>\n <v-breadcrumbs :items=\"breadcrumbData\">\n <template v-slot:divide"
},
{
"path": "frontend/Playbook-Frontend/pages/projects/index.vue",
"chars": 862,
"preview": "<template>\n <div>\n <v-breadcrumbs :items=\"breadcrumbData\">\n <template v-slot:divider>\n <v-icon>mdi-forwa"
},
{
"path": "frontend/Playbook-Frontend/pages/scan/_name.vue",
"chars": 2720,
"preview": "/* eslint-disable no-var */\n<template>\n <div>\n <v-breadcrumbs :items=\"breadcrumbData\">\n <template v-slot:divide"
},
{
"path": "frontend/Playbook-Frontend/plugins/README.md",
"chars": 314,
"preview": "# PLUGINS\n\n**This directory is not required, you can delete it if you don't want to use it.**\n\nThis directory contains J"
},
{
"path": "frontend/Playbook-Frontend/plugins/vue-apexchart.js",
"chars": 159,
"preview": "import Vue from \"vue\";\nimport VueApexCharts from \"vue-apexcharts\";\n\nVue.use({\n install(Vue, options) {\n Vue.componen"
},
{
"path": "frontend/Playbook-Frontend/plugins/vue-organization-chart.js",
"chars": 234,
"preview": "import Vue from \"vue\";\nimport OrganizationChart from \"vue-organization-chart\";\nimport \"vue-organization-chart/dist/orgch"
},
{
"path": "frontend/Playbook-Frontend/store/abuserStory.js",
"chars": 1199,
"preview": "import axios from \"axios\";\nconst loginUrl = process.env.VUE_APP_API_URL;\n\nexport const state = () => ({\n isLoading: fal"
},
{
"path": "frontend/Playbook-Frontend/store/home.js",
"chars": 1837,
"preview": "export const state = () => ({\n isLoading: false,\n data: [],\n projectCount: 0,\n userStoriesCount: 0,\n threatScenario"
},
{
"path": "frontend/Playbook-Frontend/store/index.js",
"chars": 58,
"preview": "export const state = () => ({})\nexport const getters = {}\n"
},
{
"path": "frontend/Playbook-Frontend/store/login.js",
"chars": 2596,
"preview": "import axios from \"axios\";\nconst loginUrl = process.env.VUE_APP_API_URL;\n\nexport const state = () => ({\n isLoading: fal"
},
{
"path": "frontend/Playbook-Frontend/store/projects.js",
"chars": 1321,
"preview": "import axios from \"axios\";\nconst loginUrl = process.env.VUE_APP_API_URL;\n\nexport const state = () => ({\n isLoading: fal"
},
{
"path": "frontend/Playbook-Frontend/store/scan.js",
"chars": 3284,
"preview": "import axios from \"axios\";\nconst loginUrl = process.env.VUE_APP_API_URL;\n\nexport const state = () => ({\n isLoading: fal"
},
{
"path": "frontend/Playbook-Frontend/store/threatScenario.js",
"chars": 4381,
"preview": "import axios from \"axios\";\nconst loginUrl = process.env.VUE_APP_API_URL;\n\nexport const state = () => ({\n isLoading: fal"
},
{
"path": "frontend/Playbook-Frontend/store/threatmap.js",
"chars": 1220,
"preview": "import axios from \"axios\";\nconst loginUrl = process.env.VUE_APP_API_URL;\n\nexport const state = () => ({\n isLoading: fal"
},
{
"path": "frontend/Playbook-Frontend/store/userStory.js",
"chars": 3910,
"preview": "import axios from \"axios\";\nconst loginUrl = process.env.VUE_APP_API_URL;\n\nexport const state = () => ({\n isLoading: fal"
},
{
"path": "frontend/Playbook-Frontend/store/vulnerability.js",
"chars": 4867,
"preview": "import axios from \"axios\";\nconst loginUrl = process.env.VUE_APP_API_URL;\n\nexport const state = () => ({\n isLoading: fal"
},
{
"path": "frontend/Playbook-Frontend/test/Logo.spec.js",
"chars": 232,
"preview": "import { mount } from '@vue/test-utils'\nimport Logo from '@/components/Logo.vue'\n\ndescribe('Logo', () => {\n test('is a "
},
{
"path": "nginx/Dockerfile",
"chars": 297,
"preview": "FROM ubuntu:16.04\n\nRUN apt-get update && apt-get install -y nginx && apt-get clean && rm -rf /var/lib/apt/lists/*\n\nRUN e"
},
{
"path": "nginx/alpine.df",
"chars": 195,
"preview": "FROM nginx:latest\n\nRUN echo \"daemon off;\" >> /etc/nginx/nginx.conf\nRUN rm /etc/nginx/sites-enabled/*\n\nADD sites-enabled/"
},
{
"path": "nginx/sites-enabled/tp_nginx",
"chars": 1013,
"preview": "upstream frontend_server {\n server frontend:80 fail_timeout=1000;\n}\n\nserver {\n listen 80;\n listen 5000;\n ser"
}
]
About this extraction
This page contains the full source code of the we45/ThreatPlaybook GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 108 files (324.2 KB), approximately 80.2k tokens, and a symbol index with 206 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.