-
Notifications
You must be signed in to change notification settings - Fork 61
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
ResultsTransformer interface #466
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #466 +/- ##
========================================
Coverage 98.18% 98.19%
========================================
Files 70 71 +1
Lines 7458 7464 +6
========================================
+ Hits 7323 7329 +6
Misses 135 135
Continue to review full report at Codecov.
|
def set_timestamp(value: str) -> None: | ||
"""Set the default timestamp value.""" | ||
datetime.datetime.strptime(value, '%Y-%m-%dT%H:%M:%S%z') | ||
TaniumTransformer._timestamp = value | ||
|
||
@staticmethod | ||
def get_timestamp() -> str: | ||
"""Get the default timestamp value.""" | ||
return TaniumTransformer._timestamp |
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.
@degenaro do you think timestamp is something we should generically make available as part of the base class? I see it as been something that is generic enough it might be worthwhile (as a future enhancement).
Will not block the PR but feedback would be appreciated.
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.
LGTM
@fsuits to add transformer registration prior to the PR being merged.
Signed-off-by: FrankSuits <frankst@au1.ibm.com>
Signed-off-by: FrankSuits <frankst@au1.ibm.com>
…former interface (#466) * ResultsTransformer interface * remove trestle.utils.tanium * remove trestle.utils.tanium.py * added registration of tanium transformer Signed-off-by: FrankSuits <frankst@au1.ibm.com> * added name for registration Signed-off-by: FrankSuits <frankst@au1.ibm.com> Co-authored-by: Chris Butler <chris@thebutlers.me> Co-authored-by: FrankSuits <frankst@au1.ibm.com> Signed-off-by: Vikas <avikas@in.ibm.com>
* changed print to logger * Added experiments profiling setup Signed-off-by: Chris Butler <chris@thebutlers.me> * added flah to benchmark with or without json serialization * readme file for assessment. result object * changed prinet to logger Signed-off-by: Vikas <avikas@in.ibm.com> * feat: Update NIST models to latest including refactors & UT's * feat:Update Oscal version Signed-off-by: Chris Butler <chris@thebutlers.me> * transformer changes with respect to OSCAL 1.0.0 rc2 * update documentation (transform results) * multiple changes for latest nist - some tests still fail Signed-off-by: FrankSuits <frankst@au1.ibm.com> * removed ssp validate test Signed-off-by: FrankSuits <frankst@au1.ibm.com> * fixed code format Signed-off-by: FrankSuits <frankst@au1.ibm.com> * fix:Reworking generators Signed-off-by: Chris Butler <chris@thebutlers.me> * cleaned up gen-oscal.py and regenerated the oscal models. Signed-off-by: FrankSuits <frankst@au1.ibm.com> Co-authored-by: Chris Butler <chris@thebutlers.me> Co-authored-by: degenaro <lou.degenaro@gmail.com> Signed-off-by: Vikas <avikas@in.ibm.com> * 0.11.0 Automatically generated by python-semantic-release Signed-off-by: Vikas <avikas@in.ibm.com> * feat:Improved serialisation support for OscalBaseModel (#454) * feat:Improved serialization support. Signed-off-by: Chris Butler <chris@thebutlers.me> * fix:Serializing by appropriate key and minimizing file size. Signed-off-by: Chris Butler <chris@thebutlers.me> Signed-off-by: Vikas <avikas@in.ibm.com> * Feat:transformer factory (#455) * initial prototype of transformer factory Signed-off-by: FrankSuits <frankst@au1.ibm.com> * added singleton transformer factory Signed-off-by: FrankSuits <frankst@au1.ibm.com> * added base transformer class Signed-off-by: FrankSuits <frankst@au1.ibm.com> * more fixes and added tests Signed-off-by: FrankSuits <frankst@au1.ibm.com> * added test for transform factory Signed-off-by: FrankSuits <frankst@au1.ibm.com> * restructured, added more docs and tests. Signed-off-by: FrankSuits <frankst@au1.ibm.com> * removed bad file names. Signed-off-by: FrankSuits <frankst@au1.ibm.com> * fix:Typing information Signed-off-by: Chris Butler <chris@thebutlers.me> Co-authored-by: Chris Butler <chris@thebutlers.me> Signed-off-by: Vikas <avikas@in.ibm.com> * 0.12.0 Automatically generated by python-semantic-release Signed-off-by: Vikas <avikas@in.ibm.com> * Added experiments profiling setup Signed-off-by: Chris Butler <chris@thebutlers.me> Signed-off-by: Vikas <avikas@in.ibm.com> * added flah to benchmark with or without json serialization Signed-off-by: Vikas <avikas@in.ibm.com> * readme file for assessment. result object Signed-off-by: Vikas <avikas@in.ibm.com> * feat: Update of OSCAL schema to 1.0.0-rc2 (#465) * feat:Update core OSCAL schema Signed-off-by: Chris Butler <chris@thebutlers.me> * fix:Corrected OSCAL version in the docs Signed-off-by: Chris Butler <chris@thebutlers.me> Signed-off-by: Vikas <avikas@in.ibm.com> * fix: Cleanup of fs.py to allow relative and absolute paths (#464) * cleanup of fs.py to allow relative and absolute paths Signed-off-by: FrankSuits <frankst@au1.ibm.com> * global change of absolute() to resolve() Signed-off-by: FrankSuits <frankst@au1.ibm.com> Co-authored-by: Chris Butler <chris@thebutlers.me> Signed-off-by: Vikas <avikas@in.ibm.com> * feat: Tanium to oscal tranform refactored to exploit the ResultsTransformer interface (#466) * ResultsTransformer interface * remove trestle.utils.tanium * remove trestle.utils.tanium.py * added registration of tanium transformer Signed-off-by: FrankSuits <frankst@au1.ibm.com> * added name for registration Signed-off-by: FrankSuits <frankst@au1.ibm.com> Co-authored-by: Chris Butler <chris@thebutlers.me> Co-authored-by: FrankSuits <frankst@au1.ibm.com> Signed-off-by: Vikas <avikas@in.ibm.com> * 0.13.0 Automatically generated by python-semantic-release Signed-off-by: Vikas <avikas@in.ibm.com> * fix:Corrected transforms behaviour and added example script. (#468) Signed-off-by: Chris Butler <chris@thebutlers.me> Signed-off-by: Vikas <avikas@in.ibm.com> * 0.13.1 Automatically generated by python-semantic-release Signed-off-by: Vikas <avikas@in.ibm.com> * chore: Update pre-commit markdown formatting (#476) Signed-off-by: Chris Butler <chris@thebutlers.me> Signed-off-by: Vikas <avikas@in.ibm.com> * fix:Moved directories to fix testing errors. Signed-off-by: Chris Butler <chris@thebutlers.me> * fix:Moved directories to fix testing errors. Signed-off-by: Chris Butler <chris@thebutlers.me> * chnaged benchmark to use transform API * removed script reslted to thrid party - exchange protocol, observations and their tests * fix:Perf tuning of OscalBaseModel serialization. Signed-off-by: Chris Butler <chris@thebutlers.me> * fix:Mkdocs automation Signed-off-by: Chris Butler <chris@thebutlers.me> * fix:Mkdocs automation Signed-off-by: Chris Butler <chris@thebutlers.me> Co-authored-by: Vikas <avikas@in.ibm.com> Co-authored-by: Chris Butler <chris@thebutlers.me> Co-authored-by: Frank Suits <47203786+fsuits@users.noreply.github.com> Co-authored-by: degenaro <lou.degenaro@gmail.com> Co-authored-by: semantic-release <semantic-release> Co-authored-by: FrankSuits <frankst@au1.ibm.com>
Types of changes
Description
Addresses 1/2 of issue #452