Skip to content

(DO BE DELETED when #296 is in) Stack Evidence types#261

Closed
rgayon wants to merge 20 commits into
google:masterfrom
rgayon:stack-evidence
Closed

(DO BE DELETED when #296 is in) Stack Evidence types#261
rgayon wants to merge 20 commits into
google:masterfrom
rgayon:stack-evidence

Conversation

@rgayon

@rgayon rgayon commented Sep 24, 2018

Copy link
Copy Markdown
Collaborator

Evidence types are "stacked". As in, Evidence1 inheriting Evidence2, will call its parent's pre & post processor.

We also add a "copy context" method, that should be called when a new Evidence "Child" is generated in a Task that is currently analyzing Evidence "Parent", that will be processed by other types. This method ensures the state of Parent is passed down to Children, so that all required post&pre processing will be done properly, to access data in Children.

The problem with the current solution is that new Evidence types are expected to properly implement this method, while making sure to not overwrite its parent attribute.
One solution I found is https://gist.github.com/rgayon/f1af6b32c316a67f72a37697a3c7e4c9 albeit quite disgusting :(

@rgayon rgayon changed the title Stack evidence Wip: Stack evidence Sep 24, 2018
@rgayon rgayon changed the title Wip: Stack evidence Stack Evidence types Sep 27, 2018
@rgayon rgayon requested a review from aarontp September 27, 2018 12:36

@aarontp aarontp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LG in general, but I think there's one method invocation that still needs to change. I'll take a closer look at your state management code tomorrow to see if there's something similar we can do. Another option might be to keep a chain of Evidence, and when new Evidence is created we can pass in the previous evidence as a linked parent. There's gotta be a way we can use blockchains to solve this, ;)

Comment thread turbinia/evidence.py Outdated
google_cloud.PostprocessDetachDisk(self.disk_name, self.local_path)
mount_local.PostprocessUnmountPath(self.mount_path)
mount_local.PostprocessDeleteLosetup(self.loopdevice_path)
super(GoogleCloudDiskRawEmbedded, self).post()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Shouldn't this be postprocess()?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yest it should. fixed

Comment thread turbinia/evidence.py
@rgayon rgayon requested a review from aarontp October 3, 2018 13:54
@aarontp

aarontp commented Oct 4, 2018 via email

Copy link
Copy Markdown
Member

@rgayon

rgayon commented Oct 4, 2018

Copy link
Copy Markdown
Collaborator Author

That's also one other approach I had in mind for sharing context, but then there has to be a way to make sure an "Evidence consuming & generating task" doesn't post process an input Evidence until the new output evidence has been analyzed by all the other tasks.
Do you have an example piece of code?

@rgayon rgayon changed the title Stack Evidence types WIP: Stack Evidence types Nov 16, 2018
@rgayon rgayon changed the title WIP: Stack Evidence types (DO BE DELETED when #296 is in) Stack Evidence types Nov 27, 2018
@rgayon

rgayon commented Dec 6, 2018

Copy link
Copy Markdown
Collaborator Author

This is obsolete now, replaced by #296

@rgayon rgayon closed this Dec 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants