-
Notifications
You must be signed in to change notification settings - Fork 41
Pydantic2 #90
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
Conversation
to pydanticV2
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.
As yet untested.
baselines and enrich with other content in a generic way.
serialization fixes
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.
by guid
|
||
class ConfigBuild(BaseModel): | ||
@field_serializer('hardcoded_path',when_used='always') | ||
def serialize_path(path: Union[AnyUrl, pathlib.Path])->str: |
There was a problem hiding this comment.
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?
contentctl/actions/detection_testing/infrastructures/DetectionTestingInfrastructureContainer.py
Show resolved
Hide resolved
contentctl/helper/config_handler.py
Outdated
There was a problem hiding this comment.
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?
yml writer.
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.
in github actions
Adding deprecated notes
disable-tqdm
--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
Additional Pydantic2 content
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!