Skip to content

Commit b00b0af

Browse files
committed
[client] Enhance attack patterns / tags upsert
1 parent c60df86 commit b00b0af

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

pyobas/apis/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from .organization import * # noqa: F401,F403
1212
from .payload import * # noqa: F401,F403
1313
from .security_platform import * # noqa: F401,F403
14+
from .tag import * # noqa: F401,F403
1415
from .team import * # noqa: F401,F403
1516
from .user import * # noqa: F401,F403
1617

pyobas/apis/attack_pattern.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,15 @@ class AttackPatternManager(RESTManager):
1414

1515
@exc.on_http_error(exc.OpenBASUpdateError)
1616
def upsert(
17-
self, attack_patterns: List[Dict[str, Any]], **kwargs: Any
17+
self,
18+
attack_patterns: List[Dict[str, Any]],
19+
ignore_dependencies: bool = False,
20+
**kwargs: Any,
1821
) -> Dict[str, Any]:
19-
data = {"attack_patterns": attack_patterns}
22+
data = {
23+
"attack_patterns": attack_patterns,
24+
"ignore_dependencies": ignore_dependencies,
25+
}
2026
path = f"{self.path}/upsert"
2127
result = self.openbas.http_post(path, post_data=data, **kwargs)
2228
return result

pyobas/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ def __init__(
7070
self.payload = apis.PayloadManager(self)
7171
self.security_platform = apis.SecurityPlatformManager(self)
7272
self.inject_expectation_trace = apis.InjectExpectationTraceManager(self)
73+
self.tag = apis.TagManager(self)
7374

7475
@staticmethod
7576
def _check_redirects(result: requests.Response) -> None:

0 commit comments

Comments
 (0)