Skip to content

Conversation

pyth0n1c
Copy link
Contributor

@pyth0n1c pyth0n1c commented Dec 7, 2023

Move to Pydantic2 and massively increase typing, inheritance/code reuse, and inline documentation for types around all contentctl objects.

Reduce the number of custom validators and leverage more built-in types, Enumerations, and Pydantic Field validators (for example, using regular expressions).

This will also move to Pydantic2, allowing significantly better, faster validation. In many cases, speedups of 5-50x are possible!

object fields.  Still not enough to
run for testing.
TestConfig.yml file and some
others for more pydantic2
compliance
and the Detection Tags object (and other
required places)
to run baseline searches in testing. Comment
out SSA validations for now
for some optional fields.
calls, which is required for pydantic2.
create more enums and add types to more
fields
dead code, attemping to resolve
pervasive circular import issue
the changes are correct.  Switched to much
faster yml reader.
objects that contain other, nested
SecurityContentObjects
build process of Objects and resolve
some import errors.
Looser restrictions on length for
str fields in detection.
added types. Most notably, now
validate the name field against the
filename of a piece of content to
ensure correct format.
improve name/filename checking.  make
filename optional for runtime created
security content objects such as filter macros.
SPL when searching for macros.
baselines and enrich with other content
in a generic way.
re-add data_source field to detection,
although it is currently commented out
due to significant failures.
Finally, add most of the code to support
atomic_red_team parsing guid parsing
and validation.

class ConfigBuild(BaseModel):
@field_serializer('hardcoded_path',when_used='always')
def serialize_path(path: Union[AnyUrl, pathlib.Path])->str:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the typing Union[AnyUrl, pathlib.Path] here but Optional[Union[FilePath,HttpUrl]] in the attribute definition?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we planning on retaining the read_test_config function for now?

pyth0n1c and others added 22 commits May 2, 2024 07:54
against old release notes and was
identical. output looks much different
now because each section is alphabetically sorted.
generation process
release_notes files in dist
starting any containers, not while
the containers are running
individually in each container.
after starting. this intentionally
prints the username and password
to the command line because
it is a LOCAL container only.
test servers does NOT print
this information
fixed to print correct values
to avoid strange CI/CD errors and
eliminate MASSIVE output on
every single tqdm refresh
(about once a second or more)
is not never_pause, then throw an exception.
also give improved documentation around
these settings.
--suppress-tqdm to --disable-tqdm
was not being respected. Fix undefined python
behavior where during filtering of detections,
we were deleting items from the list while iterating
over it.
fixed possible serialization issue
when writing test_plan file
to be installed for
enable-integration-testing
to be an informational message.
This may be a harder constraint
again in the future.
CIM as well to help with
integration testing
test_Servers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants