Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix objective.result_rt not populating and not linting #591

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [5.0.3] - 28 February 2025

### Added

* Added objective result fields to the GraphQL schema and reporting engine
* Objectives now have `result` and `result_rt` fields that can be used in report templates
* The `result` field can now be updated via the GraphQL API

## [5.0.2] - 24 February 2025

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions VERSION
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
v5.0.2
24 February 2025
v5.0.3
28 February 2025
4 changes: 2 additions & 2 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
# 3rd Party Libraries
import environ

__version__ = "5.0.2"
__version__ = "5.0.3"
VERSION = __version__
RELEASE_DATE = "24 February 2025"
RELEASE_DATE = "28 February 2025"

ROOT_DIR = Path(__file__).resolve(strict=True).parent.parent.parent
APPS_DIR = ROOT_DIR / "ghostwriter"
Expand Down
6 changes: 6 additions & 0 deletions ghostwriter/modules/linting_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@
"objective": "Discover Kenneth Parcell's true identity",
"description": '<p>It is unclear if this is a jest and part of an HR-related "flag" or a real request. The client was light on details. The objective is wide open; asking the team to find any and all information related to Kenneth Parcel, a member of NBC\'s Page Program.</p>',
"description_rt": "",
"result": '<p>Test result 1</p>',
"result_rt": "",
"complete": False,
"marked_complete": "",
"position": 1,
Expand All @@ -126,6 +128,8 @@
"objective": "Access hosts and files containing celebrity PII",
"description": "<p>The team may find methods of accessing data related to celebrities that appear on NBC programs. Use any discovered methods to access this information and capture evidence.</p>",
"description_rt": "",
"result": '<p>Test result 1</p>',
"result_rt": "",
"complete": False,
"marked_complete": "",
"position": 1,
Expand All @@ -146,6 +150,8 @@
"objective": "Escalate privileges in the NBC domain to Domain Administrator or equivalent",
"description": "<p>Active Directory is a key component of the assessment, and client is keen to learn how many attack paths may be discovered to escalate privileges within the network.</p>",
"description_rt": "",
"result": '<p>Test result 1</p>',
"result_rt": "",
"complete": False,
"marked_complete": "",
"position": 2,
Expand Down
6 changes: 6 additions & 0 deletions ghostwriter/modules/reportwriter/project/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ def process_projects_richtext(
objective["description"],
rich_text_context,
)
if objective["result"]:
objective["result_rt"] = ex.create_lazy_template(
f"the result of objective {objective['objective']}",
objective["result"],
rich_text_context,
)

# Scope Lists
for scope_list in base_context["scope"]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ insert_permissions:
- position
- priority_id
- project_id
- result
- status_id
- role: user
permission:
Expand All @@ -72,21 +73,23 @@ insert_permissions:
- position
- priority_id
- project_id
- result
- status_id
select_permissions:
- role: manager
permission:
columns:
- id
- priority_id
- project_id
- status_id
- complete
- objective
- deadline
- description
- id
- marked_complete
- objective
- position
- description
- priority_id
- project_id
- result
- status_id
filter: {}
- role: user
permission:
Expand Down Expand Up @@ -115,6 +118,7 @@ update_permissions:
- position
- priority_id
- project_id
- result
- status_id
filter: {}
check: {}
Expand All @@ -128,6 +132,7 @@ update_permissions:
- position
- priority_id
- project_id
- result
- status_id
filter:
project:
Expand Down