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

contentctl 5 - Step 4 - ESCU 5.0 #334

Merged
merged 169 commits into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
169 commits
Select commit Hold shift + click to select a range
60b6e1b
Add an extra, missing field to the lookup.py model called max_matches…
pyth0n1c Jul 27, 2024
fd33140
enable error for extra keys in Pydantic Objects
pyth0n1c Jul 27, 2024
e4f7dcc
update template to remove risk_score since it is a comptued_field and…
pyth0n1c Jul 27, 2024
830d201
initial lookup updates
pyth0n1c Aug 15, 2024
e96fbd4
continuing to make lookup improvements.
pyth0n1c Aug 19, 2024
32ed03f
more lookup changes
pyth0n1c Aug 19, 2024
2a5663d
First crack at default config
ljstella Aug 22, 2024
3f7a585
Adding suggested extension config
ljstella Aug 22, 2024
66e743e
initial sketch
ljstella Aug 27, 2024
802bfe6
Merge branch 'main' into obs_to_rba
ljstella Aug 27, 2024
2c1275c
Merge branch 'main' into obs_to_rba
ljstella Aug 28, 2024
0a88668
Bumping target_version
ljstella Aug 30, 2024
82b8fa7
Merge branch 'main' into ruff_config
ljstella Aug 30, 2024
f81f82e
Merge branch 'main' into obs_to_rba
ljstella Sep 4, 2024
dd5b52d
save point
ljstella Sep 5, 2024
5a9af4f
Merge branch 'main' into ruff_config
ljstella Sep 10, 2024
2568f71
Updated pyproject.toml
ljstella Sep 10, 2024
ec40b40
Merge branch 'main' into ruff_config
ljstella Sep 10, 2024
0b4158b
Github CI
ljstella Sep 12, 2024
f99655d
Add precommit hook
ljstella Sep 12, 2024
c1bdfbc
Update gitignore
ljstella Sep 12, 2024
7ed5e02
Updating ruff workflow
ljstella Sep 12, 2024
9aa1607
Adding ruff as dev dependency
ljstella Sep 12, 2024
9a493c6
Merge branch 'main' into ruff_config
ljstella Sep 13, 2024
66ef7fc
Merge branch 'main' into ruff_config
ljstella Sep 13, 2024
9ad0d96
Merge branch 'main' into ruff_config
ljstella Sep 18, 2024
56f4273
Merge branch 'main' into obs_to_rba
ljstella Sep 26, 2024
8f1845e
Merge branch 'main' into ruff_config
ljstella Sep 30, 2024
0c8d8e5
Added python 3.13 to End to End testing
ljstella Oct 7, 2024
1520f3b
Tweak run conditions and matrix
ljstella Oct 8, 2024
3ba8a09
Typo
ljstella Oct 8, 2024
a5cd630
Merge branch 'main' into ruff_config
ljstella Oct 15, 2024
9830993
Merge branch 'main' into python313
pyth0n1c Oct 16, 2024
2a5f778
Merge branch 'main' into python313
ljstella Oct 16, 2024
45a6cb0
Merge branch 'main' into ruff_config
ljstella Oct 16, 2024
a7851ba
Merge branch 'main' into python313
ljstella Oct 28, 2024
82d4f16
Merge branch 'main' into ruff_config
ljstella Oct 28, 2024
030ae92
bumped version
ljstella Oct 29, 2024
ae8c9c8
Merge branch 'main' into ruff_config
ljstella Oct 31, 2024
f6f2999
Merge branch 'main' into obs_to_rba
ljstella Nov 4, 2024
221a6c0
Merge branch 'main' into python313
ljstella Nov 6, 2024
bbe5da8
Merge branch 'main' into exception_on_extra_fields
pyth0n1c Nov 7, 2024
b294765
Implement hashing
ljstella Nov 8, 2024
7f7724c
Updated default detection
ljstella Nov 8, 2024
0224f9e
Merge branch 'main' into obs_to_rba
ljstella Nov 8, 2024
3be2c3a
Remove tags.message and tags.observable
ljstella Nov 8, 2024
9c138f1
remove code for tags.message
ljstella Nov 8, 2024
11a1ca9
reworking validations
ljstella Nov 8, 2024
3882b9b
new rba location
ljstella Nov 8, 2024
d584822
Refactor risk()
ljstella Nov 8, 2024
3cde4a6
slight tweak
ljstella Nov 8, 2024
e41e427
Merge branch 'main' into ruff_config
ljstella Nov 12, 2024
f4739cc
Better guard against None
ljstella Nov 12, 2024
d6b848e
Another None case
ljstella Nov 12, 2024
9cda91e
remove print
ljstella Nov 12, 2024
8e5676c
Another None guard
ljstella Nov 12, 2024
6f77c47
Just production
ljstella Nov 12, 2024
b4a9217
Merge branch 'main' into exception_on_extra_fields
pyth0n1c Nov 12, 2024
ef7784d
Move Baseline datamodel from YML field
pyth0n1c Nov 12, 2024
a27f790
make datamodel a computed
pyth0n1c Nov 12, 2024
9266898
Merge branch 'main' into obs_to_rba
ljstella Nov 13, 2024
1a4ea93
Validate all, not just production
ljstella Nov 13, 2024
5dd91a0
Merge branch 'main' into python313
ljstella Nov 13, 2024
e2565f4
Remove comment
ljstella Nov 14, 2024
12c8881
Temporary tweak for testing companion branch
ljstella Nov 14, 2024
afa864b
tweak to required
ljstella Nov 15, 2024
e7fd466
threat object type typo
ljstella Nov 15, 2024
2fe24e6
more threat object types
ljstella Nov 15, 2024
3435f4c
one more threat object type
ljstella Nov 15, 2024
d1c78f2
bump tyro version
ljstella Nov 18, 2024
9a546c8
Removal of required_fields from
pyth0n1c Nov 18, 2024
73ef9e3
Remove context from detection_tags
pyth0n1c Nov 18, 2024
36a0fb0
Merge branch 'main' into python313
ljstella Nov 18, 2024
0bf6a5f
Update pyproject.toml for python 3.13
ljstella Nov 18, 2024
a00958c
Merge branch 'main' into exception_on_extra_fields
ljstella Nov 18, 2024
39ce0ef
Removed risk_Score from contentctl
pyth0n1c Nov 19, 2024
c647a9f
make a change to github workflow,
pyth0n1c Nov 19, 2024
0a910ce
clean up new content template
pyth0n1c Nov 20, 2024
9856df5
fix out security_content
pyth0n1c Nov 20, 2024
aa99df8
remove duplicate in list
pyth0n1c Nov 20, 2024
4bb9d41
Revert test to security_content develop branch.
pyth0n1c Nov 20, 2024
f97597b
Update new_content generation to give a
pyth0n1c Nov 20, 2024
3fea2f6
update drilldowns
pyth0n1c Nov 20, 2024
db19969
change _UPDATE_ string to __UPDATE__
pyth0n1c Nov 21, 2024
b382d44
pin pydantic to older minor
pyth0n1c Nov 21, 2024
e3b0eea
Merge branch 'main' into python313
ljstella Nov 22, 2024
140089f
Oopsied the merge
ljstella Nov 22, 2024
9790e16
Merge branch 'main' into obs_to_rba
ljstella Nov 22, 2024
042a53a
Wrong branch for 3.13
ljstella Nov 22, 2024
f8d31fe
Merge branch 'main' into ruff_config
ljstella Nov 22, 2024
5591952
Ruff version bump
ljstella Nov 22, 2024
5191ff8
bump tyro version
ljstella Nov 23, 2024
e671f2b
Create new rba object via new content workflow
ljstella Nov 25, 2024
1107ae1
Reordering output
ljstella Nov 25, 2024
e5c150d
Placeholder for contentctl 5 prs
pyth0n1c Dec 4, 2024
8f24494
convert plain enums, or enums with
pyth0n1c Dec 4, 2024
0999270
Remove all usage of use_enum_values.
pyth0n1c Dec 4, 2024
31f46a2
Remove use of .value on enums in code
pyth0n1c Dec 4, 2024
ed958cc
fix missing typing of mode_name
pyth0n1c Dec 4, 2024
0237ccd
remove files that are no longer used anymore. Add logic to serialize …
pyth0n1c Dec 6, 2024
6f394cc
Remove dead code from
pyth0n1c Dec 6, 2024
8b86914
Merge branch 'contentctl_5' into exception_on_extra_fields
pyth0n1c Dec 10, 2024
7646c24
Merge pull request #325 from splunk/exception_on_extra_fields
pyth0n1c Dec 10, 2024
12acd66
Merge branch 'contentctl_5' into obs_to_rba
ljstella Dec 10, 2024
d11009d
Merge branch 'contentctl_5' into remove_use_enum_values
pyth0n1c Dec 10, 2024
61d99ed
remove the 'forbid' from a few classes
pyth0n1c Dec 11, 2024
5b86552
Clean up two more use of .value on
pyth0n1c Dec 11, 2024
ed1c8b0
Version bump
ljstella Dec 11, 2024
c0d440c
other precommit hooks
ljstella Dec 11, 2024
fde8b9a
Merge pull request #302 from splunk/python313
pyth0n1c Dec 12, 2024
ea437a8
Add GH Actions to Dependabot
ljstella Dec 12, 2024
5cbf82a
Reduce matrix for simplicity
ljstella Dec 12, 2024
9eb642a
Merge pull request #335 from splunk/remove_use_enum_values
pyth0n1c Dec 12, 2024
d98b493
Merge pull request #340 from splunk/gh_runner_update
pyth0n1c Dec 12, 2024
356317f
Merge branch 'contentctl_5' into ruff_config
ljstella Dec 12, 2024
474ede5
Merge branch 'contentctl_5' into obs_to_rba
ljstella Dec 12, 2024
f88bca6
convert plain enums, or enums with
pyth0n1c Dec 4, 2024
5b9cb95
Remove all usage of use_enum_values.
pyth0n1c Dec 4, 2024
827a8f4
Remove use of .value on enums in code
pyth0n1c Dec 4, 2024
eeaeb4d
fix missing typing of mode_name
pyth0n1c Dec 4, 2024
b794d15
remove files that are no longer used anymore. Add logic to serialize …
pyth0n1c Dec 6, 2024
334062c
Remove dead code from
pyth0n1c Dec 6, 2024
4bc5e68
remove the 'forbid' from a few classes
pyth0n1c Dec 11, 2024
84715bf
Clean up two more use of .value on
pyth0n1c Dec 11, 2024
8cc3451
Add GH Actions to Dependabot
ljstella Dec 12, 2024
b4848be
Reduce matrix for simplicity
ljstella Dec 12, 2024
753b3b0
Merge branch 'contentctl_5' into obs_to_rba
ljstella Dec 12, 2024
d71674f
version bump
ljstella Dec 19, 2024
cc51953
More cleanup with
pyth0n1c Dec 23, 2024
fda382f
Merge branch 'contentctl_5' into improve_lookup_regex
pyth0n1c Dec 23, 2024
b24c88d
initial working cleanup of lookups code
pyth0n1c Dec 23, 2024
e7eb947
include inputlookup and outputlookup
pyth0n1c Dec 23, 2024
6aebe3f
Version bump
ljstella Jan 2, 2025
deefd57
more cleanup on lookup object.
pyth0n1c Jan 3, 2025
97daa61
Merge branch 'obs_to_rba' into improve_lookup_regex
pyth0n1c Jan 3, 2025
6f60e75
version update
ljstella Jan 5, 2025
24b003c
Update CI to temporarily test against #3269 on security_content
ljstella Jan 6, 2025
41fab0f
Fix regex to step matching
pyth0n1c Jan 6, 2025
f04d92c
Progress and cleanup for
pyth0n1c Jan 7, 2025
825beaf
Able to build without any errors,
pyth0n1c Jan 8, 2025
a31d484
improve api output serialization
pyth0n1c Jan 8, 2025
0f70172
Clean up bad imports. Give more
pyth0n1c Jan 9, 2025
8795e97
bump to 0.9.0
ljstella Jan 9, 2025
285acf1
New threat object type
ljstella Jan 10, 2025
633f0d5
version bump to 0.9.1
ljstella Jan 12, 2025
a6faec5
merge latest rba target updates
pyth0n1c Jan 13, 2025
78aa05e
Fix access of variable that does
pyth0n1c Jan 13, 2025
9b158ce
initial commit; migrated integration testing to RBA structures; litte…
cmcginley-splunk Jan 16, 2025
0ef9754
Merge pull request #274 from splunk/improve_lookup_regex
ljstella Jan 16, 2025
779006e
Merge branch 'obs_to_rba' into integration_testing_rba_migration
cmcginley-splunk Jan 16, 2025
901415f
Change testing branch
ljstella Jan 16, 2025
da61571
Update template detection
ljstella Jan 16, 2025
72c51a4
cleanup; log fixes
cmcginley-splunk Jan 16, 2025
f72c796
resolving some todos
cmcginley-splunk Jan 16, 2025
8293a6d
Class name renaming
ljstella Jan 16, 2025
7b8b2ff
Merge branch 'obs_to_rba' into integration_testing_rba_migration
cmcginley-splunk Jan 16, 2025
51f0780
new class name
cmcginley-splunk Jan 16, 2025
c3cc5ab
little bit more cleanup on lookups.
pyth0n1c Jan 16, 2025
da39152
Merge branch 'obs_to_rba' of https://github.com/splunk/contentctl int…
pyth0n1c Jan 16, 2025
1de20e8
Merge branch 'obs_to_rba' into integration_testing_rba_migration
pyth0n1c Jan 16, 2025
c4a88f5
Bump for 0.9.2
ljstella Jan 17, 2025
0f53c69
Merge pull request #345 from splunk/integration_testing_rba_migration
ljstella Jan 17, 2025
4f92434
Merge pull request #263 from splunk/obs_to_rba
josehelps Jan 17, 2025
3530006
Merge branch 'contentctl_5' into ruff_config
josehelps Jan 17, 2025
35e9ffc
Merge pull request #254 from splunk/ruff_config
josehelps Jan 17, 2025
54a0d68
Merge branch 'main' into contentctl_5
josehelps Jan 17, 2025
9a29afc
Fix an error where a lookup that was not REALLY a lookup could be det…
pyth0n1c Jan 17, 2025
a35b5e0
write all objects to conf file
pyth0n1c Jan 17, 2025
248e436
print giant warning about
pyth0n1c Jan 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ updates:
schedule:
interval: "daily"
open-pull-requests-limit: 6
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
22 changes: 22 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: lint & format
on:
pull_request:
types: [opened, reopened, synchronize]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install ruff
run: |
python -m pip install --upgrade pip
pip install ruff
- name: Run lint
run: ruff check --output-format=github contentctl/
- name: Run Formatter
run: ruff format --check contentctl/
7 changes: 3 additions & 4 deletions .github/workflows/testEndToEnd.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: testEndToEnd
on:
push:
pull_request:
types: [opened, reopened]
types: [opened, reopened, synchronize]
schedule:
- cron: "44 4 * * *"

