From bcee80029dc1ff1042e7abc8f84c3f102704cfe5 Mon Sep 17 00:00:00 2001 From: Bhavin Patel Date: Thu, 22 Jun 2023 16:26:43 -0700 Subject: [PATCH 1/4] new line check --- .../contentctl_core/domain/entities/detection.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bin/contentctl_project/contentctl_core/domain/entities/detection.py b/bin/contentctl_project/contentctl_core/domain/entities/detection.py index fe3fdfe2b6..2f534bcd51 100644 --- a/bin/contentctl_project/contentctl_core/domain/entities/detection.py +++ b/bin/contentctl_project/contentctl_core/domain/entities/detection.py @@ -6,6 +6,7 @@ from pydantic import BaseModel, validator, root_validator from dataclasses import dataclass from datetime import datetime from typing import Union +import re from bin.contentctl_project.contentctl_core.domain.entities.security_content_object import ( @@ -139,6 +140,15 @@ class Detection(BaseModel, SecurityContentObject): raise ValueError("name is longer then 67 chars: " + values["name"]) return values + + @root_validator + def description_new_line_check(cls, values): + # Check if there is a new line in description that is not escaped + pattern = r'(? Date: Sat, 1 Jul 2023 23:37:35 +0000 Subject: [PATCH 2/4] Bump pytest from 7.3.1 to 7.4.0 Bumps [pytest](https://github.com/pytest-dev/pytest) from 7.3.1 to 7.4.0. - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pytest-dev/pytest/compare/7.3.1...7.4.0) --- updated-dependencies: - dependency-name: pytest dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 040431fd41..26da9fca96 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ pycvesearch==1.2 pydantic==1.10.8 pysigma==0.9.8 pysigma-backend-splunk==1.0.2 -pytest==7.3.1 +pytest==7.4.0 PyYAML>=5.4.1 questionary==1.10.0 requests==2.31.0 From 7ade494863dbcd0927b5b7cf26d09fe2db6db305 Mon Sep 17 00:00:00 2001 From: Bhavin Patel Date: Tue, 11 Jul 2023 14:16:33 -0500 Subject: [PATCH 3/4] check for howto --- .../contentctl_core/domain/entities/detection.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/contentctl_project/contentctl_core/domain/entities/detection.py b/bin/contentctl_project/contentctl_core/domain/entities/detection.py index 2f534bcd51..bc9ed22270 100644 --- a/bin/contentctl_project/contentctl_core/domain/entities/detection.py +++ b/bin/contentctl_project/contentctl_core/domain/entities/detection.py @@ -142,11 +142,14 @@ class Detection(BaseModel, SecurityContentObject): @root_validator - def description_new_line_check(cls, values): - # Check if there is a new line in description that is not escaped + def new_line_check(cls, values): + # Check if there is a new line in description and how to implement that is not escaped pattern = r'(? Date: Tue, 11 Jul 2023 12:57:22 -0700 Subject: [PATCH 4/4] Update error message to be more descriptive for newline validation. --- .../contentctl_core/domain/entities/detection.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/contentctl_project/contentctl_core/domain/entities/detection.py b/bin/contentctl_project/contentctl_core/domain/entities/detection.py index bc9ed22270..57d1c1a02a 100644 --- a/bin/contentctl_project/contentctl_core/domain/entities/detection.py +++ b/bin/contentctl_project/contentctl_core/domain/entities/detection.py @@ -146,10 +146,15 @@ class Detection(BaseModel, SecurityContentObject): # Check if there is a new line in description and how to implement that is not escaped pattern = r'(?