<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2017-02-21 16:32 GMT+02:00 Pino Toscano <span dir="ltr"><<a target="_blank" href="mailto:ptoscano@redhat.com">ptoscano@redhat.com</a>></span>:<br><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><span>On Monday, 20 February 2017 13:46:29 CET NoxDaFox wrote:<br>
> 2017-02-20 12:26 GMT+02:00 Daniel P. Berrange <<a target="_blank" href="mailto:berrange@redhat.com">berrange@redhat.com</a>>:<br>
><br>
> > On Sun, Feb 19, 2017 at 07:09:51PM +0200, Matteo Cafasso wrote:<br>
> > > Rebase patches on top of 1.35.25.<br>
> > ><br>
> > > No changes since last series.<br>
> ><br>
> > Can you explain the motivation behind adding the APis to libguestfs ?<br>
> ><br>
> > Since the libguestfs VM is separate from the real VM, it can't<br>
> > be relying on any live process state to scan for malicious code,<br>
> > so must be exclusively considering the file contents.<br>
> ><br>
> This is the use case. For the former one, there are tools such as Rekall<br>
> and Volatility which already do a great job.<br>
><br>
> <a target="_blank" rel="noreferrer" href="http://www.rekall-forensic.com/">http://www.rekall-forensic.com<wbr>/</a><br>
> <a target="_blank" rel="noreferrer" href="http://www.volatilityfoundation.org/">http://www.volatilityfoundatio<wbr>n.org/</a><br>
><br>
> > Could yara not simply use the existing libguestfs APIs to do its<br>
> > work. At the simplest case this might be having the FS fuse mounted<br>
> > at a location. Alternatively having it directly use the C API to<br>
> > access content it needs would be safer against malicious symlinks.<br>
><br>
> There are both security and performance implication in using the FS fuse<br>
> locally mounted.<br>
<br>
</span>IMHO the ideal way would be having yara access files inside disks using<br>
libguestfs. libyara already has APIs for scanning files from different<br>
input types, i.e. yr_rules_scan_* -- what is missing is a generic I/O<br>
implementation, which could be easy to wire up using the existing<br>
YR_STREAM stuff.<br>
<br>
This would mean that:<br>
a) disks are accessed only within libguestfs<br>
b) the yara API accesses files normally<br>
c) nothing is mounted on the host<br></blockquote><div> </div>Streaming APIs might be very useful indeed but the use case I have in mind is a bit different.<br><br></div><div class="gmail_quote">The advantage of having tools such as Yara, Grep, Hivex and Libmagic integrated within libguestfs is the added security layer.<br><br></div><div class="gmail_quote">Exploits are data driven, the way such data is accessed does not matter. What matter is where that data is accessed. <br>Streaming the data out from libguestfs would not bring great benefits neither performance nor security wise. <br>It might actually increase the attack surface as the vulnerability could hide both on the tool and on libguestfs streaming interface.<br><br></div><div class="gmail_quote">IMHO a non intrusive integration altogether with plugin-type packages would bring the best benefit to the Users.<br></div><div class="gmail_quote"> - libguestfs<br></div><div class="gmail_quote"> - libguestfs-forensics<br></div><div class="gmail_quote"> - libguestfs-recovery<br> - ...<br><br></div><div class="gmail_quote">If I'm not mistaken, libguestfs already supports such architecture.<br><br></div><div class="gmail_quote"><span class="gmail-m_-4111386788668970312HOEnZb"></span><br><span class="gmail-m_-4111386788668970312HOEnZb"></span></div><div class="gmail_quote"><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><span class="gmail-m_-4111386788668970312HOEnZb"><font color="#888888">
--<br>
Pino Toscano</font></span><br>______________________________<wbr>_________________<br>
Libguestfs mailing list<br>
<a target="_blank" href="mailto:Libguestfs@redhat.com">Libguestfs@redhat.com</a><br>
<a target="_blank" rel="noreferrer" href="https://www.redhat.com/mailman/listinfo/libguestfs">https://www.redhat.com/mailman<wbr>/listinfo/libguestfs</a><br></blockquote></div><br></div></div>