Expand All @@ -11,8 +10,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python_version: ["3.11", "3.12"]
operating_system: ["ubuntu-20.04", "ubuntu-22.04", "macos-latest", "macos-14", "windows-2022"]
python_version: ["3.11", "3.12", "3.13"]
operating_system: ["ubuntu-24.04", "macos-15", "windows-2022"]
#operating_system: ["ubuntu-20.04", "ubuntu-22.04", "macos-latest"]


Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test_against_escu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
# note yet been fixed in security_content, we may see this workflow fail.
name: test_against_escu
on:
push:
pull_request:
types: [opened, reopened]
types: [opened, reopened, synchronize]
schedule:
- cron: "44 4 * * *"

Expand All @@ -17,9 +16,9 @@ jobs:
strategy:
fail-fast: false
matrix:
python_version: ["3.11", "3.12"]
python_version: ["3.11", "3.12", "3.13"]

operating_system: ["ubuntu-20.04", "ubuntu-22.04", "macos-latest", "macos-14"]
operating_system: ["ubuntu-24.04", "macos-15"]
# Do not test against ESCU until known character encoding issue is resolved
# operating_system: ["ubuntu-20.04", "ubuntu-22.04", "macos-latest", "macos-14", "windows-2022"]

Expand All @@ -36,6 +35,7 @@ jobs:
with:
path: security_content
repository: splunk/security_content
ref: rba_migration

#Install the given version of Python we will test against
- name: Install Required Python Version
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ poetry.lock
# usual mac files
.DS_Store
*/.DS_Store
.ruff_cache

# custom
dist/*
Expand Down
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0 # Use the ref you want to point at
hooks:
- id: check-json
- id: check-symlinks
- id: check-yaml
- id: detect-aws-credentials
- id: detect-private-key
- id: forbid-submodules
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.2
hooks:
- id: ruff
args: [ --fix ]
- id: ruff-format
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"charliermarsh.ruff"
]
}
10 changes: 9 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
"python.testing.cwd": "${workspaceFolder}",
"python.languageServer": "Pylance",
"python.analysis.typeCheckingMode": "strict",
"editor.defaultFormatter": "ms-python.black-formatter"
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "charliermarsh.ruff",
},
"ruff.nativeServer": "on"


}
66 changes: 39 additions & 27 deletions contentctl/actions/build.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import sys

Check failure on line 1 in contentctl/actions/build.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (F401)

contentctl/actions/build.py:1:8: F401 `sys` imported but unused
import shutil
import os

Check failure on line 3 in contentctl/actions/build.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (F401)

contentctl/actions/build.py:3:8: F401 `os` imported but unused

from dataclasses import dataclass

from contentctl.objects.enums import SecurityContentProduct, SecurityContentType
from contentctl.objects.enums import SecurityContentType

Check failure on line 7 in contentctl/actions/build.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (F401)

contentctl/actions/build.py:7:38: F401 `contentctl.objects.enums.SecurityContentType` imported but unused
from contentctl.input.director import Director, DirectorOutputDto

Check failure on line 8 in contentctl/actions/build.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (F401)

contentctl/actions/build.py:8:39: F401 `contentctl.input.director.Director` imported but unused
from contentctl.output.conf_output import ConfOutput
from contentctl.output.conf_writer import ConfWriter
from contentctl.output.api_json_output import ApiJsonOutput
from contentctl.output.data_source_writer import DataSourceWriter
from contentctl.objects.lookup import Lookup
from contentctl.objects.lookup import CSVLookup, Lookup_Type
import pathlib
import json
import datetime
from typing import Union
import uuid

from contentctl.objects.config import build

Expand All @@ -34,27 +34,41 @@
updated_conf_files:set[pathlib.Path] = set()
conf_output = ConfOutput(input_dto.config)


# Construct a path to a YML that does not actually exist.
# We mock this "fake" path since the YML does not exist.
# This ensures the checking for the existence of the CSV is correct
data_sources_fake_yml_path = input_dto.config.getPackageDirectoryPath() / "lookups" / "data_sources.yml"

# Construct a special lookup whose CSV is created at runtime and
# written directly into the output folder. It is created with model_construct,
# not model_validate, because the CSV does not exist yet.
# written directly into the lookups folder. We will delete this after a build,
# assuming that it is successful.
data_sources_lookup_csv_path = input_dto.config.getPackageDirectoryPath() / "lookups" / "data_sources.csv"
DataSourceWriter.writeDataSourceCsv(input_dto.director_output_dto.data_sources, data_sources_lookup_csv_path)
input_dto.director_output_dto.addContentToDictMappings(Lookup.model_construct(description= "A lookup file that will contain the data source objects for detections.",
filename=data_sources_lookup_csv_path,
name="data_sources"))



DataSourceWriter.writeDataSourceCsv(input_dto.director_output_dto.data_sources, data_sources_lookup_csv_path)
input_dto.director_output_dto.addContentToDictMappings(CSVLookup.model_construct(name="data_sources",
id=uuid.UUID("b45c1403-6e09-47b0-824f-cf6e44f15ac8"),
version=1,
author=input_dto.config.app.author_name,
date = datetime.date.today(),
description= "A lookup file that will contain the data source objects for detections.",
lookup_type=Lookup_Type.csv,
file_path=data_sources_fake_yml_path))
updated_conf_files.update(conf_output.writeHeaders())
updated_conf_files.update(conf_output.writeObjects(input_dto.director_output_dto.detections, SecurityContentType.detections))
updated_conf_files.update(conf_output.writeObjects(input_dto.director_output_dto.stories, SecurityContentType.stories))
updated_conf_files.update(conf_output.writeObjects(input_dto.director_output_dto.baselines, SecurityContentType.baselines))
updated_conf_files.update(conf_output.writeObjects(input_dto.director_output_dto.investigations, SecurityContentType.investigations))
updated_conf_files.update(conf_output.writeObjects(input_dto.director_output_dto.lookups, SecurityContentType.lookups))
updated_conf_files.update(conf_output.writeObjects(input_dto.director_output_dto.macros, SecurityContentType.macros))
updated_conf_files.update(conf_output.writeObjects(input_dto.director_output_dto.dashboards, SecurityContentType.dashboards))
updated_conf_files.update(conf_output.writeLookups(input_dto.director_output_dto.lookups))
updated_conf_files.update(conf_output.writeDetections(input_dto.director_output_dto.detections))
updated_conf_files.update(conf_output.writeStories(input_dto.director_output_dto.stories))
updated_conf_files.update(conf_output.writeBaselines(input_dto.director_output_dto.baselines))
updated_conf_files.update(conf_output.writeInvestigations(input_dto.director_output_dto.investigations))
updated_conf_files.update(conf_output.writeMacros(input_dto.director_output_dto.macros))
updated_conf_files.update(conf_output.writeDashboards(input_dto.director_output_dto.dashboards))
updated_conf_files.update(conf_output.writeMiscellaneousAppFiles())




#Ensure that the conf file we just generated/update is syntactically valid
for conf_file in updated_conf_files:
ConfWriter.validateConfFile(conf_file)
Expand All @@ -67,17 +81,15 @@
if input_dto.config.build_api:
shutil.rmtree(input_dto.config.getAPIPath(), ignore_errors=True)
input_dto.config.getAPIPath().mkdir(parents=True)
api_json_output = ApiJsonOutput()
for output_objects, output_type in [(input_dto.director_output_dto.detections, SecurityContentType.detections),
(input_dto.director_output_dto.stories, SecurityContentType.stories),
(input_dto.director_output_dto.baselines, SecurityContentType.baselines),
(input_dto.director_output_dto.investigations, SecurityContentType.investigations),
(input_dto.director_output_dto.lookups, SecurityContentType.lookups),
(input_dto.director_output_dto.macros, SecurityContentType.macros),
(input_dto.director_output_dto.deployments, SecurityContentType.deployments)]:
api_json_output.writeObjects(output_objects, input_dto.config.getAPIPath(), input_dto.config.app.label, output_type )


api_json_output = ApiJsonOutput(input_dto.config.getAPIPath(), input_dto.config.app.label)
api_json_output.writeDetections(input_dto.director_output_dto.detections)
api_json_output.writeStories(input_dto.director_output_dto.stories)
api_json_output.writeBaselines(input_dto.director_output_dto.baselines)
api_json_output.writeInvestigations(input_dto.director_output_dto.investigations)
api_json_output.writeLookups(input_dto.director_output_dto.lookups)
api_json_output.writeMacros(input_dto.director_output_dto.macros)
api_json_output.writeDeployments(input_dto.director_output_dto.deployments)


#create version file for sse api
version_file = input_dto.config.getAPIPath()/"version.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@
from contentctl.actions.detection_testing.infrastructures.DetectionTestingInfrastructure import DetectionTestingInfrastructure
from contentctl.actions.detection_testing.infrastructures.DetectionTestingInfrastructureContainer import DetectionTestingInfrastructureContainer
from contentctl.actions.detection_testing.infrastructures.DetectionTestingInfrastructureServer import DetectionTestingInfrastructureServer
from urllib.parse import urlparse

Check failure on line 6 in contentctl/actions/detection_testing/DetectionTestingManager.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (F401)

contentctl/actions/detection_testing/DetectionTestingManager.py:6:26: F401 `urllib.parse.urlparse` imported but unused
from copy import deepcopy

Check failure on line 7 in contentctl/actions/detection_testing/DetectionTestingManager.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (F401)

contentctl/actions/detection_testing/DetectionTestingManager.py:7:18: F401 `copy.deepcopy` imported but unused
from contentctl.objects.enums import DetectionTestingTargetInfrastructure
import signal
import datetime
# from queue import Queue
from dataclasses import dataclass
# import threading
import ctypes

Check failure on line 13 in contentctl/actions/detection_testing/DetectionTestingManager.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (F401)

contentctl/actions/detection_testing/DetectionTestingManager.py:13:8: F401 `ctypes` imported but unused
from contentctl.actions.detection_testing.infrastructures.DetectionTestingInfrastructure import (
DetectionTestingInfrastructure,

Check failure on line 15 in contentctl/actions/detection_testing/DetectionTestingManager.py

View workflow job for this annotation

GitHub Actions / lint

Ruff (F811)

contentctl/actions/detection_testing/DetectionTestingManager.py:15:5: F811 Redefinition of unused `DetectionTestingInfrastructure` from line 3
DetectionTestingManagerOutputDto,
)
from contentctl.actions.detection_testing.views.DetectionTestingView import (
Expand Down
Loading
Loading