Intro to a linux interface for on access scanning
cover Intro to a linux interface for on access scanning
Please contact me privately or (preferably the list) for questions, comments, discussions, flames, names, or anything. I'll do complete rewrites of the patches if someone tells me how they don't meet their needs or how they can be done better. I'm here to try to bridge the needs (and wants) of the anti-malware vendors with the technical realities of the kernel. So everyone feel free to throw in your two cents and I'll try to reconcile it all. These 5 patches are part 1. They give us a working able solution.
Quoted 1 line
From my point of view patches forthcoming and mentioned below should
help with performance for those who actually have userspace scanners but also could presents be implemented using this framework.
Background
++++++++++
There is a consensus in the security industry that protecting against malicious files (viruses, root kits, spyware, ad-ware, ...) by the way of so-called on-access scanning is usable and reasonable approach. Currently the Linux kernel does not offer a completely suitable interface to implement such security solutions. Present solutions involve overwriting function pointers in the LSM, in filesystem operations, in the sycall table, and other fragile hacks. The purpose of this project is to create a fast, clean interface for userspace programs to look for malware when files are accessed. This malware may be ultimately intended for this or some other Linux machine or may be malware intended to attack a host running a different operating system and is merely in transit across the Linux server. Since there are almost an infinite number of ways in which information can enter and exit a server it is not seen as reasonable to move these checks to all the applications at the boundary (MTA, NFS, CIFS, SSH, rsync, et al.) to look for such malware on at the border.
For this Linux kernel interface speed is of particular interest for those who have it compiled into the kernel but have no userspace client. There must be no measurable performance hit to just compiling this into the kernel.
Security vendors, Linux distributors and other interested parties have come together on the malware-list mailing list to discuss this problem and see if they can work together to propose a solution. During these talks couple of requirement sets were posted with the aim of fleshing out common needs as a prerequisite of creating an interface prototype.
Collated requirements
+++++++++++++++++++++
1. Intercept file opens (exec also) for vetting (block until decision is made) and allow some userspace black magic to make decisions.
2. Intercept file closes for scanning post access
3. Cache scan results so the same file is not scanned on each and every access
4. Ability to flush the cache and cause all files to be re-scanned when accessed
5. Define which filesystems are cacheable and which are not
6. Scan files directly not relying on path. Avoid races and problems with namespaces, chroot, containers, etc.
7. Report other relevant file, process and user information associated with each interception
8. Report file pathnames to userspace (relative to process root, current working directory)
9. Mark a processes as exempt from on access scanning
10. Exclude sub-trees from scanning based on filesystem (exclude procfs, sysfs, devfs)
11. Exclude sub-trees from scanning based on filesystem path
12. Include only certain sub-trees from scanning based on filesystem path
13. Register more than one userspace client in which case behavior is restrictive
Discussion of requirements
++++++++++++++++++++++++++
The initial patch set with NOT meet all of these 'requirements.' Some will be implemented at a later time and some will never be implemented. Specifics are detailed below. There is no intention to (abu)use the LSM for this purpose. The LSM provides complete internal kernel mandatory access controls. It is not intended for userspace scanning and detection. Users should not be forced to choose between an in kernel mandatory access control policy and this additional userspace file access. LSM stacking is NOT as option as has been demonstrated repeatedly.
1., 2. Basic interception
-------------------------
Core requirement is to intercept access to files and prevent it if malicious content is detected. This is done on open, not on read. It may be possible to do read time checking with minimal performance impact although not currently implemented. This means that the following race is possible
Process1 Process2
- open file RD
- open file WR
- write virus data (1)
- read virus data
*note that any open after (1) will get properly vetted. At this time the likely hood of this being a problem vs the performance impact of scanning on read and the increased complexity of the code means this is left out. This should not be a problem for local executables as writes to files opened to be run typically return ETXTBSY.
To accomplish that two hooks were inserted, on file open in __dentry_open and in filp_close on file close. In both cases the file object in question is passed as a parameter for further processing. In case of an open the operation can actually be blocked, while closes are always immediately successful and will not cause additional blocking. Results of a close are returned to the kernel asynchronously and may be used to cache answers to speed up a future open.
Interception processing is done by way of three chains of filters. Access requests are first send to the "evaluation" chain. Depending on the results of the evaluation the decision is then send to either the allow chain or the deny chain.
There are three basic responses each filter can make - to be indifferent or either allow or deny access to the file. The filter may also allow or deny access to a file while not caching that result.
One of the most important filters in the evaluation chain implements an interface through which an userspace process can register and receive vetting requests. Userspace process opens a misc character device to express its interest and then receives binary structures from that device describing basic interception information. After file contents have been scanned a vetting response is sent by writing a different binary structure back to the device and the intercepted process continues its execution. These are not done over network sockets and no endian conversions are done. The client and the kernel must have the same endian configuration.
3., 4. Caching
---------------
To avoid scanning unchanged files on every access which would be very bad for performance some sort of caching is needed. Although possible to implement a cache in userspace having two context switches required for every open is clearly not fast. We implemented it per inode object as a serial number compared with a single global monotonically increasing system serial number.
The cache filter is inserted into the evaluation chain before the userspace client filter and if the inode serial number is equal to the system one it allows access to the file.
If the file is seen for the first time, has been modified, or for any other reason has a serial number less than the system one the cache filter will be 'indifferent' and processing of the given vetting request will continue down the evaluation chain. When some filter (only Userspace in the first patch set) allows access to a file its inode serial number is set to the system global which effectively makes it cached. Also, when a write access is gained for a file the serial number will automatically be reset as well as when any process actually writes to that file.
Cache flushing is possible by simply increasing the global system serial number.
Both positive and negative vetting results are cached by the means of positive and negative serial numbers.
This method of caching has minimal impact on system resources while providing maximal effectiveness and simple implementation.
5. Fine-grained caching
-----------------------
It is necessary to select which filesystems can be safely cached and which must not be. For example it is not a good idea to allow caching of network filesystems because their content can be changed invisibly. Disk based and some virtual filesystems can be cached safely on the other hand.
This first proposal only partially implements this requirement. Only block device backed filesystems will be cached while there is no way to enable caching for things like tmpfs. Improving this is left out of the initial prototype. Although there may be additional work to implement caching for certain FS types there is no plan to greatly increase the scope of the cache granularity. There is no plan to cache based on the operation or things of that nature. Caching of this nature can be implemented in userspace if the vendor so chooses. We include only a minimal safe cache for performance reasons.
6. Direct access to file content
--------------------------------
When an userspace daemon receives a vetting request, it also receives a new RO file descriptor which provides direct access to the inode in question. This is to enable access to the file regardless of it accessibility from the scanner environment (consider process namespaces, chroot's, NFS). The userspace client is responsible for closing this file when it is finished scanning.
7. Other reporting
------------------
Along with the fd being installed in the scanning process the process gets a binary structure of data including:
+ uint32_t version; + uint32_t type; + int32_t fd; + uint32_t operation; + uint32_t flags; + uint32_t mode; + uint32_t uid; + uint32_t gid; + uint32_t tgid; + uint32_t pid;
8. Path name reporting
----------------------
When a malicious content is detected in a file it is important to be able to report its location so the user or system administrator can take appropriate actions.
This is implemented in a amazingly simple way which will hopefully avoid the controversy of some other solutions. Path name is only needed for reporting purposes and it is obtained by reading the symlink of the given file descriptor in /proc. Its as simple as userspace calling:
snprintf(link, sizeof(link), "/proc/self/fd/%d", details.fd); ret = readlink(link, buf, sizeof(buf)-1);
9. Process exclusion
--------------------
Sometimes it is necessary to exclude certain processes from being intercepted. For example it might be a userspace root kit scanner which would not be able to find root kits if access to them was blocked by the on-access scanner.
To facilitate that we have created a special file a process can open and register itself as excluded. A flag is then put into its kernel structure (task_struct) which makes it excluded from scanning.
This implementation is very simple and provides greatest performance. In the proposed implementation access to the exclusion device is controlled though permissions on the device node which are not sufficient. An LSM call will need to be made for this type or access in a later patch.
10. Filesystem exclusions
-------------------------
One pretty important optimization is not to scan things like /proc, /sys or similar. Basically all filesystems where user can not store arbitrary, potentially malicious, content could and should be excluded from scanning.
This interface prototype implements it as a run-time configurable list of filesystem names. Again it is a filter in the evaluation chain which can allow access before the request gets routed to the userspace client.
This will not be implemented in the first patch set but should be soon to follow. It is done by simply comparing strings between those supplied and the s_type->name field in an associated superblock.
11. Path exclusions
-------------------
The need for exclusions can be demonstrated with an example of a MySQL server. It's data files are frequently modified which means they would need to be constantly rescanned which is very bad for performance. Also, it is most often not even possible to reasonably scan them. Therefore the best solution is not to scan its database store which can simply be implemented by excluding the store subdirectory.
It is a relatively simple implementation which allows run-time configuration of a list of sub directories or files to exclude. Exclusion paths are relative to each process root. So for example if we want to exclude /var/lib/mysql/ and we have a mysql running in a chroot where from the outside that directory actually lives
in /chroot/mysql/var/lib/mysql, /var/lib/mysql should actually be added to the exclusion list.
This is also not included in the initial patch set but will be coming shortly after.
12. Path Inclusions
-------------------
Path-based inclusions are not implemented due to concerns with hard-linked files both inside and outside the included directories. It is too easy to fall into a sense of false security with path inclusions since the pathname is almost meaningless. If a vendor feels this is particularly important for them they will have to implement it in userspace by use of a judicious list of exclusion filters.
13. Multiple client registration with restrictive behavior
-----------------------------------------------------------
This is currently not implemented. Multiple clients can register but they will be used for (crappy) load balancing only. Not all will be called for a single interception. Only one of the registered clients will process a single interception. Desire here is to enable multiple clients servicing interceptions in parallel for performance and reliability reasons.
Requirement for serial and restrictive behavior would be slightly more complicated to implement because we would want to keep the current behavior as well. Or in other words we would need to have groups of multiple clients, where each interception would go through one client from each group with the desired restrictive behavior.
This may be left for a future implementation for simplicity reasons but I find it unlikely. If a vendor needs to send requests to multiple scanners they should be able to implement that serialization in userspace. I see no need for an in kernel event dispatcher. Note that the audit system had this same need and has done it as a userspace event dispatcher. We have also seen in the LSM that restrictive access stacking is not as easy as it sounds and has been abandoned.
Closing remarks
---------------
Although some may argue some of the filters are not necessary or may better be implemented in userspace, we think it is better to have them in kernel primarily for performance reasons. Secondly, it is all simple code not introducing much baggage or risk into the kernel itself. The most complex filter and the only one with locking ramifications is the userspace client vetting which calls into dentry_open() on both open and close operations. There is no locking around caching or process exclusions or other work.
**************************
The patches can be found in a git tree located:
http://git.infradead.org/users/eparis/talpa.git
since:
commit 2b12a4c524812fb3f6ee590a02e65b95c8c32229
Author: Linus Torvalds <[email protected]> Date: Fri Aug 1 14:59:11 2008 -0700
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
This tree will be rebased regularly, so please do not just start pulling and hoping it will continue to always merge. My current plan is to commit changes and comments on the end of this tree and eventually reroll those changes into these 5 patches for finally submission to upstream. Likely this will be an iterative process.
The 5 patches in the following e-mails can also be found at
http://people.redhat.com/~eparis/talpa
Documentation/talpa/allow_most.c | 138 ++++++++ Documentation/talpa/cache | 17 + Documentation/talpa/client | 85 +++++ Documentation/talpa/design.txt | 266 +++++++++++++++ Documentation/talpa/tecat.c | 50 ++ Documentation/talpa/test_deny.c | 356 ++++++++++++++++++++ Documentation/talpa/thread_exclude | 6 fs/inode.c | 6 fs/namei.c | 2 fs/open.c | 10 include/linux/fs.h | 5 include/linux/sched.h | 1 include/linux/talpa.h | 188 +++++++++++ security/Kconfig | 1 security/Makefile | 2 security/talpa/Kconfig | 51 +++ security/talpa/Makefile | 17 - security/talpa/talpa.h | 115 ++++++ security/talpa/talpa_allow_calls.h | 12 security/talpa/talpa_cache.c | 207 ++++++++++++ security/talpa/talpa_cache.h | 22 + security/talpa/talpa_client.c | 543 ++++++++++++++++++++++++++++++++ security/talpa/talpa_common.c | 56 +++ security/talpa/talpa_configuration.c | 156 +++++++++ security/talpa/talpa_deny_calls.h | 11 security/talpa/talpa_evaluation_calls.h | 42 ++ security/talpa/talpa_interceptor.c | 121 +++++++ security/talpa/talpa_thread_exclude.c | 67 +++ 28 files changed, 2546 insertions(+), 7 deletions(-)
Quoted 38 lines · Eric Paris
Please contact me privately or (preferably the list) for questions, comments, discussions, flames, names, or anything. I'll do complete rewrites of the patches if someone tells me how they don't meet their needs or how they can be done better. I'm here to try to bridge the needs (and wants) of the anti-malware vendors with the technical realities of the kernel. So everyone feel free to throw in your two cents and I'll try to reconcile it all. These 5 patches are part 1. They give us a working able solution.
Quoted 1 line
From my point of view patches forthcoming and mentioned below should
help with performance for those who actually have userspace scanners but also could presents be implemented using this framework.
Background
++++++++++
There is a consensus in the security industry that protecting against malicious files (viruses, root kits, spyware, ad-ware, ...) by the way of so-called on-access scanning is usable and reasonable approach. Currently the Linux kernel does not offer a completely suitable interface to implement such security solutions. Present solutions involve overwriting function pointers in the LSM, in filesystem operations, in the sycall table, and other fragile hacks. The purpose of this project is to create a fast, clean interface for userspace programs to look for malware when files are accessed. This malware may be ultimately intended for this or some other Linux machine or may be malware intended to attack a host running a different operating system and is merely in transit across the Linux server. Since there are almost an infinite number of ways in which information can enter and exit a server it is not seen as reasonable to move these checks to all the applications at the boundary (MTA, NFS, CIFS, SSH, rsync, et al.) to look for such malware on at the border.For this Linux kernel interface speed is of particular interest for those who have it compiled into the kernel but have no userspace client. There must be no measurable performance hit to just compiling this into the kernel.
Quoted 5 lines
Security vendors, Linux distributors and other interested parties have come together on the malware-list mailing list to discuss this problem and see if they can work together to propose a solution. During these talks couple of requirement sets were posted with the aim of fleshing out common needs as a prerequisite of creating an interface prototype.
These requirements were posted? Where? I don't recall seeing them.
Quoted 9 lines
Collated requirements
+++++++++++++++++++++
1. Intercept file opens (exec also) for vetting (block until decision is made) and allow some userspace black magic to make decisions.
2. Intercept file closes for scanning post access
3. Cache scan results so the same file is not scanned on each and every access
4. Ability to flush the cache and cause all files to be re-scanned when accessed
5. Define which filesystems are cacheable and which are not
Quoted 8 lines
6. Scan files directly not relying on path. Avoid races and problems with namespaces, chroot, containers, etc.
7. Report other relevant file, process and user information associated with each interception
8. Report file pathnames to userspace (relative to process root, current working directory)
9. Mark a processes as exempt from on access scanning
10. Exclude sub-trees from scanning based on filesystem (exclude procfs, sysfs, devfs)
11. Exclude sub-trees from scanning based on filesystem path
12. Include only certain sub-trees from scanning based on filesystem path
13. Register more than one userspace client in which case behavior is restrictive
I don't see anything in the list above that make this a requirement that the code to do this be placed within the kernel.
What is wrong with doing it in glibc or some other system-wide library (LD_PRELOAD hooks, etc.)?
Quoted 8 lines
1., 2. Basic interception
-------------------------
Core requirement is to intercept access to files and prevent it if malicious content is detected. This is done on open, not on read. It may be possible to do read time checking with minimal performance impact although not currently implemented. This means that the following race is possible
Quoted 5 lines
Process1 Process2
- open file RD
- open file WR
- write virus data (1)
- read virus data
Wonderful, we are going to implement a solution that is known to not work, with a trivial way around it?
Sorry, that's not going to fly.
Quoted 5 lines
*note that any open after (1) will get properly vetted. At this time the likely hood of this being a problem vs the performance impact of scanning on read and the increased complexity of the code means this is left out. This should not be a problem for local executables as writes to files opened to be run typically return ETXTBSY.
Are you sure about this?
Quoted 10 lines
One of the most important filters in the evaluation chain implements an interface through which an userspace process can register and receive vetting requests. Userspace process opens a misc character device to express its interest and then receives binary structures from that device describing basic interception information. After file contents have been scanned a vetting response is sent by writing a different binary structure back to the device and the intercepted process continues its execution. These are not done over network sockets and no endian conversions are done. The client and the kernel must have the same endian configuration.
How about the same 64/32bit requirement? Your implementation is incorrect otherwise.
(hint, your current patch is also wrong in this area, you should fix that up...)
And a binary structure? Ick, are you trying to make it hard for future expansions and such?
And why not netlink/network socket? Why a character device? You are already using securityfs, why not use a file node in there?
Quoted 8 lines
6. Direct access to file content
--------------------------------
When an userspace daemon receives a vetting request, it also receives a new RO file descriptor which provides direct access to the inode in question. This is to enable access to the file regardless of it accessibility from the scanner environment (consider process namespaces, chroot's, NFS). The userspace client is responsible for closing this file when it is finished scanning.
Is this secondary file handle properly checked for the security issues involved with such a thing? What happens if the userspace client does not close the file handle?
Quoted 4 lines
7. Other reporting
------------------
Along with the fd being installed in the scanning process the process gets a binary structure of data including:
What's with the love of binary structures? :)
Review
Quoted 10 lines
(quoted diff) +10
-0+ uint32_t version; + uint32_t type; + int32_t fd; + uint32_t operation; + uint32_t flags; + uint32_t mode; + uint32_t uid; + uint32_t gid; + uint32_t tgid; + uint32_t pid;
What happens when the world moves to 128bit or 64bit uids? (yes, I've seen proposals for such a thing...)
Why would userspace care about these meta-file things, what does it want with them?
Quoted 6 lines
8. Path name reporting
----------------------
When a malicious content is detected in a file it is important to be able to report its location so the user or system administrator can take appropriate actions.
Quoted 7 lines
This is implemented in a amazingly simple way which will hopefully avoid the controversy of some other solutions. Path name is only needed for reporting purposes and it is obtained by reading the symlink of the given file descriptor in /proc. Its as simple as userspace calling:
snprintf(link, sizeof(link), "/proc/self/fd/%d", details.fd); ret =readlink(link, buf, sizeof(buf)-1);
Cute hack. What's to keep it from racing with the fd changing from the original program?
Quoted 7 lines
9. Process exclusion
--------------------
Sometimes it is necessary to exclude certain processes from being intercepted. For example it might be a userspace root kit scanner which would not be able to find root kits if access to them was blocked by the on-access scanner.
Quoted 8 lines
To facilitate that we have created a special file a process can open and register itself as excluded. A flag is then put into its kernel structure (
task_struct) which makes it excluded from scanning.This implementation is very simple and provides greatest performance. In the proposed implementation access to the exclusion device is controlled though permissions on the device node which are not sufficient. An LSM call will need to be made for this type or access in a later patch.
Heh, so if you want to write a "virus" for Linux, just implement this flag. What's to keep a "rogue" program from telling the kernel that all programs on the system are to be excluded?
Quoted 6 lines
10. Filesystem exclusions
-------------------------
One pretty important optimization is not to scan things like /proc, /sys or similar. Basically all filesystems where user can not store arbitrary, potentially malicious, content could and should be excluded from scanning.
Why, does scanning these files take extra time? Just curious.
Quoted 17 lines
11. Path exclusions
-------------------
The need for exclusions can be demonstrated with an example of a MySQL server. It's data files are frequently modified which means they would need to be constantly rescanned which is very bad for performance. Also, it is most often not even possible to reasonably scan them. Therefore the best solution is not to scan its database store which can simply be implemented by excluding the store subdirectory.It is a relatively simple implementation which allows run-time configuration of a list of sub directories or files to exclude. Exclusion paths are relative to each process root. So for example if we want to exclude
/var/lib/mysql/and we have a mysql running in a chroot where from the outside that directory actually lives
in /chroot/mysql/var/lib/mysql,/var/lib/mysqlshould actually be added to the exclusion list.
Quoted 2 lines
This is also not included in the initial patch set but will be coming shortly after.
Again, what's to keep all files to be marked as excluded?
Quoted 5 lines
Closing remarks
---------------
Although some may argue some of the filters are not necessary or may better be implemented in userspace, we think it is better to have them in kernel primarily for performance reasons.
Why? What numbers do you have that say the kernel is faster in implementing this? This is the first mention of such a requirement, we need to see real data to back it up please.
Quoted 2 lines
Secondly, it is all simple code not introducing much baggage or risk into the kernel itself.
I disagree, see above.
thanks,
greg k-h
Quoted 3 lines · Greg KH
Quoted 3 lines
1. Intercept file opens (exec also) for vetting (block until decision is made) and allow some userspace black magic to make decisions.
NACK, this kind of policy should be done in kernelspace.
Quoted 1 line
Quoted 1 line
2. Intercept file closes for scanning post access
Not even possible for mmap, and dumb otherwise, NACK.
Quoted 1 line
Quoted 1 line
6. Scan files directly not relying on path. Avoid races and problems with namespaces, chroot, containers, etc.
Explain?
Quoted 1 line
Quoted 1 line
9. Mark a processes as exempt from on access scanning
Nack, this completely defeats the purpose.
Quoted 2 lines
Quoted 2 lines
11. Exclude sub-trees from scanning based on filesystem path
12. Include only certain sub-trees from scanning based on filesystem path
Nack, please no pathname based idiocies.
Quoted 6 lines · Christoph Hellwig
Quoted 3 lines · Greg KH
Quoted 3 lines
1. Intercept file opens (exec also) for vetting (block until decision is made) and allow some userspace black magic to make decisions.
NACK, this kind of policy should be done in kernelspace.
What? You want to write and in kernel scanner for Window viruses?
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
2. Intercept file closes for scanning post access
Not even possible for mmap, and dumb otherwise, NACK.
I don't know when files get closed and can't preemptively scan to make sure it is clean for the next open? Any writes are going to invalidate the allow/deny cache....
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
6. Scan files directly not relying on path. Avoid races and problems with namespaces, chroot, containers, etc.
Explain?
The data connected with the file being opened must as reasonably as possible be the data the 'scanner' looks at. Some foolish early discussion wanted to do simplistic things like pass a pathname to a scanner and have it call open on that path name. I'm willing to entertain any other method of making the scanner look at the data the process is about to get.
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
9. Mark a processes as exempt from on access scanning
Nack, this completely defeats the purpose.
What? it allows a process to open a file that contains malware, how is that horrible. If a process says "I want to see malware" it can then see malware. Doesn't in any way affect other processes or the system security as a whole. If 'bad' data gets into a file its going to get blocked from everything that doesn't actively choose to see it.
Quoted 5 lines
Quoted 3 lines
Quoted 3 lines
11. Exclude sub-trees from scanning based on filesystem path
12. Include only certain sub-trees from scanning based on filesystem pathNack, please no pathname based idiocies.
Go read the long explainations, I already rules out path based inclusions. I'm leaving exclusions up for grabs since I don't see it weakening the security model.
Quoted 9 lines · Eric Paris
Quoted 6 lines · Christoph Hellwig
Quoted 3 lines · Greg KH
Quoted 3 lines
1. Intercept file opens (exec also) for vetting (block until decision is made) and allow some userspace black magic to make decisions.
NACK, this kind of policy should be done in kernelspace.
What? You want to write and in kernel scanner for Window viruses?
No, I want a sane security policy in kernelsapce that doesn't look at the content because doing security by content properly is equivalent to solving the halting problem. I couldn't give a rats a** about windows viruses as they can't actually cause any harm on a Linux machine.
Quoted 11 lines
Quoted 4 lines
Quoted 2 lines
Quoted 2 lines
6. Scan files directly not relying on path. Avoid races and problems with namespaces, chroot, containers, etc.
Explain?
The data connected with the file being opened must as reasonably as possible be the data the 'scanner' looks at. Some foolish early discussion wanted to do simplistic things like pass a pathname to a scanner and have it call open on that path name. I'm willing to entertain any other method of making the scanner look at the data the process is about to get.
Well, data can change all the time, as can the path name. This whole content scanning thing doesn't make any sense at all.
Quoted 9 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
9. Mark a processes as exempt from on access scanning
Nack, this completely defeats the purpose.
What? it allows a process to open a file that contains malware, how is that horrible. If a process says "I want to see malware" it can then see malware. Doesn't in any way affect other processes or the system security as a whole. If 'bad' data gets into a file its going to get blocked from everything that doesn't actively choose to see it.
So make this opt-in and in userspace. Just LD_PRELOAD some monster lib doing all the horrible things you propose and use it wherever you want.
Quoted 11 lines · Christoph Hellwig
Quoted 4 lines · Eric Paris
Quoted 1 line · Christoph Hellwig
NACK, this kind of policy should be done in kernelspace.
What? You want to write and in kernel scanner for Window viruses?
No, I want a sane security policy in kernelsapce that doesn't look at the content because doing security by content properly is equivalent to solving the halting problem. I couldn't give a rats a** about windows viruses as they can't actually cause any harm on a Linux machine.
Much better solution:
Use SELinux or another similar Mandatory Access Control labeling system. Mark some things as "trusted" or "privileged" or whatever your particular labeling methodology requires. Mark other things as "untrusted", "unprivileged", "internet file", etc. Disallow most interaction between "trusted" and "untrusted" things. Configure your userspace virus-scanner which is allowed to read "untrusted" files and create "semi-trusted" files in a particular directory, where they can then be picked up by "trusted" programs.
Problem solved. Untrusted and possibly-compromised files can't be executed, or even if they could be they can't do anything interesting/harmful. In order to execute some junk you just downloaded from the internet you have to click "Yes I accept the security risk" and run it through whatever virus-scanner you want. Then you copy it from the virus-scanner output directory into somewhere else and run it.
You can do the same thing with software updates downloaded from the internet, just replace "trusted" with "installed package", "semi-trusted" with "valid package", "untrusted" with "just-downloaded package file", and "virus scanner" with "package signature verification tool".
I could easily come up with a bunch more examples if you really care that much.
Cheers,
Kyle Moffett
Quoted 1 line
Much better solution:
And one which was found lacking about 1950...
Quoted 2 lines
Problem solved. Untrusted and possibly-compromised files can't be executed, or even if they could be they can't do anything
Two things
- Scripts
- Attacks based on compromising a live binary
You can use SELinux to control what is executed and it is a very effective management control technique. However it doesn't control javascript in web pages, exploits that popen perl and chat to it and so on...
Quoted 5 lines
No, I want a sane security policy in kernelsapce that doesn't look at the content because doing security by content properly is equivalent to solving the halting problem. I couldn't give a rats a** about windows viruses as they can't actually cause any harm on a Linux machine.
Go on then.. post patches.
I think your are being incredibly naïve. Our memory debugging is not 100% solid but work by heuristic. Our lock analysis doesn't solve the halting problem but is extremely useful and so on.
Quoted 2 lines
Well, data can change all the time, as can the path name. This whole content scanning thing doesn't make any sense at all.
Phone numbers change all the time, shall we burn all the phone books ?
Quoted 2 lines
So make this opt-in and in userspace. Just
LD_PRELOADsome monster lib doing all the horrible things you propose and use it wherever you want.
Rather tricky as the needed hooks don't exist and you need to get ahead of even ld.so as well as protect suid apps. You've clearly not even thought about the problem space before sounding off because there are more elegant ways of tackling it even if you want to push it at userspace, and ones that aren't implausible like LD_PRELOAD.
If you'd applied even 30 seconds thought you would at least be pointing people at FUSE or a stacking fs.
Alan
Quoted 11 lines · Alan Cox
Quoted 5 lines
No, I want a sane security policy in kernelsapce that doesn't look at the content because doing security by content properly is equivalent to solving the halting problem. I couldn't give a rats a** about windows viruses as they can't actually cause any harm on a Linux machine.
Go on then.. post patches.
I think your are being incredibly naïve. Our memory debugging is not 100% solid but work by heuristic. Our lock analysis doesn't solve the halting problem but is extremely useful and so on.
Sure, but what's the point of partial security? It seems to me you're not secure until you're fully secure, so why bother with almost?
Every bug caught with the debuggers is one caught, yay :-)
Every virus let through is a pawned system, aww :-(
Quoted 6 lines
Sure, but what's the point of partial security? It seems to me you're not secure until you're fully secure, so why bother with almost?
Every bug caught with the debuggers is one caught, yay :-)
Every virus let through is a pawned system, aww :-(
Every bug missed is a crash. Security is not an absolute. If I burst into your office with a machine gun and ask you for the password your security system probably fails ...
Security is a risk/reward model.
Alan
Quoted 7 lines · Alan Cox
Quoted 5 lines
No, I want a sane security policy in kernelsapce that doesn't look at the content because doing security by content properly is equivalent to solving the halting problem. I couldn't give a rats a** about windows viruses as they can't actually cause any harm on a Linux machine.
Go on then.. post patches.
Onus is not (or actually often is, but should not) be on reviewers to do this. That effectively further reduces review bandwidth.
I can see why "feature" writers like the idea though. Either they get someone to do their work for them, or negative reviews disappear :)
Quoted 3 lines · Christoph Hellwig
I couldn't give a rats a** about
windows viruses as they can't actually cause any harm on a Linux machine.
My guess is that wine is good enough these days to run many Windows worms actually.
-Andi
Quoted 8 lines · On Wed, 06 Aug 2008 04:41:04 +0200 Andi Kleen <[email protected]> wrote:
Quoted 3 lines · Christoph Hellwig
I couldn't give a rats a** about
windows viruses as they can't actually cause any harm on a Linux machine.My guess is that wine is good enough these days to run many Windows worms actually.
Firefox, Open Office and other applications are probably large and feature rich enough that making worms for them might be possible.
Not being able to harm the operating system is not the same as not being able to harm the user. We still want some protection from the latter...
Signature · 1 line
All Rights Reversed
Quoted 9 lines · Greg KH
Quoted 5 lines · Eric Paris
Security vendors, Linux distributors and other interested parties have come together on the malware-list mailing list to discuss this problem and see if they can work together to propose a solution. During these talks couple of requirement sets were posted with the aim of fleshing out common needs as a prerequisite of creating an interface prototype.
These requirements were posted? Where? I don't recall seeing them.
they were collected from the comments of Sophos, CA, and McAfee on [email protected] back in January 2008. I can't find the lists archived on the net so I will post the raw messages tomorrow from my local mail store and send a link.
Quoted 19 lines
Quoted 10 lines
Collated requirements
+++++++++++++++++++++
1. Intercept file opens (exec also) for vetting (block until decision is made) and allow some userspace black magic to make decisions.
2. Intercept file closes for scanning post access
3. Cache scan results so the same file is not scanned on each and every access
4. Ability to flush the cache and cause all files to be re-scanned when accessed
5. Define which filesystems are cacheable and which are notQuoted 8 lines
6. Scan files directly not relying on path. Avoid races and problems with namespaces, chroot, containers, etc.
7. Report other relevant file, process and user information associated with each interception
8. Report file pathnames to userspace (relative to process root, current working directory)
9. Mark a processes as exempt from on access scanning
10. Exclude sub-trees from scanning based on filesystem (exclude procfs, sysfs, devfs)
11. Exclude sub-trees from scanning based on filesystem path
12. Include only certain sub-trees from scanning based on filesystem path
13. Register more than one userspace client in which case behavior is restrictive
Quoted 5 lines
I don't see anything in the list above that make this a requirement that the code to do this be placed within the kernel.
What is wrong with doing it in glibc or some other system-wide library (
LD_PRELOADhooks, etc.)?
It may be possible to do in glibc, LD_PRELOAD doesn't exactly work for suid binaries
Quoted 15 lines
Quoted 9 lines
1., 2. Basic interception
-------------------------
Core requirement is to intercept access to files and prevent it if malicious content is detected. This is done on open, not on read. It may be possible to do read time checking with minimal performance impact although not currently implemented. This means that the following race is possibleQuoted 5 lines
Process1 Process2
- open file RD
- open file WR
- write virus data (1)
- read virus data
Quoted 4 lines
Wonderful, we are going to implement a solution that is known to not work, with a trivial way around it?
Sorry, that's not going to fly.
The model only makes claims about open and I want to be forthright with its shortcomings. It sounds rather unreasonable to think that every time I want to read one bite from a file which is being concurrently written by another process some virus scanner should have to reread and validate the entire file. I think as some point we have to accept the fact that there is no feasible perfect solution (no you can't do write time checking since circumventing that is as simple as splitting your bad bits into two writes...)
Quoted 8 lines
Quoted 6 lines
*note that any open after (1) will get properly vetted. At this time the likely hood of this being a problem vs the performance impact of scanning on read and the increased complexity of the code means this is left out. This should not be a problem for local executables as writes to files opened to be run typically return ETXTBSY.
Are you sure about this?
I'm willing to say that opens after (1) are going to be validated. I am not certain that all executables opened for write while they are being executed return ETXTBSY (I do know it happens at least sometimes) so I'm willing to drop that idea.
Quoted 11 lines
Quoted 10 lines
One of the most important filters in the evaluation chain implements an interface through which an userspace process can register and receive vetting requests. Userspace process opens a misc character device to express its interest and then receives binary structures from that device describing basic interception information. After file contents have been scanned a vetting response is sent by writing a different binary structure back to the device and the intercepted process continues its execution. These are not done over network sockets and no endian conversions are done. The client and the kernel must have the same endian configuration.
Quoted 2 lines
How about the same 64/32bit requirement? Your implementation is incorrect otherwise.
I'll definitely go back and look, but I think I use bit lengths for everything in the communication channel so its only endian issues to worry about.
Quoted 5 lines
(hint, your current patch is also wrong in this area, you should fix that up...)
And a binary structure? Ick, are you trying to make it hard for future expansions and such?
As long as the requirement that the first 32 bits be a version it might make ugly code but any future expansions are easy to deal with. Read from userspace, get the first 32 bits, cast the read from userspace to the correct structure. What would you suggest?
Quoted 3 lines
And why not netlink/network socket? Why a character device? You are already using securityfs, why not use a file node in there?
Opps, old description. I do just use an inode in securityfs, not a misc character device. I'm not clear what netlink would buy here. I might be able to make my async close vetting code a little cleaner, but it would make other things more complex (like registration and actually having to track userspace clients)
Quoted 10 lines
Quoted 9 lines
6. Direct access to file content
--------------------------------
When an userspace daemon receives a vetting request, it also receives a new RO file descriptor which provides direct access to the inode in question. This is to enable access to the file regardless of it accessibility from the scanner environment (consider process namespaces, chroot's, NFS). The userspace client is responsible for closing this file when it is finished scanning.
Quoted 3 lines
Is this secondary file handle properly checked for the security issues involved with such a thing? What happens if the userspace client does not close the file handle?
I'm not sure the security issues that you are refering too, do you mean do we make LSM checks and regular DAC checks for the userspace client on the file in question? yes.
The userspace client is forced to respond to all fd's it is handed. If userspace decided to respond to a request but never close the file the client will eventually run out of fds and I really should make sure I have decent error handling for that case. No real damage done aside from extra references outstanding until the client program dies. Much the same way as any program that calls open on files it doesn't ever close....
Quoted 7 lines
Quoted 5 lines
7. Other reporting
------------------
Along with the fd being installed in the scanning process the process gets a binary structure of data including:What's with the love of binary structures? :)
Its only the one structure (ok and the response)
include/linux/talpa.h
struct talpa_packet_client
struct talpa_packet_kernel
Quoted 11 lines
Review
Quoted 10 lines
(quoted diff) +10
-0+ uint32_t version; + uint32_t type; + int32_t fd; + uint32_t operation; + uint32_t flags; + uint32_t mode; + uint32_t uid; + uint32_t gid; + uint32_t tgid; + uint32_t pid;
Quoted 2 lines
What happens when the world moves to 128bit or 64bit uids? (yes, I've seen proposals for such a thing...)
The same things that happens to every other subsystem that uses uint32_t to describe uid (like audit?) It either gets truncated massive main ensues...
Quoted 2 lines
Why would userspace care about these meta-file things, what does it want with them?
Honstely? I don't know. Maybe someone with access to the black magic source code will stand up and say if most of this metadata is important and if so how.
Quoted 12 lines
Quoted 12 lines
8. Path name reporting
----------------------
When a malicious content is detected in a file it is important to be able to report its location so the user or system administrator can take appropriate actions.This is implemented in a amazingly simple way which will hopefully avoid the controversy of some other solutions. Path name is only needed for reporting purposes and it is obtained by reading the symlink of the given file descriptor in /proc. Its as simple as userspace calling:
Quoted 5 lines
Quoted 2 lines
snprintf(link, sizeof(link), "/proc/self/fd/%d", details.fd); ret =readlink(link, buf, sizeof(buf)-1);Cute hack. What's to keep it from racing with the fd changing from the original program?
Not sure what you mean here. On sys_open the original program is blocking until the userspace client answers allow or deny. Both the original program fd and the fd that magically appeared in the client point to the same dentry. Names may move around but its going to be the same 'name' for both of them. I don't see a race here....
Quoted 12 lines
Quoted 12 lines
9. Process exclusion
--------------------
Sometimes it is necessary to exclude certain processes from being intercepted. For example it might be a userspace root kit scanner which would not be able to find root kits if access to them was blocked by the on-access scanner.To facilitate that we have created a special file a process can open and register itself as excluded. A flag is then put into its kernel structure (
task_struct) which makes it excluded from scanning.
Quoted 8 lines
Quoted 4 lines
This implementation is very simple and provides greatest performance. In the proposed implementation access to the exclusion device is controlled though permissions on the device node which are not sufficient. An LSM call will need to be made for this type or access in a later patch.
Heh, so if you want to write a "virus" for Linux, just implement this flag. What's to keep a "rogue" program from telling the kernel that all programs on the system are to be excluded?
Processes can only get this flag one of 2 ways.
1) register as a client to make access decisions
2) echo 1 into the magic file to enable the flag for themselves
A process can only set this flag on itself and having this flag only means that your opens and closes will not be scanned. And exculded program could write a virus and it would not be caught on close, but it would be caught on the next open.
Quoted 8 lines
Quoted 6 lines
10. Filesystem exclusions
-------------------------
One pretty important optimization is not to scan things like /proc, /sys or similar. Basically all filesystems where user can not store arbitrary, potentially malicious, content could and should be excluded from scanning.Why, does scanning these files take extra time? Just curious.
Perf win, why bothering looking for malware in /proc when it can't exist? It doesn't take longer it just takes time having to do
userspace -> kernel -> userspace -> kernel -> userspace
just to cat /proc/mounts, all of this could probably be alliviated if we cached access on non block backed files but then we have to come up with a way to exclude only nfs/cifs. I'd rather list the FSs that don't need scanning every time than those that do....
Quoted 18 lines
Quoted 18 lines
11. Path exclusions
-------------------
The need for exclusions can be demonstrated with an example of a MySQL server. It's data files are frequently modified which means they would need to be constantly rescanned which is very bad for performance. Also, it is most often not even possible to reasonably scan them. Therefore the best solution is not to scan its database store which can simply be implemented by excluding the store subdirectory.It is a relatively simple implementation which allows run-time configuration of a list of sub directories or files to exclude. Exclusion paths are relative to each process root. So for example if we want to exclude
/var/lib/mysql/and we have a mysql running in a chroot where from the outside that directory actually lives
in /chroot/mysql/var/lib/mysql,/var/lib/mysqlshould actually be added to the exclusion list.
Quoted 4 lines
Quoted 2 lines
This is also not included in the initial patch set but will be coming shortly after.
Again, what's to keep all files to be marked as excluded?
You have to be root and I'll probably add an LSM hook?
Quoted 9 lines
Quoted 5 lines
Closing remarks
---------------
Although some may argue some of the filters are not necessary or may better be implemented in userspace, we think it is better to have them in kernel primarily for performance reasons.Why? What numbers do you have that say the kernel is faster in implementing this? This is the first mention of such a requirement, we need to see real data to back it up please.
In kernel caching is clearly a huge perf win. I couldn't even measure a change in kernel build time when I didn't run a userspace client. If anyone can explain a way to get race free in kernel caching and out of
kernel redirection and scanning I'd love it :)
I'll post numbers on perf in the next day or 2.
Quoted 4 lines
Quoted 2 lines
Secondly, it is all simple code not introducing much baggage or risk into the kernel itself.
I disagree, see above.
Quoted 5 lines · Eric Paris
The model only makes claims about open and I want to be forthright with its shortcomings. It sounds rather unreasonable to think that every time I want to read one bite from a file which is being concurrently written by another process some virus scanner should have to reread and validate the entire file. I think as some point we have to accept the
Sorry, can't help but laugh at myself for typing "bite".
-Eric
Quoted 20 lines · Eric Paris
Quoted 19 lines · Greg KH
Quoted 17 lines · Eric Paris
Collated requirements
+++++++++++++++++++++
1. Intercept file opens (exec also) for vetting (block until
decision is made) and allow some userspace black magic to make
decisions.
2. Intercept file closes for scanning post access
3. Cache scan results so the same file is not scanned on each and every access
4. Ability to flush the cache and cause all files to be re-scanned when accessed
5. Define which filesystems are cacheable and which are not
6. Scan files directly not relying on path. Avoid races and problems with namespaces, chroot, containers, etc.
7. Report other relevant file, process and user information associated with each interception
8. Report file pathnames to userspace (relative to process root, current working directory)
9. Mark a processes as exempt from on access scanning
10. Exclude sub-trees from scanning based on filesystem (exclude procfs, sysfs, devfs)
11. Exclude sub-trees from scanning based on filesystem path
12. Include only certain sub-trees from scanning based on filesystem path
13. Register more than one userspace client in which case behavior is restrictive
Quoted 8 lines
Quoted 5 lines
I don't see anything in the list above that make this a requirement that the code to do this be placed within the kernel.
What is wrong with doing it in glibc or some other system-wide library (
LD_PRELOADhooks, etc.)?It may be possible to do in glibc,
LD_PRELOADdoesn't exactly work for suid binaries
Are suid binaries something that you feel is necessary to scan from?
I don't see it on the list above :)
Quoted 19 lines
Quoted 14 lines
Quoted 8 lines
1., 2. Basic interception
-------------------------
Core requirement is to intercept access to files and prevent it if malicious content is detected. This is done on open, not on read. It may be possible to do read time checking with minimal performance impact although not currently implemented. This means that the following race is possibleQuoted 5 lines
Process1 Process2
- open file RD
- open file WR
- write virus data (1)
- read virus dataQuoted 4 lines
Wonderful, we are going to implement a solution that is known to not work, with a trivial way around it?
Sorry, that's not going to fly.
Quoted 8 lines
The model only makes claims about open and I want to be forthright with its shortcomings. It sounds rather unreasonable to think that every time I want to read one bite from a file which is being concurrently written by another process some virus scanner should have to reread and validate the entire file. I think as some point we have to accept the fact that there is no feasible perfect solution (no you can't do write time checking since circumventing that is as simple as splitting your bad bits into two writes...)
So, if this isn't really going to protect anything, how can anyone justify adding it to the kernel? I sure would not allow that.
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
One of the most important filters in the evaluation chain implements an interface through which an userspace process can register and receive vetting requests. Userspace process opens a misc character device to express its interest and then receives binary structures from that device describing basic interception information. After file contents have been scanned a vetting response is sent by writing a different binary structure back to the device and the intercepted process continues its execution. These are not done over network sockets and no endian conversions are done. The client and the kernel must have the same endian configuration.
Quoted 6 lines
Quoted 2 lines
How about the same 64/32bit requirement? Your implementation is incorrect otherwise.
I'll definitely go back and look, but I think I use bit lengths for everything in the communication channel so its only endian issues to worry about.
No, your field definitions are incorrect.
You must use __u8 and friends for variables that cross the userspace/kernel boundry. None of the uint_* crap :)
Quoted 10 lines
Quoted 5 lines
(hint, your current patch is also wrong in this area, you should fix that up...)
And a binary structure? Ick, are you trying to make it hard for future expansions and such?
As long as the requirement that the first 32 bits be a version it might make ugly code but any future expansions are easy to deal with. Read from userspace, get the first 32 bits, cast the read from userspace to the correct structure. What would you suggest?
Not doing this in the kernel at all.
Seriously.
I mean it.
Oh, and after that, not using a binary interface, have we not learned from the ioctl mess? I sure thought we had...
Quoted 8 lines
Quoted 2 lines
And why not netlink/network socket? Why a character device? You are already using securityfs, why not use a file node in there?
Opps, old description. I do just use an inode in securityfs, not a misc character device. I'm not clear what netlink would buy here. I might be able to make my async close vetting code a little cleaner, but it would make other things more complex (like registration and actually having to track userspace clients)
Why would the kernel have to worry about that?
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
6. Direct access to file content
--------------------------------
When an userspace daemon receives a vetting request, it also receives a new RO file descriptor which provides direct access to the inode in question. This is to enable access to the file regardless of it accessibility from the scanner environment (consider process namespaces, chroot's, NFS). The userspace client is responsible for closing this file when it is finished scanning.
Quoted 7 lines
Quoted 3 lines
Is this secondary file handle properly checked for the security issues involved with such a thing? What happens if the userspace client does not close the file handle?
I'm not sure the security issues that you are refering too, do you mean do we make LSM checks and regular DAC checks for the userspace client on the file in question? yes.
Yes, that is what I was referring to.
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
(quoted diff) +10
-0+ uint32_t version; + uint32_t type; + int32_t fd; + uint32_t operation; + uint32_t flags; + uint32_t mode; + uint32_t uid; + uint32_t gid; + uint32_t tgid; + uint32_t pid;
Quoted 6 lines
Quoted 2 lines
What happens when the world moves to 128bit or 64bit uids? (yes, I've seen proposals for such a thing...)
The same things that happens to every other subsystem that uses
uint32_tto describe uid (like audit?) It either gets truncated massive main ensues...
audit passed the value in a binary structure from the kernel to userspace? Really? Ick.
Quoted 6 lines
Quoted 2 lines
Why would userspace care about these meta-file things, what does it want with them?
Honstely? I don't know. Maybe someone with access to the black magic source code will stand up and say if most of this metadata is important and if so how.
Don't add things that are not needed, _everything_ must be justified.
Quoted 14 lines
Quoted 14 lines
Quoted 13 lines
8. Path name reporting
----------------------
When a malicious content is detected in a file it is important to be able to report its location so the user or system administrator can take appropriate actions.This is implemented in a amazingly simple way which will hopefully avoid the controversy of some other solutions. Path name is only needed for reporting purposes and it is obtained by reading the symlink of the given file descriptor in /proc. Its as simple as userspace calling:
snprintf(link, sizeof(link), "/proc/self/fd/%d", details.fd); ret =readlink(link, buf, sizeof(buf)-1);
Quoted 8 lines
Quoted 2 lines
Cute hack. What's to keep it from racing with the fd changing from the original program?
Not sure what you mean here. On
sys_openthe original program is blocking until the userspace client answers allow or deny. Both the original program fd and the fd that magically appeared in the client point to the same dentry. Names may move around but its going to be the same 'name' for both of them. I don't see a race here....
Oh, forgot about the fact that the code blocks. That's probably a race in itself :)
Quoted 7 lines
Quoted 3 lines
Heh, so if you want to write a "virus" for Linux, just implement this flag. What's to keep a "rogue" program from telling the kernel that all programs on the system are to be excluded?
Processes can only get this flag one of 2 ways.
1) register as a client to make access decisions
How do you do that?
Quoted 1 line
2) echo 1 into the magic file to enable the flag for themselves
Simple enough :)
Quoted 12 lines
Quoted 8 lines
Quoted 6 lines
10. Filesystem exclusions
-------------------------
One pretty important optimization is not to scan things like /proc, /sys or similar. Basically all filesystems where user can not store arbitrary, potentially malicious, content could and should be excluded from scanning.Why, does scanning these files take extra time? Just curious.
Perf win, why bothering looking for malware in /proc when it can't exist? It doesn't take longer it just takes time having to do
Quoted 6 lines
userspace -> kernel -> userspace -> kernel -> userspace
just to cat
/proc/mounts, all of this could probably be alliviated if we cached access on non block backed files but then we have to come up with a way to exclude only nfs/cifs. I'd rather list the FSs that don't need scanning every time than those that do....
How long does this whole process take? Seriously is it worth the added kernel code for something that is not measurable?
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
11. Path exclusions
-------------------
The need for exclusions can be demonstrated with an example of a MySQL server. It's data files are frequently modified which means they would need to be constantly rescanned which is very bad for performance. Also, it is most often not even possible to reasonably scan them. Therefore the best solution is not to scan its database store which can simply be implemented by excluding the store subdirectory.It is a relatively simple implementation which allows run-time configuration of a list of sub directories or files to exclude. Exclusion paths are relative to each process root. So for example if we want to exclude
/var/lib/mysql/and we have a mysql running in a chroot where from the outside that directory actually lives
in /chroot/mysql/var/lib/mysql,/var/lib/mysqlshould actually be added to the exclusion list.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
This is also not included in the initial patch set but will be coming shortly after.
Again, what's to keep all files to be marked as excluded?
You have to be root and I'll probably add an LSM hook?
Why an LSM hook? You aren't an LSM.
Quoted 11 lines
Quoted 9 lines
Quoted 5 lines
Closing remarks
---------------
Although some may argue some of the filters are not necessary or may better be implemented in userspace, we think it is better to have them in kernel primarily for performance reasons.Why? What numbers do you have that say the kernel is faster in implementing this? This is the first mention of such a requirement, we need to see real data to back it up please.
In kernel caching is clearly a huge perf win.
Why? If the cache is also in userspace, it should be the same, right?
Quoted 2 lines
I couldn't even measure a change in kernel build time when I didn't run a userspace client.
And when you did run a foolish userspace client?
If you did it all in userspace, if the userspace code isn't being called, the kernel build time should be the same as well :)
Quoted 2 lines
If anyone can explain a way to get race free in kernel caching and out
of kernel redirection and scanning I'd love it :)
Again, do it all in userspace (caching, and scanning). I still really don't see the need to do this in the kernel becides it being "the way people have always done it."
thanks,
greg k-h
Quoted 6 lines
Quoted 2 lines
It may be possible to do in glibc,
LD_PRELOADdoesn't exactly work for suid binariesAre suid binaries something that you feel is necessary to scan from?
I don't see it on the list above :)
Doesn't work very well really does it - ld.so loads files too and can be attacked.
Quoted 9 lines · Alan Cox
Quoted 6 lines
Quoted 2 lines
It may be possible to do in glibc,
LD_PRELOADdoesn't exactly work for suid binariesAre suid binaries something that you feel is necessary to scan from?
I don't see it on the list above :)
Doesn't work very well really does it - ld.so loads files too and can be attacked.
But that's an "attack" vector, which virus scanners are not addressing. They are going for the "is this file corrupted" type issue. The "normal" LSM interface is for malware itself, taking control of a system.
thanks,
greg k-h
Quoted 8 lines · Greg KH
Quoted 7 lines · Alan Cox
Quoted 6 lines
Quoted 2 lines
It may be possible to do in glibc,
LD_PRELOADdoesn't exactly work for suid binariesAre suid binaries something that you feel is necessary to scan from?
I don't see it on the list above :)
Quoted 7 lines
Quoted 2 lines
Doesn't work very well really does it - ld.so loads files too and can be attacked.
But that's an "attack" vector, which virus scanners are not addressing. They are going for the "is this file corrupted" type issue. The "normal" LSM interface is for malware itself, taking control of a system.
So you are arguing against the defense in depth theory? LSM should solve it all so why bother?
I don't think that anyone is claiming that they don't address that vector. They may not be perfect but they are infinitely better than the zero protection we offer today. Clearly in the enterprise world the most useful purpose of these scanners is looking at inflight data crossing valid safe non-hacked linux processes, but the implementation I have given is such that we can start doing some validation on our own executables. Remember the requirement wasn't just to scan data, it was to scan everything that gets opened.
As an example of the usefulness of this approach as opposed to the LD_PRELOAD/glibc approach is that I could be used to minimize the impact of things like the recently much touted discussion about malicious repository mirrors. Although clearly there were some flaws in the common conception of the problem, the ability to trick users into downloading and installing trojaned libraries is not something we can presently protect against with any mechanism.
Lets assume that the black magic in userspace was able to spot a trojaned library running programs which would still be linked to the old files on disk would continue to work but you would very quickly find out there was trouble when everything that tried to open its shared library was getting EPERM. Yes, yes, even I can think of ways around it (bad repo sends bad kernel first and waits until the machine is running the bad kernel to disable scanning) but by that time they already won. And its possible that the userspace scanning could/would spot the trojaned kernel and report on it during install time.
I'm going to run perf test this afternoon but I'm going to have to look for a test that is a good mix of reads,writes, and opens. I strongly suspect that there will be a noticable perf lose in any other method that doesn't include in kernel caching. (how can there not be with an extra context switch for every open?)
-Eric
Quoted 12 lines · Eric Paris
Quoted 11 lines · Greg KH
Quoted 9 lines · Alan Cox
Quoted 6 lines
Quoted 2 lines
It may be possible to do in glibc,
LD_PRELOADdoesn't exactly work for suid binariesAre suid binaries something that you feel is necessary to scan from?
I don't see it on the list above :)
Doesn't work very well really does it - ld.so loads files too and can be attacked.
Quoted 7 lines
Quoted 4 lines
But that's an "attack" vector, which virus scanners are not addressing. They are going for the "is this file corrupted" type issue. The "normal" LSM interface is for malware itself, taking control of a system.
So you are arguing against the defense in depth theory? LSM should solve it all so why bother?
No, I am saying I have yet to see a real requirement to justify that this code goes into the kernel.
Your list shows no such requirement, in fact it overlaps with some things that LSM already provides. So why not just make it an LSM and be done with it?
Oh wait, this is a commercial add-on for vendor kernels that already have an LSM built in, that will not work.
Is that really the community's issue? :)
Quoted 8 lines
I don't think that anyone is claiming that they don't address that vector. They may not be perfect but they are infinitely better than the zero protection we offer today. Clearly in the enterprise world the most useful purpose of these scanners is looking at inflight data crossing valid safe non-hacked linux processes, but the implementation I have given is such that we can start doing some validation on our own executables. Remember the requirement wasn't just to scan data, it was to scan everything that gets opened.
/me points at a fixed inotify.
Quoted 7 lines
As an example of the usefulness of this approach as opposed to the LD_PRELOAD/glibc approach is that I could be used to minimize the impact of things like the recently much touted discussion about malicious repository mirrors. Although clearly there were some flaws in the common conception of the problem, the ability to trick users into downloading and installing trojaned libraries is not something we can presently protect against with any mechanism.
Exactly, so don't try to bring it up when it does not even pertain here.
Quoted 5 lines
Lets assume that the black magic in userspace was able to spot a trojaned library running programs which would still be linked to the old files on disk would continue to work but you would very quickly find out there was trouble when everything that tried to open its shared library was getting EPERM.
But that's not what virus scanners on Linux do! So again, don't bring up things that are outside the threat model!
Quoted 5 lines
I'm going to run perf test this afternoon but I'm going to have to look for a test that is a good mix of reads,writes, and opens. I strongly suspect that there will be a noticable perf lose in any other method that doesn't include in kernel caching. (how can there not be with an extra context switch for every open?)
See my earlier comments about this.
thanks,
greg k-h
Quoted 7 lines · Greg KH
Quoted 2 lines · Eric Paris
So you are arguing against the defense in depth theory? LSM should solve it all so why bother?
No, I am saying I have yet to see a real requirement to justify that this code goes into the kernel.
While I try to get someone to talk to me, lets consider even the most simplistic threat model. I'm not stating that this is the only threat that vendors wish to protect against, but I think we can all agree it is a meaningful threat. Trying to get the AV vendors to talk about their products actual uses is like pulling teeth.
This simple thread shows what I believe to be clear and compelling evidence of the need for an in kernel solution. Lets just consider that we are a high input, high output, NFS file server with other OS's mounting this NFS share RW.
Our goal is to stop, or at least reduce the throughput (I clearly document and accept the open to read race, and until we get a working revoke I don't see that changing) of malware across the NFS server. This data will not be attacking the NFS server. We wish to slow and hopefully halt the spread of this data with minimal impact to the NFS server.
Since the NFS server interacts directly with the VFS no purely userspace solution is possible. I certainly hope noone tells me we should hook
directly into nfsd and do everything else in userspace :)
The purpose of this e-mail is not to ask others to find 'the perfect solution for this one example' but merely to holp move away from the ideas that this can be done in GLIBC or in LD_PRELOAD.
Maybe my code is all crap, I'm more than willing to accept that, it wouldn't be the first time, but I do see the open on the NFS server and I could do "something" with that file on the server. I can continue to define lots of other threats that my interface is useful for (even if Greg dismissed one of them out of hand) but right now I'm trying to get all of the AV vendors to define what it is they do (and I think we all know they will claim to do exactly this)
-Eric
Quoted 6 lines · Eric Paris
This simple thread shows what I believe to be clear and compelling evidence of the need for an in kernel solution. Lets just consider that we are a high input, high output, NFS file server with other OS's mounting this NFS share RW.
Quoted 6 lines
Our goal is to stop, or at least reduce the throughput (I clearly document and accept the open to read race, and until we get a working revoke I don't see that changing) of malware across the NFS server. This data will not be attacking the NFS server. We wish to slow and hopefully halt the spread of this data with minimal impact to the NFS server.
In this scenario, are you positing that you are worried about Windows malware, or Linux malware? What OS are the clients running? I will note that Windows has such a sucky NFS implementation that nearly all Widows clients will be running CIFS/SMB, not NFS --- so the right solution there is to integrate the virus checking with Samba --- especially since the one AV vendor has already admitted the actual virus signature checking has to be done in userspace.
For Linux clients, one question that immediately rises is the end-to-end argument. Wouldn't be far better to run whatever security solution on the client? After all, a Virus checking on an NFS server isn't going to help the user if they accidentally track in the virus on a USB stick. (Especially if it is an infected Macro virus in an office document.)
- Ted
Quoted 14 lines · Theodore Tso
Quoted 6 lines · Eric Paris
This simple thread shows what I believe to be clear and compelling evidence of the need for an in kernel solution. Lets just consider that we are a high input, high output, NFS file server with other OS's mounting this NFS share RW.
Quoted 6 lines
Our goal is to stop, or at least reduce the throughput (I clearly document and accept the open to read race, and until we get a working revoke I don't see that changing) of malware across the NFS server. This data will not be attacking the NFS server. We wish to slow and hopefully halt the spread of this data with minimal impact to the NFS server.
Quoted 4 lines
In this scenario, are you positing that you are worried about Windows malware, or Linux malware? What OS are the clients running? I will note that Windows has such a sucky NFS implementation that nearly all Widows clients will be running CIFS/SMB, not NFS
I believe I specifically did not make any such claims at all about the client OS and merely claimed the intended target was not the linux NFS server. I didn't make those claims because they are irrelevant and so that people could not jump on those details and try to offload the solution to the wrong place. Maybe the client is not Windows but another large desktop OS who actually has a reasonable NFS client? How do you turn this into a straw man argument then? Remember, I'm not claiming that my solution for the entirety of the threads that AV vendors claim to want to protect again, I simply claim that a GLIBC/LD_PRELOAD solution is easily shown to be infeasible for even the most elementary of threats.
Quoted 4 lines
--- so the right
solution there is to integrate the virus checking with Samba --- especially since the one AV vendor has already admitted the actual virus signature checking has to be done in userspace.
<snide> I believe they all are going to claim it has to be in some userspace proprietary application for them to keep making money </snide>
Quoted 6 lines
For Linux clients, one question that immediately rises is the end-to-end argument. Wouldn't be far better to run whatever security solution on the client? After all, a Virus checking on an NFS server isn't going to help the user if they accidentally track in the virus on a USB stick. (Especially if it is an infected Macro virus in an office document.)
Your argument is irrelevant for the threat given and you seem to have contorted the actual point of the statements to fit something else. But I'm sure you a fan of multiple layers of security that you don't actually believe that "just check on the clients" is the right thing to do. Linux client side checking is most likely going to be something that vendors claim to want to do but has no bearing on if out of kernel scanning is feasible for NFS servers. Nor if you want to look at the "end-to-end argument" as you claim can excluding server side scanning be a reasonable choice.
How many clients machines at your location are controlled by some IT organization? How many servers? I think it's quite obvious that unless the answer to the first question is "all" then we would want scanning on both the client and the server. I think there are many organizations in which many, or even most, machines with access to an NFS server can be controlled so as to enforce scanning, but its not reasonable, at least in my mind, to throw out server side NFS scanning unless you can control ALL of the clients.
-Eric
-Eric
Quoted 8 lines · Eric Paris
Quoted 4 lines
In this scenario, are you positing that you are worried about Windows malware, or Linux malware? What OS are the clients running? I will note that Windows has such a sucky NFS implementation that nearly all Widows clients will be running CIFS/SMB, not NFS
I believe I specifically did not make any such claims at all about the client OS and merely claimed the intended target was not the linux NFS server.
I know you didn't say; that's why I asked. :-)
I dispute your assertion that this quesiton is irrelevant. It's highly relevant, because if it's Windows clients, they ***won't*** be using NFS.
As for other large desktop OS's, that would be MacOS and Linux; anything else? And the big, huge, vast difference between Windows and MacOS/Linux is that with Windows, in practice people ran with Administrator privileges because most applications (including at one point Microsoft Visual Studio :-) died and/or completely refused to install if you didn't have Administrator privileges. So people very regularly ran with Root privs. With Vista, you no longer run with root privileges by default --- instead, applications still assume they have Administrator privileges, causing the Really Annoying Popup boxes to pop up each time the application needs to do something that require privileges --- which has trained users to mindlessly click "OK" each time the Annoying Popup Box comes up.
Given that MacOS and Linux don't have these flaws with respect to applications regularly expecting root privileges, will you admit that perhaps some of the extreme scanning tactics that were required by AntiVirus vendors might be not as necessary for "other desktops"?
Asking the question is important because if they are spending all of their time on Windows virii, then your "elementary threat" is really an "elementary strawman". Or, at the very least, it's a low priority effort, since the number of virii out in the field for Linux and MacOS desktops is in the noise compared to Windows. I know that it's convenient for AV vendors to claim in their marketing literature that this is only because Windows is more popular, but while that might be part of it, it is also true that there are significant, structural differences between Windows and those other large desktop candidates.
Quoted 5 lines
Your argument is irrelevant for the threat given and you seem to have contorted the actual point of the statements to fit something else. But I'm sure you a fan of multiple layers of security that you don't actually believe that "just check on the clients" is the right thing to do.
Giving up my water bottles and having to take off my shoes at airport security has been justified in the name of "multiple layers of security". No, I'm NOT a fan of mindlessly using "defense in depth" as an excuse for arbitrary amounts of security and giving up arbitrary amounts of my private data. You need to prove to me that from a cost benefit tradeoff it's really worth it.
- Ted
Quoted 11 lines · Theodore Tso
Quoted 8 lines · Eric Paris
Quoted 4 lines
In this scenario, are you positing that you are worried about Windows malware, or Linux malware? What OS are the clients running? I will note that Windows has such a sucky NFS implementation that nearly all Widows clients will be running CIFS/SMB, not NFS
I believe I specifically did not make any such claims at all about the client OS and merely claimed the intended target was not the linux NFS server.
I know you didn't say; that's why I asked. :-)
We are sort of talking past each other here, but I really am listening.
[snip]
Quoted 4 lines
Given that MacOS and Linux don't have these flaws with respect to applications regularly expecting root privileges, will you admit that perhaps some of the extreme scanning tactics that were required by AntiVirus vendors might be not as necessary for "other desktops"?
Absolutely, I think that our solution needs worry much less about an actively attacking root process than Windows. I think everyone on list would tend to agree that our security model greatly helps in this regard. I think the problem quickly becomes intractable as soon as we talk about a locally running actively attacking root process, which I believe is what you are discussing. I think that leaves 4 things
1) fileserver with no active attack on system
2) actively attacking non-root processes (run some process that tries to screw people)
3) accidentally attacking, non-root process. (open a malicious openoffice file)
4) accidentally attacking, properly functioning, root processes (my thought on this would be a properly functioning non-exploited yum program getting data from a bad repo)
For the purposes of this e-mail discussion can we only discuss #1? I think its the easiest problem to look at and is at the heart of stopping #2, 3 and 4. If we can keep the files off the disk we greatly reduce (although clearly don't eliminate) the ability for all of the other attacks against our system.
Quoted 9 lines
Asking the question is important because if they are spending all of their time on Windows virii, then your "elementary threat" is really an "elementary strawman". Or, at the very least, it's a low priority effort, since the number of virii out in the field for Linux and MacOS desktops is in the noise compared to Windows. I know that it's convenient for AV vendors to claim in their marketing literature that this is only because Windows is more popular, but while that might be part of it, it is also true that there are significant, structural differences between Windows and those other large desktop candidates.
Remember my (contrived to prove a single point, but I think interesting) goal was not to stop an active attack against any OS, which you appear to be focusing on. My goal was to make a Linux fileserver an inhospitable place for data which may someday attack a system to live. Our systems have almost infinitely many ingress and egress mechanisms and I don't think its tractable to attempt to do this at the edge. At a minimum while I sit here I can think of smbd, nfs, ftp, http, smtp, ssh, and rsync which are very likely ingress and egress points of data on a Linux system. Trying to move the solution to all of those places gets a bit large and certainly buggy. And I think we both agree those aren't the only possible ingress and egress points for information.
Quoted 6 lines
Quoted 5 lines
Your argument is irrelevant for the threat given and you seem to have contorted the actual point of the statements to fit something else. But I'm sure you a fan of multiple layers of security that you don't actually believe that "just check on the clients" is the right thing to do.
Quoted 6 lines
Giving up my water bottles and having to take off my shoes at airport security has been justified in the name of "multiple layers of security". No, I'm NOT a fan of mindlessly using "defense in depth" as an excuse for arbitrary amounts of security and giving up arbitrary amounts of my private data. You need to prove to me that from a cost benefit tradeoff it's really worth it.
I guess step one is agreeing that the goal "harden linux to be an inhospitable host for 'bad' data which may someday be used to attack another system" is a useful goal. Maybe you don't agree and if so please help me understand how that goal is unreasonable. We aren't talking about the solution just yet (I'm the first to say that the patches I posted might be complete shiet for the final solution), just the goal for a moment. Maybe the solution will be so unwieldy that we later find the goal to not be worth it, but this seems the most simplistic of goals that all AV vendors are going to claim to want to do.
I believe this to be a reasonable goal as it reduces the attack area for a number of attacks against linux programs (pdf rendering flaws, jpg rendering flaws, etc). Browser downloads bad pdf, evince tries to open that which the browser just downloaded, BLOCKED. Obviously the 'right' thing to do there was update evince so the attack would not work, but now what stops me, the unsuspecting use who just looked at this pdf and didn't get hacked from passing it on? Same thing for openoffice macros? Sure you update openoffice and you down get p0wnt but that doesn't keep you from putting it on the NFS server for everyone else in the office who doesn't know how to keep their system up to date from getting screwed.
While waiting for AV vendors to see if any of them can make reasonable claims about goals 2, 3, and 4 I think we can consider #1. (for all I know #1 is going to be the ONLY thing that any vendor can make a reasonable claim about) Even if they come up with other things I think that just considering #1 is valuable since it can eliminate some of the potential solutions. I don't see myself wasting time going down the GLIBC path since I believe that making systems inhospitable to 'bad' data is something that should be done (if reasonably possible) both client and server side.
-Eric
Quoted 12 lines · Eric Paris
Absolutely, I think that our solution needs worry much less about an actively attacking root process than Windows. [...]
1) fileserver with no active attack on system
2) actively attacking non-root processes (run some process that tries to screw people)
3) accidentally attacking, non-root process. (open a malicious openoffice file)
4) accidentally attacking, properly functioning, root processes (my thought on this would be a properly functioning non-exploited yum program getting data from a bad repo)
Quoted 1 line
For the purposes of this e-mail discussion can we only discuss #1?
OK, focusing on the case of a Linux fileserver that is serving files to Windows clients (scenario #1) makes sense to me. That seems like progress, because it helps define the problem space better.
Seems like Ted Tso has already responded to that one with his comments on SMB/NFS, where he suggests that there are good technical solutions to the case of a Linux Samba fileserver, and argues that this is the case that matters. It seems to me the ball is now in your court to respond to that on a technical level.
Quoted 4 lines
I believe this to be a reasonable goal as it reduces the attack area for a number of attacks against linux programs (pdf rendering flaws, jpg rendering flaws, etc). Browser downloads bad pdf, evince tries to open that which the browser just downloaded, BLOCKED.
I guess this is scenario #2 which you suggest we should not discuss, so perhaps I shouldn't respond, but here goes: The weakness is that this does not really reduce the attack area. This can filter out exploits but cannot fix vulnerabilities. For any one vulnerability there are likely to be gazillions of ways to exploit the vulnerability, and it is unlikely that an A/V scanner will be able to detect all of those exploits. So we can't really say that surface area is closed off.
There are other ways to mitigate this particular example threat (e.g., SELinux, Systrace, plash, etc.), so if we wanted to consider this kind of attack scenario, we should probably also look at those as well. But since you suggested we focus on scenario #1, not on this scenario, I won't belabor that point any further.
Quoted 4 lines
I don't see myself wasting time going down the
GLIBC path since I believe that making systems inhospitable to 'bad' data is something that should be done (if reasonably possible) both client and server side.
"Making systems inhospitable to 'bad' data" is a slogan, not a well-defined technical problem. The slogan sounds full of motherhood and apple-pie goodness on the surface, but when it comes down to details, what exactly is meant by the slogan isn't so clear to me (what's the definition of 'bad'? what's the threat model? is this really the best approach?). I guess I agree with others who have suggested focusing on a well-defined technical problem, and that's going to take more than slogans.
Quoted 1 line · Eric Paris
Absolutely, I think that our solution needs worry much less about an actively attacking root process than Windows.
Note by the way that this assumption is being actively undermined by all those companies releasing software released as big executable blobs that you just have to chmod +x and run; as root if you want them in /opt, or /usr/local/bin, or ...
Even when OpenOffice.org, IBM Lotus Symphony, RealPlayer, Flash, what have you, might generally by themselves not be considered virusses both the precedent they set and the opportunity for infecting systems by offering those for re-download from elsewhere is worrying.
One of the more useful things the security crowd could do to keep the above assumption valid would be working on a general "external software installer" and getting all distributions to settle on it (which probably needs a common divisor package and distro backends to feed it to the native package manager).
Rene.
Quoted 9 lines · Rene Herman
Quoted 2 lines · Eric Paris
Absolutely, I think that our solution needs worry much less about an actively attacking root process than Windows.
Note by the way that this assumption is being actively undermined by all those companies releasing software released as big executable blobs that you just have to chmod +x and run; as root if you want them in /opt, or
/usr/local/bin, or ...
but you already say that said blob exists on disk? Therefore by my most basic of models it won't ever actually get to run since it will get scanned right as you try to execute it and you will get EPERM instead of a running evil process. (all of that is assuming the userspace black magic is useful, but I don't think that's really up for debate since we have no way of knowing exactly what these closed source AV vendors actually are doing....)
It looks in my mind that more and more the only real model that can even attempt to be addressed is to make disks inhospitable to data which might be intended to do ill to another machine.
Once the process is running we are talking about an IDS right?
Quoted 11 lines
Even when OpenOffice.org, IBM Lotus Symphony, RealPlayer, Flash, what have you, might generally by themselves not be considered virusses both the precedent they set and the opportunity for infecting systems by offering those for re-download from elsewhere is worrying.
One of the more useful things the security crowd could do to keep the above assumption valid would be working on a general "external software installer" and getting all distributions to settle on it (which probably needs a common divisor package and distro backends to feed it to the native package manager).
maybe a good idea, but beyond my expertise or ability to push forward...
-Eric
Quoted 14 lines · Eric Paris
Quoted 4 lines · Rene Herman
Quoted 1 line · Eric Paris
Absolutely, I think that our solution needs worry much less about an actively attacking root process than Windows.
Note by the way that this assumption is being actively undermined by all those companies releasing software released as big executable blobs that you just have to chmod +x and run; as root if you want them in /opt, or
/usr/local/bin, or ...but you already say that said blob exists on disk? Therefore by my most basic of models it won't ever actually get to run since it will get scanned right as you try to execute it and you will get EPERM instead of a running evil process. (all of that is assuming the userspace black magic is useful, but I don't think that's really up for debate since we have no way of knowing exactly what these closed source AV vendors actually are doing....)
Quoted 5 lines
It looks in my mind that more and more the only real model that can even attempt to be addressed is to make disks inhospitable to data which might be intended to do ill to another machine.
Once the process is running we are talking about an IDS right?
Once the process is running we are talking about having lost.
Note, I did not follow this thread (closely) ...
Thing is just -- just wait for how long it takes said clueless user you are so vigorously protecting to disable that which brings about your model the first time if interferes with him running a cracked copy of an expensive yet popular program, playing a game, installing a wiggling nudies screensaver, ...
The difference here is just that Linux systems are particularly bad at those tasks to begin with which in nice circular motions keeps those clueless users away, obviating the need to protect ourselves from them. If this stuff is to be discussed in a context as if Linux were relevant on the desktop though, I believe it's rather unproductive to expect a fundamental difference with Windows in this respect.
Fine though if you wouldn't insist on that context. As said, wasn't following along really.
Quoted 5 lines
Quoted 3 lines
Even when OpenOffice.org, IBM Lotus Symphony, RealPlayer, Flash, what have you, might generally by themselves not be considered virusses both the precedent they set and the opportunity for infecting systems by offering those for re-download from elsewhere is worrying.
One of the more useful things the security crowd could do to keep the above assumption valid would be working on a general "external software installer" and getting all distributions to settle on it (which probably needs a common divisor package and distro backends to feed it to the native package manager).
maybe a good idea, but beyond my expertise or ability to push forward...
I'll leave it in just in case it spurs someone :)
Rene.
Quoted 6 lines
-----Original Message-----
From: [email protected] [mailto:malware-list- [email protected]] On Behalf Of Rene Herman
Sent: Thursday, August 07, 2008 10:56 PM
To: Eric Paris
Cc: [email protected]; Alan Cox;
Quoted 1 line
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux
interface for on
Quoted 5 lines
access scanning
The difference here is just that Linux systems are particularly bad at those tasks to begin with which in nice circular motions keeps those clueless users away, obviating the need to protect ourselves from
them.
Quoted 1 line
If this stuff is to be discussed in a context as if Linux were
relevant
Quoted 2 lines
on the desktop though, I believe it's rather unproductive to expect a fundamental difference with Windows in this respect.
Just an observation about this...
Since I earn my living on the basis of users, clueless or not, I've gotten into the habit of just taking them as they come and trying to go out of my way to not refer to them as clueless -- except in a few specific and particularly annoying cases.
But that's not my point. My point is that Linux has become a commercially viable environment with a lot of enterprise users, with a significant number of enterprises are standardizing on it, or at least officially supporting/allowing/encouraging its use. Because of that, for example, we have a significant number of user issues coming in that indicate that there are actually plenty of clueless Linux users, whether the OS was intended for them or not.
The fact that they are there is the main reason that Red Hat and Novell, for example (at least by my observation from the outside -- I can't speak at all about how they see if from the inside) seem to be putting the bulk of their efforts into their enterprise editions, as opposed to their traditional technologist editions.
The bottom line, then, is that there ARE way more clueless Linux users out there than there used to be, which makes them a) vulnerable to losses by virtue of their own mistakes, and b) vectors for the spread of malware. Which is kind of why we're here.
Jon Press
Quoted 6 lines · Jonathan
Just an observation about this...
Since I earn my living on the basis of users, clueless or not, I've gotten into the habit of just taking them as they come and trying to go out of my way to not refer to them as clueless -- except in a few specific and particularly annoying cases.
You say that as though you feel that calling someone clueless were a bad thing. There are tons of subjects I'm completely and utterly clueless about and very happily so. But, as you say, that's not the point...
Quoted 7 lines
But that's not my point. My point is that Linux has become a commercially viable environment with a lot of enterprise users, with a significant number of enterprises are standardizing on it, or at least officially supporting/allowing/encouraging its use. Because of that, for example, we have a significant number of user issues coming in that indicate that there are actually plenty of clueless Linux users, whether the OS was intended for them or not.
But not users with root access, which is the context in which my own remark was. Enterprise users in corporations are not what I call the desktop; I'd generally call those workstations, with the desktop being your average home PC with the enormous amounts of cheap and buggy hardware and the definite lack of central IT management.
It's also dependent on country. Over here in the Netherlands, corporate adoption "on the workstation" is very low (and seemingly dropping again after some initial attempts in local government) and adoption on the desktop is for all intents and purposes 0. It's different especially in eastern-europe.
Funny that really, how all that Free as in Speech stuff mostly works for people without money...
Quoted 10 lines
The fact that they are there is the main reason that Red Hat and Novell, for example (at least by my observation from the outside -- I can't speak at all about how they see if from the inside) seem to be putting the bulk of their efforts into their enterprise editions, as opposed to their traditional technologist editions.
The bottom line, then, is that there ARE way more clueless Linux users out there than there used to be, which makes them a) vulnerable to losses by virtue of their own mistakes, and b) vectors for the spread of malware. Which is kind of why we're here.
Right, so that, then, is a threat model. I myself believe you are here mostly to guard against 11-year old girls installing infected screensavers of horses which given the fairly low adoption of Linux by 11-year old girls says something about my view of things.
But, yes, as I myself said as well, it might be sensible to discuss this issue simply _as if_ lots of users were brushing their My Little Pony's while waiting for their kernels to finish compiling if you're designing something that _should_ protect them if they were.
Goes back really to the threat model question you were asked I guess.
Rene.
Quoted 7 lines
-----Original Message-----
From: Rene Herman [mailto:[email protected]]
Sent: Friday, August 08, 2008 8:35 AM
To: Press, Jonathan
Cc: Eric Paris; [email protected]; Alan Cox; malware- [email protected]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux
interface for on
Quoted 4 lines
access scanning
Quoted 2 lines
Since I earn my living on the basis of users, clueless or not, I've gotten into the habit of just taking them as they come and trying to
go
Quoted 4 lines
Quoted 2 lines
out of my way to not refer to them as clueless -- except in a few specific and particularly annoying cases.
You say that as though you feel that calling someone clueless were a
bad
Quoted 2 lines
thing. There are tons of subjects I'm completely and utterly clueless about and very happily so.
Well, in all honesty, sometimes when I think of someone as clueless, there is a certain negative emotion that goes along with it. However, the point is more that THEY don't like to be called clueless -- both because, for some reason they take it as an insult, and also because there are many out there who "know enough to be dangerous" and think they know more than they really do. So I have to be careful not to say anything to them that sounds like I think that, and to make sure that people in my group have the same discipline.
Quoted 2 lines
Quoted 2 lines
But that's not my point. My point is that Linux has become a commercially viable environment with a lot of enterprise users, with
a
Quoted 1 line
Quoted 1 line
significant number of enterprises are standardizing on it, or at
least
Quoted 1 line
Quoted 1 line
officially supporting/allowing/encouraging its use. Because of
that,
Quoted 1 line
Quoted 1 line
for example, we have a significant number of user issues coming in
that
Quoted 1 line
Quoted 1 line
indicate that there are actually plenty of clueless Linux users,
whether
Quoted 7 lines
Quoted 1 line
the OS was intended for them or not.
But not users with root access, which is the context in which my own remark was. Enterprise users in corporations are not what I call the desktop; I'd generally call those workstations, with the desktop being your average home PC with the enormous amounts of cheap and buggy hardware and the definite lack of central IT management.
You would be surprised how many users with root access are also clueless. I used the word "enterprise" very broadly. It applies to large companies/institutions with sophisticated IT departments, but it also applies to small to medium organizations who said to themselves, "Gee what's this Linux thing I keep hearing about -- maybe we ought to get one of those." And they end up with administrators who also don't really know all the ins and outs they need to in order to create a secure environment.
In a way, it's a price that Linux has paid for its growing acceptance. The user community is not what it used to be.
Quoted 1 line
It's also dependent on country. Over here in the Netherlands,
corporate
Quoted 1 line
adoption "on the workstation" is very low (and seemingly dropping
again
Quoted 2 lines
after some initial attempts in local government) and adoption on the desktop is for all intents and purposes 0. It's different especially
in
Quoted 1 line
eastern-europe.
I can't speak about every different country, but I would say that you are right about Eastern Europe. But also in the US and Canada we have plenty of adoption on the workstation.
Quoted 1 line
Quoted 1 line
The fact that they are there is the main reason that Red Hat and
Novell,
Quoted 2 lines
Quoted 2 lines
for example (at least by my observation from the outside -- I can't speak at all about how they see if from the inside) seem to be
putting
Quoted 1 line
Quoted 1 line
the bulk of their efforts into their enterprise editions, as opposed
to
Quoted 3 lines
Quoted 3 lines
their traditional technologist editions.
The bottom line, then, is that there ARE way more clueless Linux
users
Quoted 2 lines
Quoted 2 lines
out there than there used to be, which makes them a) vulnerable to losses by virtue of their own mistakes, and b) vectors for the
spread of
Quoted 8 lines
Quoted 1 line
malware. Which is kind of why we're here.
Right, so that, then, is a threat model. I myself believe you are here mostly to guard against 11-year old girls installing infected screensavers of horses which given the fairly low adoption of Linux by 11-year old girls says something about my view of things.
But, yes, as I myself said as well, it might be sensible to discuss
this
Quoted 1 line
issue simply
_asif_lots of users were brushing their My Little
Pony's
Quoted 1 line
while waiting for their kernels to finish compiling if you're
designing
Quoted 1 line
something that _should_ protect them if they were.
There are many gradations of users between the kernel pro and the 11-year-old girl.
One is the guy right out of college who really likes computers and he gets a job at a place where they use Linux, and he does a web search and finds this really cool application that might help him do his job better, so he installs it on the spot. Uh-oh.
One is the guy who's been working there for a while and the head of IT, tired of spending so much on Windows, tells him to install Linux on a few machines, so he follows the instructions and he's now the administrator.
The fact is that there are MILLIONS out there, and when you have millions of anything, you are going to have lots of different kinds of behavior that are hard to predict ahead of time.
Quoted 4 lines · Jonathan
One is the guy right out of college who really likes computers and he gets a job at a place where they use Linux, and he does a web search and finds this really cool application that might help him do his job better, so he installs it on the spot. Uh-oh.
See, that never happens here. Our guys use Linux while _in_ college (in between the periods where they need to run Windows to get their college work done ofcourse) and after graduation take a job collecting microsoft certifications that their boss pays them to collect.
Then I come along a couple of years later and buy the old soundcards that they put up for sale on our national auction site, mentioning I want that stuff for Linux testing and they get all teary-eyed and melancholic about the good old days when they had the time to play around with linux. Those fun childhood days.
Not making it up.
Quoted 3 lines
One is the guy who's been working there for a while and the head of IT, tired of spending so much on Windows, tells him to install Linux on a few machines, so he follows the instructions and he's now the administrator.
I saw that happening a few years ago here. By now, the small time shops that I'm aware of have all gone back to Windows. Linux simply cost them too much time which, if IT is not their business, they had no intention whatsoever of spending on IT.
Do let me assure you though that I'm definitely aware that my personal frame of refence might not be all that gobally applicable and bow out of the discussion.
Rene.
Quoted 3 lines
Again, do it all in userspace (caching, and scanning). I still really don't see the need to do this in the kernel becides it being "the way people have always done it."
We don't have notifiers for file segment changes that are scalable that far. We don't have mechanisms for delaying an open for a scan.
There are various bits of this you can't just do in user space. This doesn't just hurt virus scanners btw its also bad news for indexing disk content.
Quoted 6 lines · Alan Cox
Quoted 3 lines
Again, do it all in userspace (caching, and scanning). I still really don't see the need to do this in the kernel becides it being "the way people have always done it."
We don't have notifiers for file segment changes that are scalable that far.
I agree, but if we did, would that help out a lot here? Lots of other groups of people are needing/asking for something like this and if someone can finally get it together to post something useful, that might be a very good thing.
thanks,
greg k-h
Quoted 5 lines · On Tue, 5 Aug 2008 10:01:43 -0700 Greg KH <[email protected]> wrote:
Quoted 4 lines · Alan Cox
Quoted 3 lines
Again, do it all in userspace (caching, and scanning). I still really don't see the need to do this in the kernel becides it being "the way people have always done it."
Quoted 7 lines
Quoted 2 lines
We don't have notifiers for file segment changes that are scalable that far.
I agree, but if we did, would that help out a lot here? Lots of other groups of people are needing/asking for something like this and if someone can finally get it together to post something useful, that might be a very good thing.
A scalable notification scheme would certainly sort out content indexing systems more nicely. Open notifiers that scale let you do path indexing ("People who opened file X also opened file Y" - both for optimising disk layouts and for application level 'what do I prompt the user with' stuff)
The only thing I can see that is actually needed to get the whole thing working sweetly even for the virus and HSM cases is an LSM willing to bounce some opens via a user space helper. Even without that you could label content 'dubious' on close and relabel it accordingly in the asynchronous scanning app
Alan
Quoted 4 lines · Greg KH
On Mon, Aug 04, 2008 at 08:32:54PM -0400, Eric Paris wrote:
Oh, and after that, not using a binary interface, have we not learned from the ioctl mess? I sure thought we had...
I don't see a reason why we can't use strings and key=value pairs for any metadata being sent back and forth. That seem more reasonable?
Quoted 9 lines
Quoted 7 lines
Quoted 3 lines
Heh, so if you want to write a "virus" for Linux, just implement this flag. What's to keep a "rogue" program from telling the kernel that all programs on the system are to be excluded?
Processes can only get this flag one of 2 ways.
1) register as a client to make access decisions
How do you do that?
open the magic "vetting" file RW and you are a client who can answer access decisions.
Quoted 18 lines
Quoted 1 line
2) echo 1 into the magic file to enable the flag for themselves
Simple enough :)
Quoted 14 lines
Quoted 8 lines
Quoted 6 lines
10. Filesystem exclusions
-------------------------
One pretty important optimization is not to scan things like /proc, /sys or similar. Basically all filesystems where user can not store arbitrary, potentially malicious, content could and should be excluded from scanning.Why, does scanning these files take extra time? Just curious.
Perf win, why bothering looking for malware in /proc when it can't exist? It doesn't take longer it just takes time having to do
userspace -> kernel -> userspace -> kernel -> userspace
Quoted 7 lines
Quoted 4 lines
just to cat
/proc/mounts, all of this could probably be alliviated if we cached access on non block backed files but then we have to come up with a way to exclude only nfs/cifs. I'd rather list the FSs that don't need scanning every time than those that do....How long does this whole process take? Seriously is it worth the added kernel code for something that is not measurable?
Is it worth having 2 context switches for every open when none are needed? I plan to get numbers on that.
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
Quoted 18 lines
11. Path exclusions
-------------------
The need for exclusions can be demonstrated with an example of a MySQL server. It's data files are frequently modified which means they would need to be constantly rescanned which is very bad for performance. Also, it is most often not even possible to reasonably scan them. Therefore the best solution is not to scan its database store which can simply be implemented by excluding the store subdirectory.It is a relatively simple implementation which allows run-time configuration of a list of sub directories or files to exclude. Exclusion paths are relative to each process root. So for example if we want to exclude
/var/lib/mysql/and we have a mysql running in a chroot where from the outside that directory actually lives
in /chroot/mysql/var/lib/mysql,/var/lib/mysqlshould actually be added to the exclusion list.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
This is also not included in the initial patch set but will be coming shortly after.
Again, what's to keep all files to be marked as excluded?
You have to be root and I'll probably add an LSM hook?
Why an LSM hook? You aren't an LSM.
Maybe a new hook, maybe just a capability call, something to make root not the
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines
Closing remarks
---------------
Although some may argue some of the filters are not necessary or may better be implemented in userspace, we think it is better to have them in kernel primarily for performance reasons.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Why? What numbers do you have that say the kernel is faster in implementing this? This is the first mention of such a requirement, we need to see real data to back it up please.
In kernel caching is clearly a huge perf win.
Why? If the cache is also in userspace, it should be the same, right?
In kernel cache has 0 context switches for every open. Userspace caching has 2. Every open has to block, switch to the context of the userspace client/cache, get that decisions, and then switch back to the original process.
Quoted 8 lines · Eric Paris
Quoted 4 lines · Greg KH
On Mon, Aug 04, 2008 at 08:32:54PM -0400, Eric Paris wrote:
Oh, and after that, not using a binary interface, have we not learned from the ioctl mess? I sure thought we had...
I don't see a reason why we can't use strings and key=value pairs for any metadata being sent back and forth. That seem more reasonable?
Sure, but do you really want to put a parser in the kernel (well, make that, yet-another-parser-in-the-kernel...)?
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Heh, so if you want to write a "virus" for Linux, just implement this flag. What's to keep a "rogue" program from telling the kernel that all programs on the system are to be excluded?
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
Processes can only get this flag one of 2 ways.
1) register as a client to make access decisions
How do you do that?
open the magic "vetting" file RW and you are a client who can answer access decisions.
What's to keep anyone from doing this?
Quoted 10 lines
Quoted 10 lines
Quoted 9 lines
Perf win, why bothering looking for malware in /proc when it can't exist? It doesn't take longer it just takes time having to do
userspace -> kernel -> userspace -> kernel -> userspace
just to cat
/proc/mounts, all of this could probably be alliviated if we cached access on non block backed files but then we have to come up with a way to exclude only nfs/cifs. I'd rather list the FSs that don't need scanning every time than those that do....
Quoted 5 lines
Quoted 2 lines
How long does this whole process take? Seriously is it worth the added kernel code for something that is not measurable?
Is it worth having 2 context switches for every open when none are needed? I plan to get numbers on that.
Compared to the real time it takes in the "virus engine"? I bet it's totally lost in the noise. Those things are huge beasts with thousands to hundreds of thousands of context switches.
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
In kernel caching is clearly a huge perf win.
Why? If the cache is also in userspace, it should be the same, right?
In kernel cache has 0 context switches for every open. Userspace caching has 2. Every open has to block, switch to the context of the userspace client/cache, get that decisions, and then switch back to the original process.
Again, compared to what? If you in userspace are doing big complex things, such an overhead is trivial.
And again, realize that Linux has the fastest context switches _by far_ of any other operating system. It is ok to do things in userspace, we are used to that :)
thanks,
greg k-h
Greg KH wrote on 05/08/2008 21:15:35:
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Perf win, why bothering looking for malware in /proc when it can't exist? It doesn't take longer it just takes time having to do
userspace -> kernel -> userspace -> kernel -> userspace
just to cat
/proc/mounts, all of this could probably be alliviated
if we
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
cached access on non block backed files but then we have to come
up with
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
a way to exclude only nfs/cifs. I'd rather list the FSs that
don't need
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
scanning every time than those that do....
How long does this whole process take? Seriously is it worth the
added
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
kernel code for something that is not measurable?
Is it worth having 2 context switches for every open when none are needed? I plan to get numbers on that.
Compared to the real time it takes in the "virus engine"? I bet it's totally lost in the noise. Those things are huge beasts with thousands to hundreds of thousands of context switches.
No, because we are talking about a case here where we don't want to do any scanning. We want to detect if it is procfs (for example) as quickly as possible and don't do anything. Same goes for any other filesystem where it is not possible to store arbitrary user data.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
In kernel caching is clearly a huge perf win.
Why? If the cache is also in userspace, it should be the same,
right?
Quoted 4 lines
Quoted 4 lines
In kernel cache has 0 context switches for every open. Userspace caching has 2. Every open has to block, switch to the context of the userspace client/cache, get that decisions, and then switch back to
the
Quoted 4 lines
Quoted 1 line
original process.
Again, compared to what? If you in userspace are doing big complex things, such an overhead is trivial.
Again similar thing as above - In case of a cache we are not doing complex things.
So I think you can't argue that because scanning is slow everything else has to go to userspace. On a typical running system scanning is exceptional and everything else benefits from being in the fast path.
Tvrtko
Sophos Plc, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom.
Company Reg No 2096520. VAT Reg No GB 348 3873 20.
Quoted 22 lines · On Wed, Aug 06, 2008 at 10:37:06AM +0100, [email protected] wrote:
Greg KH wrote on 05/08/2008 21:15:35:
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Perf win, why bothering looking for malware in /proc when it can't exist? It doesn't take longer it just takes time having to do
userspace -> kernel -> userspace -> kernel -> userspace
just to cat
/proc/mounts, all of this could probably be alliviatedif we
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
cached access on non block backed files but then we have to come
up with
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
a way to exclude only nfs/cifs. I'd rather list the FSs that
don't need
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
scanning every time than those that do....
How long does this whole process take? Seriously is it worth the
added
Quoted 5 lines
Quoted 4 lines
Quoted 1 line
kernel code for something that is not measurable?
Is it worth having 2 context switches for every open when none are needed? I plan to get numbers on that.
Quoted 8 lines
Quoted 3 lines
Compared to the real time it takes in the "virus engine"? I bet it's totally lost in the noise. Those things are huge beasts with thousands to hundreds of thousands of context switches.
No, because we are talking about a case here where we don't want to do any scanning. We want to detect if it is procfs (for example) as quickly as possible and don't do anything. Same goes for any other filesystem where it is not possible to store arbitrary user data.
See previous messages about namespaces and paths for trying to figure this kind of information out in a sane way within the kernel.
Quoted 8 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
In kernel caching is clearly a huge perf win.
Why? If the cache is also in userspace, it should be the same,
right?
Quoted 4 lines
Quoted 4 lines
In kernel cache has 0 context switches for every open. Userspace caching has 2. Every open has to block, switch to the context of the userspace client/cache, get that decisions, and then switch back to
Quoted 8 lines
the
Quoted 4 lines
Quoted 1 line
original process.
Again, compared to what? If you in userspace are doing big complex things, such an overhead is trivial.
Again similar thing as above - In case of a cache we are not doing complex things.
Except for the overhead of keeping a cache :)
Quoted 3 lines
So I think you can't argue that because scanning is slow everything else has to go to userspace. On a typical running system scanning is exceptional and everything else benefits from being in the fast path.
I really can not judge as we have not seen an implementation yet.
thanks,
greg k-h
Quoted 27 lines · Greg KH
Quoted 26 lines · On Wed, Aug 06, 2008 at 10:37:06AM +0100, [email protected] wrote:
Greg KH wrote on 05/08/2008 21:15:35:
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Perf win, why bothering looking for malware in /proc when it can't exist? It doesn't take longer it just takes time having to do
userspace -> kernel -> userspace -> kernel -> userspace
just to cat
/proc/mounts, all of this could probably be alliviatedif we
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
cached access on non block backed files but then we have to come
up with
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
a way to exclude only nfs/cifs. I'd rather list the FSs that
don't need
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
scanning every time than those that do....
How long does this whole process take? Seriously is it worth the
added
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
kernel code for something that is not measurable?
Is it worth having 2 context switches for every open when none are needed? I plan to get numbers on that.
Compared to the real time it takes in the "virus engine"? I bet it's totally lost in the noise. Those things are huge beasts with thousands to hundreds of thousands of context switches.
Quoted 7 lines
Quoted 4 lines
No, because we are talking about a case here where we don't want to do any scanning. We want to detect if it is procfs (for example) as quickly as possible and don't do anything. Same goes for any other filesystem where it is not possible to store arbitrary user data.
See previous messages about namespaces and paths for trying to figure this kind of information out in a sane way within the kernel.
Didn't I already go over this? The patch for FS exclusions would not be namespace based, rather dentry->d_inode->i_sb->fstype->name matching.
Lets not start name based discussions at this point in time. Those patches weren't proposed on this go and reading the write up of both of the name based items (I think number 11 and 12) one I outright reject and the other will require future discussion.
-Eric
Greg KH <[email protected]> wrote on 06/08/2008 16:25:55:
Quoted 1 line
On Wed, Aug 06, 2008 at 10:37:06AM +0100, [email protected]
Quoted 3 lines · wrote:
Quoted 3 lines
Greg KH wrote on 05/08/2008 21:15:35:
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Perf win, why bothering looking for malware in /proc when it
can't
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
exist? It doesn't take longer it just takes time having to do
userspace -> kernel -> userspace -> kernel -> userspace
just to cat
/proc/mounts, all of this could probably be
alliviated
Quoted 2 lines
Quoted 2 lines
if we
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
cached access on non block backed files but then we have to
come
Quoted 6 lines
Quoted 6 lines
up with
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
a way to exclude only nfs/cifs. I'd rather list the FSs that
don't need
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
scanning every time than those that do....
How long does this whole process take? Seriously is it worth
the
Quoted 7 lines
Quoted 7 lines
added
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
kernel code for something that is not measurable?
Is it worth having 2 context switches for every open when none are needed? I plan to get numbers on that.
Compared to the real time it takes in the "virus engine"? I bet
it's
Quoted 1 line
Quoted 1 line
Quoted 1 line
totally lost in the noise. Those things are huge beasts with
thousands
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
to hundreds of thousands of context switches.
No, because we are talking about a case here where we don't want to do
any
Quoted 1 line
Quoted 1 line
scanning. We want to detect if it is procfs (for example) as quickly
as
Quoted 1 line
Quoted 1 line
possible and don't do anything. Same goes for any other filesystem
where
Quoted 3 lines
Quoted 1 line
it is not possible to store arbitrary user data.
See previous messages about namespaces and paths for trying to figure
this
Quoted 1 line
kind of information out in a sane way within the kernel.
How are namespaces and pathnames relevant to exclusions based on filesystem *type*? It is not about checking for /proc but checking if the filesystem name is proc, sysfs, ..
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
In kernel caching is clearly a huge perf win.
Why? If the cache is also in userspace, it should be the same,
right?
Quoted 3 lines
Quoted 3 lines
In kernel cache has 0 context switches for every open. Userspace caching has 2. Every open has to block, switch to the context of
the
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
userspace client/cache, get that decisions, and then switch back
to
Quoted 7 lines
Quoted 7 lines
the
Quoted 4 lines
Quoted 1 line
original process.
Again, compared to what? If you in userspace are doing big complex things, such an overhead is trivial.
Again similar thing as above - In case of a cache we are not doing
complex
Quoted 3 lines
Quoted 1 line
things.
Except for the overhead of keeping a cache :)
As small as possible - just one extra field in the inode struct.
And really you are talking about a different thing again and moving the argument around. I answered you why your argument about putting a cache in userspace since we do so much there already is wrong, because we don't do a lot (anything really) in userspace for vast majority of opens if we have this totally simple in-kernel caching scheme.
Quoted 5 lines
Quoted 3 lines
So I think you can't argue that because scanning is slow everything else has to go to userspace. On a typical running system scanning is exceptional and everything else benefits from being in the fast path.
I really can not judge as we have not seen an implementation yet.
Did you mean "_I_ have not seen an implementation yet"? Because Eric posted it so you can have a look at your leisure.
Tvrtko
Sophos Plc, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom.
Company Reg No 2096520. VAT Reg No GB 348 3873 20.
Eric Paris wrote on 05/08/2008 20:46:03:
Quoted 8 lines · Greg KH
Quoted 4 lines · Eric Paris
Oh, and after that, not using a binary interface, have we not learned from the ioctl mess? I sure thought we had...
I don't see a reason why we can't use strings and key=value pairs for any metadata being sent back and forth. That seem more reasonable?
Should be OK from my point of view assuming we keep cache and basic filesystem exclusions in kernel. Otherwise it would be too much work (I am talking about CPU time) to do with each and every interception.
Tvrtko
Sophos Plc, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom.
Company Reg No 2096520. VAT Reg No GB 348 3873 20.
RE: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interface foron access scanning
In reply to Eric ParisI share the concern here. The idea that a piece of malware can exclude itself seems nasty to me. I am not an expert on writing malware, but it intuitively seems to me to be a huge opportunity for creativity. The argument that it's ok because anything that the malware writes will eventually be scanned anyway does not reassure me.
Also... I was one of the people who brought up the idea of a process exclusion when the requirements list was being developed. I intended it as a way that an AV application could exclude specific OTHER processes by name (as selected by the AV user) -- not as a way that a process would exclude itself. I don't think that the implementation here reflects this goal, which still seems to me to be a requirement.
Jon Press
CA/HCL Internet Security Business Unit
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Eric Paris
Sent: Monday, August 04, 2008 8:33 PM
To: Greg KH
Cc: [email protected]; [email protected]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interface foron access scanning
Quoted 5 lines
Quoted 5 lines
9. Process exclusion
--------------------
Sometimes it is necessary to exclude certain processes from being intercepted. For example it might be a userspace root kit scanner
which
Quoted 1 line
Quoted 1 line
would not be able to find root kits if access to them was blocked by
the
Quoted 3 lines
Quoted 3 lines
on-access scanner.
To facilitate that we have created a special file a process can open
and
Quoted 4 lines
Quoted 4 lines
register itself as excluded. A flag is then put into its kernel structure (
task_struct) which makes it excluded from scanning.This implementation is very simple and provides greatest
performance. In
Quoted 1 line
Quoted 1 line
the proposed implementation access to the exclusion device is
controlled
Quoted 1 line
Quoted 1 line
though permissions on the device node which are not sufficient. An
LSM
Quoted 4 lines
Quoted 1 line
call will need to be made for this type or access in a later patch.
Heh, so if you want to write a "virus" for Linux, just implement this flag. What's to keep a "rogue" program from telling the kernel that
all
Quoted 1 line
programs on the system are to be excluded?
Processes can only get this flag one of 2 ways.
1) register as a client to make access decisions
2) echo 1 into the magic file to enable the flag for themselves
A process can only set this flag on itself and having this flag only means that your opens and closes will not be scanned. And excluded program could write a virus and it would not be caught on close, but it would be caught on the next open.
RE: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interface foron access scanning
Quoted 5 lines · Jonathan
I share the concern here. The idea that a piece of malware can exclude itself seems nasty to me. I am not an expert on writing malware, but it intuitively seems to me to be a huge opportunity for creativity. The argument that it's ok because anything that the malware writes will eventually be scanned anyway does not reassure me.
You aren't doing write time scanning anyway. This exclusion means that an 'excluded' process can OPEN things that would normally be called malware. The model here doesn't talk about adding files with bad information to the system it talks about stopping that bad information from being opened and propagated further. Thread exclusions as they are written in the patch only weaken security to those processes which actively choose to read malware, it in no way weakens the security of the system as a whole...
Quoted 7 lines
Also... I was one of the people who brought up the idea of a process exclusion when the requirements list was being developed. I intended it as a way that an AV application could exclude specific OTHER processes by name (as selected by the AV user) -- not as a way that a process would exclude itself. I don't think that the implementation here reflects this goal, which still seems to me to be a requirement.
Wait wit, you'd rather have a 'privileged' process be allowed to exclude every other process on a system than have a it only be allowed to exclude itself? and somehow that is safer?
"by name" is right out the window. You are never going to win 'by name' on anything to do with the kernel :) Maybe you can get me to eventually buy into 'by pid' or something like that, but setting flags on other running processes is always going to be racy and scary for me. Can you show me some code on how to do this cleanly? And why it needs to be done in kernel?
What is the goal you are trying to achieve? A performance win for the application in question or is this a security aware application that needs to be able to access 'sensitive' data?
-Eric
RE: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
Regarding self-exclusion... We are doing write-time scanning, or more accurately close-time scanning. We don't block the close, but we do scan the file afterwards, and if it is infected, we perform any one of several actions -- such as report to user, rename, quarantine, delete, etc. I would not want a self-excluded executable to be able to write something that I don't get to scan.
Regarding exclusion by name, etc... You are right. I am accustomed to thinking about our current architecture, which does not involve a published interface. I have to adjust my thinking. Putting such a feature into the kernel would not be a good idea. We can handle it in user space.
Jon
-----Original Message-----
From: Eric Paris [mailto:[email protected]]
Sent: Tuesday, August 05, 2008 10:57 AM
To: Press, Jonathan
Cc: Greg KH; [email protected]; [email protected]
Subject: RE: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
Quoted 1 line · Jonathan
I share the concern here. The idea that a piece of malware can
exclude
Quoted 1 line
itself seems nasty to me. I am not an expert on writing malware, but
it
Quoted 3 lines
intuitively seems to me to be a huge opportunity for creativity. The argument that it's ok because anything that the malware writes will eventually be scanned anyway does not reassure me.
You aren't doing write time scanning anyway. This exclusion means that an 'excluded' process can OPEN things that would normally be called malware. The model here doesn't talk about adding files with bad information to the system it talks about stopping that bad information from being opened and propagated further. Thread exclusions as they are written in the patch only weaken security to those processes which actively choose to read malware, it in no way weakens the security of the system as a whole...
Quoted 3 lines
Also... I was one of the people who brought up the idea of a process exclusion when the requirements list was being developed. I intended
it
Quoted 4 lines
as a way that an AV application could exclude specific OTHER processes by name (as selected by the AV user) -- not as a way that a process would exclude itself. I don't think that the implementation here reflects this goal, which still seems to me to be a requirement.
Wait wit, you'd rather have a 'privileged' process be allowed to exclude every other process on a system than have a it only be allowed to exclude itself? and somehow that is safer?
"by name" is right out the window. You are never going to win 'by name' on anything to do with the kernel :) Maybe you can get me to eventually buy into 'by pid' or something like that, but setting flags on other running processes is always going to be racy and scary for me. Can you show me some code on how to do this cleanly? And why it needs to be done in kernel?
What is the goal you are trying to achieve? A performance win for the application in question or is this a security aware application that needs to be able to access 'sensitive' data?
-Eric
RE: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
Quoted 6 lines · Jonathan
Regarding self-exclusion... We are doing write-time scanning, or more accurately close-time scanning. We don't block the close, but we do scan the file afterwards, and if it is infected, we perform any one of several actions -- such as report to user, rename, quarantine, delete, etc. I would not want a self-excluded executable to be able to write something that I don't get to scan.
With the current implementation there are 2 ways to be excluded. Both require root and I plan on both requiring the access to pass a newfangled LSM hook or maybe just require CAP_RAWIO. LSM people have thoughts?
Method #1) Become a client listening for access decisions, basically just open /security/talpa/client/talpa-client and you are free of open/close scans. We have to make the scanner itself not cause its own opens and closes to need scanned, think infinite recursion.
Method #2) Exclude yourself. This involves
opening /security/talpa/exclude/talpa-exclude and writing "1" into it. this file is owned by root and is 600. Regular user processes cannot exclude themselves willy nilly nor can any configuration exclude them. It might be possible to do exclusions in userspace using the pid and non-caching results for things other than the scanning clients themselves.
If you can outline the design of a better method that meets your needs I'd be glad to try to code it. In your mind how do you see programs being able to exclude others while not being a security risk? I assume your answer is that the program "giving out the exclusions" must be root, which we already satisfy. There is (or could be, I don't remember offhand) the option to disable thread exclusions in kernel (except for those threads that act as userspace clients, they MUST be excluded somehow). But really as it stands any root process could just enable them again. In the non-LSM case root processes already won so, they can just disable the whole infrastructure send kill -9 to all your clients and have at it.....
-Eric
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
Quoted 3 lines · On Tue, 05 Aug 2008 13:19:56 -0400 Eric Paris <[email protected]> wrote:
If you can outline the design of a better method that meets your needs I'd be glad to try to code it. In your mind how do you see programs being able to exclude others while not being a security risk?
ok so lets be specific.
You are trying to prevent an application from opening a "damaged" file, or from someone starting a "damaged" file.
You are not trying to prevent anything once you have executed a damaged file; once you execute one of these for this part it's game over (to limit the damage other tools like selinux exist, but are outside the scope of talpa).
So... as long as /sbin/init isn't compromised... intercepting exec and open (in all variants) is all you need.
And this can be done from userland with the preload: the "workaround" from the preload assumes you've already executed malicious code, which is outside of your protection scope.
What am I missing?
Signature · 3 lines
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
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
Quoted 5 lines
And this can be done from userland with the preload: the "workaround" from the preload assumes you've already executed malicious code, which is outside of your protection scope.
What am I missing?
Scripts
Attempts to screen content
Exec occuring after ld.so is compromised
Is there anything however that cannot be done with SELinux if you added the ability to block an open and kick it upwards (including the open of an exec binary)
It seems you would then get a transition from a label of 'trusted' to 'untrusted_unverified' and an open of untrusted_unverified can (depending on the SELinux rule) then block, trap upwards and continue according to a userspace response.
At that point all the questions like 'what do I want to scan for' become SELinux questions and we already have all the technology to do stuff like 'only scan for samba' or 'only scan for httpd and cgi' and do it efficiently.
The cache then becomes the labels which are already part of the fs and our existing labelling and context management.
Alan
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
Quoted 7 lines · On Tue, 5 Aug 2008 18:29:44 +0100 Alan Cox <[email protected]> wrote:
Quoted 5 lines
And this can be done from userland with the preload: the "workaround" from the preload assumes you've already executed malicious code, which is outside of your protection scope.
What am I missing?
Scripts
get either opened or exec'd...
(ignoring stdin-fed scripts right now.. but that's a problem regardless)
Quoted 1 line
Attempts to screen content
can you explain?
Quoted 1 line
Exec occuring after ld.so is compromised
this is post-compromise scenario; if you have enough root rights to do that then it's game over.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
Quoted 5 lines
Quoted 1 line
Scripts
get either opened or exec'd...
(ignoring stdin-fed scripts right now.. but that's a problem regardless)
Don't forget pty/tty pairs, ioctls to type chars etc
Quoted 3 lines
Quoted 1 line
Attempts to screen content
can you explain?
One common use for scanning is to scan content not looking for executable stuff but for things like malformed image files and the like. It's also useful for indexing and in those cases you don't really want ld.so in the way.
Quoted 4 lines
Quoted 1 line
Exec occuring after ld.so is compromised
this is post-compromise scenario; if you have enough root rights to do that then it's game over.
You still want to know if you spot this. And the root rights thing assumes no selinux. For a large case of uses I would agree however.
Alan
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
Quoted 5 lines · On Tue, 5 Aug 2008 21:12:43 +0100 Alan Cox <[email protected]> wrote:
Quoted 2 lines
this is post-compromise scenario; if you have enough root rights to do that then it's game over.
You still want to know if you spot this. And the root rights thing assumes no selinux. For a large case of uses I would agree however.
if selinux wouldn't stop a "not really root" root from writing to ld.so stuff you have a different problem ;-)
Signature · 3 lines
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
RE: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
In reply to Arjan van de VenI'm not sure if this is off the direct idea of this thread, or if I am possibly missing the whole point.
However, I want to point out that scanning on close is still an integral part of AV protection, even if intercepting opens and execs theoretically catches everything.
You can say that there are four parts to the malware life cycle -- getting on a machine, residing there, causing local damage, and propagating elsewhere. It is part of the philosophy of AV protection that you do everything you can to prevent all of them. That's why there are scans on close, scheduled scans, and scans on open. Most of our users employ all three and do not rely on one or two. If an infection arrives on a machine and finds a home because it is assumed that it will be caught when it is opened for use, then it is just one more compromise away from doing damage and/or spreading.
Jon Press
-----Original Message-----
From: Arjan van de Ven [mailto:[email protected]]
Sent: Tuesday, August 05, 2008 1:39 PM
To: Eric Paris
Cc: Press, Jonathan; Greg KH; [email protected]; [email protected]; [email protected]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
Quoted 3 lines · On Tue, 05 Aug 2008 13:19:56 -0400 Eric Paris <[email protected]> wrote:
If you can outline the design of a better method that meets your needs I'd be glad to try to code it. In your mind how do you see programs being able to exclude others while not being a security risk?
ok so lets be specific.
You are trying to prevent an application from opening a "damaged" file, or from someone starting a "damaged" file.
You are not trying to prevent anything once you have executed a damaged file; once you execute one of these for this part it's game over (to limit the damage other tools like selinux exist, but are outside the scope of talpa).
So... as long as /sbin/init isn't compromised... intercepting exec and open (in all variants) is all you need.
And this can be done from userland with the preload: the "workaround" from the preload assumes you've already executed malicious code, which is outside of your protection scope.
What am I missing?
Signature · 3 lines
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
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
A: No.
Q: Should I include quotations after my reply?
Quoted 2 lines · Jonathan
I'm not sure if this is off the direct idea of this thread, or if I am possibly missing the whole point.
I think you might be missing the point a bit here, as the traditional Unix model that Linux has prevents much of what the "traditional AV" products need to do, right?
Quoted 3 lines
However, I want to point out that scanning on close is still an integral part of AV protection, even if intercepting opens and execs theoretically catches everything.
Great, then put a hook in glibc and catch all closes and then kick off your scanning.
Quoted 4 lines
You can say that there are four parts to the malware life cycle -- getting on a machine, residing there, causing local damage, and propagating elsewhere. It is part of the philosophy of AV protection that you do everything you can to prevent all of them.
But this proposed patchset does not do much to prevent all of these, right?
Quoted 5 lines
That's why there are scans on close, scheduled scans, and scans on open. Most of our users employ all three and do not rely on one or two. If an infection arrives on a machine and finds a home because it is assumed that it will be caught when it is opened for use, then it is just one more compromise away from doing damage and/or spreading.
So how are you going about preventing the "infection from arriving" with this proposed patchset?
Isn't that something that SELinux or another LSM can prevent better?
thanks,
greg k-h
RE: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 1 line
Quoted 1 line
I think you might be missing the point a bit here, as the traditional
Unix model that
Quoted 1 line
Quoted 1 line
Linux has prevents much of what the "traditional AV" products need to
do, right?
Is your point that Linux and Unix machines are less vulnerable to viruses? If so, that's not relevant to my point at all. A Unix machine can be a carrier, passing infections on to other vulnerable platforms (guess which one). An enterprise security system sees the entire enterprise as an integrated whole -- not just individual machines with their own separate attributes and no impact on each other at all.
Quoted 2 lines
Quoted 2 lines
So how are you going about preventing the "infection from arriving" with this proposed patchset?
I'm not endorsing or opposing the proposal until I digest it further.
However, I will say that while preventing infections from arriving is not foolproof, doing a scan-on-close with the option to delete or quarantine an infected file goes a long way.
Jon
-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Tuesday, August 05, 2008 2:12 PM
To: Press, Jonathan
Cc: Arjan van de Ven; Eric Paris; [email protected]; [email protected]; [email protected]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
A: No.
Q: Should I include quotations after my reply?
Quoted 2 lines · Jonathan
I'm not sure if this is off the direct idea of this thread, or if I am possibly missing the whole point.
I think you might be missing the point a bit here, as the traditional Unix model that Linux has prevents much of what the "traditional AV" products need to do, right?
Quoted 1 line
However, I want to point out that scanning on close is still an
integral
Quoted 2 lines
part of AV protection, even if intercepting opens and execs theoretically catches everything.
Great, then put a hook in glibc and catch all closes and then kick off your scanning.
Quoted 4 lines
You can say that there are four parts to the malware life cycle -- getting on a machine, residing there, causing local damage, and propagating elsewhere. It is part of the philosophy of AV protection that you do everything you can to prevent all of them.
But this proposed patchset does not do much to prevent all of these, right?
Quoted 5 lines
That's why there are scans on close, scheduled scans, and scans on open. Most of our users employ all three and do not rely on one or two. If an infection arrives on a machine and finds a home because it is assumed that it will be caught when it is opened for use, then it is just one more compromise away from doing damage and/or spreading.
So how are you going about preventing the "infection from arriving" with this proposed patchset?
Isn't that something that SELinux or another LSM can prevent better?
thanks,
greg k-h
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 6 lines · Jonathan
Is your point that Linux and Unix machines are less vulnerable to viruses? If so, that's not relevant to my point at all. A Unix machine can be a carrier, passing infections on to other vulnerable platforms (guess which one). An enterprise security system sees the entire enterprise as an integrated whole -- not just individual machines with their own separate attributes and no impact on each other at all.
Sure, but if that's the case, you don't need to have a blocking open() interface. Having inotify tell your application that a file descriptor that had been opened for writing has been closed (IN_CLOSE_WRITE) should be quite sufficient.
- Ted
RE: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
-----Original Message-----
From: Theodore Tso [mailto:[email protected]]
Sent: Tuesday, August 05, 2008 2:55 PM
To: Press, Jonathan
Cc: Greg KH; Arjan van de Ven; Eric Paris; [email protected]; [email protected]; [email protected]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Quoted 2 lines · Jonathan
Is your point that Linux and Unix machines are less vulnerable to viruses? If so, that's not relevant to my point at all. A Unix
machine
Quoted 4 lines
can be a carrier, passing infections on to other vulnerable platforms (guess which one). An enterprise security system sees the entire enterprise as an integrated whole -- not just individual machines with their own separate attributes and no impact on each other at all.
Sure, but if that's the case, you don't need to have a blocking open() interface. Having inotify tell your application that a file descriptor that had been opened for writing has been closed (IN_CLOSE_WRITE) should be quite sufficient.
[JON PRESS] I don't get the connection between what I said and your point about not needing blocking open() interface. If I ftp into a Linux machine and GET an infected file, you want FTP to go right ahead and read it and send it to me over the wire?
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Quoted 5 lines · Jonathan
[JON PRESS] I don't get the connection between what I said and your point about not needing blocking
open()interface. If I ftp into a Linux machine and GET an infected file, you want FTP to go right ahead and read it and send it to me over the wire?
Shouldn't that be the issue of the FTP server itself not serving up "invalid" files, and not the kernel? Why not just hook in it, I'm pretty sure they already provide this kind of interface, right?
thanks,
greg k-h
RE: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforonaccess scanning
-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Tuesday, August 05, 2008 5:15 PM
To: Press, Jonathan
Cc: Theodore Tso; Arjan van de Ven; Eric Paris; [email protected]; [email protected]; [email protected]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforonaccess scanning
Quoted 5 lines · Jonathan
[JON PRESS] I don't get the connection between what I said and your point about not needing blocking
open()interface. If I ftp into a Linux machine and GET an infected file, you want FTP to go right ahead and read it and send it to me over the wire?
Shouldn't that be the issue of the FTP server itself not serving up "invalid" files, and not the kernel? Why not just hook in it, I'm pretty sure they already provide this kind of interface, right?
[JON PRESS] So how would that work? The FTP server would have code that called into someone's AV SDK (maybe CA's, maybe not) and scanned the file before sending. OK. What about all the thousands of other applications that might access a file and send it somewhere, or copy it somewhere. They should all do the same thing, right? How do we make that happen? That's the whole point of centralizing the control (the notification, blocking and waiting -- not the actual scanning, of course) in the kernel. The scan becomes unavoidable -- and that is the definition (OK, a definition) of true security.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforonaccess scanning
Quoted 17 lines · Jonathan
-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Tuesday, August 05, 2008 5:15 PM
To: Press, Jonathan
Cc: Theodore Tso; Arjan van de Ven; Eric Paris; [email protected]; [email protected]; [email protected]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforonaccess scanningQuoted 5 lines · Jonathan
[JON PRESS] I don't get the connection between what I said and your point about not needing blocking
open()interface. If I ftp into a Linux machine and GET an infected file, you want FTP to go right ahead and read it and send it to me over the wire?
Quoted 6 lines
Shouldn't that be the issue of the FTP server itself not serving up "invalid" files, and not the kernel? Why not just hook in it, I'm pretty sure they already provide this kind of interface, right?
[JON PRESS] So how would that work?
the admin (or distro) decides he wants all files opened by the FTP server scanned, so he starts the FTP server with the LD_PRELOAD set.
Signature · 3 lines
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
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforonaccess scanning
In reply to Press, JonathanQuoted 9 lines · Jonathan
[JON PRESS] So how would that work? The FTP server would have code that called into someone's AV SDK (maybe CA's, maybe not) and scanned the file before sending. OK. What about all the thousands of other applications that might access a file and send it somewhere, or copy it somewhere. They should all do the same thing, right? How do we make that happen? That's the whole point of centralizing the control (the notification, blocking and waiting -- not the actual scanning, of course) in the kernel. The scan becomes unavoidable -- and that is the definition (OK, a definition) of true security.
Give me a break... There's nothing to stop you from doing that as a stackable fs, cachefs-based filesystem, fuse-based filesystem, CODA with trimmed-down server that does scan-on-commit, et sodding cetera.
Again, do you or do you not expect the malware to be active on scanning host? Yes or no, please.
These two variants are so fundamentally different that discussion without clearly indicating which variant you are currently talking about is absolutely pointless.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforonaccess scanning
In reply to Press, JonathanQuoted 22 lines · Jonathan
-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Tuesday, August 05, 2008 5:15 PM
To: Press, Jonathan
Cc: Theodore Tso; Arjan van de Ven; Eric Paris; [email protected]; [email protected]; [email protected]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforonaccess scanningQuoted 5 lines · Jonathan
[JON PRESS] I don't get the connection between what I said and your point about not needing blocking
open()interface. If I ftp into a Linux machine and GET an infected file, you want FTP to go right ahead and read it and send it to me over the wire?Shouldn't that be the issue of the FTP server itself not serving up "invalid" files, and not the kernel? Why not just hook in it, I'm pretty sure they already provide this kind of interface, right?
Quoted 5 lines
[JON PRESS] So how would that work? The FTP server would have code that called into someone's AV SDK (maybe CA's, maybe not) and scanned the file before sending. OK. What about all the thousands of other applications that might access a file and send it somewhere, or copy it somewhere.
Ok, let's stop right here.
Please answer Al's question:
What is the threat model this proposal is attempting to address?
Unless this is well defined, we will go down the "hook this here", "but what about..." argument back and forth for a very long time getting no where.
So please let's end this thread right now and can someone please post the answer to this question.
thanks,
greg k-h
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [malware-list] [RFC 0/5] [TALPA] Intro toalinuxinterfaceforonaccess scanning
Quoted 10 lines · Jonathan
Sorry for the top-post... but I give up.
I don't think I'm stupid, but frankly I don't understand the point of the questions being asked in the last three responses to my statement. I don't know why they are relevant, and I don't know how to answer them in a framework that we can all understand at the same time. What is my threat model? Naively stated, it is that there is a file on a machine that might do damage, either there or elsewhere, and I want to find it and get rid of it in the most efficient way. I am not defining the nature of the damage or the mechanism.
If you can not define this, in a precise manner, then how can we expect to review the proposed solution to ensure that it matches your needs?
Without that, this patchset is going to go nowhere but into the circular bin :(
greg k-h
Re: [malware-list] [RFC 0/5] [TALPA] Intro toalinuxinterfaceforonaccess scanning
Quoted 7 lines · Greg KH
Quoted 6 lines · Jonathan
Sorry for the top-post... but I give up.
I don't think I'm stupid, but frankly I don't understand the point of the questions being asked in the last three responses to my statement. I don't know why they are relevant, and I don't know how to answer them in a framework that we can all understand at the same time.
Excuse me? One of those questions had been a very specific yes-or-no one and I certainly hope that we all can understand either answer to such...
For the record, the question is
"Do you or do you not expect the malware to be active on scanning host?"
I hope that relevance of that to the analysis of software involved in scanning should be obvious.
Re: [malware-list] [RFC 0/5] [TALPA] Intro toalinuxinterfaceforonaccess scanning
Quoted 9 lines · Al Viro
Quoted 7 lines · Greg KH
Quoted 6 lines · Jonathan
Sorry for the top-post... but I give up.
I don't think I'm stupid, but frankly I don't understand the point of the questions being asked in the last three responses to my statement. I don't know why they are relevant, and I don't know how to answer them in a framework that we can all understand at the same time.
Quoted 6 lines
Excuse me? One of those questions had been a very specific yes-or-no one and I certainly hope that we all can understand either answer to such...
For the record, the question is
"Do you or do you not expect the malware to be active on scanning host?"
I do believe for a number of AV vendors the answer is yes. I will try to have some offline conversations with the right people at a number of vendors and work to better define the threats that they wish to or believe they are able to help mitigate.
-Eric
Quoted 2 lines
I hope that relevance of that to the analysis of software involved in scanning should be obvious.
Re: [malware-list] [RFC 0/5] [TALPA] Intro toalinuxinterfaceforonaccess scanning
Quoted 4 lines · Eric Paris
I do believe for a number of AV vendors the answer is yes. I will try to have some offline conversations with the right people at a number of vendors and work to better define the threats that they wish to or believe they are able to help mitigate.
OK, and if the malware is running on the machine, does the malware have root (superuser) access?
- Ted
Re: [malware-list] [RFC 0/5] [TALPA] Intro toalinuxinterfaceforonaccess scanning
In reply to Eric ParisQuoted 13 lines · Eric Paris
Quoted 12 lines · Al Viro
Quoted 7 lines · Greg KH
Quoted 6 lines · Jonathan
Sorry for the top-post... but I give up.
I don't think I'm stupid, but frankly I don't understand the point of the questions being asked in the last three responses to my statement. I don't know why they are relevant, and I don't know how to answer them in a framework that we can all understand at the same time.
Excuse me? One of those questions had been a very specific yes-or-no one and I certainly hope that we all can understand either answer to such...
Quoted 8 lines
Quoted 3 lines
For the record, the question is
"Do you or do you not expect the malware to be active on scanning host?"
I do believe for a number of AV vendors the answer is yes. I will try to have some offline conversations with the right people at a number of vendors and work to better define the threats that they wish to or believe they are able to help mitigate.
This is troubling to me. Why "offline conversations"? Why are you being forced to be the mediator here? Why will these companies not contribute directly to the development of this code/model in public, like all other major Linux kernel contributions?
Isn't this the point of the malware-list in the first place?
For them to hide behind _anyone_ seems very suspect.
thanks,
greg k-h
Re: [malware-list] [RFC 0/5] [TALPA] Intro toalinuxinterfaceforonaccess scanning
Quoted 23 lines · Greg KH
Quoted 13 lines · Eric Paris
Quoted 12 lines · Al Viro
Quoted 7 lines · Greg KH
Quoted 6 lines · Jonathan
Sorry for the top-post... but I give up.
I don't think I'm stupid, but frankly I don't understand the point of the questions being asked in the last three responses to my statement. I don't know why they are relevant, and I don't know how to answer them in a framework that we can all understand at the same time.
Excuse me? One of those questions had been a very specific yes-or-no one and I certainly hope that we all can understand either answer to such...
Quoted 8 lines
Quoted 3 lines
For the record, the question is
"Do you or do you not expect the malware to be active on scanning host?"
I do believe for a number of AV vendors the answer is yes. I will try to have some offline conversations with the right people at a number of vendors and work to better define the threats that they wish to or believe they are able to help mitigate.
Quoted 4 lines
This is troubling to me. Why "offline conversations"? Why are you being forced to be the mediator here? Why will these companies not contribute directly to the development of this code/model in public, like all other major Linux kernel contributions?
I'm going to be trying to get them to talk offline because obviously few people from the AV industry are stepping up online. I'm told we'll be hearing from Sophos tomorrow and hopefully they will have read all of today chatter and will form a coherent position.
Quoted 1 line
Isn't this the point of the malware-list in the first place?
Yes it is, hopefully if we can move parts of this conversation to malware list the AV vendors will feel a bit less like this is an us against them proposition and more like a collaborative effort. From my point of view I'd have to say that everyone has been refreshingly
polite :)
Quoted 1 line
For them to hide behind _anyone_ seems very suspect.
I don't think its hiding, I'm attempting to bring these companies who just don't understand how to work in public after years of building walls along at a reasonable pace so noone feels they have to give up or that finding a real solution is an impossible task.
-Eric
Re: [malware-list] [RFC 0/5] [TALPA] Intro toalinuxinterfaceforonaccess scanning
Quoted 2 lines · On Tue, 05 Aug 2008 20:25:29 -0400 Eric Paris <[email protected]> wrote:
I don't think its hiding, I'm attempting to bring these companies who just don't understand how to work in public
That's not my worry.
My real worry is that the anti-virus companies have been working with an enforcement policy that has been evolving slowly from the DOS days, while today's threat model has changed considerably.
I do not see how the proposed hooks would close off a system sufficiently to claim anything approaching security.
The way forward is to:
1) define a threat model
2) figure out what infrastructure is needed for protection
3) come up with interfaces that also help other software (eg. file range inotify to help disk indexing software)
Trying to shoe-horn the DOS anti-virus security model into a multi-user operating system with networking may not be sufficient protection for today's world. Eg. it does not protect against script virusses fetched off web sites and executed directly in a browser, office suite or any gnome-vfs enabled program. This is a major vulnerability in modern systems.
What problem are we really trying to solve?
Which problems are out of scope?
What infrastructure can solve the problem, while being useful for other things too?
Signature · 1 line
All rights reversed.
Re: [malware-list] [RFC 0/5] [TALPA] Intro toalinuxinterfaceforonaccess scanning
Quoted 3 lines · Rik van Riel
My real worry is that the anti-virus companies have been working with an enforcement policy that has been evolving slowly from the DOS days, while today's threat model has changed considerably.
... and which also doesn't into account some of the facilities which Linux has, that DOS/Windows does not have.
Part of the problem I suspect is that the AV folks have managed to get CIO's believe that all computer systems need to have anti-virus software, of the same design that is needed for DOS/Windows systems. This state of delusion is so bad that apparently some AV engineers aren't even willing to reason from first principles what is necessary or not to maintain a secure system.
And arguably, if the goal is security theater, much like the security lines in airports, perhaps it doesn't matter. If there are silly CIO's that are willing to pay for such a thing, regardless of whether or not it is actually *necessary* to maintain security, one school of capitalism would say it doesn't matter if it actually provides any functional value or not.
On the other hand, it seems pretty clear there are plenty of LKML developers who aren't buying it. :-)
It may be helpful to separate the threat model into at least three different scenarios:
The Linux Desktop (where clueless users may be tricked into
running malware).
The Linux File Server (where it is *highly* unlikely to have
active running malware, since there are no clueless users running on said file server), but where malware may be stored and read over CIFS, NFS, etc.
The Linux Mail server is really a restricted case of the Linux
Fileserver; where the only way in is SMTP, and the only protocol out is IMAP/POP.
Clamav arguably does a very nice job for the third case. And the number of ways in and out for a Linux fileserver is sufficiently small (and there are no clueless users to start the malware program running), that it's relatively easy to reason about.
In the Linux Desktop case, you do have to worry about clueless users, but in general you don't have to worry about serving CIFS or NFS on such boxes.
It seems that the AV folks are trying to argue for a worst case scenario --- one where you have a clueless user, *and* you have a root comproise, *and* it is also simultaneously serving as a high output fileserver. #1, I think it is questionable whether this is a reasonable model, and #2, if root is compromised, no amount of scanning software will helpyou, since the malware can simply directly attach and disable the scanning software.
But it is specifically this sort of threat analysis and explicit detailing of the assumptions of what capabilities the attacker has which is critical for proceeding. The fact at least one AV engineer thinks it's pointless to do this sort of low-level design is disappointing.
- Ted
Re: [malware-list] Threat model for Unix Computers
Am Mittwoch, 6. August 2008 03:44 schrieb Theodore Tso:
Quoted 1 line · Rik van Riel
...
I'm trying to fill in some other thread models, not all directly related to virus-scanning, but if we want to get a complete anti-threat model for linux, we should take them into account too.
In addition I'll add some usage scenarios for later extracting some threat scenarios ...
Desktop-Users:
----------------------
Quoted 2 lines
The Linux Desktop (where clueless users may be tricked into
running malware).
I would add the chance of users exporting there locally stored Files via CIFS, SMB, http, ... for accessing them with there beloveled streaming clients.
Speaking of exporting Files from a Desktop PC we should also take in account File-Sharing clients.
Some more examples of a Desktop Users desire would be:
- copying Files to/from there PDA (BT,USB,WLAN)
- sharing internet connection with there PDA (BT,USB,WLAN)
Another threads would be:
- giving access to the Desktop-PC to guest-users for
"just let me look up something in the internet"
and the guest-user on the Desktop not informing about the (in his point of view) urgent installation of there beloved Browser-malware^H^H^H^H^H -adware ^H^H^H^H^H -extention
For all the Files stored on the Desktop PC we should also take in account, that the paranoid Desktop user would store them inside a crypted device/container. Some examples would be: truecrypt-container/-partition, External crypted Harddrive, ...
... speaking of storing Files I would expect even Desktop Homeusers to store there Files on a local mini Fileserver (like a Fritz-Box, NSLU2, ...) to share them with other devices like Multimedia players, ...
Notebook-Users:
------------------------
And then we have the Linux Notebook users. I separate these from the Desktop users, because they will have most of the Scenarios for Desktop users plus some additional treats.
- Connecting to random accesspoints (Airports, Hotels, ...)
- Exporting there Wireless (BT,WLAN,UMTS, ...) to random people. Sometimes willingly, sometimes unwillingly
- leaving there Notebooks unattended
- without Bios password
- without HDD-encrytion
- without Boot-Manager Password
- without screenlock
- ...
Linux Desktops in public places:
--------------------------------------------
I'm thinking of Linux Desktop PCs in places like Internet-Cafe, Public-Library, School, ...
These would be similar to the Standard Linux Desktop but adding some additional threats.
- willingly trying to attack the PC with physical access to
- CD-Rom
- USB-Devices
USB-Stick
Card Reader
- Network cable
- Floppy drive (if still existing)
- Reset Button
Quoted 4 lines
The Linux File Server (where it is *highly* unlikely to have
active running malware, since there are no clueless users running on said file server), but where malware may be stored and read over CIFS, NFS, etc.
Maybe it "was" unlikely, but you can see more and more (Now-)Unix-administrators originally used to other operating systems and with a different view to security. So it would be nice if we would be able to protect these users/admins/installations too.
Mail-Proxy:
--------------
Quoted 3 lines
The Linux Mail server is really a restricted case of the Linux
Fileserver; where the only way in is SMTP, and the only protocol out is IMAP/POP.
I would add SMTP for the outgoing channel too.
Web-Proxy:
----------------
Only to complete the list:
The Linux Web Proxy is another example of a Linux Server.
The way in would be http traffic (mostly over port 80 and 443) and the way out will be either over a shared proxy port or offered transparent if the Linux machine is used as router.
In my opinion all good webproxies with scanner already provide a pretty good solution here.
Signature · 15 lines
Jörg Ostertag - Manager UNIX SW Development - Avira GmbH Phone: +49 (0) 7542/500-500 Fax: +49 (0) 7542/500-576 Lindauer Str. 21, D-88069 Tettnang, Germany, http://www.avira.com PGP Key-ID: 0x46BDEF37 Geschäftsführender Gesellschafter: Tjark Auerbach Sitz der Gesellschaft: Tettnang Handelsregister: Amtsgericht Ulm, HRB 630992 ALLGEMEINE GESCHÄFTSBEDINGUNGEN Es gelten unsere Allgemeinen Geschäftsbedingungen (AGB). Sie finden sie in der jeweils gültigen Fassung im Internet unter http://www.avira.de/agb ***************************************************
Re: [malware-list] Threat model for Unix Computers
Quoted 101 lines · Jörg Ostertag
Am Mittwoch, 6. August 2008 03:44 schrieb Theodore Tso:
Quoted 1 line · Rik van Riel
...
I'm trying to fill in some other thread models, not all directly related to virus-scanning, but if we want to get a complete anti-threat model for linux, we should take them into account too.
In addition I'll add some usage scenarios for later extracting some threat scenarios ...Desktop-Users:
----------------------Quoted 2 lines
The Linux Desktop (where clueless users may be tricked into
running malware).I would add the chance of users exporting there locally stored Files via CIFS, SMB, http, ... for accessing them with there beloveled streaming clients.
Speaking of exporting Files from a Desktop PC we should also take in account File-Sharing clients.
Some more examples of a Desktop Users desire would be:
- copying Files to/from there PDA (BT,USB,WLAN)
- sharing internet connection with there PDA (BT,USB,WLAN)Another threads would be:
- giving access to the Desktop-PC to guest-users for
"just let me look up something in the internet"
and the guest-user on the Desktop not informing about the (in his point of view) urgent installation of there beloved Browser-malware^H^H^H^H^H -adware ^H^H^H^H^H -extentionFor all the Files stored on the Desktop PC we should also take in account, that the paranoid Desktop user would store them inside a crypted device/container. Some examples would be: truecrypt-container/-partition, External crypted Harddrive, ...
... speaking of storing Files I would expect even Desktop Homeusers to store there Files on a local mini Fileserver (like a Fritz-Box, NSLU2, ...) to share them with other devices like Multimedia players, ...
Notebook-Users:
------------------------
And then we have the Linux Notebook users. I separate these from the Desktop users, because they will have most of the Scenarios for Desktop users plus some additional treats.
- Connecting to random accesspoints (Airports, Hotels, ...)
- Exporting there Wireless (BT,WLAN,UMTS, ...) to random people. Sometimes willingly, sometimes unwillingly
- leaving there Notebooks unattended
- without Bios password
- without HDD-encrytion
- without Boot-Manager Password
- without screenlock
- ...Linux Desktops in public places:
--------------------------------------------
I'm thinking of Linux Desktop PCs in places like Internet-Cafe, Public-Library, School, ...
These would be similar to the Standard Linux Desktop but adding some additional threats.
- willingly trying to attack the PC with physical access to
- CD-Rom
- USB-Devices
USB-Stick
Card Reader
- Network cable
- Floppy drive (if still existing)
- Reset ButtonQuoted 4 lines
The Linux File Server (where it is *highly* unlikely to have
active running malware, since there are no clueless users running on said file server), but where malware may be stored and read over CIFS, NFS, etc.Maybe it "was" unlikely, but you can see more and more (Now-)Unix-administrators originally used to other operating systems and with a different view to security. So it would be nice if we would be able to protect these users/admins/installations too.
Mail-Proxy:
--------------Quoted 3 lines
The Linux Mail server is really a restricted case of the Linux
Fileserver; where the only way in is SMTP, and the only protocol out is IMAP/POP.I would add SMTP for the outgoing channel too.
Web-Proxy:
----------------
Only to complete the list:
The Linux Web Proxy is another example of a Linux Server.
The way in would be http traffic (mostly over port 80 and 443) and the way out will be either over a shared proxy port or offered transparent if the Linux machine is used as router.
Quoted 4 lines
In my opinion all good webproxies with scanner already provide a pretty good solution here.
Software Conflits
------------------------
Anti-virus Software conflicting with other secuirty software. This is a design issue on Windows and some of the hooks different companies have tried to develop for the Linux world.
Linux systems can have HIDS and other non anti-virus monitoring
software. On windows realtime scanning can be crippled if you
install 2 anti-viruses at a time due to stuffing up each others hooks.
We need to avoid this on Linux. There is more that will want to
monitor the same things as a Antivirus on Linux looking for different
kinds of problems. Yes the first platform where 1 alone running does
not cut it.
Peter Dolding
Re: [malware-list] Threat model for Unix Computers
In reply to Jörg OstertagQuoted 6 lines · J?rg Ostertag
Another threads would be:
- giving access to the Desktop-PC to guest-users for
"just let me look up something in the internet"
and the guest-user on the Desktop not informing about the (in his point of view) urgent installation of there beloved Browser-malware^H^H^H^H^H -adware ^H^H^H^H^H -extention
if you give the guest user access to your account this is the same as the clueless desktop user.
if you make a new account for that user the standard *nix permissions and user seperation come to your rescue, they may infect that temporary account, but that won't infect the normal user.
David Lang
Re: [malware-list] Threat model for Unix Computers
In reply to Jörg OstertagOn Fri, Aug 8, 2008 at 3:48 AM, Jörg Ostertag <[email protected]> wrote:> - giving access to the Desktop-PC to guest-users for> "just let me look up something in the internet"> and the guest-user on the Desktop not informing about the (in his point of> view) urgent installation of there beloved> Browser-malware^H^H^H^H^H -adware ^H^H^H^H^H -extention
Install the xguest package on Fedora (yum install xguest), use thefast user switch applet, and be done:
http://dwalsh.fedorapeople.org/xguest/
http://danwalsh.livejournal.com/14778.html���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m����������?�I�
Re: [malware-list] [RFC 0/5] [TALPA] Intro toalinuxinterfaceforonaccess scanning
In reply to a message not in the archiveQuoted 9 lines · Jonathan
I don't think I'm stupid, but frankly I don't understand the point of the questions being asked in the last three responses to my statement. I don't know why they are relevant, and I don't know how to answer them in a framework that we can all understand at the same time. What is my threat model? Naively stated, it is that there is a file on a machine that might do damage, either there or elsewhere, and I want to find it and get rid of it in the most efficient way. I am not defining the nature of the damage or the mechanism.
This is actually quite shocking to me. You don't know how to define the threat model? And you call yourself in the security business? Read some books or essays by Bruce Schneier. A good one might be his recent book, "Beyond Fear: Thinking Sensibly About Security In An Uncertain World".
The naive refusal to think about threat models is why we have to submit to really insane, useless, "security theater" every time we get on an Airplane and have to take off our shoes and throw our bottleed water into a huge heap in front of the security line. (If they really thought the water bottles could contain explosives, why leave them in a huge pile in front of the TSA employees. :-)
If the goal is to get make we are proof against malware, we need to be very clear about the whys and wherefores about how the file might have gotten there. And if you are going to be serving that file a million times a day, does it really make sense to block the open a million times a day, or do you make sure that you notice when it gets corrupted in the first place?
And security is not an absolute. Just as the terrorists win if it can induce the White House to shred the constitution and force us all to live in a constant state of fear, it is also pointless to induce people to install software that horrifically slows down their server so badly that you can't get anything done.
If people in the AV industry don't know how to think about threat models, it says a lot about their competence as security engineers. And I say this as someone who was team lead of Kerberos at MIT, and was the chair of the IP Security working group at the IETF (the standards body for the Internet), and who has served on the Security Area Directorate (alongside Bruce Schneier) at the IETF.
- Ted
Re: [malware-list] [RFC 0/5] [TALPA] Intro toalinuxinterfaceforonaccess scanning
Quoted 17 lines · Jonathan
Quoted 9 lines
I don't think I'm stupid, but frankly I don't understand the point of the questions being asked in the last three responses to my statement. I don't know why they are relevant, and I don't know how to answer them in a framework that we can all understand at the same time. What is my threat model? Naively stated, it is that there is a file on a machine that might do damage, either there or elsewhere, and I want to find it and get rid of it in the most efficient way. I am not defining the nature of the damage or the mechanism.
This is actually quite shocking to me. You don't know how to define the threat model? And you call yourself in the security business? Read some books or essays by Bruce Schneier. A good one might be his recent book, "Beyond Fear: Thinking Sensibly About Security In An Uncertain World".
Quoted 6 lines
The naive refusal to think about threat models is why we have to submit to really insane, useless, "security theater" every time we get on an Airplane and have to take off our shoes and throw our bottleed water into a huge heap in front of the security line. (If they really thought the water bottles could contain explosives, why leave them in a huge pile in front of the TSA employees. :-)
Actually it is better. When I travelled from brussels they were so busy confiscating water from me that they missed a knife ;-).
Quoted 6 lines
If the goal is to get make we are proof against malware, we need to be very clear about the whys and wherefores about how the file might have gotten there. And if you are going to be serving that file a million times a day, does it really make sense to block the open a million times a day, or do you make sure that you notice when it gets corrupted in the first place?
Well, I'm afraid that AV industry with its "lets enumerate badness" model... just does not protect against anything at all...
Maybe we should be thinking more like "only ever run exectuables from trusted sources" -- like from your distro -- ? Fortunately that's the way most linux users work today.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
In reply to Press, JonathanQuoted 9 lines · Jonathan
Quoted 1 line
Quoted 1 line
I think you might be missing the point a bit here, as the traditional
Unix model that
Quoted 1 line
Quoted 1 line
Linux has prevents much of what the "traditional AV" products need to
do, right?
Is your point that Linux and Unix machines are less vulnerable to viruses? If so, that's not relevant to my point at all. A Unix machine can be a carrier, passing infections on to other vulnerable platforms (guess which one).
So you are going to try to force us to take something into the Linux kernel due to the security inadiquacies of a totally different operating system? You might want to rethink that argument :)
Quoted 3 lines
An enterprise security system sees the entire enterprise as an integrated whole -- not just individual machines with their own separate attributes and no impact on each other at all.
I agree, but as others have pointed out, you don't need to do this in the kernel, you can do it from userspace today (samba has hooks for this for that "other" operating system already).
thanks,
greg k-h
RE: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Tuesday, August 05, 2008 4:18 PM
To: Press, Jonathan
Cc: Arjan van de Ven; Eric Paris; [email protected]; [email protected]; [email protected]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Quoted 1 line · Jonathan
Quoted 1 line
Quoted 1 line
I think you might be missing the point a bit here, as the
traditional
Quoted 2 lines
Unix model that
Quoted 1 line
Quoted 1 line
Linux has prevents much of what the "traditional AV" products need
to
Quoted 4 lines
do, right?
Is your point that Linux and Unix machines are less vulnerable to viruses? If so, that's not relevant to my point at all. A Unix
machine
Quoted 2 lines
can be a carrier, passing infections on to other vulnerable platforms (guess which one).
So you are going to try to force us to take something into the Linux kernel due to the security inadiquacies of a totally different operating system? You might want to rethink that argument :)
[JON PRESS] On the contrary...you might want to rethink your reaction. The security inadequacies of that other operating system that happens to have a 90+% market sure are exactly why Linux and other OS's that coexist with it should be more conscious of their own interactions with it. Enterprises that see Linux as a potential breeding ground for infestations are less likely to tolerate Linux in their environment. Why do you think we have so many customers who have a corporate mandate to have AV software on all machines, no matter what platform type?
thanks,
greg k-h
RE: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Quoted 27 lines · Jonathan
-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Tuesday, August 05, 2008 4:18 PM
To: Press, Jonathan
Cc: Arjan van de Ven; Eric Paris; [email protected]; [email protected]; [email protected]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanningQuoted 1 line · Jonathan
Quoted 1 line
Quoted 1 line
I think you might be missing the point a bit here, as the
traditional
Quoted 2 lines
Unix model that
Quoted 1 line
Quoted 1 line
Linux has prevents much of what the "traditional AV" products need
to
Quoted 4 lines
do, right?
Is your point that Linux and Unix machines are less vulnerable to viruses? If so, that's not relevant to my point at all. A Unix
machine
Quoted 2 lines
can be a carrier, passing infections on to other vulnerable platforms (guess which one).
So you are going to try to force us to take something into the Linux kernel due to the security inadiquacies of a totally different operating system? You might want to rethink that argument :)
Quoted 8 lines
[JON PRESS] On the contrary...you might want to rethink your reaction. The security inadequacies of that other operating system that happens to have a 90+% market sure are exactly why Linux and other OS's that coexist with it should be more conscious of their own interactions with it. Enterprises that see Linux as a potential breeding ground for infestations are less likely to tolerate Linux in their environment. Why do you think we have so many customers who have a corporate mandate to have AV software on all machines, no matter what platform type?
I don't think the pissing contest is going to get us anywhere. I think Jon might want to realize that the linux kernel is not driven by business needs, we are driven by technical correctness and technical necessity. lkml isn't a place where you wave a bag of money and say "do you want to be in the data center, do as I say." Techies always win, not business. I think Greg needs to realize that not all of the AV vendors are being or want to be difficult, thick, or stubborn. I would like to point out for the community's enjoyment that much of the heavy lifting here has been done by one of these vendors who is currently using the above mentioned horrible hacks to make their product work (although at least I believe GPL horrible hacks). Most all of the black magic vendors agree they want to work towards a real upstream solution so lets try to find it, not just build walls and get defensive.
I personally agree with Greg that I don't care if its 'hard' to get all the information you need to do your job as long as it is reasonable and sustainable. I think this interface is both and I'm going to be looking for numbers to show it over the next couple of days.
I think Alan and I have both described how greater linux security can be gained through this interface compared to glibc or LD_PRELOAD even if it isn't perfect security. I certainly don't make the claim that all malware (for any OS) is going to get stopped dead in its tracks. But then again I also haven't heard any vendor say "we don't look for any linux malware." Even if the majority of their business is driven by "that other OS" it doesn't mean that software on linux is without flaws and we don't have attackable programs. Would any vendor who does this type of work stand up and say how your product may have stopped or been able to stop a vulnerability that would have been impossible in userspace.
-Eric
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Quoted 3 lines · On Tue, 05 Aug 2008 16:51:07 -0400 Eric Paris <[email protected]> wrote:
I think Alan and I have both described how greater linux security can be gained through this interface compared to glibc or
LD_PRELOADeven if it isn't perfect security.
I guess I missed that.
I will fully subscribe to the idea that "the LD_PRELOAD way assumes you have a good->bad transition" might not be fully bullet proof (after all, if your init is compromised you won't have this transition)
but what else is the actual gap?
Signature · 3 lines
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
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
In reply to Press, JonathanQuoted 3 lines · Jonathan
However, I will say that while preventing infections from arriving is not foolproof, doing a scan-on-close with the option to delete or quarantine an infected file goes a long way.
How can you, as a security professional, argue for a security measure that you know is flawed, when there is a mailing list full of people willing to help figure out what a working security measure would look like?
Yes, abandoning some of the old DOS anti-virus security model may cause work, but surely that will be worth it if it leads to a more secure system?
Signature · 1 line
All rights reversed.
RE: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
-----Original Message-----
From: Rik van Riel [mailto:[email protected]]
Sent: Tuesday, August 05, 2008 8:51 PM
To: Press, Jonathan
Cc: Greg KH; Arjan van de Ven; Eric Paris; [email protected]; [email protected]; [email protected]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 3 lines · Jonathan
However, I will say that while preventing infections from arriving is not foolproof, doing a scan-on-close with the option to delete or quarantine an infected file goes a long way.
How can you, as a security professional, argue for a security measure that you know is flawed, when there is a mailing list full of people willing to help figure out what a working security measure would look like?
Yes, abandoning some of the old DOS anti-virus security model may cause work, but surely that will be worth it if it leads to a more secure system?
[JON PRESS] I hesitate to join back in the discussion, because so far I haven't been very successful. I know that my level of technical depth is not at all the equal of just about everybody else in this conversation. That's not my job and I don't claim to have the answers to all the questions that are being raised.
However... This question about arguing for a flawed security technique is a good one, and in a way it gets to the heart of the philosophy of security. Scan-on-close is admittedly incomplete as an anti-virus tool.
But I don't agree that that make it flawed. It is part of a repertoire
of techniques for preventing malware from residing on a machine.
Let's take a simplistic and unrealistic example. Let's suppose that you knew that there were 20 applications on your machine that had buffer overflow vulnerabilities that could be exploited, and you had a fix for 18 of them. Would you decide not to apply the fixes, because that meant that there would still be 2 left -- and because theoretically there is a way to prevent all buffer overflows from being exploited and there is a mailing list full of people trying to figure out how to do it.
I think if it as being like the Sieve of Eratosthenes. The further down you go, the more numbers drop out. In AV scanning, each step of the way removes some percentage of the harmful files, and closes the window of time that they have to operate or migrate. Or maybe it's like spraying insecticide when there is an outbreak of some deadly mosquito-borne illness. Without getting into the political issues about spraying, because this is JUST AN EXAMPLE -- would you not spray because 5% of the bugs would still be left behind? Wouldn't you then spray again, because you wipe out another 95%?
If this were not the case, why would so many of our customers run scheduled system scans on a regular basis in addition to scanning on use and scanning on close? There are several reasons, including the constant evolution of malware, the possibility that a machine's protection was temporarily disabled for some reason, etc. The point is that catching malware as close to the time it is written as possible is a net gain that adds to the overall level of protection.
Hopefully, in addition to discussing the particular question that was raised in Rik's email, this also sheds some light on how I look at the overall problem -- i.e., from a higher more conceptual level of functionality and value, rather than the low-level technical specifics.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 38 lines · Jonathan
-----Original Message-----
From: Rik van Riel [mailto:[email protected]]
Sent: Tuesday, August 05, 2008 8:51 PM
To: Press, Jonathan
Cc: Greg KH; Arjan van de Ven; Eric Paris; [email protected]; [email protected]; [email protected]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanningQuoted 3 lines · Jonathan
However, I will say that while preventing infections from arriving is not foolproof, doing a scan-on-close with the option to delete or quarantine an infected file goes a long way.
How can you, as a security professional, argue for a security measure that you know is flawed, when there is a mailing list full of people willing to help figure out what a working security measure would look like?
Yes, abandoning some of the old DOS anti-virus security model may cause work, but surely that will be worth it if it leads to a more secure system?
[JON PRESS] I hesitate to join back in the discussion, because so far I haven't been very successful. I know that my level of technical depth is not at all the equal of just about everybody else in this conversation. That's not my job and I don't claim to have the answers to all the questions that are being raised.
However... This question about arguing for a flawed security technique is a good one, and in a way it gets to the heart of the philosophy of security. Scan-on-close is admittedly incomplete as an anti-virus tool.
But I don't agree that that make it flawed. It is part of a repertoire
of techniques for preventing malware from residing on a machine.
Quoted 8 lines
Let's take a simplistic and unrealistic example. Let's suppose that you knew that there were 20 applications on your machine that had buffer overflow vulnerabilities that could be exploited, and you had a fix for 18 of them. Would you decide not to apply the fixes, because that meant that there would still be 2 left -- and because theoretically there is a way to prevent all buffer overflows from being exploited and there is a mailing list full of people trying to figure out how to do it.
This buffer overflow risk and other equals are why LSM's exist. It
put jails around applications so they cannot do any more than they are
meant to. Its called risk reduction something that is most likely a
new idea to people coming from a windows background. It also makes
exploiting a flawed applicaiton tricky. Do something that application should not normally do it will be blocked and trip the LSM alarm that
could be set to straight up terminate the offending application. Yes
a true shot on sign of trouble system. This is what you anti-virus guys call behaviour monitoring same system some anti-virus software uses to detect unknown viruses.
So 2 left should never happen since we have at least a part fix for
all of them. This is how it has to work. Failure is not a option
in our eyes. If you have a percent missed that is a failure of there
is not something else to prevent damage. We are not Windows users
with weak setup systems. We don't want weak distributions out there.
Nice if some anti-virus products started demanding a min standard LSM
to run side by side with them.
LSM's are already embedded core system exploitation prevention.
LSM currently don't extend deep enough into users to really tighten completely down on the Users account.
So far I have not found a exact list of what is needed by AV or Malware companies that say LSM stacking is needed. That says stacked LSM's are needed.
So I will bring a few things to the table. Number one LSB is working
on a common packaging API using DBUS based off policy kit. So
malware application installers run in users own account and to install
into the system have to go threw a scan able interface. So far I
have not seen AV companies there working in improving the design. Prevention beats cure.
This reduces a issue of malware to the Users own account without heavy handed scanning.
So scanning becomes reduced to user editable files.
Linux firewall supports user mode modules so antivirus can scan network traffic and use built in firewall to monitor for malware.
File scanning look no deeper than fusefs.
http://clamfs.sourceforge.net/. Alter the automount system to wrap
this over the top of user mounted file systems and locations of user editable and your are done.
Now credentials patch that has not got mainline yet also provides user mode daemon support to override filesystem permissions. Could also be integrated into a Anti Virus Scanner. credentials is not a LSM really its centralisation of permission information so its no longer speed all over the kernel.
There are sections in containers as well that could cover bits..
TPM segments appear in 2.6.27 as well that will also make a core system breach harder.
Now please layout what you need Anti-Virus Companies. Don't use
clueless desktop users as a reason. Linux could already provide the
needed interfaces just not LSM.
Now please provide a detailed list of exactly what you need Anti-virus
companies. Most likely everything you need already exists mainline
or in a development side line. Extra coders to get some of those features mainline would be good.
Peter Dolding
PS how to I get my email on the [email protected] So it does not bounce things to me.
RE: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
-----Original Message-----
From: Peter Dolding [mailto:[email protected]]
Sent: Wednesday, August 06, 2008 8:39 AM
To: Press, Jonathan
Cc: Rik van Riel; Greg KH; Arjan van de Ven; Eric Paris; [email protected]; [email protected]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 5 lines · Jonathan
-----Original Message-----
From: Rik van Riel [mailto:[email protected]]
Sent: Tuesday, August 05, 2008 8:51 PM
To: Press, Jonathan
Cc: Greg KH; Arjan van de Ven; Eric Paris;
Quoted 11 lines
[email protected]; [email protected]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanningQuoted 3 lines · Jonathan
However, I will say that while preventing infections from arriving is not foolproof, doing a scan-on-close with the option to delete or quarantine an infected file goes a long way.
Quoted 6 lines
How can you, as a security professional, argue for a security measure that you know is flawed, when there is a mailing list full of people willing to help figure out what a working security measure would look like?
Yes, abandoning some of the old DOS anti-virus security model may
cause
Quoted 5 lines
work, but surely that will be worth it if it leads to a more secure system?
[JON PRESS] I hesitate to join back in the discussion, because so far
I
Quoted 6 lines
haven't been very successful. I know that my level of technical depth is not at all the equal of just about everybody else in this conversation. That's not my job and I don't claim to have the answers to all the questions that are being raised.
However... This question about arguing for a flawed security
technique
Quoted 2 lines
is a good one, and in a way it gets to the heart of the philosophy of security. Scan-on-close is admittedly incomplete as an anti-virus
tool.
Quoted 1 line
But I don't agree that that make it flawed. It is part of a
repertoire
Quoted 3 lines
of techniques for preventing malware from residing on a machine.
Let's take a simplistic and unrealistic example. Let's suppose that
you
Quoted 2 lines
knew that there were 20 applications on your machine that had buffer overflow vulnerabilities that could be exploited, and you had a fix
for
Quoted 1 line
18 of them. Would you decide not to apply the fixes, because that
meant
Quoted 1 line
that there would still be 2 left -- and because theoretically there is
a
Quoted 1 line
way to prevent all buffer overflows from being exploited and there is
a
Quoted 2 lines
mailing list full of people trying to figure out how to do it.
This buffer overflow risk and other equals are why LSM's exist. It put
jails around applications so they cannot do any more than they are meant
to. Its called risk reduction something that is most likely a new idea
to people coming from a windows background. It also makes exploiting a
flawed applicaiton tricky. Do something that application should not normally do it will be blocked and trip the LSM alarm that
could be set to straight up terminate the offending application. Yes a
true shot on sign of trouble system. This is what you anti-virus guys call behaviour monitoring same system some anti-virus software uses to detect unknown viruses.
So 2 left should never happen since we have at least a part fix for all
of them. This is how it has to work. Failure is not a option in our
eyes. If you have a percent missed that is a failure of there is not
something else to prevent damage. We are not Windows users with weak
setup systems. We don't want weak distributions out there. Nice if
some anti-virus products started demanding a min standard LSM to run side by side with them.
LSM's are already embedded core system exploitation prevention.
LSM currently don't extend deep enough into users to really tighten completely down on the Users account.
So far I have not found a exact list of what is needed by AV or Malware companies that say LSM stacking is needed. That says stacked LSM's are needed.
So I will bring a few things to the table. Number one LSB is working on
a common packaging API using DBUS based off policy kit. So malware
application installers run in users own account and to install into the
system have to go threw a scan able interface. So far I have not seen
AV companies there working in improving the design. Prevention beats cure.
This reduces a issue of malware to the Users own account without heavy handed scanning.
So scanning becomes reduced to user editable files.
Linux firewall supports user mode modules so antivirus can scan network traffic and use built in firewall to monitor for malware.
File scanning look no deeper than fusefs.
http://clamfs.sourceforge.net/. Alter the automount system to wrap
this over the top of user mounted file systems and locations of user editable and your are done.
Now credentials patch that has not got mainline yet also provides user mode daemon support to override filesystem permissions. Could also be integrated into a Anti Virus Scanner. credentials is not a LSM really its centralisation of permission information so its no longer speed all over the kernel.
There are sections in containers as well that could cover bits..
TPM segments appear in 2.6.27 as well that will also make a core system breach harder.
Now please layout what you need Anti-Virus Companies. Don't use
clueless desktop users as a reason. Linux could already provide the
needed interfaces just not LSM.
Now please provide a detailed list of exactly what you need Anti-virus
companies. Most likely everything you need already exists mainline or
in a development side line. Extra coders to get some of those features mainline would be good.
[JON PRESS] First of all, my examples were just hypothetical examples designed to set a context. If they don't work, then don't take them too literally.
Second, I'll try to put another way. The disease analogy for computer viruses, though perhaps overused, actually goes a surprisingly long way. The kernel guys are like medical researchers, and the AV guys (or at least speaking for myself) are in Public Health. You guys are looking at the human body (the computer) and looking for its low-level vulnerabilities and ways to protect against them. We are working in the context of imperfect human behavior that often causes people to get sick in spite of the current state of medical knowledge, and occasionally causes things to get out of control. Neither point of view is incorrect -- but each attacks a very different aspect of the problem.
And this goes right to the heart of the statement "prevention beats cure". That's true in the long run, but it's not true if you're already sick -- or your neighbor is, and prevention is still a few years away.
Third, regarding stating what we need, we actually already had a discussion about this several months ago, where we described this. That discussion was the basis for Eric's proposal. To give it some perspective, here is how I understand the flow of events. As Eric described in his original posting this week, in the past many products (AV, along with others that have needed access to similar events -- representatives of which have been participating in this discussion) have done their own tricks to get at i/o events that they need to trigger some action. Many do this by modifying the syscall table. We were told that this was going to become an invalid operation in a coming release of Red Hat Linux, and Red Hat offered to have a discussion with us on what could be done to offer us another way into the same information. This seemed like a very positive direction to go in, and there was a discussion about what this alternative ought to look like. On the basis of this discussion, Eric then went off and worked on the design that he has presented.
There was probably an implicit assumption on everyone's part, including Red Hat's, that what ought to be done was to replace the existing syscall-based event trapping with some other interface that more or less does the same thing in a cleaner way -- NOT to have all of the AV and other product vendors go out and completely rethink their models. And that's not because we inherently object to rethinking. It's really an issue of what kind of time frame we have before a new OS goes out that completely breaks our products. Rethinking the entire model and developing all new products along different paradigms is not a bad thing to do, but it takes a lot of time. Frankly we're always doing that in some way. However, there is a more pressing problem at hand, and that's what Eric's spec is meant to solve.
Jon
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
On Wed, 6 Aug 2008 09:11:14 -0400
Quoted 8 lines
There was probably an implicit assumption on everyone's part, including Red Hat's, that what ought to be done was to replace the existing syscall-based event trapping with some other interface that more or less does the same thing in a cleaner way -- NOT to have all of the AV and other product vendors go out and completely rethink their models. And that's not because we inherently object to rethinking. It's really an issue of what kind of time frame we have before a new OS goes out that completely breaks our products.
not writing to the syscall table hasn't been possible/allowed for.. about 5 years now. (yes I know there were still bad hacks possible until 2 years ago). So I'm sorry, but the timeline argument doesn't hold, you've had 5+ years of warning.
All existing RHEL products already don't allow this (I know it for the earlier ones since I was part of the design team)... unless your software acts entirely like a rootkit (but even then)
Signature · 3 lines
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
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 10 lines · Arjan van de Ven
On Wed, 6 Aug 2008 09:11:14 -0400
Quoted 8 lines
There was probably an implicit assumption on everyone's part, including Red Hat's, that what ought to be done was to replace the existing syscall-based event trapping with some other interface that more or less does the same thing in a cleaner way -- NOT to have all of the AV and other product vendors go out and completely rethink their models. And that's not because we inherently object to rethinking. It's really an issue of what kind of time frame we have before a new OS goes out that completely breaks our products.
Quoted 8 lines
not writing to the syscall table hasn't been possible/allowed for.. about 5 years now. (yes I know there were still bad hacks possible until 2 years ago). So I'm sorry, but the timeline argument doesn't hold, you've had 5+ years of warning.
All existing RHEL products already don't allow this (I know it for the earlier ones since I was part of the design team)... unless your software acts entirely like a rootkit (but even then)
Other options involved overwriting LSM function pointers. I was told that recently moving SELinux to be statically compiled in apparently messed them up on that method, at least for RH products. The other method I've heard is hunting down all of the filesystem_operations structs and overwriting those functions. I was also told that until recently pages marked RO could just be marked RW and then remarked RO, although it was recently fixed to RO pages stayed RO. So yeah, I'd have to call them all ugly rootkit like hacks.
they just keep finding uglier and uglier ways to infiltrate the kernel which is why I was ask to try to help get a clean solution.
-Eric
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 29 lines · Eric Paris
Quoted 10 lines · Arjan van de Ven
On Wed, 6 Aug 2008 09:11:14 -0400
Quoted 8 lines
There was probably an implicit assumption on everyone's part, including Red Hat's, that what ought to be done was to replace the existing syscall-based event trapping with some other interface that more or less does the same thing in a cleaner way -- NOT to have all of the AV and other product vendors go out and completely rethink their models. And that's not because we inherently object to rethinking. It's really an issue of what kind of time frame we have before a new OS goes out that completely breaks our products.
Quoted 8 lines
not writing to the syscall table hasn't been possible/allowed for.. about 5 years now. (yes I know there were still bad hacks possible until 2 years ago). So I'm sorry, but the timeline argument doesn't hold, you've had 5+ years of warning.
All existing RHEL products already don't allow this (I know it for the earlier ones since I was part of the design team)... unless your software acts entirely like a rootkit (but even then)
Other options involved overwriting LSM function pointers. I was told that recently moving SELinux to be statically compiled in apparently messed them up on that method, at least for RH products. The other method I've heard is hunting down all of the
filesystem_operationsstructs and overwriting those functions. I was also told that until recently pages marked RO could just be marked RW and then remarked RO, although it was recently fixed to RO pages stayed RO. So yeah, I'd have to call them all ugly rootkit like hacks.
Quoted 3 lines
they just keep finding uglier and uglier ways to infiltrate the kernel which is why I was ask to try to help get a clean solution.
Simplely they are following the windows way of doing things. Rootkit the OS no one will stop us. Sorry that RootKitting is not going to work here long term because we will fix Root Kit weaknesses. TPM from IBM will make it even harder. Nice bits of that are in 2.6.27.
Allowing LSM stacking solves nothing. IBM's developers credentials
is a far better place for file system monitoring to hook in. Its pre caching allows all the alterations they could want. Even better credentials is a required patch to clean up Linux internal permission splating all over the place. Then generic filesystem caching sits on
top of that. So 1 less cache needed. Ie the cache of passes and
failures they keep so they don't slow the system down too much.
About time they wake up Linux Different OS. We have zero tolerance of
root kits. There is a section with the design to provide the file
system monitoring and the network monitoring both without being in LSM
space. So why do they need LSM's. Cannot they just use system LSM's
to protect there anti-virus like everyone else. No need to treat
them special. If they have a issue with a LSM not being good enough
they need to speak up.
They really need to provide what they want to do to us. There issue
is they keep on looking in the wrong places and doing things the
windows way. This is not WINDOWS. In time mac and other OS's could
come tighter on root kits as well causing the programs to fail as
well. Basically get use to working with a OS that does not tolerate
secuirty flaws.
Peter Dolding
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 33 lines · Peter Dolding
Quoted 29 lines · Eric Paris
Quoted 10 lines · Arjan van de Ven
On Wed, 6 Aug 2008 09:11:14 -0400
Quoted 8 lines
There was probably an implicit assumption on everyone's part, including Red Hat's, that what ought to be done was to replace the existing syscall-based event trapping with some other interface that more or less does the same thing in a cleaner way -- NOT to have all of the AV and other product vendors go out and completely rethink their models. And that's not because we inherently object to rethinking. It's really an issue of what kind of time frame we have before a new OS goes out that completely breaks our products.
Quoted 8 lines
not writing to the syscall table hasn't been possible/allowed for.. about 5 years now. (yes I know there were still bad hacks possible until 2 years ago). So I'm sorry, but the timeline argument doesn't hold, you've had 5+ years of warning.
All existing RHEL products already don't allow this (I know it for the earlier ones since I was part of the design team)... unless your software acts entirely like a rootkit (but even then)
Other options involved overwriting LSM function pointers. I was told that recently moving SELinux to be statically compiled in apparently messed them up on that method, at least for RH products. The other method I've heard is hunting down all of the
filesystem_operationsstructs and overwriting those functions. I was also told that until recently pages marked RO could just be marked RW and then remarked RO, although it was recently fixed to RO pages stayed RO. So yeah, I'd have to call them all ugly rootkit like hacks.Quoted 3 lines
they just keep finding uglier and uglier ways to infiltrate the kernel which is why I was ask to try to help get a clean solution.
Quoted 6 lines
Simplely they are following the windows way of doing things. Rootkit the OS no one will stop us. Sorry that RootKitting is not going to work here long term because we will fix Root Kit weaknesses. TPM from IBM will make it even harder. Nice bits of that are in 2.6.27.
Allowing LSM stacking solves nothing. IBM's developers credentials
Seriously, it's David Howells at Redhat who's doing that. In your last email i figured it was a typo, but credit where it's due :)
-serge
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
In reply to Press, JonathanQuoted 141 lines · Jonathan
-----Original Message-----
From: Peter Dolding [mailto:[email protected]]
Sent: Wednesday, August 06, 2008 8:39 AM
To: Press, Jonathan
Cc: Rik van Riel; Greg KH; Arjan van de Ven; Eric Paris; [email protected]; [email protected]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanningQuoted 5 lines · Jonathan
-----Original Message-----
From: Rik van Riel [mailto:[email protected]]
Sent: Tuesday, August 05, 2008 8:51 PM
To: Press, Jonathan
Cc: Greg KH; Arjan van de Ven; Eric Paris;Quoted 11 lines
[email protected]; [email protected]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanningQuoted 3 lines · Jonathan
However, I will say that while preventing infections from arriving is not foolproof, doing a scan-on-close with the option to delete or quarantine an infected file goes a long way.
Quoted 6 lines
How can you, as a security professional, argue for a security measure that you know is flawed, when there is a mailing list full of people willing to help figure out what a working security measure would look like?
Yes, abandoning some of the old DOS anti-virus security model may
cause
Quoted 5 lines
work, but surely that will be worth it if it leads to a more secure system?
[JON PRESS] I hesitate to join back in the discussion, because so far
I
Quoted 6 lines
haven't been very successful. I know that my level of technical depth is not at all the equal of just about everybody else in this conversation. That's not my job and I don't claim to have the answers to all the questions that are being raised.
However... This question about arguing for a flawed security
technique
Quoted 2 lines
is a good one, and in a way it gets to the heart of the philosophy of security. Scan-on-close is admittedly incomplete as an anti-virus
tool.
Quoted 1 line
But I don't agree that that make it flawed. It is part of a
repertoire
Quoted 3 lines
of techniques for preventing malware from residing on a machine.
Let's take a simplistic and unrealistic example. Let's suppose that
you
Quoted 2 lines
knew that there were 20 applications on your machine that had buffer overflow vulnerabilities that could be exploited, and you had a fix
for
Quoted 1 line
18 of them. Would you decide not to apply the fixes, because that
meant
Quoted 1 line
that there would still be 2 left -- and because theoretically there is
a
Quoted 1 line
way to prevent all buffer overflows from being exploited and there is
a
Quoted 2 lines
mailing list full of people trying to figure out how to do it.
This buffer overflow risk and other equals are why LSM's exist. It put
jails around applications so they cannot do any more than they are meant
to. Its called risk reduction something that is most likely a new idea
to people coming from a windows background. It also makes exploiting a
flawed applicaiton tricky. Do something that application should not normally do it will be blocked and trip the LSM alarm that
could be set to straight up terminate the offending application. Yes a
true shot on sign of trouble system. This is what you anti-virus guys call behaviour monitoring same system some anti-virus software uses to detect unknown viruses.So 2 left should never happen since we have at least a part fix for all
of them. This is how it has to work. Failure is not a option in our
eyes. If you have a percent missed that is a failure of there is not
something else to prevent damage. We are not Windows users with weak
setup systems. We don't want weak distributions out there. Nice if
some anti-virus products started demanding a min standard LSM to run side by side with them.LSM's are already embedded core system exploitation prevention.
LSM currently don't extend deep enough into users to really tighten completely down on the Users account.
So far I have not found a exact list of what is needed by AV or Malware companies that say LSM stacking is needed. That says stacked LSM's are needed.
So I will bring a few things to the table. Number one LSB is working on
a common packaging API using DBUS based off policy kit. So malware
application installers run in users own account and to install into the
system have to go threw a scan able interface. So far I have not seen
AV companies there working in improving the design. Prevention beats cure.This reduces a issue of malware to the Users own account without heavy handed scanning.
So scanning becomes reduced to user editable files.
Linux firewall supports user mode modules so antivirus can scan network traffic and use built in firewall to monitor for malware.
File scanning look no deeper than fusefs.
http://clamfs.sourceforge.net/. Alter the automount system to wrap
this over the top of user mounted file systems and locations of user editable and your are done.Now credentials patch that has not got mainline yet also provides user mode daemon support to override filesystem permissions. Could also be integrated into a Anti Virus Scanner. credentials is not a LSM really its centralisation of permission information so its no longer speed all over the kernel.
There are sections in containers as well that could cover bits..
TPM segments appear in 2.6.27 as well that will also make a core system breach harder.
Now please layout what you need Anti-Virus Companies. Don't use
clueless desktop users as a reason. Linux could already provide the
needed interfaces just not LSM.Now please provide a detailed list of exactly what you need Anti-virus
companies. Most likely everything you need already exists mainline or
in a development side line. Extra coders to get some of those features mainline would be good.[JON PRESS] First of all, my examples were just hypothetical examples designed to set a context. If they don't work, then don't take them too literally.
Quoted 10 lines
Second, I'll try to put another way. The disease analogy for computer viruses, though perhaps overused, actually goes a surprisingly long way. The kernel guys are like medical researchers, and the AV guys (or at least speaking for myself) are in Public Health. You guys are looking at the human body (the computer) and looking for its low-level vulnerabilities and ways to protect against them. We are working in the context of imperfect human behavior that often causes people to get sick in spite of the current state of medical knowledge, and occasionally causes things to get out of control. Neither point of view is incorrect -- but each attacks a very different aspect of the problem.
We are not just kernel. http://hal.freedesktop.org/docs/PolicyKit/
Is a good read.
Long term Linux design is basically Nuke the root user and protect the core os providing restricted access.
So anti system core damage integrates outside kernel space. We are
designing to limit how damaging that imperfect behavior is.
Quoted 21 lines
And this goes right to the heart of the statement "prevention beats cure". That's true in the long run, but it's not true if you're already sick -- or your neighbor is, and prevention is still a few years away.
Third, regarding stating what we need, we actually already had a discussion about this several months ago, where we described this. That discussion was the basis for Eric's proposal. To give it some perspective, here is how I understand the flow of events. As Eric described in his original posting this week, in the past many products (AV, along with others that have needed access to similar events -- representatives of which have been participating in this discussion) have done their own tricks to get at i/o events that they need to trigger some action. Many do this by modifying the syscall table. We were told that this was going to become an invalid operation in a coming release of Red Hat Linux, and Red Hat offered to have a discussion with us on what could be done to offer us another way into the same information. This seemed like a very positive direction to go in, and there was a discussion about what this alternative ought to look like. On the basis of this discussion, Eric then went off and worked on the design that he has presented.
Quoted 13 lines
There was probably an implicit assumption on everyone's part, including Red Hat's, that what ought to be done was to replace the existing syscall-based event trapping with some other interface that more or less does the same thing in a cleaner way -- NOT to have all of the AV and other product vendors go out and completely rethink their models. And that's not because we inherently object to rethinking. It's really an issue of what kind of time frame we have before a new OS goes out that completely breaks our products. Rethinking the entire model and developing all new products along different paradigms is not a bad thing to do, but it takes a lot of time. Frankly we're always doing that in some way. However, there is a more pressing problem at hand, and that's what Eric's spec is meant to solve.
You got to remember syscall trapping can be done for good and evil.
You use it to monitor actions another use it to do harm like steal data.
We need syscall trapping for debugging. ptrace and the like.
Something important you are forgetting and its critical. Windows gets
hell loads of overhead from Anti-Virus products. Our LSM's already
provide overhead. Duplication is not a way forwards.
Credentials IBM patch provides a way to override filesystem permissions so monitor and scan can be done there.
Tracing improvements lined 2.6.27 could be used to monitor applications a AV is suspect of.
Capabilities restrict syscalls by blocks.
Question exactly why needing to monitor at the syscall level. Really
why. There are ways to monitor and restrict accesses without
dropping to that level.
Most likely the issue is that your models are broken. Under windows
most anti-viruses copy the methods you would use to root kit a OS to
get there data. Not working with the existing secuirty model.
Learning to work side by side with the LSM and other systems already
provided anti-virus companies are going to have to learn to do. No
more of this hooking into the OS to get what you want.
Critical note on Linux. Rootkits out number viruses and malware 20
to 1. This is way different to your windows numbers. So any method
that is Rootkit style will fail in time because that hole will have to be closed.
My main issue is TALPA, dazuko and so on of Anti-Virus Filesystem monitoring are all going to break anyhow when
http://lwn.net/Articles/251224/ Credentials get added and common filesystem caching gets added.
You want to change a permissions on a file/object before its opened. So does the Credential user space daemon on file systems that cannot store secuirty information. We only really need 1 location in the source base for this. Expand Credentials slightly to allow anti
viruses to operate by by problem. Even better when FS-Cache can sit
on top of Credentials correctly no need for anti virus software to have independent caching of blocked and allowed files. FS-Cache picks a large amount of this up.
Basically TALPA, dazuko and so on of Anti-Virus Filesystem monitoring
don't fit in the future design of Linux. All they will be is
duplication of a existing interface. A interface that complete avoids the stacking issue.
Peter Dolding
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
Quoted 14 lines · Peter Dolding
My main issue is TALPA, dazuko and so on of Anti-Virus Filesystem monitoring are all going to break anyhow when
http://lwn.net/Articles/251224/ Credentials get added and common filesystem caching gets added.You want to change a permissions on a file/object before its opened. So does the Credential user space daemon on file systems that cannot store secuirty information. We only really need 1 location in the source base for this. Expand Credentials slightly to allow anti
viruses to operate by by problem. Even better when FS-Cache can sit
on top of Credentials correctly no need for anti virus software to have independent caching of blocked and allowed files. FS-Cache picks a large amount of this up.
Quoted 4 lines
Basically TALPA, dazuko and so on of Anti-Virus Filesystem monitoring
don't fit in the future design of Linux. All they will be is
duplication of a existing interface. A interface that complete avoids the stacking issue.
Then in a real sense you've solved much of their problem for them (;-))
After this comes engineering, so that they can re-use the scanning mechanisms they already have, but from a different caller.
The requirements are probably that they know
- is this an open for read or write (somewhat less time-sensitive)?
- is the data present, or do we have to wait?
- if so, for what?
as of the time they start looking at the file. Having a race-free mechanism using credentials and RCU is, IMHO, A Really Good Thing.
Another thing they and we will likely need is a way to discover if a file is inacessable due to an AV operation, and if the time it has been inacessable is less than or equal to a scanning upper bound by file size or beyond it. The latter is for repair of broken state introduced by the AV process failing.
--dave
Quoted 8 lines
Peter Dolding
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Signature · 4 lines
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#
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
Quoted 33 lines · David Collier-Brown
Quoted 14 lines · Peter Dolding
My main issue is TALPA, dazuko and so on of Anti-Virus Filesystem monitoring are all going to break anyhow when
http://lwn.net/Articles/251224/ Credentials get added and common filesystem caching gets added.You want to change a permissions on a file/object before its opened. So does the Credential user space daemon on file systems that cannot store secuirty information. We only really need 1 location in the source base for this. Expand Credentials slightly to allow anti
viruses to operate by by problem. Even better when FS-Cache can sit
on top of Credentials correctly no need for anti virus software to have independent caching of blocked and allowed files. FS-Cache picks a large amount of this up.Quoted 4 lines
Basically TALPA, dazuko and so on of Anti-Virus Filesystem monitoring
don't fit in the future design of Linux. All they will be is
duplication of a existing interface. A interface that complete avoids the stacking issue.Then in a real sense you've solved much of their problem for them (;-)) After this comes engineering, so that they can re-use the scanning mechanisms they already have, but from a different caller.
The requirements are probably that they know
- is this an open for read or write (somewhat less time-sensitive)?
- is the data present, or do we have to wait?
- if so, for what?
as of the time they start looking at the file. Having a race-free mechanism using credentials and RCU is, IMHO, A Really Good Thing.
Quoted 8 lines
Another thing they and we will likely need is a way to discover if a file is inacessable due to an AV operation, and if the time it has been inacessable is less than or equal to a scanning upper bound by file size or beyond it. The latter is for repair of broken state introduced by the AV process failing.
--dave
Failed daemon support has to exist in Credentials for filesystems that cannot store all the security data and needing third party support. This is the issue same features basically required to do the same things. Different reasons.
One to virus scan. One to fix up security lacking file systems. From what I see exactly the same set of features are needed.
At most only 1 feature is missing a form of copy on write. Adding
this at credentials level over the complete system would not be a bad thing. A option to cache writes for scanning even write to like a
journal for latter applying once scanned. This could even come as
part of the generic file system cache.
This is why I am kinda scratching my head. Creating new files also
have to go past Credentials. Even creating and editing files have to go past Credentials.
It seams like the best place to look to hook in correctly even better most of the hook is already there. Hooking into Credentials is far
better than hooking into syscalls. Since if a new special feature
filesystem access syscall is added it will still enter Credentials. On top Credentials interface is under the VFS. Its between the raw
filesystem and the VFS. So no more path based errors.
Yes deeper into the OS to the correct location. Anti-virus methods are too shallow. AppArmor and some other secuirty systems like it have the same path based issue because LSM is too shallow. Anti-Virus company answer has been to root kit out of the LSM API wrong answer. Correct answer is get to the correct location in the OS.
Note clamfs is on the right path using fuse since this goes under the VFS and not effected by path issues and is not root kitting the OS. Of course credentials do the job better.
Really Anti-Virus guys give as a shopping list of exactly what you
need to do. Key word need. Hooking syscall's most likely is not a
need but a want. Even worse a want in the wrong location to give 100
percent coverage. Ie when a new syscall is added it creates a backdoor around you scanners.
Peter Dolding
PS I really wound not mind a better paid job. The developers who
have to created all these incorrect ways have to been paid more than me.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
In reply to Press, JonathanQuoted 6 lines · Jonathan
However... This question about arguing for a flawed security technique is a good one, and in a way it gets to the heart of the philosophy of security. Scan-on-close is admittedly incomplete as an
anti-virus tool. But I don't agree that that make it flawed. It is
part of a repertoire of techniques for preventing malware from residing on a machine.
this indeed gets to the heart of the problem.
several of us here are trying to argue that scan-on-close isn't very good, BUT that if you do scan-on-change (say with inotify) you do reach the same goal but with much better results.
notice the "but" in there. What I hope will happen is that one or more people from the AV side (eg you and tvrtko) will actually read the "but" part rather than just dismissing it outright because of not liking your solution in the first part of it. Part of the answer could be "nice however our goal is <THIS> so it won't work because of <THAT>". At least as long as <THIS> isn't "scan on close" because that's not a goal, that's a means.
this kind of thing seems to be indicative of the entire discussion. For lkml proposals, both sides need to be willing to accept alternative solutions for a problem (I know I am, just need to see why ;-).. and explain the WHY and the goal if it's not clear.
Signature · 3 lines
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
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Arjan van de Ven wrote on 06/08/2008 14:44:18:
Quoted 23 lines
Quoted 6 lines · Jonathan
However... This question about arguing for a flawed security technique is a good one, and in a way it gets to the heart of the philosophy of security. Scan-on-close is admittedly incomplete as an
anti-virus tool. But I don't agree that that make it flawed. It is
part of a repertoire of techniques for preventing malware from residing on a machine.this indeed gets to the heart of the problem.
several of us here are trying to argue that scan-on-close isn't very good, BUT that if you do scan-on-change (say with inotify) you do reach the same goal but with much better results.notice the "but" in there. What I hope will happen is that one or more people from the AV side (eg you and tvrtko) will actually read the "but" part rather than just dismissing it outright because of not liking your solution in the first part of it. Part of the answer could be "nice however our goal is <THIS> so it won't work because of <THAT>". At least as long as <THIS> isn't "scan on close" because that's not a goal, that's a means.
Quoted 4 lines
this kind of thing seems to be indicative of the entire discussion. For lkml proposals, both sides need to be willing to accept alternative solutions for a problem (I know I am, just need to see why ;-).. and explain the WHY and the goal if it's not clear.
Problems with inotify as far as I know:
You can't do something like inotify("/") (made up API) but you have to set up a watch for every directory you wan't to watch. That seems like a waste of resources.
Then you get back a file name, if you wan't to report it or attempt* to scan it you have to build a pathname yourself, which means you have to maintain the whole tree of names in memory. Even bigger waste.
When I say attempt to scan it above I mean that we are back into the pathanme teritorry. It is not guaranteed we will be able to open and scan using that pathname. I don't know what inotify reports with chroots and private namespaces, but it can certainly fail with NFS and root_squash. So it is less effective as well as being resource intensive.
I think this is a good amount of flaws which shows inotify isn't really ideal.
Tvrtko
Sophos Plc, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom.
Company Reg No 2096520. VAT Reg No GB 348 3873 20.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 25 lines · On Wed, 6 Aug 2008 15:16:02 +0100 [email protected] wrote:
Arjan van de Ven wrote on 06/08/2008 14:44:18:
Quoted 23 lines
Quoted 6 lines · Jonathan
However... This question about arguing for a flawed security technique is a good one, and in a way it gets to the heart of the philosophy of security. Scan-on-close is admittedly incomplete as an anti-virus tool. But I don't agree that that make it
flawed. It is part of a repertoire of techniques for preventing
malware from residing on a machine.this indeed gets to the heart of the problem.
several of us here are trying to argue that scan-on-close isn't very good, BUT that if you do scan-on-change (say with inotify) you do reach the same goal but with much better results.notice the "but" in there. What I hope will happen is that one or more people from the AV side (eg you and tvrtko) will actually read the "but" part rather than just dismissing it outright because of not liking your solution in the first part of it. Part of the answer could be "nice however our goal is <THIS> so it won't work because of <THAT>". At least as long as <THIS> isn't "scan on close" because that's not a goal, that's a means.
Quoted 6 lines
Quoted 4 lines
this kind of thing seems to be indicative of the entire discussion. For lkml proposals, both sides need to be willing to accept alternative solutions for a problem (I know I am, just need to see why ;-).. and explain the WHY and the goal if it's not clear.
Problems with inotify as far as I know:
finally some useful discussion ;-)
Quoted 9 lines
You can't do something like
inotify("/")(made up API) but you have to set up a watch for every directory you wan't to watch. That seems like a waste of resources.Then you get back a file name, if you wan't to report it or attempt* to scan it you have to build a pathname yourself, which means you have to maintain the whole tree of names in memory. Even bigger waste.
Quoted 6 lines
When I say attempt to scan it above I mean that we are back into the pathanme teritorry. It is not guaranteed we will be able to open and scan using that pathname. I don't know what inotify reports with chroots and private namespaces, but it can certainly fail with NFS and
root_squash. So it is less effective as well as being resource intensive.
one argument against the namespaces one is that of security; on the one hand I can see the argument of running the virus scanner in its own container, on the other hand I can see the argument of not liking cross-container access of data as a security issue by itself.
Quoted 3 lines
I think this is a good amount of flaws which shows inotify isn't really ideal.
that is a fair list of complaints.. the question is can inotify be fixed....
Signature · 3 lines
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
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
In reply to [email protected]Quoted 8 lines · On Wed, Aug 06, 2008 at 03:16:02PM +0100, [email protected] wrote:
You can't do something like
inotify("/")(made up API) but you have to set up a watch for every directory you wan't to watch. That seems like a waste of resources.Then you get back a file name, if you wan't to report it or attempt* to scan it you have to build a pathname yourself, which means you have to maintain the whole tree of names in memory. Even bigger waste.
Yes, it would be nice if inotify gave you back a full pathname and where a single watch would return all changes anywhere in the filesystem tree. I'd recommend that folks try to create such a patch.
Quoted 5 lines
When I say attempt to scan it above I mean that we are back into the pathanme teritorry. It is not guaranteed we will be able to open and scan using that pathname. I don't know what inotify reports with chroots and private namespaces, but it can certainly fail with NFS and
root_squash. So it is less effective as well as being resource intensive.
Linux's namespace support does break a lot of traditional paradigm. I'll note the TALPA "requirements" are broken themselves since they refer to pathnames.
Furthermore, I assume you'll always want to do the scanning in userspace; the virus signature files for Windows are ***huge***. And if you are going to be scanning for Windows virii on the argument that you want to stop malware on fileservers, I don't think you want to put all of that code into the kernel. (I'll note that all that code complexity leads to bugs, which will in kernel code cause system crashes. One company's Linux AV code --- I won't say which --- almost lead to a rather big and public customer abandoning an Linux deployment because said proprietary, badly/disastrously written, kernel code was leaking a small amount of memory on every file open, and no one could figure out why their file server was crashing every five days or so. I was called in to rescue said customer before they cancelled the contract in disgust, and I traced it back to a proprietary AV kernel module. What fun...)
So if we are going to have to deal with namespaces, I suspect the best we can do for any interface (whether it is inotify based or not) is to have it return pathnames that are valid in the namespace that the program calling said interface happens to be running in. If necessary the AV program can be given access to a highly privileged namespace where all mounts are visible. And if you want to restrict namespaces from being created at all, that's a security policy decision that should be made via the LSM hooks.
As far as blocking opens are concerned, my suggestion there would be changes would probably be much more likely accepted if they solved more problems than just what the AV folks need. For example, think about hierarchical storage management, and DMAPI. DMAPI is a total disaster because it doesn't know about namespaces and so is completely pathname based (which doesn't work well when you have namespaces). But a solution which is general enough that it can also be used to support HSM would probably be a good thing.
Also, it may very well be that instead of one, purpose-specific interface such as what you suggested in TALPA, it might be much better if it was a series of different interfaces; and in some cases, some of the changes might be extensions and improvments to existing facilities, such inotify.
Regards,
- Ted
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Theodore Tso <[email protected]> wrote on 06/08/2008 16:22:36:
Quoted 1 line
On Wed, Aug 06, 2008 at 03:16:02PM +0100, [email protected]
Quoted 2 lines · wrote:
Quoted 2 lines
You can't do something like
inotify("/")(made up API) but you have to
set
Quoted 1 line
Quoted 1 line
up a watch for every directory you wan't to watch. That seems like a
waste
Quoted 3 lines
Quoted 3 lines
of resources.
Then you get back a file name, if you wan't to report it or attempt*
to
Quoted 7 lines
Quoted 3 lines
scan it you have to build a pathname yourself, which means you have to
maintain the whole tree of names in memory. Even bigger waste.
Yes, it would be nice if inotify gave you back a full pathname and where a single watch would return all changes anywhere in the filesystem tree. I'd recommend that folks try to create such a patch.
I will have a brief look to familiarise myself with inotify implementation. So maybe, but even if that solves only one sub-requirement.
Quoted 2 lines
Quoted 2 lines
When I say attempt to scan it above I mean that we are back into the pathanme teritorry. It is not guaranteed we will be able to open and
scan
Quoted 1 line
Quoted 1 line
using that pathname. I don't know what inotify reports with chroots
and
Quoted 1 line
Quoted 1 line
private namespaces, but it can certainly fail with NFS and
root_squash. So
Quoted 5 lines
Quoted 1 line
it is less effective as well as being resource intensive.
Linux's namespace support does break a lot of traditional paradigm. I'll note the TALPA "requirements" are broken themselves since they refer to pathnames.
Core functionality does not depend on pathnames. I thought that was sufficiently clear from the design description. But read below...
Quoted 2 lines
Furthermore, I assume you'll always want to do the scanning in userspace; the virus signature files for Windows are ***huge***. And
You assume correctly so the rest of the paragraph was not needed. :)
Quoted 4 lines
if you are going to be scanning for Windows virii on the argument that you want to stop malware on fileservers, I don't think you want to put all of that code into the kernel. (I'll note that all that code complexity leads to bugs, which will in kernel code cause system
Quoted 8 lines
crashes. One company's Linux AV code --- I won't say which --- almost lead to a rather big and public customer abandoning an Linux deployment because said proprietary, badly/disastrously written, kernel code was leaking a small amount of memory on every file open, and no one could figure out why their file server was crashing every five days or so. I was called in to rescue said customer before they cancelled the contract in disgust, and I traced it back to a proprietary AV kernel module. What fun...)
Once upon a time I worked for a different company and we used embedded linux to drive some custom hardware, rather complex things. On some customer sites, every week or so the OS would hang. Some free, public and open kernel GPL code was leaking kernel memory on each USB transaction and depending on the use it would use up all memory sooner or later. We lost the customer, but didn't abandon Linux. Instead we helped fix the leak and if you don't believe me it should be ChangeLogs under my name, something like five or six years ago.
So what do ours anecdotes prove? Only lack of testing I would say.
Also, that companies from your example bad code would probably be better if a proper interface did exist and they didn't have to hack around.
Quoted 8 lines
So if we are going to have to deal with namespaces, I suspect the best we can do for any interface (whether it is inotify based or not) is to have it return pathnames that are valid in the namespace that the program calling said interface happens to be running in. If necessary the AV program can be given access to a highly privileged namespace where all mounts are visible. And if you want to restrict namespaces from being created at all, that's a security policy decision that should be made via the LSM hooks.
I agree wih the first part and that is how it works.
Pathnames are used for reporting purposes and for possible filesystem hiearchy exclusions. For reporting it is obviously not critical from security point of view and the design document showed how we get them. There is no new code added to do it and it happens from userspace. Such pathnames are relative to the userspace daemon since they are obtained via /proc/self/fd/ and readlink. Exclusions use relative paths and that is also explained in the document.
Therefore access to all namespaces should not be needed except in a way of getting a file descriptor from another process, possibly from another namespace, do to the scan.
Quoted 8 lines
As far as blocking opens are concerned, my suggestion there would be changes would probably be much more likely accepted if they solved more problems than just what the AV folks need. For example, think about hierarchical storage management, and DMAPI. DMAPI is a total disaster because it doesn't know about namespaces and so is completely pathname based (which doesn't work well when you have namespaces). But a solution which is general enough that it can also be used to support HSM would probably be a good thing.
I agree and think we are completely open to this. However the story reverses in a way that we now don't know what are the requirements for those so couldn't possibly address them initially.
Quoted 5 lines
Also, it may very well be that instead of one, purpose-specific interface such as what you suggested in TALPA, it might be much better if it was a series of different interfaces; and in some cases, some of the changes might be extensions and improvments to existing facilities, such inotify.
Could be, but I think we won't know for sure until everything is fleshed out.
Tvrtko
Sophos Plc, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom.
Company Reg No 2096520. VAT Reg No GB 348 3873 20.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
In reply to [email protected]Hi!
Quoted 10 lines
Problems with inotify as far as I know:
You can't do something like
inotify("/")(made up API) but you have to set up a watch for every directory you wan't to watch. That seems like a waste of resources.Then you get back a file name, if you wan't to report it or attempt* to scan it you have to build a pathname yourself, which means you have to maintain the whole tree of names in memory. Even bigger waste.
Quoted 8 lines
When I say attempt to scan it above I mean that we are back into the pathanme teritorry. It is not guaranteed we will be able to open and scan using that pathname. I don't know what inotify reports with chroots and private namespaces, but it can certainly fail with NFS and
root_squash. So it is less effective as well as being resource intensive.I think this is a good amount of flaws which shows inotify isn't really ideal.
Not ideal, but looks like good enough, and could certainly be improved. If it is secure-enough for you (I think it is), that looks like a way to go.
(Plus, such improvements would actually be very welcome).
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 21 lines · Pavel Machek
Hi!
Quoted 10 lines
Problems with inotify as far as I know:
You can't do something like
inotify("/")(made up API) but you have to set up a watch for every directory you wan't to watch. That seems like a waste of resources.Then you get back a file name, if you wan't to report it or attempt* to scan it you have to build a pathname yourself, which means you have to maintain the whole tree of names in memory. Even bigger waste.
Quoted 8 lines
When I say attempt to scan it above I mean that we are back into the pathanme teritorry. It is not guaranteed we will be able to open and scan using that pathname. I don't know what inotify reports with chroots and private namespaces, but it can certainly fail with NFS and
root_squash. So it is less effective as well as being resource intensive.I think this is a good amount of flaws which shows inotify isn't really ideal.
Quoted 7 lines
Not ideal, but looks like good enough, and could certainly be improved. If it is secure-enough for you (I think it is), that looks like a way to go.
(Plus, such improvements would actually be very welcome).
Pavel
My Issue API does not have to be made up. The API kinda exists in Credentials for a completely different use.
Issue with inotify its only monitoring. No permission alteration to
block access.
Also its the wrong level. I will explain why.
inotify is sitting on top of the vfs. Ok fine if you don't want scan
effectiveness. With bind mounts this becomes trouble quickly.
/tmp/usr/tmp/usr/local/tmp
All could be exactly the same physical drive. Now in the anti-virus
would have to scan each of thoose directories if it does not find out they are bind mounted. Also could not look up and say ok that is bind mounted its fine because since the last lookup a new bind mount could have been put over the top letting something slip past.
Also TALPA is wrong because its a LSM. LSM are the most powerful
bits of the OS. LSM are the enforcers of Linux. They are the last
line of defence for the OS. You have your normal permission systems
when they fail then its the job of a LSM to pick up the mess.
Virus scanning is way better inside the permission system. This way
if you have a issue there is still a back stop of the LSM to prevent a
breached virus scanner doing major system harm. TALPA risks killing
the backstop.
Basically path based + Linux equals doomed. VFS is not path based friendly.
Credentials patch on the other hand. Is under the VFS sees real partitions so can process divided by partition avoiding rescanning. Also its in the permission system to has to get approve from the LSM to do alterations. So its back stoped.
Also is sitting at exactly the right point to override permissions.
Filesystem cache that exists to sit on top of Credentials provides the other needed bit scan on write function.
Also filesystem driver level was also correct. Same reason not messed up by VFS multi mounting and over mounting.
Don't worry lots of things have been made as LSM's that should not been. Basically avoiding having to correct the right things.
Peter Dolding
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 4 lines · Peter Dolding
Also TALPA is wrong because its a LSM. LSM are the most powerful
bits of the OS. LSM are the enforcers of Linux. They are the last
line of defence for the OS. You have your normal permission systems
when they fail then its the job of a LSM to pick up the mess.
I've been trying to ignore you, but I just can't any more. Please dear god look at my work before spewing this crap. My work is not an LSM. My work doesn't care about bind mounts, it cares about inodes. My work is not path name based. I'm not sure who you are trying to convince of something here but obviously talking about something you don't know about is not working for you.....
-Eric
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 7 lines · Eric Paris
Quoted 4 lines · Peter Dolding
Also TALPA is wrong because its a LSM. LSM are the most powerful
bits of the OS. LSM are the enforcers of Linux. They are the last
line of defence for the OS. You have your normal permission systems
when they fail then its the job of a LSM to pick up the mess.
Quoted 7 lines
I've been trying to ignore you, but I just can't any more. Please dear god look at my work before spewing this crap. My work is not an LSM. My work doesn't care about bind mounts, it cares about inodes. My work is not path name based. I'm not sure who you are trying to convince of something here but obviously talking about something you don't know about is not working for you.....
Path based was to using inotify that basically cannot do the job. I
guess you agree with that.
Ok you corrected that bit in the TALPA design? Past form of the
beast was hooking down threw the LSM structs to block files so if something went wrong it could override all the permissions on the system without any means of anything else blocking it. Effectively
killing the system. Basically the Userspace daemon answering block
everything worked. Ie connected in too high. So key operational
files of the OS could not be protected against the scanner turning
into malware itself. Yes users are tricked to install fake
anti-viruses and malware scanners on windows. So yes something hostile to the system can and most likely will connect to the TALPA
API. Is over site to the LSM provided? Just last time I looked
still missing.
Credentials alterations to permissions must go back threw the LSM. Also Credentials permission change will not operate without LSM built
into kernel. Running a Anti-virus without a wrapper around it is
partly foolish anyhow.
There is still the duplication issue. Two filesystem caches one in TALPA and One the FS-cache that is designed to sit on top of
Credentials. TALPA is only a part filesystem cache but caching
approved and not approved is still a form of filesystem cache. Its caching virtual permissions of the filesystem.
Also duplication of permission overriding Credentials provides means to override permissions from userspace as well including creating virtual permissions like TALPA is doing. Reason for virtual permissions simple not all file system support the all the permissions to run Linux on with LSM's fully active.
Simple fact you have two API doing almost exactly the same thing.
Just different ways. Credentials spreed all the way threw the OS as
well.
So if in the Credential stuct was added a flag saying what version virus scan had been done on a running executable a search of running programs that had not been scanned against particular virus signatures
would also be simple. Same with disconnected files. Ie files that
have been deleted but since a process is still running are still not
deleted yet in the /proc. TALPA cache current design cache is
nothing more than duplication beside what Credentials and FS-cache is doing.
Also Credentials nice screw up you inode monitoring. FS-cache on top of Credentials can impersonate a inode. So TALPA will think its getting a inode from like NFS but its really getting what was stored in the FS-cache. So now TALPA is failed it has to scan everything to avoid Credentials and its cache is rendered useless.
Caching of scanned and not scanned is more than doable threw the
credentials. Scanning at the Filesystem cache itself also makes
sence. Only 1 cache system to run also equals not exploited by
another cache running on the system.
OS hardening will required doing away with all per filesystem caches and come back to generic cache only. The caches currently back door
TALPA and have minor down side to Credentials. Credentials with
FS-cache does have the option to scan everything as its loaded into the Cache so can defend against the other caches harming it at the cost of CPU time and ram. Double full caching. But since its caching the files themselves its can not be tricked by impersonation.
TALPA is a failed design. It has too many holes. They need to be closed. Fastest way to close them is just merge its ideas into Credentials.
Peter Dolding
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 3 lines · Peter Dolding
TALPA is a failed design. It has too many holes. They need to be closed. Fastest way to close them is just merge its ideas into Credentials.
Sound great, looking forward to your patches!
I suggest developing them against:
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6#next-creds
Thanks.
- James
Signature · 2 lines
James Morris <[email protected]>
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
In reply to Press, JonathanQuoted 9 lines · Jonathan
I think if it as being like the Sieve of Eratosthenes. The further down you go, the more numbers drop out. In AV scanning, each step of the way removes some percentage of the harmful files, and closes the window of time that they have to operate or migrate. Or maybe it's like spraying insecticide when there is an outbreak of some deadly mosquito-borne illness. Without getting into the political issues about spraying, because this is JUST AN EXAMPLE -- would you not spray because 5% of the bugs would still be left behind? Wouldn't you then spray again, because you wipe out another 95%?
The problem with your example is that it ignores the cost; the cost in code maintenance; the cost in performance, etc. That's the problem an absolutist view towards security. Going back to the your sparying analogy, if the illness is considered *so* utterly deadly that you don't consider the costs of beneficial insects dieing, children getting exposed so badly that they get cancer five years later, etc. --- then the argument would be heck, let's spray every day! Let's spray every hour! Let's have a insectside misters going 24 hours a day in the parks and in the schools!!!
In the TSA example, let's force every single traveller to strip naked publically and be submitted to body cavity searches! Since **obviously** stopping terrorist bombs is so important that no other considerations need to be taken into account. Oh, and we should obviously also give all of our financial information to the security agencies so they can do futher screens to look for terrorists; who cares about the risks that laptops with all of that unencrypted data will be stolen out of a locked office in the San Francisco airport?
Similarly there are costs to doing all of this extra scanning. You're getting carried away here way you say that it never hurts to do extra scanning, and that we don't need to decide whether or not it makes sense to do it all. That's just stupid. The whole defense in depth, taken to extremes, leads to completely nonsensical thinking. Security is *defintiely* a cost/benefit tradeoff, and to do something meaningful here we need to think rationally about the threat environment --- and part of that threat environment is the existing security systems in Linux, which are definitely far more powerful than what DOS/Windows have.
- Ted
RE: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
-----Original Message-----
From: Theodore Tso [mailto:[email protected]]
Sent: Wednesday, August 06, 2008 11:09 AM
To: Press, Jonathan
Cc: Rik van Riel; [email protected]; [email protected]; [email protected]; Arjan van de Ven
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Quoted 1 line · Jonathan
I think if it as being like the Sieve of Eratosthenes. The further
down
Quoted 1 line
you go, the more numbers drop out. In AV scanning, each step of the
way
Quoted 2 lines
removes some percentage of the harmful files, and closes the window of time that they have to operate or migrate. Or maybe it's like
spraying
Quoted 3 lines
insecticide when there is an outbreak of some deadly mosquito-borne illness. Without getting into the political issues about spraying, because this is JUST AN EXAMPLE -- would you not spray because 5% of
the
Quoted 1 line
bugs would still be left behind? Wouldn't you then spray again,
because
Quoted 1 line
you wipe out another 95%?
The problem with your example is that it ignores the cost; the cost in code maintenance; the cost in performance, etc. That's the problem an absolutist view towards security. Going back to the your sparying analogy, if the illness is considered *so* utterly deadly that you don't consider the costs of beneficial insects dieing, children getting exposed so badly that they get cancer five years later, etc. --- then the argument would be heck, let's spray every day! Let's spray every hour! Let's have a insectside misters going 24 hours a day in the parks and in the schools!!!
In the TSA example, let's force every single traveller to strip naked publically and be submitted to body cavity searches! Since **obviously** stopping terrorist bombs is so important that no other considerations need to be taken into account. Oh, and we should obviously also give all of our financial information to the security agencies so they can do futher screens to look for terrorists; who cares about the risks that laptops with all of that unencrypted data will be stolen out of a locked office in the San Francisco airport?
Similarly there are costs to doing all of this extra scanning. You're getting carried away here way you say that it never hurts to do extra scanning, and that we don't need to decide whether or not it makes sense to do it all. That's just stupid. The whole defense in depth, taken to extremes, leads to completely nonsensical thinking. Security is *defintiely* a cost/benefit tradeoff, and to do something meaningful here we need to think rationally about the threat environment --- and part of that threat environment is the existing security systems in Linux, which are definitely far more powerful than what DOS/Windows have.
[JON PRESS] You're absolutely right, there is a cost-benefit tradeoff, and I am not ignoring it at all. Reasonable people can have a reasonable discussion about what constitutes enough or too much scanning. From my experience with customers, many if not most enterprises consider any outbreak with any serious damage to be too much, and don't mind redundant scanning if it will help to prevent it.
Even so, I don't think your extreme examples are really parallel to what we do. Personally, I think that scanning on open, exec and close is not excessive.
And in fact, we do go out of our way to avoid scanning when it really isn't necessary. For example, that's the reason that we want a cache -- and again reasonable people can have a reasonable discussion about how to handle that.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Quoted 6 lines · Jonathan
Even so, I don't think your extreme examples are really parallel to what we do. Personally, I think that scanning on open, exec and close is not excessive.
And in fact, we do go out of our way to avoid scanning when it really isn't necessary. For example, that's the reason that we want a cache --
Disks are slow and files are getting larger by the day.
We can do a lot better than scanning a whole file. A mechanism that can notify programs about what file changed and what byte range in the file changed can reduce scanning overhead by only needing to scan the part of the file that changed.
More importantly, getting info on which bytes in a file changed will also help backup programs and disk indexing programs.
Blocking on open can be useful for more than just anti-virus scanning. It can also be useful for hierarchical storage management or simply for using a filesystem while it is being restored from backup - an important consideration because restoring a filesystem from backup can take days with modern data sizes.
Blocking on exec is similar to blocking on open and useful in the same scenarios.
What we need to work on is making sure that the interfaces that go into the kernel are useful not just for anti-virus programs, but also for other software.
Signature · 1 line
All Rights Reversed
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Rik van Riel wrote on 06/08/2008 16:46:04:
Quoted 4 lines
Quoted 1 line · Jonathan
Even so, I don't think your extreme examples are really parallel to
what
Quoted 1 line
Quoted 1 line
we do. Personally, I think that scanning on open, exec and close is
not
Quoted 4 lines
Quoted 4 lines
excessive.
And in fact, we do go out of our way to avoid scanning when it really isn't necessary. For example, that's the reason that we want a cache
--
Quoted 7 lines
Disks are slow and files are getting larger by the day.
We can do a lot better than scanning a whole file. A mechanism that can notify programs about what file changed and what byte range in the file changed can reduce scanning overhead by only needing to scan the part of the file that changed.
It is much more advanced than that, really. I don't know if ever a whole file is read and in 99% it is just a tiny part of it. I don't know what I am allowed to disclose and also it is not my area of expertise, but if you are interested in how detection actually works maybe we can talk off list and put you in touch with some other people here.
It is also wrong to think that you can scan only what has changes because that bit may be harmless itself but present a final part of a malware puzzle.
Quoted 2 lines
More importantly, getting info on which bytes in a file changed will also help backup programs and disk indexing programs.
True, but Nick mentioned some huge issues with access after close and munmap in one of your previous postings. It sounds to me that would be a huge VM/filesystem work to actually enable things like this.
Quoted 3 lines
What we need to work on is making sure that the interfaces that go into the kernel are useful not just for anti-virus programs, but also for other software.
I definitely agree with that.
Tvrtko
Sophos Plc, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom.
Company Reg No 2096520. VAT Reg No GB 348 3873 20.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Quoted 8 lines · On Wed, 6 Aug 2008 17:12:56 +0100 [email protected] wrote:
Rik van Riel wrote on 06/08/2008 16:46:04:
Quoted 2 lines
More importantly, getting info on which bytes in a file changed will also help backup programs and disk indexing programs.
True, but Nick mentioned some huge issues with access after close and munmap in one of your previous postings. It sounds to me that would be a huge VM/filesystem work to actually enable things like this.
A universally useful large change is often easier to get into the Linux kernel than a single-purpose hack.
Signature · 1 line
All Rights Reversed
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Quoted 7 lines · Rik van Riel
Quoted 5 lines · On Wed, 6 Aug 2008 17:12:56 +0100 [email protected] wrote:
Rik van Riel wrote on 06/08/2008 16:46:04:
Quoted 2 lines
More importantly, getting info on which bytes in a file changed will also help backup programs and disk indexing programs.
Quoted 6 lines
Quoted 3 lines
True, but Nick mentioned some huge issues with access after close and munmap in one of your previous postings. It sounds to me that would be a huge VM/filesystem work to actually enable things like this.
A universally useful large change is often easier to get into the Linux kernel than a single-purpose hack.
Over engineering in a void for some supposed someday user isn't a good idea either. If there are other people interested in working together to come up with a solution to multiple needs I'm here to help!
-Eric
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
In reply to Greg KHQuoted 6 lines
Quoted 3 lines
However, I want to point out that scanning on close is still an integral part of AV protection, even if intercepting opens and execs theoretically catches everything.
Great, then put a hook in glibc and catch all closes and then kick off your scanning.
kill -9
deferred close via mmap
etc etc etc
You can't just armwave it into glibc, that doesn't hold water. You also have shared state between processes (index on last close of a handle shared by several threads or processes).
Same problem you have in the indexing business (which also wants the close hook) - aside from all the practical issues that LD_PRELOAD tends to turn up.
I'm not actually interested in the AV stuff, but content indexing I do care about and we do need a way to get notification up to user space.
Alan
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
In reply to Greg KHGreg KH wrote on 05/08/2008 19:11:41:
Quoted 7 lines · Jonathan
Quoted 2 lines
I'm not sure if this is off the direct idea of this thread, or if I am possibly missing the whole point.
I think you might be missing the point a bit here, as the traditional Unix model that Linux has prevents much of what the "traditional AV" products need to do, right?
Could you please explain some more what and how do you think Unix model prevents?
Tvrtko
Sophos Plc, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom.
Company Reg No 2096520. VAT Reg No GB 348 3873 20.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
Quoted 6 lines · On Wed, Aug 06, 2008 at 10:24:21AM +0100, [email protected] wrote:
Greg KH wrote on 05/08/2008 19:11:41:
Quoted 4 lines · Jonathan
Quoted 2 lines
I'm not sure if this is off the direct idea of this thread, or if I am possibly missing the whole point.
Quoted 6 lines
Quoted 3 lines
I think you might be missing the point a bit here, as the traditional Unix model that Linux has prevents much of what the "traditional AV" products need to do, right?
Could you please explain some more what and how do you think Unix model prevents?
It prevents any user from overwriting an existing executable, and it prevents any user from adding an executable file to a common directory (/usr/bin).
It also prevents any user from overwriting a different user's data file.
What specific threat model are you feeling is still present on Linux today that this proposal is supposed to address?
thanks,
greg k-h
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
In reply to Press, JonathanQuoted 4 lines · Jonathan
However, I want to point out that scanning on close is still an integral part of AV protection, even if intercepting opens and execs theoretically catches everything.
but close is... very limited in value. Open is a discrete event traditionally associated withh permission checks.
Close... not so. (And if you mmap memory, you can then close the file and still write to it via the mmap)
Lets ask it differently: what will you do if you find something nasty? You can't fail the close... so why block for it?
And if you don't block for it... all you would need is an asynchronous notification... something like... inotify
RE: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
You're right...I am not talking about blocking at all -- which may be a further indication that I am missing the specific point of this thread.
But be that as it may... I don't want to have to use more than one interface to get all the events I am interested in. I want to register as a client and listen, and get everything I need from the same place.
Also, it seems to me that for my purposes, close is discrete enough. It tells me that there is now something out there that should be looked at.
Jon
-----Original Message-----
From: Arjan van de Ven [mailto:[email protected]]
Sent: Tuesday, August 05, 2008 2:28 PM
To: Press, Jonathan
Cc: Eric Paris; Greg KH; [email protected]; [email protected]; [email protected]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
Quoted 4 lines · Jonathan
However, I want to point out that scanning on close is still an integral part of AV protection, even if intercepting opens and execs theoretically catches everything.
but close is... very limited in value. Open is a discrete event traditionally associated withh permission checks.
Close... not so. (And if you mmap memory, you can then close the file and still write to it via the mmap)
Lets ask it differently: what will you do if you find something nasty? You can't fail the close... so why block for it?
And if you don't block for it... all you would need is an asynchronous notification... something like... inotify
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
you're still top-posting!
Please do not do that.. post your comments below the mail like anyone else does.
Quoted 4 lines · Jonathan
But be that as it may... I don't want to have to use more than one interface to get all the events I am interested in. I want to register as a client and listen, and get everything I need from the same place.
that's your problem to be honest. Worst case you have a small wrapper to funnel various sources into one.
Quoted 3 lines
Also, it seems to me that for my purposes, close is discrete enough. It tells me that there is now something out there that should be looked at.
inotify tells you that. close does not.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
In reply to Press, JonathanA: http://en.wikipedia.org/wiki/Top_post
Q: Were do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
Quoted 6 lines · Jonathan
You're right...I am not talking about blocking at all -- which may be a further indication that I am missing the specific point of this thread.
But be that as it may... I don't want to have to use more than one interface to get all the events I am interested in. I want to register as a client and listen, and get everything I need from the same place.
That's an implementation issue, not a requirement. If it's a requirement, it sure is a lazy one :)
Quoted 2 lines
Also, it seems to me that for my purposes, close is discrete enough. It tells me that there is now something out there that should be looked at.
So, if you hook glibc to catch all calls to close, is that sufficient?
thanks,
greg k-h
RE: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
-----Original Message-----
From: Greg KH [mailto:[email protected]]
Sent: Tuesday, August 05, 2008 2:39 PM
To: Press, Jonathan
Cc: Arjan van de Ven; Eric Paris; [email protected]; [email protected]; [email protected]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
A: http://en.wikipedia.org/wiki/Top_post
Q: Were do I find info about this thing called top-posting?
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
Quoted 1 line · Jonathan
You're right...I am not talking about blocking at all -- which may be
a
Quoted 1 line
further indication that I am missing the specific point of this
thread.
Quoted 3 lines
But be that as it may... I don't want to have to use more than one interface to get all the events I am interested in. I want to
register
Quoted 1 line
as a client and listen, and get everything I need from the same place.
That's an implementation issue, not a requirement. If it's a requirement, it sure is a lazy one :)
[JON PRESS] I wouldn't call it lazy, actually. It's more like "economical" or "ergonomic" -- or, dare I say it -- "user-friendly." In this case, the users are the AV vendors who will have to write to the API that will come out of this spec. We will be more inclined to appreciate the SDK (for want of a better term) if it covers all the bases, rather than force us to go elsewhere for some of our requirements. When we write SDKs, we try to make sure that our users will find whatever they need.
Quoted 1 line
Also, it seems to me that for my purposes, close is discrete enough.
It
Quoted 1 line
tells me that there is now something out there that should be looked
at.
So, if you hook glibc to catch all calls to close, is that sufficient?
[JON PRESS] Let's see...I'm going to use inotify for some events, glibc for others, and this API for the rest. Would you really want to write an application like that?
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 15 lines · Jonathan
Quoted 1 line · Jonathan
You're right...I am not talking about blocking at all -- which may be
a
Quoted 1 line
further indication that I am missing the specific point of this
thread.
Quoted 3 lines
But be that as it may... I don't want to have to use more than one interface to get all the events I am interested in. I want to
register
Quoted 1 line
as a client and listen, and get everything I need from the same place.
That's an implementation issue, not a requirement. If it's a requirement, it sure is a lazy one :)
Quoted 8 lines
[JON PRESS] I wouldn't call it lazy, actually. It's more like "economical" or "ergonomic" -- or, dare I say it -- "user-friendly." In this case, the users are the AV vendors who will have to write to the API that will come out of this spec. We will be more inclined to appreciate the SDK (for want of a better term) if it covers all the bases, rather than force us to go elsewhere for some of our requirements. When we write SDKs, we try to make sure that our users will find whatever they need.
But realize that you are adding an overhead on us, the kernel community, to make your life easier. We are the ones that are taking our time to review and comment on this code. We are the ones who will have to live with this code for forever, and maintain it over the lifetime of linux. So far, you all have shown no willingness to give anything back to us at all.
In fact, I'd go so far as to say you have been openly hostile, violating our copyright and license by shipping closed source kernel modules, making our users have huge problems when we can not support them if they happen to have the misfortune of using your product, and creating code that pokes directly into the kernel in ways we explicily do not want to have happen (syscall hooking, walking symbol tables, etc.)
So please remember, that you should be the ones going out of your way to be nice to us, as you are coming from a huge deficit here that you all need to make up from.
Quoted 10 lines
Quoted 1 line
Also, it seems to me that for my purposes, close is discrete enough.
It
Quoted 1 line
tells me that there is now something out there that should be looked
at.
So, if you hook glibc to catch all calls to close, is that sufficient?
[JON PRESS] Let's see...I'm going to use inotify for some events, glibc for others, and this API for the rest. Would you really want to write an application like that?
Think of it as a way to justify your huge prices :)
thanks,
greg k-h
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Greg KH wrote on 05/08/2008 21:26:21:
Quoted 2 lines
Quoted 2 lines
[JON PRESS] I wouldn't call it lazy, actually. It's more like "economical" or "ergonomic" -- or, dare I say it -- "user-friendly."
In
Quoted 7 lines
Quoted 6 lines
this case, the users are the AV vendors who will have to write to the API that will come out of this spec. We will be more inclined to appreciate the SDK (for want of a better term) if it covers all the bases, rather than force us to go elsewhere for some of our requirements. When we write SDKs, we try to make sure that our users will find whatever they need.
Quoted 6 lines
But realize that you are adding an overhead on us, the kernel community, to make your life easier. We are the ones that are taking our time to review and comment on this code. We are the ones who will have to live with this code for forever, and maintain it over the lifetime of linux. So far, you all have shown no willingness to give anything back to us at all.
We all? How is that true? I for example wrote some code and am willing to help maintain it if it gets accepted. And as you describe it, it would be true for any submission because not all things are usefull for all people, while everything is baggage for the community. And who is the community? I thought all who take place in discussions, bug reporting, submitting code, fixing bugs etc are the community.
Tvrtko
Sophos Plc, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom.
Company Reg No 2096520. VAT Reg No GB 348 3873 20.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 19 lines · On Wed, Aug 06, 2008 at 11:05:43AM +0100, [email protected] wrote:
Greg KH wrote on 05/08/2008 21:26:21:
Quoted 2 lines
Quoted 2 lines
[JON PRESS] I wouldn't call it lazy, actually. It's more like "economical" or "ergonomic" -- or, dare I say it -- "user-friendly."
In
Quoted 7 lines
Quoted 6 lines
this case, the users are the AV vendors who will have to write to the API that will come out of this spec. We will be more inclined to appreciate the SDK (for want of a better term) if it covers all the bases, rather than force us to go elsewhere for some of our requirements. When we write SDKs, we try to make sure that our users will find whatever they need.
Quoted 6 lines
But realize that you are adding an overhead on us, the kernel community, to make your life easier. We are the ones that are taking our time to review and comment on this code. We are the ones who will have to live with this code for forever, and maintain it over the lifetime of linux. So far, you all have shown no willingness to give anything back to us at all.
Quoted 6 lines
We all? How is that true? I for example wrote some code and am willing to help maintain it if it gets accepted. And as you describe it, it would be true for any submission because not all things are usefull for all people, while everything is baggage for the community. And who is the community? I thought all who take place in discussions, bug reporting, submitting code, fixing bugs etc are the community.
As an observer of this thread:
- Some set of requirements suddenly appears out of the void on linux-kernel.
- Noone is able and/or willing to exactly describe the problem(s) they are trying to solve.
With this status quo the discussion is going nowhere - Linux kernel development does not work this way.
The aim is not to include this code, but to find the best technical solution for your problem(s) - no matter whether this will have anything in common with the list of requirements and the code posted or not.
Quoted 1 line
Tvrtko
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon SeedRe: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Adrian Bunk <[email protected]> wrote on 06/08/2008 11:50:08:
Quoted 1 line
On Wed, Aug 06, 2008 at 11:05:43AM +0100, [email protected]
Quoted 4 lines · wrote:
Quoted 4 lines
Greg KH wrote on 05/08/2008 21:26:21:
Quoted 2 lines
Quoted 2 lines
[JON PRESS] I wouldn't call it lazy, actually. It's more like "economical" or "ergonomic" -- or, dare I say it --
"user-friendly."
Quoted 2 lines
Quoted 2 lines
In
Quoted 1 line
Quoted 1 line
this case, the users are the AV vendors who will have to write to
the
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
API that will come out of this spec. We will be more inclined to appreciate the SDK (for want of a better term) if it covers all
the
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
bases, rather than force us to go elsewhere for some of our requirements. When we write SDKs, we try to make sure that our
users
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
will find whatever they need.
But realize that you are adding an overhead on us, the kernel
community,
Quoted 1 line
Quoted 1 line
Quoted 1 line
to make your life easier. We are the ones that are taking our time
to
Quoted 1 line
Quoted 1 line
Quoted 1 line
review and comment on this code. We are the ones who will have to
live
Quoted 1 line
Quoted 1 line
Quoted 1 line
with this code for forever, and maintain it over the lifetime of
linux.
Quoted 1 line
Quoted 1 line
Quoted 1 line
So far, you all have shown no willingness to give anything back to
us at
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
all.
We all? How is that true? I for example wrote some code and am willing
to
Quoted 1 line
Quoted 1 line
help maintain it if it gets accepted. And as you describe it, it would
be
Quoted 1 line
Quoted 1 line
true for any submission because not all things are usefull for all
people,
Quoted 1 line
Quoted 1 line
while everything is baggage for the community. And who is the
community? I
Quoted 1 line
Quoted 1 line
thought all who take place in discussions, bug reporting, submitting
code,
Quoted 6 lines
Quoted 1 line
fixing bugs etc are the community.
As an observer of this thread:
- Some set of requirements suddenly appears out of the void on linux-kernel.
Because previously it was said to go away and come back with a clear list of requirements. And here you make it sound like a negative thing. See what I am talking about?
Quoted 2 lines
- Noone is able and/or willing to exactly describe the problem(s) they are trying to solve.
Hopefully we will get there. Very little time has passed since the discussion has started, even less considering the time zone difference for some.
Quoted 6 lines
With this status quo the discussion is going nowhere - Linux kernel development does not work this way.
The aim is not to include this code, but to find the best technical solution for your problem(s) - no matter whether this will have anything in common with the list of requirements and the code posted or not.
I completely agree with that. Here I was just pointing out that what Greg wrote was untrue and exaggerated so not helping the discussion at all.
Tvrtko
Sophos Plc, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom.
Company Reg No 2096520. VAT Reg No GB 348 3873 20.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 10 lines · On Wed, Aug 06, 2008 at 12:07:57PM +0100, [email protected] wrote:
Adrian Bunk <[email protected]> wrote on 06/08/2008 11:50:08:
Quoted 5 lines
As an observer of this thread:
- Some set of requirements suddenly appears out of the void on linux-kernel.
Because previously it was said to go away and come back with a clear list of requirements. And here you make it sound like a negative thing. See what I am talking about?
Both of my points belong together.
Quoted 10 lines
Quoted 2 lines
- Noone is able and/or willing to exactly describe the problem(s) they are trying to solve.
Hopefully we will get there. Very little time has passed since the discussion has started, even less considering the time zone difference for some.
Quoted 3 lines
With this status quo the discussion is going nowhere - Linux kernel development does not work this way.
Quoted 6 lines
Quoted 3 lines
The aim is not to include this code, but to find the best technical solution for your problem(s) - no matter whether this will have anything in common with the list of requirements and the code posted or not.
I completely agree with that. Here I was just pointing out that what Greg wrote was untrue and exaggerated so not helping the discussion at all.
Until now the main discussion participant from the AV side is Jonathan Press.
But the real discussion hasn't even started since the information required is not available.
And as soon as the information for the real discussion is available all these initial discussions become irrelevant.
Quoted 1 line
Tvrtko
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon SeedRe: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 28 lines · Adrian Bunk
Quoted 9 lines · On Wed, Aug 06, 2008 at 12:07:57PM +0100, [email protected] wrote:
Adrian Bunk <[email protected]> wrote on 06/08/2008 11:50:08:
Quoted 4 lines
As an observer of this thread:
- Some set of requirements suddenly appears out of the void on linux-kernel.
Because previously it was said to go away and come back with a clear list of requirements. And here you make it sound like a negative thing. See what I am talking about?
Both of my points belong together.
Quoted 15 lines
Quoted 2 lines
- Noone is able and/or willing to exactly describe the problem(s) they are trying to solve.
Hopefully we will get there. Very little time has passed since the discussion has started, even less considering the time zone difference for some.
Quoted 7 lines
With this status quo the discussion is going nowhere - Linux kernel development does not work this way.
The aim is not to include this code, but to find the best technical solution for your problem(s) - no matter whether this will have anything in common with the list of requirements and the code posted or not.
Quoted 5 lines
Quoted 2 lines
I completely agree with that. Here I was just pointing out that what Greg wrote was untrue and exaggerated so not helping the discussion at all.
Until now the main discussion participant from the AV side is Jonathan Press.
Well, if you insist, but I must state that this mail represents my own opinion and not my employer's (that's because all the people I could consult with are sleeping :) ).
Quoted 8 lines
But the real discussion hasn't even started since the information required is not available.
And as soon as the information for the real discussion is available all these initial discussions become irrelevant.
- Noone is able and/or willing to exactly describe the problem(s) they are trying to solve.
Well, here is one attempt.
A good percentage of an AV product's job is to prevent exploitation of a security hole in a product before the vendor (assuming the vendor admits it's bug and not a misuse of the product's features).
Most distribution makers go through a lot of work before releasing an update, which might take days. Add to this the fact that some users refuse to update periodically (because one operating system out there shattered the belief in this practice) and that some of them are willing to pay to not care. This is reason enough for most AV vendors.
In the present, on the Linux Desktop, this is [still] hypothetical talk and God help it will remain so. However, if there is one incredibly small chance that one (new?) type of malware can spread to a large number of users, then AV vendors will race for creating a solution because there will _definitely_ be people needing help with this (please notice that the IQ scale starts from zero and not from 130 :) ).
I think this patch is trying to do what dazuko hasn't managed to do (yet): get into mainline. :)
Signature · 1 line
Mihai Donțu
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 5 lines · On Thu, 7 Aug 2008 03:49:55 +0300 Mihai Donțu <[email protected]> wrote:
Well, here is one attempt.
A good percentage of an AV product's job is to prevent exploitation of a security hole in a product before the vendor (assuming the vendor admits it's bug and not a misuse of the product's features).
just to get things clear;
you're not talking about preventing the actual exploitation per se (that would be the job of the various protection technologies) or the containment (that would be SELinux), but more about detecting the presence and preventing to (accidental) use of pre-canned, widely used exploit binaries/files ?
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 9 lines · Arjan van de Ven
On Thu, 7 Aug 2008 03:49:55 +0300
Quoted 5 lines · Mihai Donțu
Well, here is one attempt.
A good percentage of an AV product's job is to prevent exploitation of a security hole in a product before the vendor (assuming the vendor admits it's bug and not a misuse of the product's features).
Quoted 6 lines
just to get things clear;
you're not talking about preventing the actual exploitation per se (that would be the job of the various protection technologies) or the containment (that would be SELinux), but more about detecting the presence and preventing to (accidental) use of pre-canned, widely used exploit binaries/files ?
I apologize for the late reply. The answer to your question is: yes. I was planning to write some more on this subject but this is unnecessary now, because I see [almost] everyone accepted that some kind of antimalware scanning is needed and are looking for alternative (better) solutions to the patch that started all this.
Can't wait to see the end result. :)
Thanks,
Signature · 1 line
Mihai Donțu
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 18 lines · On Mon, 11 Aug 2008 16:45:47 +0300 Mihai Donțu <[email protected]> wrote:
Quoted 10 lines · Arjan van de Ven
On Thu, 7 Aug 2008 03:49:55 +0300
Quoted 6 lines · Mihai Donțu
Well, here is one attempt.
A good percentage of an AV product's job is to prevent exploitation of a security hole in a product before the vendor (assuming the vendor admits it's bug and not a misuse of the product's features).
Quoted 6 lines
just to get things clear;
you're not talking about preventing the actual exploitation per se (that would be the job of the various protection technologies) or the containment (that would be SELinux), but more about detecting the presence and preventing to (accidental) use of pre-canned, widely used exploit binaries/files ?
Quoted 5 lines
I apologize for the late reply. The answer to your question is: yes. I was planning to write some more on this subject but this is unnecessary now, because I see [almost] everyone accepted that some kind of antimalware scanning is needed and are looking for alternative (better) solutions to the patch that started all this.
we do still appreciate your description, since I don't think there's a clear "here's what we really try to protect against" statement yet.
Answering Ted's questions would be a really good start...
Signature · 3 lines
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
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 3 lines · Arjan van de Ven
Quoted 3 lines
Quoted 3 lines
just to get things clear; yyou're [ talking about ...] detecting the presence and preventing to (accidental) use of pre-canned, widely used exploit binaries/files ?
Quoted 2 lines · Mihai Donțu
Quoted 2 lines
I apologize for the late reply. The answer to your question is: yes. I was planning to write some more on this subject
Quoted 2 lines · Arjan van de Ven
we do still appreciate your description, since I don't think there's a clear "here's what we really try to protect against" statement yet.
Perhaps I could try: the AV folks are trying to prevent the
execution of either modified normal binaries/files or specifically exploit binaries/files, by machines for which the files are executable or interpretable.
The experience of those communities is predominantly
with DOS/Windows executables and interpretable files, which they have difficulty generalizing from.
In principle, they could be targeted at any machine, so any
mechanisms should be applicable to native executables and interpretables as well as foreign ones.
--dave (who (in)famously wrote a UUCP virus, which warned sysadmins
if they had bad enough security settings to have run it as root) c-b
Signature · 4 lines
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#
RE: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 16 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of David Collier-Brown
Sent: Monday, August 11, 2008 12:11 PM
To: Arjan van de Ven
Cc: Mihai Donțu; Adrian Bunk; [email protected]; Greg KH; Press, Jonathan; [email protected]; [email protected]; [email protected]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanningPerhaps I could try: the AV folks are trying to prevent the
execution of either modified normal binaries/files or specifically exploit binaries/files, by machines for which the files are executable or interpretable.
Quoted 7 lines
The experience of those communities is predominantly
with DOS/Windows executables and interpretable files, which they have difficulty generalizing from.In principle, they could be targeted at any machine, so any
mechanisms should be applicable to native executables and interpretables as well as foreign ones.
You know, that's actually a very good statement of the model.
I think everyone understands one side of the threat model, that is Linux machines being carriers of infections aimed at other platforms. There are many ways that such infections can be stored, and many ways in which they can be communicated to the target machines. There are so many that it would not be effective or efficient for each such transfer application to be able to handle its own malware scanning, which is the short statement of why centralized AV protection with notification assistance from the kernel is appropriate.
So, putting that aside, David's statement is a reasonable summary of the nature of the other side of the model, the native attacks we are trying to protect against. That is, on any platform, not just Linux, we don't always know ahead of time what kind of attack can be launched and how it would be done. Experience has shown that no one knows enough about every piece of software on every machine to be able to know ahead of time what vulnerabilities there are that can be exploited. Therefore, we adopt a methodology that allows us to be fairly general. The signature matching approach allows us to find the signatures of either specific exploit binaries or corrupted normal binaries that our collection and research activities have identified as malware.
It is true that most of our experience is with DOS and Windows, and that the types of attacks that can be launched there are not easy to generalize to other platforms. However, that does not mean that non-Windows platforms like Linux are therefore immune, or that we are tilting at windmills to say that we address non-Windows infections. There are many specific forms of malware on non-Windows platforms that we identify in the same way that we identify them on Windows.
In a sense the reason I have found the question about "threat model" to be so difficult to answer is that the basic unpredictability of the attack makes the answer in essence: "Anything". That is, it essentially doesn't matter what the threat is or how malware is implemented, except that we know that it exists, both in theory and in practice, and we have an effective way of detecting and removing it.
Jon Press
���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m����������?�I�
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 8 lines · Jonathan
I think everyone understands one side of the threat model, that is Linux machines being carriers of infections aimed at other platforms. There are many ways that such infections can be stored, and many ways in which they can be communicated to the target machines. There are so many that it would not be effective or efficient for each such transfer application to be able to handle its own malware scanning, which is the short statement of why centralized AV protection with notification assistance from the kernel is appropriate.
I'm not sure I follow. Could you name a few channels that you think are likely to represent a serious problem in practice (not just a theoretical possibility)? There are a few obvious ones: files shared over a SMB filesystem; attachments sent via email. What else? Can you give some other examples?
If it's true that there are an unbounded number of channels by which malware could reach a target Windows machine, all of equal importance, then it sounds to me like the end-to-end argument would suggest that the virus scanner needs to be on the target machine. (Otherwise there will inevitably be some channel you missed.) But I'm not convinced that this is true.
One standard counter-argument to the end-to-end argument is that, in some cases, we can identify a single chokepoint: a single central machine or network where you can do virus scanning for a large collection of machines, at much lower administrative cost. If this addresses one propagation channel that accounts for the overwhelming majority of viral spread in practice, this can potentially be useful. Is that the idea you had in mind?
Are we talking about enterprise networks? Are we talking about consumers?
I assume we're talking about a case where there is a Linux machine L and a Windows machine W, and W is the target and there is a channel by which malware can propagate from L to W, and L and W are under the same administrative control (e.g., two machines owned by the same company). Moreover, I'm assuming that L is secure and has not been compromised (otherwise you've got a horse of a different color). Have I understood you correctly so far?
Quoted 7 lines
It is true that most of our experience is with DOS and Windows, and that the types of attacks that can be launched there are not easy to generalize to other platforms. However, that does not mean that non-Windows platforms like Linux are therefore immune, or that we are tilting at windmills to say that we address non-Windows infections. There are many specific forms of malware on non-Windows platforms that we identify in the same way that we identify them on Windows.
The point is that you need to think about what classes of attacks you want to defend against, and be able to precisely characterize which attacks are and aren't in scope. So far, I haven't seen any evidence of that; I've just seen fuzzy slogans and hand-wavy "philosophies".
You can't stop them all, so pick your battles.
Quoted 6 lines
In a sense the reason I have found the question about "threat model" to be so difficult to answer is that the basic unpredictability of the attack makes the answer in essence: "Anything". That is, it essentially doesn't matter what the threat is or how malware is implemented, except that we know that it exists, both in theory and in practice, and we have an effective way of detecting and removing it.
If your answer to the question of which security threats you want to address is "All of them", then you've tackled a hopeless problem. If that's your answer, give up now. There is no silver bullet for computer security. You need to narrow your scope if you want to have any hope of building something useful.
I dispute the claim that we have an effective way of detecting malware. We have a way of detecting some malware.
I'm being blunt because I think sometimes it helps to hear it told straight, without any sweetening. Please forgive any impoliteness this may cause.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 3 lines
theoretical possibility)? There are a few obvious ones: files shared over a SMB filesystem; attachments sent via email. What else? Can you give some other examples?
This is the nightclub model and doesn't work viz:
"If I put a big scary man on the door nobody will be able to get knives and drugs in because we only have one door for the public"
If you have to enumerate the potential attack vectors to make your model work you already lost. There is one of you and a lot of them. Smart nightclubs don't do that they circulate looking for evidence. Yes, they will miss some, yes they will respond late to some, but they will at least notice there has been a problem.
Now computer security is a bit different because it has some night of the living dead type properties where the zombies don't just sneak in through the toilet window but they go around turning security guards into zombies too but the basic premise is very much the same.
Quoted 1 line
Are we talking about enterprise networks? Are we talking about consumers?
What theat model and set of security properties does this change ? The reasons for poor security may change from 'who cares if we get a virus, I get an afternoon drinking coffee' to 'not computer skilled' but the basic problem is very similar.
What are the invariants and what are the probability based things we are trying to achieve ? What level of interference with existing behaviour is acceptable ?
The last is important as we SELinux you can achieve much of what is needed but only at a cost of interfering in normal practice now and then
- eg downloading a shell script versus accidentally downloading a worm is rather hard for a PC to tell apart so implementing 'written by web browser, can't be executed' is easy but has side effects
Alan
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
In reply to Press, JonathanHi!
Quoted 9 lines
Quoted 9 lines
Perhaps I could try: the AV folks are trying to prevent the
execution of either modified normal binaries/files or specifically exploit binaries/files, by machines for which the files are executable or interpretable.The experience of those communities is predominantly
with DOS/Windows executables and interpretable files, which they have difficulty generalizing from.
Quoted 9 lines
Quoted 3 lines
In principle, they could be targeted at any machine, so any
mechanisms should be applicable to native executables and interpretables as well as foreign ones.You know, that's actually a very good statement of the model.
I think everyone understands one side of the threat model, that is Linux machines being carriers of infections aimed at other platforms. There are many ways that such infections can be stored, and many ways in which they can be communicated to the target machines. There are so many that it would not be effective or efficient for each such transfer application to be able to handle its own malware scanning, which is the short statement of why centralized AV protection with notification assistance from the kernel is appropriate.
No.
Proposed kernel solution did not work -- there still was write vs. read race. You are right that it is not ok for each application to do its own malware scanning, but libmalware.so that handles the scanning seems very reasonable.
And as applications _need_ to be modified for the write vs. read race to be solved, libmalware.so looks like a way forward.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
RE: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 6 lines
-----Original Message-----
From: Pavel Machek [mailto:[email protected]]
Sent: Wednesday, August 13, 2008 6:28 AM
To: Press, Jonathan
Cc: [email protected]; Arjan van de Ven; Mihai Don??u; Adrian Bunk; [email protected]; Greg KH; [email protected];
linux-security-
Quoted 2 lines
[email protected]; [email protected]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to a
linuxinterfaceforon access
Quoted 3 lines
scanning
Quoted 1 line
I think everyone understands one side of the threat model, that is
Linux machines
Quoted 1 line
being carriers of infections aimed at other platforms. There are many
ways that
Quoted 1 line
such infections can be stored, and many ways in which they can be
communicated
Quoted 1 line
to the target machines. There are so many that it would not be
effective or efficient
Quoted 1 line
for each such transfer application to be able to handle its own
malware scanning,
Quoted 1 line
which is the short statement of why centralized AV protection with
notification
Quoted 5 lines
assistance from the kernel is appropriate.
Quoted 1 line
No.
Quoted 8 lines
Proposed kernel solution did not work -- there still was write vs. read race. You are right that it is not ok for each application to do its own malware scanning, but libmalware.so that handles the scanning seems very reasonable.
And as applications _need_ to be modified for the write vs. read race to be solved, libmalware.so looks like a way forward.
Pavel
I am not sure what you are suggesting, and I may have missed the libmalware proposal (I don't see any mention of that specific idea in any other message). However, just to be clear... At no point did we suggest that the kernel would do any scanning. What we have been interested in is a mechanism that can allow a scanning application to be notified by the kernel of specific i/o events, for those events to be blocked by the kernel until a user-space scan is done, and then the user-space scan sends back allow or deny, at which point the i/o event returns to the caller -- either success or error. This is the only way that malware can be guaranteed of being detected when it is used (for local application purposes or for transmission to another platform) or created.
Also, a solution that requires applications to be modified will not work, because there is no way that we would be able to get ALL applications on the machines to be modified in the required ways. If ANY applications are not so modified, then you have an unacceptable malware hole. The only solution that really works is one that guarantees that all applications are involved, which is why the kernel has to be involved in some way. It's the only centralized authority that can stick its nose into all of the required activities.
Whether the specific proposal currently on the table handles all the issues or not is to me a separate point.
Jon Press
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 61 lines · Jonathan
Quoted 6 lines
-----Original Message-----
From: Pavel Machek [mailto:[email protected]]
Sent: Wednesday, August 13, 2008 6:28 AM
To: Press, Jonathan
Cc: [email protected]; Arjan van de Ven; Mihai Don??u; Adrian Bunk; [email protected]; Greg KH; [email protected];linux-security-
Quoted 2 lines
[email protected]; [email protected]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access
Quoted 3 lines
scanning
Quoted 1 line
I think everyone understands one side of the threat model, that is
Linux machines
Quoted 1 line
being carriers of infections aimed at other platforms. There are many
ways that
Quoted 1 line
such infections can be stored, and many ways in which they can be
communicated
Quoted 1 line
to the target machines. There are so many that it would not be
effective or efficient
Quoted 1 line
for each such transfer application to be able to handle its own
malware scanning,
Quoted 1 line
which is the short statement of why centralized AV protection with
notification
Quoted 5 lines
assistance from the kernel is appropriate.
Quoted 1 line
No.
Quoted 8 lines
Proposed kernel solution did not work -- there still was write vs. read race. You are right that it is not ok for each application to do its own malware scanning, but libmalware.so that handles the scanning seems very reasonable.
And as applications _need_ to be modified for the write vs. read race to be solved, libmalware.so looks like a way forward.
Pavel
I am not sure what you are suggesting, and I may have missed the libmalware proposal (I don't see any mention of that specific idea in any other message). However, just to be clear... At no point did we suggest that the kernel would do any scanning. What we have been interested in is a mechanism that can allow a scanning application to be notified by the kernel of specific i/o events, for those events to be blocked by the kernel until a user-space scan is done, and then the user-space scan sends back allow or deny, at which point the i/o event returns to the caller -- either success or error. This is the only way that malware can be guaranteed of being detected when it is used (for local application purposes or for transmission to another platform) or created.
Also, a solution that requires applications to be modified will not work, because there is no way that we would be able to get ALL applications on the machines to be modified in the required ways. If ANY applications are not so modified, then you have an unacceptable malware hole. The only solution that really works is one that guarantees that all applications are involved, which is why the kernel has to be involved in some way. It's the only centralized authority that can stick its nose into all of the required activities.
Quoted 2 lines
Whether the specific proposal currently on the table handles all the issues or not is to me a separate point.
Being in the correct place is key. Wrong place more issues more holes.
Lets get this right this time please. Windows is a mess. You cannot
run many av products side by side. Due to failures of signatures at
times to pickup every threat out there we have to move forward with a system that works. Supporting many scanners at once if needed.
LIM guys are going after the same kind of defect detection.
Lot of designs have been created over all the years but they have all failed to address the basics.
Scanning without file caching leaves a hole and costs cpu time. So integration into the file system cache system is kinda key.
Designing hooks forcing users to use only 1 product. Yes good for
market lock in but kicks lots people in teeth.
Getting patch mainline is basically going to hit walls if you don't
sit down and say lets fix the kernel secuirty correctly. This is not
windows you have the power to alter the complete kernel if you can provide valid justification for the change.
Valid justification is that someone like me looks at it and cannot find a flaw in design and it provides needed functionality. Issue you keep on addressing only 1 this is the reason why the patches have
stayed out side mainline when other patches have got in. In theory
the complete core of the Linux kernel could be replaced if Valid justification could be made.
This is where Linux is different to Windows. You are free to
redesign linux to be the hardest OS on earth for a virus to operate.
Where windows you have to work with provided model. Lots here need
to drop the idea that anything in the Linux kernel is set in stone. Only thing set in stone flawed designed get shot down.
Lets start with what would the features you would wish for as Anti-virus designers if you could design a OS from scratch around your
Anti-virus so it was almost flawless. From that list we have what we
need to work on to give you exactly what you want in time. Even
better post that on a long term website as a wishlist for all OS's. Basically give us direction.
Peter Dolding
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
In reply to Press, JonathanHi!
Quoted 8 lines
Quoted 7 lines
Proposed kernel solution did not work -- there still was write vs. read race. You are right that it is not ok for each application to do its own malware scanning, but libmalware.so that handles the scanning seems very reasonable.
And as applications _need_ to be modified for the write vs. read race to be solved, libmalware.so looks like a way forward.
Quoted 12 lines
I am not sure what you are suggesting, and I may have missed the libmalware proposal (I don't see any mention of that specific idea in any other message). However, just to be clear... At no point did we suggest that the kernel would do any scanning. What we have been interested in is a mechanism that can allow a scanning application to be notified by the kernel of specific i/o events, for those events to be blocked by the kernel until a user-space scan is done, and then the user-space scan sends back allow or deny, at which point the i/o event returns to the caller -- either success or error. This is the only way that malware can be guaranteed of being detected when it is used (for local application purposes or for transmission to another platform) or created.
As I said, that does not work. Proposed solution blocked open, while you'd have to block read() and you still could not handle mmap. So sorry, no kernel solution can work.
Quoted 5 lines
Also, a solution that requires applications to be modified will not work, because there is no way that we would be able to get ALL applications on the machines to be modified in the required ways. If ANY applications are not so modified, then you have an unacceptable malware hole. The only solution that really works is one that
So you make sure all apps are modified. Distros are good at that, and modifications are not that hard.
Plus, proposed solution already has three unacceptable holes:
1) it only catches known signatures
2) write vs. read race mentioned above
3) mmap problem
. Making sure all apps use libmalware.so is trivial compared to solving 3).
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Pavel Machek wrote on 13/08/2008 13:56:38:
Big snip since I am really only curious about libmalware.so.
Quoted 4 lines
Plus, proposed solution already has three unacceptable holes:
1) it only catches known signatures
2) write vs. read race mentioned above
Discussions about perfect, better or no security are in danger of becoming boring.
Quoted 4 lines
3) mmap problem
. Making sure all apps use libmalware.so is trivial compared to solving 3).
You haven't answered what exactly is this libmalware.so, since you are the only one mentioning it? It would be interesting to learn how it solves the mmap problem, provides perfect security so it is acceptable, handles the kernel NFS server serving malicious files, caters for applications which do not use it, is better (more secure) than the kernel solution, provides reasonalbe performance and is easier to maintain for the community? To list only some of the requirements which have been mentioned so far.
--
Tvrtko A. Ursulin
Senior Software Engineer, Sophos
"Views and opinions expressed in this email are strictly those of the author.
The contents has not been reviewed or approved by Sophos."
Sophos Plc, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom.
Company Reg No 2096520. VAT Reg No GB 348 3873 20.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Hi!
Okay, so goal of libmalware.so is to "not allow data in the black list to pass through Linux server". Threat model is windows machines trying to copy infected files through the server. Viruses are not expected to have shell access to either root or normal users on the server.
Quoted 15 lines
Big snip since I am really only curious about libmalware.so.
Quoted 4 lines
Plus, proposed solution already has three unacceptable holes:
1) it only catches known signatures
2) write vs. read race mentioned aboveDiscussions about perfect, better or no security are in danger of becoming boring.
Quoted 4 lines
3) mmap problem
. Making sure all apps use libmalware.so is trivial compared to solving 3).
Quoted 7 lines
You haven't answered what exactly is this libmalware.so, since you are the only one mentioning it? It would be interesting to learn how it solves the mmap problem, provides perfect security so it is acceptable, handles the kernel NFS server serving malicious files, caters for applications which do not use it, is better (more secure) than the kernel solution, provides reasonalbe performance and is easier to maintain for the community? To list only some of the requirements which have been mentioned so far.
mmap problem: libmalware.so would not offer mmap() to applications (or maybe it would do copy of the file, then allow mmap on the copy).
kernel NFS server is not handled; don't use it for serving Windows clients. Not that you need performance for that, anyway.
Obviously libmalware.so will not help applications not using it. With distributions, that's not a problem.
Unlike kernel solution, it does not contain races with read/write/mmap -- untrusted files access is made through methods that can be safe.
You can query helper daemon for cache info; that should provide good enough performance.
I never claimed it is easier to maintain than kernel solution; but unlike kernel solution it actually _works_, 100% of time, for apps using it.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
RE: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Quoted 5 lines
-----Original Message-----
From: Pavel Machek [mailto:[email protected]]
Sent: Thursday, August 14, 2008 8:54 AM
To: [email protected]
Cc: Arjan van de Ven; Adrian Bunk; [email protected]; Greg KH; Press,
Jonathan;
Quoted 1 line
malware-
Quoted 2 lines
[email protected]; Mihai Don??u
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to
alinuxinterfaceforon access
Quoted 7 lines
scanning
Hi!
Okay, so goal of libmalware.so is to "not allow data in the black list to pass through Linux server". Threat model is windows machines trying to copy infected files through the server.
That's only part of the threat model.
Quoted 3 lines
Viruses are not expected to have shell access to either root or normal
users on the server.
That's a big exception.
Quoted 1 line
it actually _works_, 100% of time, for apps using it.
Again that's a big condition.
Jon Press
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Hi!
Quoted 5 lines
Quoted 3 lines
Okay, so goal of libmalware.so is to "not allow data in the black list to pass through Linux server". Threat model is windows machines trying to copy infected files through the server.
That's only part of the threat model.
Yes, that's the part libmalware.so proposal solves. Given scary number of 0 Linux viruses in wild, it seems to solve the problem pretty well.
Quoted 3 lines
Quoted 1 line
it actually _works_, 100% of time, for apps using it.
Again that's a big condition.
Yep, so... why don't you propose something better? I'm pretty sure 100% reliable scanning is impossible without modifying applications, but hey, you can prove me wrong.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Quoted 8 lines · On Fri, 15 Aug 2008 00:39:18 +0200 Pavel Machek <[email protected]> wrote:
Quoted 5 lines
Quoted 3 lines
Okay, so goal of libmalware.so is to "not allow data in the black list to pass through Linux server". Threat model is windows machines trying to copy infected files through the server.
That's only part of the threat model.
Yes, that's the part libmalware.so proposal solves. Given scary number of 0 Linux viruses in wild, it seems to solve the problem pretty well.
If you're trolling, you're not being very good at it.
Just because you cannot easily infect a Linux system from a user application does not mean malware cannot do all kinds of damage with user privileges. Think of a key sniffer (using the same interface that the X screensavers use) or a spam bot running with user privileges.
Firefox, OpenOffice.org and other (mostly desktop) programs are extremely large and complex, deal with untrusted data on a daily basis and could be used to spread worms and get malware onto systems.
The old DOS model of "you need to infect system binaries" is not a good description of how today's malware works. Malware is not there to infect a system "as much as possible", but to accomplish actual malice.
Consequently, the number of acceptable attack vectors on a system is pretty large and we should protect against these kinds of programs.
It would be good to get this additional layer of protection against malware in place, before people start developing Linux malware.
Signature · 1 line
All rights reversed.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Quoted 10 lines · Rik van Riel
Quoted 2 lines
Yes, that's the part libmalware.so proposal solves. Given scary number of 0 Linux viruses in wild, it seems to solve the problem pretty well.
If you're trolling, you're not being very good at it.
Just because you cannot easily infect a Linux system from a user application does not mean malware cannot do all kinds of damage with user privileges. Think of a key sniffer (using the same interface that the X screensavers use) or a spam bot running with user privileges.
But Pavel is raising a good question. In Eric's proposed threat model, he claimed the only thing that he was trying to solve was "scanning". Just file scanning. That implies no root privileges, but it also implied that he wasn't worried about malware running with user privileges, either. Presumbly, that would be caught and stopped by the file scanner before the malware had a chance to run; that is the execve(2) system call would also be blocked until the executable was scanned.
So if that is the threat model, then the only thing libmalware.so doesn't solve is knfsd access, and it should be evaluated on that basis. If the threat model *does* include malware which is **not** caught by the AV scanner, and is running with user privileges, then there are a whole host of other attacks that we have to worry about. So let's be real clear, up front, what the threat model is, and avoid changing the model around to rule out solutions that don't fit the initially preconceived one. That's how you get to the TSA confiscating water bottles in airport security lines.
- Ted
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Quoted 6 lines · On Thu, 14 Aug 2008 20:43:35 -0400 Theodore Tso <[email protected]> wrote:
But Pavel is raising a good question. In Eric's proposed threat model, he claimed the only thing that he was trying to solve was "scanning". Just file scanning. That implies no root privileges, but it also implied that he wasn't worried about malware running with user privileges, either. Presumbly, that would be caught and stopped by the file scanner before the malware had a chance to run;
You bring up a very good point - malware does not need to be stored on a filesystem in order to run or cause damage.
Signature · 1 line
All rights reversed.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
In reply to Theodore TsoQuoted 21 lines · Theodore Tso
Quoted 10 lines · Rik van Riel
Quoted 2 lines
Yes, that's the part libmalware.so proposal solves. Given scary number of 0 Linux viruses in wild, it seems to solve the problem pretty well.
If you're trolling, you're not being very good at it.
Just because you cannot easily infect a Linux system from a user application does not mean malware cannot do all kinds of damage with user privileges. Think of a key sniffer (using the same interface that the X screensavers use) or a spam bot running with user privileges.
But Pavel is raising a good question. In Eric's proposed threat model, he claimed the only thing that he was trying to solve was "scanning". Just file scanning. That implies no root privileges, but it also implied that he wasn't worried about malware running with user privileges, either. Presumbly, that would be caught and stopped by the file scanner before the malware had a chance to run; that is the execve(2) system call would also be blocked until the executable was scanned.
Quoted 9 lines
So if that is the threat model, then the only thing libmalware.so doesn't solve is knfsd access, and it should be evaluated on that basis. If the threat model *does* include malware which is **not** caught by the AV scanner, and is running with user privileges, then there are a whole host of other attacks that we have to worry about. So let's be real clear, up front, what the threat model is, and avoid changing the model around to rule out solutions that don't fit the initially preconceived one. That's how you get to the TSA confiscating water bottles in airport security lines.
No, I'm not claiming to protect against running processes. I'll leave that for SELinux.
I haven't seen this supposed libmalware.so so take anything I say with a grain of sand. But I take it that the solutions to the problems are 'don't do that.'
aka malware is allowed to flow freely across linux nfs servers. Great, I'm sure corperate IT organizations are going to love knowing there isn't a darn thing they can do to protect their nfs server from being storage grounds other than hope they can control all of the border.
And I still don't get this 'mmap problem' that I don't solve that libmalware magically solves. What? don't use mmap? I certainly hope not.
Are we seriously considering that the right thing to do is to try to push malware scanning to every project on sourceforge? At least putting a solution inside glibc wasn't completely insane, I just think for numerous reasons we've seen on list for the last 2 weeks not a better idea. In any case, having an application have to make special calls to handle 'untrusted' data is basically like turning the keys to the castle over on every exploit. No, I might not make promises about subverted applications, but that doesn't mean I have to just open all the doors. And anything that requires explicit application help is just that. Talk about theater.
-Eric
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Quoted 19 lines · Eric Paris
Quoted 9 lines
But Pavel is raising a good question. In Eric's proposed threat model, he claimed the only thing that he was trying to solve was "scanning". Just file scanning. That implies no root privileges, but it also implied that he wasn't worried about malware running with user privileges, either. Presumbly, that would be caught and stopped by the file scanner before the malware had a chance to run; that is the execve(2) system call would also be blocked until the executable was scanned.
Quoted 9 lines
So if that is the threat model, then the only thing libmalware.so doesn't solve is knfsd access, and it should be evaluated on that basis. If the threat model *does* include malware which is **not** caught by the AV scanner, and is running with user privileges, then there are a whole host of other attacks that we have to worry about. So let's be real clear, up front, what the threat model is, and avoid changing the model around to rule out solutions that don't fit the initially preconceived one. That's how you get to the TSA confiscating water bottles in airport security lines.
Quoted 6 lines
No, I'm not claiming to protect against running processes. I'll leave that for SELinux.
I haven't seen this supposed libmalware.so so take anything I say with a grain of sand. But I take it that the solutions to the problems are 'don't do that.'
libmalware.so is shorthand for 'have a userspace library do the scanning and handle the open'
Quoted 4 lines
aka malware is allowed to flow freely across linux nfs servers. Great, I'm sure corperate IT organizations are going to love knowing there isn't a darn thing they can do to protect their nfs server from being storage grounds other than hope they can control all of the border.
nfs isn't secure anyway so you better control the border.
it's only the kernel nfs daemon that won't use the library, so the answer is don't use that daemon. I beleive that there is a FUSE NFS option, or if nothing else, mount a filesystem with FUSE (linked against libmalware.so) and then export the result vi knfsd.
Quoted 3 lines
And I still don't get this 'mmap problem' that I don't solve that libmalware magically solves. What? don't use mmap? I certainly hope not.
libmalware can intercept the mmap call and decide to either prohibit it, copy the file so that the program is operating from it's own copy, or do something else (all dependant on policy, as defined in userspace for this library)
Quoted 10 lines
Are we seriously considering that the right thing to do is to try to push malware scanning to every project on sourceforge? At least putting a solution inside glibc wasn't completely insane, I just think for numerous reasons we've seen on list for the last 2 weeks not a better idea. In any case, having an application have to make special calls to handle 'untrusted' data is basically like turning the keys to the castle over on every exploit. No, I might not make promises about subverted applications, but that doesn't mean I have to just open all the doors. And anything that requires explicit application help is just that. Talk about theater.
libmalware.so and a modified glibc are not mutually exclusive. you distros could offer versions of glibc that include libmalware.
again, libmalware.so is not referring to any specific body of code, it's referring to the concept that the handling of open/mmap/read/etc and scanning is done via a userspace library rather then by the kernel. if everyone can agree on that concept then hashing out the details of _which_ library it gets put in is a smaller detail.
this isn't designed to require every app that wants this protection to have to change it's code.
David lang
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Quoted 1 line · On Thu, 14 Aug 2008, [email protected] wrote:
again, libmalware.so is not referring to any specific body of code, it's referring to the concept that the handling of open/mmap/read/etc and scanning is done via a userspace library rather then by the kernel. if everyone can agree on that concept then hashing out the details of _which_ library it gets put in is a smaller detail.
one reason to layer scanners is that you could have one that just checks to see if the file was deployed from a OS package, if it was (and still has the same hash as the package manager thinks it should have) it sets a flag that other scanners could look for (if they see it they can skip scanning the file)
David Lang
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Quoted 5 lines · On Thu, 14 Aug 2008, [email protected] wrote:
Quoted 1 line · On Thu, 14 Aug 2008, [email protected] wrote:
again, libmalware.so is not referring to any specific body of code, it's referring to the concept that the handling of open/mmap/read/etc and scanning is done via a userspace library rather then by the kernel. if everyone can agree on that concept then hashing out the details of _which_ library it gets put in is a smaller detail.
one reason to layer scanners is that you could have one that just checks to see if the file was deployed from a OS package, if it was (and still has the same hash as the package manager thinks it should have) it sets a flag that other scanners could look for (if they see it they can skip scanning the file)
actually, instead of trying to have one scanner trust the results of another, a better approach would be for libmalware to look for the package manager approval and if it finds that it could skip asking the other scanners to look at it.
this sort of thing can easily be done in userspace libraries, but you definantly would _not_ want to do in a kernel-level enforcement mechanism.
David Lang
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
In reply to [email protected]Quoted 24 lines · Eric Paris
Quoted 23 lines
Quoted 10 lines
But Pavel is raising a good question. In Eric's proposed threat model, he claimed the only thing that he was trying to solve was "scanning". Just file scanning. That implies no root privileges, but it also implied that he wasn't worried about malware running with user privileges, either. Presumbly, that would be caught and stopped by the file scanner before the malware had a chance to run; that is the execve(2) system call would also be blocked until the executable was scanned.
Quoted 9 lines
So if that is the threat model, then the only thing libmalware.so doesn't solve is knfsd access, and it should be evaluated on that basis. If the threat model *does* include malware which is **not** caught by the AV scanner, and is running with user privileges, then there are a whole host of other attacks that we have to worry about. So let's be real clear, up front, what the threat model is, and avoid changing the model around to rule out solutions that don't fit the initially preconceived one. That's how you get to the TSA confiscating water bottles in airport security lines.
No, I'm not claiming to protect against running processes. I'll leave that for SELinux.
Quoted 6 lines
Quoted 3 lines
I haven't seen this supposed libmalware.so so take anything I say with a grain of sand. But I take it that the solutions to the problems are 'don't do that.'
libmalware.so is shorthand for 'have a userspace library do the scanning and handle the open'
(snip). Agreed, you explained it better than I would.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
In reply to Eric ParisHi!
Quoted 3 lines
And I still don't get this 'mmap problem' that I don't solve that libmalware magically solves. What? don't use mmap? I certainly hope not.
Don't use mmap, it is as simple as that. AFAICS mmap(MAP_SHARED) -- which is basically shared memory -- is fundamentally incompatible with reliable virus scanning.
...or do you have a reasonable solution for mmap?
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Quoted 11 lines · Pavel Machek
Hi!
Quoted 3 lines
And I still don't get this 'mmap problem' that I don't solve that libmalware magically solves. What? don't use mmap? I certainly hope not.
Don't use mmap, it is as simple as that. AFAICS
mmap(MAP_SHARED)-- which is basically shared memory -- is fundamentally incompatible with reliable virus scanning....or do you have a reasonable solution for mmap?
mmap has a few different problems
1. intercepting reads and writes to take action at that time
2. the fact that two programs can use it as an inter-process communication mechanism.
if you are worried about the IPC aspects, all you can do is forbid it, along with shared memory, pipes, network connections, etc. none of these provide you with a 'final result' that can be scanned, and as others have pointed out there are too many ways to do things that get assembled by the far side to try and catch all malware in them.
as for intercepting reads and writes. the approach I outlined addresses this by having the kernel mark thefile as dirty if any writes happen, and checking the file status at the time of doing the mmap instead of trying to do it when the file is accessed after the mmap.
David Lang
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Hi!
Quoted 11 lines
Quoted 9 lines
Quoted 3 lines
And I still don't get this 'mmap problem' that I don't solve that libmalware magically solves. What? don't use mmap? I certainly hope not.
Don't use mmap, it is as simple as that. AFAICS
mmap(MAP_SHARED)-- which is basically shared memory -- is fundamentally incompatible with reliable virus scanning....or do you have a reasonable solution for mmap?
Quoted 6 lines
mmap has a few different problems
1. intercepting reads and writes to take action at that time
2. the fact that two programs can use it as an inter-process communication mechanism.
...can and will use it as an IPC. So we need to modify some applications.
Rather than modify all the applications using mmap (you can't tell if the other side is going to use it for shared memory... right?), we could simply modify all the Windows-facing applications using mmap.
Quoted 1 line
if you are worried about the IPC aspects, all you can do is forbid it,
Can you automatically tell if applications are using mmap for IPC?
BTW in another mail you wanted to include /var/log/syslog from scanning. You should not be doing that if syslog is exported to Windows systems. Of course, you can get away with scanning syslog when Windows client tries to read it, which should be acceptable...
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Quoted 21 lines · Pavel Machek
Quoted 11 lines
Quoted 9 lines
Quoted 3 lines
And I still don't get this 'mmap problem' that I don't solve that libmalware magically solves. What? don't use mmap? I certainly hope not.
Don't use mmap, it is as simple as that. AFAICS
mmap(MAP_SHARED)-- which is basically shared memory -- is fundamentally incompatible with reliable virus scanning....or do you have a reasonable solution for mmap?
Quoted 6 lines
mmap has a few different problems
1. intercepting reads and writes to take action at that time
2. the fact that two programs can use it as an inter-process communication mechanism.
...can and will use it as an IPC. So we need to modify some applications.
Quoted 7 lines
Rather than modify all the applications using mmap (you can't tell if the other side is going to use it for shared memory... right?), we could simply modify all the Windows-facing applications using mmap.
Quoted 1 line
if you are worried about the IPC aspects, all you can do is forbid it,
Can you automatically tell if applications are using mmap for IPC?
no, but can you tell at the time of the mmap command if anyone has it opened for writing? if you can then you can just not allow the mmap in thid case (policy decision by userspace, as such it can try to look at what other programs are accessing it via mmap to decide if it should allow it or not)
Quoted 4 lines
BTW in another mail you wanted to include
/var/log/syslogfrom scanning. You should not be doing that if syslog is exported to Windows systems. Of course, you can get away with scanning syslog when Windows client tries to read it, which should be acceptable...
I listed that as an example of what I would consider a sane policy. by doing the checking is a userspace library different binaries can be linked against different libraries by the sysadmin/distro to decide which ones need to do what checking. there's nothing inherent in the mechanism that foces the policy in any direction.
David Lang
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
In reply to Pavel MachekQuoted 31 lines · Pavel Machek
Hi!
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
And I still don't get this 'mmap problem' that I don't solve that libmalware magically solves. What? don't use mmap? I certainly hope not.
Don't use mmap, it is as simple as that. AFAICS
mmap(MAP_SHARED)-- which is basically shared memory -- is fundamentally incompatible with reliable virus scanning.Quoted 8 lines
Quoted 2 lines
...or do you have a reasonable solution for mmap?
mmap has a few different problems
1. intercepting reads and writes to take action at that time
2. the fact that two programs can use it as an inter-process communication mechanism.
...can and will use it as an IPC. So we need to modify some applications.
Rather than modify all the applications using mmap (you can't tell if the other side is going to use it for shared memory... right?), we could simply modify all the Windows-facing applications using mmap.
Quoted 2 lines
if you are worried about the IPC aspects, all you can do is forbid it,
Quoted 8 lines
Can you automatically tell if applications are using mmap for IPC?
BTW in another mail you wanted to include
/var/log/syslogfrom scanning. You should not be doing that if syslog is exported to Windows systems. Of course, you can get away with scanning syslog when Windows client tries to read it, which should be acceptable...
Pavel
There is a solution to this whole scanning thing, but I've been reluctant to suggest it, and it will be pretty obvious why y'all probably don't want to try it. Just to be sure the options are out on the table, here goes.
Define an xattr, let's call it "UNSCANNED", which has as its value a timestamp. A regular file with this attribute cannot be executed or opened,(exec or open hangs or fails, either behavior has merit and downsides) and it requires privilege (perhaps CAP_MAC_ADMIN) to remove the attribute. File creation attaches the attribute. Any open for write attaches the attribute.
Your scanner runs with privilege (say CAP_MAC_OVERRIDE) and passes judgment on files with this attribute, removing either the file, if it is Evil, or the attribute, if it is Good. The scanner is invoked when a file that was open with write access is closed. This can be done using mechanisms already discussed on this thread.
If you like, you could use a "SCANNED" attribute instead of an "UNSCANNED" attribute, and reverse the sense of the test. The major difference will show up on filesystems that don't support xattrs. The implications should be obvious.
Now at the beginning I said that you wouldn't like this scheme, and it shouldn't take a security expert to see the usability problems. This is how an old school trusted systems junkie (like me) would do it, and I don't see a better way that would actually achieve the stated goals. If you wanted you could implement an LSM to do the labeling bit in a day or two, the notification in about the same time, which would leave the scanner as the long pole in your development schedule.
P.S. - Library based security doesn't work.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Quoted 60 lines · Casey Schaufler
Quoted 27 lines · Pavel Machek
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
And I still don't get this 'mmap problem' that I don't solve that libmalware magically solves. What? don't use mmap? I certainly hope not.
Don't use mmap, it is as simple as that. AFAICS
mmap(MAP_SHARED)-- which is basically shared memory -- is fundamentally incompatible with reliable virus scanning.Quoted 8 lines
Quoted 2 lines
...or do you have a reasonable solution for mmap?
mmap has a few different problems
1. intercepting reads and writes to take action at that time
2. the fact that two programs can use it as an inter-process communication mechanism.
...can and will use it as an IPC. So we need to modify some applications.
Rather than modify all the applications using mmap (you can't tell if the other side is going to use it for shared memory... right?), we could simply modify all the Windows-facing applications using mmap.
Quoted 1 line
if you are worried about the IPC aspects, all you can do is forbid it,
Quoted 8 lines
Can you automatically tell if applications are using mmap for IPC?
BTW in another mail you wanted to include
/var/log/syslogfrom scanning. You should not be doing that if syslog is exported to Windows systems. Of course, you can get away with scanning syslog when Windows client tries to read it, which should be acceptable...
PavelThere is a solution to this whole scanning thing, but I've been reluctant to suggest it, and it will be pretty obvious why y'all probably don't want to try it. Just to be sure the options are out on the table, here goes.
Define an xattr, let's call it "UNSCANNED", which has as its value a timestamp. A regular file with this attribute cannot be executed or opened,(exec or open hangs or fails, either behavior has merit and downsides) and it requires privilege (perhaps
CAP_MAC_ADMIN) to remove the attribute. File creation attaches the attribute. Any open for write attaches the attribute.Your scanner runs with privilege (say
CAP_MAC_OVERRIDE) and passes judgment on files with this attribute, removing either the file, if it is Evil, or the attribute, if it is Good. The scanner is invoked when a file that was open with write access is closed. This can be done using mechanisms already discussed on this thread.If you like, you could use a "SCANNED" attribute instead of an "UNSCANNED" attribute, and reverse the sense of the test. The major difference will show up on filesystems that don't support xattrs. The implications should be obvious.
Quoted 8 lines
Now at the beginning I said that you wouldn't like this scheme, and it shouldn't take a security expert to see the usability problems. This is how an old school trusted systems junkie (like me) would do it, and I don't see a better way that would actually achieve the stated goals. If you wanted you could implement an LSM to do the labeling bit in a day or two, the notification in about the same time, which would leave the scanner as the long pole in your development schedule.
did you read the proposal I wrote up? it's similar to (but more flexible than) what you are saying
it would allow for multiple 'scanned' tags (to allow for multiple scanning programs). the kernel would clear the tags when the file is dirtied (not when it is closed, the file may not be closed for weeks after all), there is a mechanism to tell the scanner(s) that a file was modified (rather then having to scan the entire filesystem), and if the scan was not done yet when a file is opened the scanner(s) can be invoked at that time.
Quoted 1 line
P.S. - Library based security doesn't work.
why not? (with the appropriate kernel support)
it actually wouldn't be hard to have the kernel check the xattr, what would be hard is hving the kernel know when it should then invoke the scanner(s) and when it shouldn't. This is a policy decision that doesn't belong in the kernel.
David Lang
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Quoted 84 lines · On Mon, Aug 18, 2008 at 10:17 AM, <[email protected]> wrote:
Quoted 63 lines · Casey Schaufler
Quoted 29 lines · Pavel Machek
Quoted 9 lines
Quoted 9 lines
Quoted 5 lines
And I still don't get this 'mmap problem' that I don't solve that libmalware magically solves. What? don't use mmap? I certainly hope not.
Don't use mmap, it is as simple as that. AFAICS
mmap(MAP_SHARED)-- which is basically shared memory -- is fundamentally incompatible with reliable virus scanning.Quoted 9 lines
Quoted 2 lines
...or do you have a reasonable solution for mmap?
mmap has a few different problems
1. intercepting reads and writes to take action at that time
2. the fact that two programs can use it as an inter-process communication mechanism.
...can and will use it as an IPC. So we need to modify some applications.
Rather than modify all the applications using mmap (you can't tell if the other side is going to use it for shared memory... right?), we could simply modify all the Windows-facing applications using mmap.
Quoted 1 line
if you are worried about the IPC aspects, all you can do is forbid it,
Quoted 9 lines
Can you automatically tell if applications are using mmap for IPC?
BTW in another mail you wanted to include
/var/log/syslogfrom scanning. You should not be doing that if syslog is exported to Windows systems. Of course, you can get away with scanning syslog when Windows client tries to read it, which should be acceptable...Pavel
There is a solution to this whole scanning thing, but I've been reluctant to suggest it, and it will be pretty obvious why y'all probably don't want to try it. Just to be sure the options are out on the table, here goes.
Define an xattr, let's call it "UNSCANNED", which has as its value a timestamp. A regular file with this attribute cannot be executed or opened,(exec or open hangs or fails, either behavior has merit and downsides) and it requires privilege (perhaps
CAP_MAC_ADMIN) to remove the attribute. File creation attaches the attribute. Any open for write attaches the attribute.Your scanner runs with privilege (say
CAP_MAC_OVERRIDE) and passes judgment on files with this attribute, removing either the file, if it is Evil, or the attribute, if it is Good. The scanner is invoked when a file that was open with write access is closed. This can be done using mechanisms already discussed on this thread.If you like, you could use a "SCANNED" attribute instead of an "UNSCANNED" attribute, and reverse the sense of the test. The major difference will show up on filesystems that don't support xattrs. The implications should be obvious.
Quoted 8 lines
Now at the beginning I said that you wouldn't like this scheme, and it shouldn't take a security expert to see the usability problems. This is how an old school trusted systems junkie (like me) would do it, and I don't see a better way that would actually achieve the stated goals. If you wanted you could implement an LSM to do the labeling bit in a day or two, the notification in about the same time, which would leave the scanner as the long pole in your development schedule.
did you read the proposal I wrote up? it's similar to (but more flexible than) what you are saying
it would allow for multiple 'scanned' tags (to allow for multiple scanning programs). the kernel would clear the tags when the file is dirtied (not when it is closed, the file may not be closed for weeks after all), there is a mechanism to tell the scanner(s) that a file was modified (rather then having to scan the entire filesystem), and if the scan was not done yet when a file is opened the scanner(s) can be invoked at that time.
Quoted 9 lines
Quoted 1 line
P.S. - Library based security doesn't work.why not? (with the appropriate kernel support)
it actually wouldn't be hard to have the kernel check the xattr, what would be hard is hving the kernel know when it should then invoke the scanner(s) and when it shouldn't. This is a policy decision that doesn't belong in the kernel.
Because of syscalls and you don't need to use LD.so to run a program.
Programs can embed there own LD.so and avoid using the system core
one. This kind of function is being developed for LSB applications
for platforms that don't support LSB.
syscalls you can run programs by passing all .so files and directly talk to kernel.
Two aways around LD Preloads there are a few more.
Peter Dolding
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Quoted 96 lines · Peter Dolding
Quoted 84 lines · On Mon, Aug 18, 2008 at 10:17 AM, <[email protected]> wrote:
Quoted 63 lines · Casey Schaufler
Quoted 29 lines · Pavel Machek
Quoted 9 lines
Quoted 9 lines
Quoted 5 lines
And I still don't get this 'mmap problem' that I don't solve that libmalware magically solves. What? don't use mmap? I certainly hope not.
Don't use mmap, it is as simple as that. AFAICS
mmap(MAP_SHARED)-- which is basically shared memory -- is fundamentally incompatible with reliable virus scanning.Quoted 9 lines
Quoted 2 lines
...or do you have a reasonable solution for mmap?
mmap has a few different problems
1. intercepting reads and writes to take action at that time
2. the fact that two programs can use it as an inter-process communication mechanism.
...can and will use it as an IPC. So we need to modify some applications.
Rather than modify all the applications using mmap (you can't tell if the other side is going to use it for shared memory... right?), we could simply modify all the Windows-facing applications using mmap.
Quoted 1 line
if you are worried about the IPC aspects, all you can do is forbid it,
Quoted 9 lines
Can you automatically tell if applications are using mmap for IPC?
BTW in another mail you wanted to include
/var/log/syslogfrom scanning. You should not be doing that if syslog is exported to Windows systems. Of course, you can get away with scanning syslog when Windows client tries to read it, which should be acceptable...Pavel
There is a solution to this whole scanning thing, but I've been reluctant to suggest it, and it will be pretty obvious why y'all probably don't want to try it. Just to be sure the options are out on the table, here goes.
Define an xattr, let's call it "UNSCANNED", which has as its value a timestamp. A regular file with this attribute cannot be executed or opened,(exec or open hangs or fails, either behavior has merit and downsides) and it requires privilege (perhaps
CAP_MAC_ADMIN) to remove the attribute. File creation attaches the attribute. Any open for write attaches the attribute.Your scanner runs with privilege (say
CAP_MAC_OVERRIDE) and passes judgment on files with this attribute, removing either the file, if it is Evil, or the attribute, if it is Good. The scanner is invoked when a file that was open with write access is closed. This can be done using mechanisms already discussed on this thread.If you like, you could use a "SCANNED" attribute instead of an "UNSCANNED" attribute, and reverse the sense of the test. The major difference will show up on filesystems that don't support xattrs. The implications should be obvious.
Quoted 8 lines
Now at the beginning I said that you wouldn't like this scheme, and it shouldn't take a security expert to see the usability problems. This is how an old school trusted systems junkie (like me) would do it, and I don't see a better way that would actually achieve the stated goals. If you wanted you could implement an LSM to do the labeling bit in a day or two, the notification in about the same time, which would leave the scanner as the long pole in your development schedule.
did you read the proposal I wrote up? it's similar to (but more flexible than) what you are saying
it would allow for multiple 'scanned' tags (to allow for multiple scanning programs). the kernel would clear the tags when the file is dirtied (not when it is closed, the file may not be closed for weeks after all), there is a mechanism to tell the scanner(s) that a file was modified (rather then having to scan the entire filesystem), and if the scan was not done yet when a file is opened the scanner(s) can be invoked at that time.
Quoted 9 lines
Quoted 1 line
P.S. - Library based security doesn't work.why not? (with the appropriate kernel support)
it actually wouldn't be hard to have the kernel check the xattr, what would be hard is hving the kernel know when it should then invoke the scanner(s) and when it shouldn't. This is a policy decision that doesn't belong in the kernel.
Because of syscalls and you don't need to use LD.so to run a program.
Quoted 8 lines
Programs can embed there own LD.so and avoid using the system core
one. This kind of function is being developed for LSB applications
for platforms that don't support LSB.syscalls you can run programs by passing all .so files and directly talk to kernel.
Two aways around LD Preloads there are a few more.
you seem to be disagreeing with the threat model. If so, rather then arguing agains this implementation of a defense, you need to be arguing against the threat model.
you are arguing that this solution doesn't work in some conditions. you are correct, but the threat model that was proposed (and nobody has proposed any different ones) is not trying to defend against code running on the system, even if that code is trying to bypass the protection. I even think that this is a good thing. it allows the distros to use the protection where appropriate and disable it where it's not (which is a surprisingly large number of places).
David Lang
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
In reply to [email protected]Quoted 71 lines · [email protected] wrote:
Quoted 60 lines · Casey Schaufler
Quoted 27 lines · Pavel Machek
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
And I still don't get this 'mmap problem' that I don't solve that libmalware magically solves. What? don't use mmap? I certainly hope not.
Don't use mmap, it is as simple as that. AFAICS
mmap(MAP_SHARED)-- which is basically shared memory -- is fundamentally incompatible with reliable virus scanning.Quoted 8 lines
Quoted 2 lines
...or do you have a reasonable solution for mmap?
mmap has a few different problems
1. intercepting reads and writes to take action at that time
2. the fact that two programs can use it as an inter-process communication mechanism.
...can and will use it as an IPC. So we need to modify some applications.
Rather than modify all the applications using mmap (you can't tell if the other side is going to use it for shared memory... right?), we could simply modify all the Windows-facing applications using mmap.
Quoted 1 line
if you are worried about the IPC aspects, all you can do is forbid it,
Quoted 8 lines
Can you automatically tell if applications are using mmap for IPC?
BTW in another mail you wanted to include
/var/log/syslogfrom scanning. You should not be doing that if syslog is exported to Windows systems. Of course, you can get away with scanning syslog when Windows client tries to read it, which should be acceptable...
PavelThere is a solution to this whole scanning thing, but I've been reluctant to suggest it, and it will be pretty obvious why y'all probably don't want to try it. Just to be sure the options are out on the table, here goes.
Define an xattr, let's call it "UNSCANNED", which has as its value a timestamp. A regular file with this attribute cannot be executed or opened,(exec or open hangs or fails, either behavior has merit and downsides) and it requires privilege (perhaps
CAP_MAC_ADMIN) to remove the attribute. File creation attaches the attribute. Any open for write attaches the attribute.Your scanner runs with privilege (say
CAP_MAC_OVERRIDE) and passes judgment on files with this attribute, removing either the file, if it is Evil, or the attribute, if it is Good. The scanner is invoked when a file that was open with write access is closed. This can be done using mechanisms already discussed on this thread.If you like, you could use a "SCANNED" attribute instead of an "UNSCANNED" attribute, and reverse the sense of the test. The major difference will show up on filesystems that don't support xattrs. The implications should be obvious.
Quoted 8 lines
Now at the beginning I said that you wouldn't like this scheme, and it shouldn't take a security expert to see the usability problems. This is how an old school trusted systems junkie (like me) would do it, and I don't see a better way that would actually achieve the stated goals. If you wanted you could implement an LSM to do the labeling bit in a day or two, the notification in about the same time, which would leave the scanner as the long pole in your development schedule.
Quoted 1 line
did you read the proposal I wrote up? it's similar to (but more flexible than) what you are saying
Sorry, I must have missed it. My bad.
Quoted 2 lines
it would allow for multiple 'scanned' tags (to allow for multiple scanning programs). the kernel would clear the tags when the file is dirtied (not when it is closed, the file may not be closed for weeks after all), there is a mechanism to tell the scanner(s) that a file was modified (rather then having to scan the entire filesystem), and if the scan was not done yet when a file is opened the scanner(s) can be invoked at that time.
One xattr, multiple xattrs, all would work. It's simpler to clear the "scanned" attribute on open than on dirty, a your scheme means looking at writes, seeks, ioctls, fcntls, and so on.
Quoted 3 lines
Quoted 1 line
P.S. - Library based security doesn't work.why not? (with the appropriate kernel support)
If you have kernel support it aint library based.
Quoted 1 line
it actually wouldn't be hard to have the kernel check the xattr, what would be hard is hving the kernel know when it should then invoke the scanner(s) and when it shouldn't. This is a policy decision that doesn't belong in the kernel.
I'm old school. I say that all policy decisions regarding objects that the kernel maintains belong in the kernel. That's why I say that any time a file is closed with scanned unset (or unscanned set) the scanner should be invoked or notified. The scanner can choose to ignore or queue the notification, but the kernel will be done at that point. The kernel have done all that it can and it's up to the scanner from then on.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
In reply to Pavel MachekQuoted 3 lines · On Mon, 18 Aug 2008 00:58:44 +0200 Pavel Machek <[email protected]> wrote:
Rather than modify all the applications using mmap (you can't tell if the other side is going to use it for shared memory... right?), we could simply modify all the Windows-facing applications using mmap.
If web browsers, office suites and mail clients on Windows have certain kinds of vulnerabilities, it is safe to assume that the same programs on Linux will have similar problems.
Can we please get rid of the idea that "Windows facing" is where the whole malware problem is?
As for how to solve it - lets try to come up with a solution that is reasonably high performance and can be used for more than just malware scanning.
Using the same code for things like HSM would be nice.
Signature · 1 line
All rights reversed.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Quoted 11 lines · Rik van Riel
Quoted 3 lines · On Mon, 18 Aug 2008 00:58:44 +0200 Pavel Machek <[email protected]> wrote:
Rather than modify all the applications using mmap (you can't tell if the other side is going to use it for shared memory... right?), we could simply modify all the Windows-facing applications using mmap.
If web browsers, office suites and mail clients on Windows have certain kinds of vulnerabilities, it is safe to assume that the same programs on Linux will have similar problems.
Quoted 6 lines
Can we please get rid of the idea that "Windows facing" is where the whole malware problem is?
As for how to solve it - lets try to come up with a solution that is reasonably high performance and can be used for more than just malware scanning.
Don't mix exploits with viruses -- they are different.
Exploit is where application does something very unexpected due to a bug.
Virus is where machine works correctly, but user does something stupid.
For exploits, randomization + patching + compartments seem like a solution. We should be working on "how to confine openoffice.org so that it can't do much damage" instead of "how to detect .doc documents that makes openoffice.org do something unexpected".
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
In reply to Theodore TsoQuoted 2 lines
So if that is the threat model, then the only thing libmalware.so doesn't solve is knfsd access, and it should be evaluated on that
And static binaries, and other kernel modular file I/O done on behalf of applications, and making a library work well which is *hard*, and labelling and scalability, and sharing a cache between users, and aggregating events across processes .. and a few other things.
You have a lot of shared state here.
Quoted 4 lines
So let's be real clear, up front, what the threat model is, and avoid changing the model around to rule out solutions that don't fit the initially preconceived one. That's how you get to the TSA confiscating water bottles in airport security lines.
I don't think this is useful. I don't actually care what the virus folks want to implement. I would rather see useful general purpose interfaces that are practical and make sense. I cdon't really care whether people use the write() system call to do sensible or dumb things. What we should care about is the write syscall.
There seem so far to be two independent requests
* Noticing a file has recently changed, possibly with information about changes and possibly being able to aggregate/time that for scalability. This has a need to be able to accurately reference which file. This is needed for good content indexing, and virus people want it for certain kinds of scanning (post write, background etc). Doing this solely as a final close notifier seems to be insufficient (as it may never close).
* Being able to pause an open pending some action. Examples include HSM and dubiously some kinds of virus check. Problems here include the fact it can only meaningfully be done for first open (which is fine for HSM) and that the notion of an exclusive open, or of repeated clearly defined open/read-write/close/done sequences are actually quite foreign to Unix like systems.
We shouldn't need to care what people do with good interface. What matters is in your airport example is that at the infrastructure level there is a point you can choose to do scanning and we agree where. Whether people use this to provide a Starbucks or goons with rubber gloves who take away babies milk is an application layer problem.
Alan
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
Quoted 5 lines · Alan Cox
We shouldn't need to care what people do with good interface. What matters is in your airport example is that at the infrastructure level there is a point you can choose to do scanning and we agree where. Whether people use this to provide a Starbucks or goons with rubber gloves who take away babies milk is an application layer problem.
If it's a good interface that also happens to address HSM/DMAPI functionality, as well as a more efficient way for trackerd to work, I agree completely. I think you will agree the proposed TALPA interface is a bit too virus-scanner specific, though? Especially with explicit talk of specialized (persistent or not) "clean/dirty/infected" bits that the kernel would store in the inode for the benefit of the AV scanner? That's rather optimized for the goons-with-rubber-gloves that-make-mothers-drink-their-own-breast-to-prove-it's-not-explosives crowd, I think...
- Ted
RE: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforonaccess scanning
Quoted 5 lines
-----Original Message-----
From: Theodore Tso [mailto:[email protected]]
Sent: Friday, August 15, 2008 7:35 AM
To: Alan Cox
Cc: Rik van Riel; Pavel Machek; Press, Jonathan; [email protected];
Adrian Bunk;
Quoted 1 line
Mihai Don??u; [email protected];
[email protected]; linux-
Quoted 2 lines
[email protected]; Arjan van de Ven
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to
alinuxinterfaceforonaccess
Quoted 5 lines
scanning
Quoted 2 lines · Alan Cox
We shouldn't need to care what people do with good interface. What matters is in your airport example is that at the infrastructure
level
Quoted 3 lines
Quoted 3 lines
there is a point you can choose to do scanning and we agree where. Whether people use this to provide a Starbucks or goons with rubber gloves who take away babies milk is an application layer problem.
An interesting example is (please don't scream everyone -- it's just an illustration of one approach to the problem) NetWare. (In fact, we still have a lot of active NetWare customers, so the fact that it is an archaic OS is not really the issue.) NetWare takes the kitchen-sink approach. It has an interface that allows notification on a whole host of i/o events, way more than we have ever found useful, and the application can register for the ones it wants and go from there. The kernel does not care what the application's inherent logic is, as long as the application passes control back with some appropriate return information (in other words, allow or deny in the context of malware) within a reasonable amount of time. I have no idea what purpose it was written for originally, and there are flaws to be sure, but I know that it is used successfully for HSMs and anti-malware products.
Quoted 9 lines
If it's a good interface that also happens to address HSM/DMAPI functionality, as well as a more efficient way for trackerd to work, I agree completely. I think you will agree the proposed TALPA interface is a bit too virus-scanner specific, though? Especially with explicit talk of specialized (persistent or not) "clean/dirty/infected" bits that the kernel would store in the inode for the benefit of the AV scanner? That's rather optimized for the goons-with-rubber-gloves that-make-mothers-drink-their-own-breast-to-prove-it's-not-explosives crowd, I think...
That may just be a question of terminology. If the bits are construed not as clean/dirty/infected, but as "I care about this file" vs. "I don't care about this file" then the rubber gloves come off.
Jon Press
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforonaccess scanning
Quoted 3 lines · Jonathan
That may just be a question of terminology. If the bits are construed not as clean/dirty/infected, but as "I care about this file" vs. "I don't care about this file" then the rubber gloves come off.
Sure, as long as we're very clear about the semantics of the bits. If the bits are not persistent, but which get dropped if the inode is every evicted from memory, and it's considered OK, or even desirable, to rescan the file when it is brought back into memory, that may be acceptable to the rubber gloves folks (make people go through lots superflous of security scans, even when they are transfering betewen flights --- security is always more important than passengers' convenience!), but perhaps not to other applications such as file indexers, who would view rescanning files that have already been scanned, and not have been modified, as a waste of time, battery, CPU and disk bandwidth, etc.
As I understand it, the TALPA proposal had non-persistent clean/dirty/infected bits.
- Ted
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforonaccess scanning
[email protected] wrote on 2008-08-15 14:16:21:
Quoted 17 lines · Jonathan
Quoted 3 lines
That may just be a question of terminology. If the bits are construed not as clean/dirty/infected, but as "I care about this file" vs. "I don't care about this file" then the rubber gloves come off.
Sure, as long as we're very clear about the semantics of the bits. If the bits are not persistent, but which get dropped if the inode is every evicted from memory, and it's considered OK, or even desirable, to rescan the file when it is brought back into memory, that may be acceptable to the rubber gloves folks (make people go through lots superflous of security scans, even when they are transfering betewen flights --- security is always more important than passengers' convenience!), but perhaps not to other applications such as file indexers, who would view rescanning files that have already been scanned, and not have been modified, as a waste of time, battery, CPU and disk bandwidth, etc.
Quoted 4 lines
As I understand it, the TALPA proposal had non-persistent clean/dirty/infected bits.
- Ted
Yes the current proposal has temporary markers in the in-memory representation if inodes.
This is a problem for current anti-malware scanning, as virus data updates come every few hours
(at which point the entire clean/infected state has to be cleared), so the loss after a reboot is
limited.
Signature · 6 lines
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.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforonaccess scanning
[email protected] wrote on 2008-08-15 14:22:27:
Quoted 4 lines
[email protected] wrote on 2008-08-15 14:16:21:
Quoted 2 lines · Jonathan
Quoted 1 line
That may just be a question of terminology. If the bits are
construed
Quoted 18 lines
Quoted 18 lines
Quoted 2 lines
not as clean/dirty/infected, but as "I care about this file" vs. "I don't care about this file" then the rubber gloves come off.
Sure, as long as we're very clear about the semantics of the bits. If the bits are not persistent, but which get dropped if the inode is every evicted from memory, and it's considered OK, or even desirable, to rescan the file when it is brought back into memory, that may be acceptable to the rubber gloves folks (make people go through lots superflous of security scans, even when they are transfering betewen flights --- security is always more important than passengers' convenience!), but perhaps not to other applications such as file indexers, who would view rescanning files that have already been scanned, and not have been modified, as a waste of time, battery, CPU and disk bandwidth, etc.
As I understand it, the TALPA proposal had non-persistent clean/dirty/infected bits.
Quoted 6 lines
Quoted 1 line
- Ted
Yes the current proposal has temporary markers in the in-memory representation if inodes.
This is a problem for current anti-malware scanning, as virus data
updates
Quoted 2 lines
come every few hours
(at which point the entire clean/infected state has to be cleared), so
the
Quoted 2 lines
loss after a reboot is
limited.
Of course I mean't NOT a problem...
Signature · 8 lines
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.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforonaccess scanning
In reply to [email protected]Quoted 3 lines · On Fri, Aug 15, 2008 at 02:22:27PM +0100, [email protected] wrote:
This is a problem for current anti-malware scanning, as virus data updates come every few hours
Every few hours?!? I hadn't noticed Windows AV programs getting updates that frequently, at least not the ones that I've been familiar with. (Semantec, Norton, McAfee)
- Ted
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforonaccess scanning
Theodore Tso <[email protected]> wrote on 2008-08-15 14:55:37:
Quoted 1 line
On Fri, Aug 15, 2008 at 02:22:27PM +0100, [email protected]
Quoted 2 lines · wrote:
Quoted 2 lines
This is a problem for current anti-malware scanning, as virus data
updates
Quoted 7 lines
Quoted 1 line
come every few hours
Every few hours?!? I hadn't noticed Windows AV programs getting updates that frequently, at least not the ones that I've been familiar with. (Semantec, Norton, McAfee)
From one of our Linux machines that configured to update normally:
Fri 15 Aug 2008 15:02:23 BST
Fri 15 Aug 2008 12:52:19 BST
Fri 15 Aug 2008 08:32:24 BST
Fri 15 Aug 2008 04:12:27 BST
Fri 15 Aug 2008 02:02:23 BST
That was the sort of time period I remember being told -
but the AV products probably don't make a song and
dance about a small virus data updates so you probably wouldn't notice them.
Signature · 6 lines
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.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforonaccess scanning
In reply to Theodore TsoQuoted 8 lines · Theodore Tso
Quoted 3 lines · On Fri, Aug 15, 2008 at 02:22:27PM +0100, [email protected] wrote:
This is a problem for current anti-malware scanning, as virus data updates come every few hours
Every few hours?!? I hadn't noticed Windows AV programs getting updates that frequently, at least not the ones that I've been familiar with. (Semantec, Norton, McAfee)
Try running a mail server that provides virus scanning for a large population of 100K or so mailboxes. You end up pulling from your vendor on an hourly basis, just because a virus on a burn through your userbase can toast you that quickly.
Since 9AM Sunday (is now 11:30AM Friday as I write this), we've pulled new signatures 33 times (one new signature each time in this case) from our vendor. So yeah, about once every 3-4 hours we get a new updated one for a new variant of whatever. I've seen times when we've pulled a new signature file 3 hours in a row, and each time there were 10-12 new variants, so averaging 12/hour...
Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access scanning
In reply to Alan CoxQuoted 7 lines
Quoted 2 lines
So if that is the threat model, then the only thing libmalware.so doesn't solve is knfsd access, and it should be evaluated on that
And static binaries, and other kernel modular file I/O done on behalf of applications, and making a library work well which is *hard*, and labelling and scalability, and sharing a cache between users, and aggregating events across processes .. and a few other things.
Well, I believe libmalware.so works with threat model I described; of course it will not protect statically linked sambad (unless you statically link it with libmalware.so, which you should do). I'm not actually advocating LD_PRELOAD. There are enough userspace nfsds around, but yes, you can't use libmalware.so with knfsd.
[You could do something like fuse filesystem linked with libmalware, and make knfsd export that, and put applications you can't link with libmalware to use that. But that's a _hack_.]
Quoted 9 lines
There seem so far to be two independent requests
* Noticing a file has recently changed, possibly with information about changes and possibly being able to aggregate/time that for scalability. This has a need to be able to accurately reference which file. This is needed for good content indexing, and virus people want it for certain kinds of scanning (post write, background etc). Doing this solely as a final close notifier seems to be insufficient (as it may never close).
Agreed, we need this.
Quoted 6 lines
* Being able to pause an open pending some action. Examples include HSM and dubiously some kinds of virus check. Problems here include the fact it can only meaningfully be done for first open (which is fine for HSM) and that the notion of an exclusive open, or of repeated clearly defined open/read-write/close/done sequences are actually quite foreign to Unix like systems.
Do HSMs really get implemented like that? I'd expect HSM to be something like fuse or unionfs... and when it is confined to one filesystem, you can use existing solutions.
I don't like blocking at open at all, and I don't think blocking at open is enough for antivirus scanner.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
In reply to Pavel MachekQuoted 5 lines · On Wed, 13 Aug 2008 14:56:38 +0200 Pavel Machek <[email protected]> wrote:
So you make sure all apps are modified. Distros are good at that, and modifications are not that hard.
Plus, proposed solution already has three unacceptable holes:
Quoted 8 lines
1) it only catches known signatures
2) write vs. read race mentioned above
3) mmap problem
. Making sure all apps use libmalware.so is trivial compared to solving 3).
the other thing is.. all applications ALREADY use such a library. It's called "glibc".
Signature · 3 lines
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
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
In reply to Press, JonathanQuoted 40 lines · Jonathan
Quoted 6 lines
-----Original Message-----
From: Pavel Machek [mailto:[email protected]]
Sent: Wednesday, August 13, 2008 6:28 AM
To: Press, Jonathan
Cc: [email protected]; Arjan van de Ven; Mihai Don??u; Adrian Bunk; [email protected]; Greg KH; [email protected];linux-security-
Quoted 2 lines
[email protected]; [email protected]
Subject: Re: [malware-list] [RFC 0/5] [TALPA] Intro to alinuxinterfaceforon access
Quoted 3 lines
scanning
Quoted 1 line
I think everyone understands one side of the threat model, that is
Linux machines
Quoted 2 lines
being carriers of infections aimed at other platforms. There are many
ways that
Quoted 1 line
such infections can be stored, and many ways in which they can be
communicated
Quoted 1 line
to the target machines. There are so many that it would not be
effective or efficient
Quoted 1 line
for each such transfer application to be able to handle its own
malware scanning,
Quoted 1 line
which is the short statement of why centralized AV protection with
notification
Quoted 5 lines
assistance from the kernel is appropriate.
Quoted 1 line
No.
Quoted 8 lines
Proposed kernel solution did not work -- there still was write vs. read race. You are right that it is not ok for each application to do its own malware scanning, but libmalware.so that handles the scanning seems very reasonable.
And as applications _need_ to be modified for the write vs. read race to be solved, libmalware.so looks like a way forward.
Pavel
Quoted 12 lines
I am not sure what you are suggesting, and I may have missed the libmalware proposal (I don't see any mention of that specific idea in any other message). However, just to be clear... At no point did we suggest that the kernel would do any scanning. What we have been interested in is a mechanism that can allow a scanning application to be notified by the kernel of specific i/o events, for those events to be blocked by the kernel until a user-space scan is done, and then the user-space scan sends back allow or deny, at which point the i/o event returns to the caller -- either success or error. This is the only way that malware can be guaranteed of being detected when it is used (for local application purposes or for transmission to another platform) or created.
this is a very broad statement that ignores the LD_PRELOAD approach, and thus not true.
Quoted 5 lines
Also, a solution that requires applications to be modified will not work, because there is no way that we would be able to get ALL applications on the machines to be modified in the required ways. If ANY applications are not so modified, then you have an unacceptable
you don't need to modify applications to make them use a library...
Signature · 3 lines
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
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Arjan van de Ven <[email protected]> wrote on 13/08/2008 14:54:01:
Quoted 13 lines
Quoted 4 lines
I am not sure what you are suggesting, and I may have missed the libmalware proposal (I don't see any mention of that specific idea in any other message). However, just to be clear... At no point did we suggest that the kernel would do any scanning. What we have been
Quoted 8 lines
interested in is a mechanism that can allow a scanning application to be notified by the kernel of specific i/o events, for those events to be blocked by the kernel until a user-space scan is done, and then the user-space scan sends back allow or deny, at which point the i/o event returns to the caller -- either success or error. This is the only way that malware can be guaranteed of being detected when it is used (for local application purposes or for transmission to another platform) or created.
Quoted 2 lines
this is a very broad statement that ignores the
LD_PRELOADapproach, and thus not true.
LD_PRELOAD does not solve at least knfsd and suid binaries. But we are going in circles. :)
Quoted 6 lines
Quoted 4 lines
Also, a solution that requires applications to be modified will not work, because there is no way that we would be able to get ALL applications on the machines to be modified in the required ways. If ANY applications are not so modified, then you have an unacceptable
you don't need to modify applications to make them use a library...
Same is true for a kernel solution. Plus, it also works for those who make system calls directly, knfsd and suid binaries, and we can have cheap and ultra-efficient caching. Not much kernel code, even less complex kernel code and unmeasurable impact when not used and compiled in. What are the big technical objections to that?
--
Tvrtko A. Ursulin
Senior Software Engineer, Sophos
"Views and opinions expressed in this email are strictly those of the author.
The contents has not been reviewed or approved by Sophos."
Sophos Plc, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom.
Company Reg No 2096520. VAT Reg No GB 348 3873 20.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 28 lines · On Wed, 13 Aug 2008 15:16:12 +0100 [email protected] wrote:
Arjan van de Ven <[email protected]> wrote on 13/08/2008 14:54:01:
Quoted 14 lines
Quoted 5 lines
I am not sure what you are suggesting, and I may have missed the libmalware proposal (I don't see any mention of that specific idea in any other message). However, just to be clear... At no point did we suggest that the kernel would do any scanning. What we have been interested in is a mechanism that can allow a
Quoted 8 lines
scanning application to be notified by the kernel of specific i/o events, for those events to be blocked by the kernel until a user-space scan is done, and then the user-space scan sends back allow or deny, at which point the i/o event returns to the caller -- either success or error. This is the only way that malware can be guaranteed of being detected when it is used (for local application purposes or for transmission to another platform) or created.
Quoted 2 lines
this is a very broad statement that ignores the
LD_PRELOADapproach, and thus not true.
LD_PRELOADdoes not solve at least knfsd and suid binaries. But we are going in circles. :)Quoted 6 lines
Quoted 5 lines
Also, a solution that requires applications to be modified will not work, because there is no way that we would be able to get ALL applications on the machines to be modified in the required ways. If ANY applications are not so modified, then you have an unacceptable
Quoted 8 lines
Quoted 1 line
you don't need to modify applications to make them use a library...
Same is true for a kernel solution. Plus, it also works for those who make system calls directly, knfsd and suid binaries, and we can have cheap and ultra-efficient caching. Not much kernel code, even less complex kernel code and unmeasurable impact when not used and compiled in. What are the big technical objections to that?
the biggest objection is the lack of security model description. STILL nobody has answered Ted's questions.
And still the AV side of the argument keeps making circular arguments.
I'm not saying the kernel shouldn't be involved at all.
I can totally see a solution where we have a sys_virus_scan(int fd)
that glibc calls at appropriate places (say every read() and mmap()) and that on the kernel side uses a cache to store which virus signature version it was last scanned with, and if not new enough.. punts to some userspace scanner for vetting.
but first someone needs to answer Ted's very basic questions or the TALPA side really does look like a donkey in this argument.
Signature · 3 lines
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
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Arjan van de Ven wrote on 13/08/2008 15:28:59:
Quoted 54 lines
Quoted 28 lines · On Wed, 13 Aug 2008 15:16:12 +0100 [email protected] wrote:
Arjan van de Ven <[email protected]> wrote on 13/08/2008 14:54:01:
Quoted 14 lines
Quoted 5 lines
I am not sure what you are suggesting, and I may have missed the libmalware proposal (I don't see any mention of that specific idea in any other message). However, just to be clear... At no point did we suggest that the kernel would do any scanning. What we have been interested in is a mechanism that can allow a
Quoted 8 lines
scanning application to be notified by the kernel of specific i/o events, for those events to be blocked by the kernel until a user-space scan is done, and then the user-space scan sends back allow or deny, at which point the i/o event returns to the caller -- either success or error. This is the only way that malware can be guaranteed of being detected when it is used (for local application purposes or for transmission to another platform) or created.
Quoted 2 lines
this is a very broad statement that ignores the
LD_PRELOADapproach, and thus not true.
LD_PRELOADdoes not solve at least knfsd and suid binaries. But we are going in circles. :)Quoted 6 lines
Quoted 5 lines
Also, a solution that requires applications to be modified will not work, because there is no way that we would be able to get ALL applications on the machines to be modified in the required ways. If ANY applications are not so modified, then you have an unacceptable
Quoted 8 lines
Quoted 1 line
you don't need to modify applications to make them use a library...
Same is true for a kernel solution. Plus, it also works for those who make system calls directly, knfsd and suid binaries, and we can have cheap and ultra-efficient caching. Not much kernel code, even less complex kernel code and unmeasurable impact when not used and compiled in. What are the big technical objections to that?
the biggest objection is the lack of security model description. STILL nobody has answered Ted's questions.
And still the AV side of the argument keeps making circular arguments.
I'm not saying the kernel shouldn't be involved at all.
I can totally see a solution where we have asys_virus_scan(int fd)
that glibc calls at appropriate places (say everyread()andmmap()) and that on the kernel side uses a cache to store which virus signature version it was last scanned with, and if not new enough.. punts to some userspace scanner for vetting.
Quoted 2 lines
but first someone needs to answer Ted's very basic questions or the TALPA side really does look like a donkey in this argument.
I think that the english saying is "It takes two to tangle". As much as I am "guilty" for stepping out on Pavel's dejavu comments while at this stage I agree we should be making a more coherent and systematic threat model, you also haven't really contributed anything new and constructive by jumping into my (or was it Jonathans?) reply to him. So I disagree that "AV side" is the only side making circular argument and looking as a donkey (thanks), especially in todays exchange.
So lets finish this thread now and hopefully we will have something real to discuss soon.
--
Tvrtko A. Ursulin
Senior Software Engineer, Sophos
"Views and opinions expressed in this email are strictly those of the author.
The contents has not been reviewed or approved by Sophos."
Sophos Plc, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom.
Company Reg No 2096520. VAT Reg No GB 348 3873 20.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
In reply to [email protected]Quoted 15 lines · On Wed 2008-08-13 15:16:12, [email protected] wrote:
Arjan van de Ven <[email protected]> wrote on 13/08/2008 14:54:01:
Quoted 13 lines
Quoted 12 lines
I am not sure what you are suggesting, and I may have missed the libmalware proposal (I don't see any mention of that specific idea in any other message). However, just to be clear... At no point did we suggest that the kernel would do any scanning. What we have been interested in is a mechanism that can allow a scanning application to be notified by the kernel of specific i/o events, for those events to be blocked by the kernel until a user-space scan is done, and then the user-space scan sends back allow or deny, at which point the i/o event returns to the caller -- either success or error. This is the only way that malware can be guaranteed of being detected when it is used (for local application purposes or for transmission to another platform) or created.
Quoted 5 lines
Quoted 2 lines
this is a very broad statement that ignores the
LD_PRELOADapproach, and thus not true.
LD_PRELOADdoes not solve at least knfsd and suid binaries. But we are going in circles. :)
Yes, there are about 5 suid binaries on typical linux system. Link them to libmalware by hand.
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
Also, a solution that requires applications to be modified will not work, because there is no way that we would be able to get ALL applications on the machines to be modified in the required ways. If ANY applications are not so modified, then you have an unacceptable
Quoted 7 lines
Quoted 1 line
you don't need to modify applications to make them use a library...
Same is true for a kernel solution. Plus, it also works for those who make system calls directly, knfsd and suid binaries, and we can have cheap and ultra-efficient caching. Not much kernel code, even less complex kernel code and unmeasurable impact when not used and compiled in. What are the big technical objections to that?
That is does not work?
(Neither does LD_PRELOAD; it still has the old mmap problem. Too bad, but at least you get 99.9% coverage of all the apps).
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 5 lines
Quoted 2 lines
LD_PRELOADdoes not solve at least knfsd and suid binaries. But we are going in circles. :)Yes, there are about 5 suid binaries on typical linux system. Link them to libmalware by hand
And knfsd ?
Oh yes you don't seem to have an answer just manure to throw
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 9 lines · Alan Cox
Quoted 5 lines
Quoted 2 lines
LD_PRELOADdoes not solve at least knfsd and suid binaries. But we are going in circles. :)Yes, there are about 5 suid binaries on typical linux system. Link them to libmalware by hand
And knfsd ?
Oh yes you don't seem to have an answer just manure to throw
I think I acknowledged inability to handle knfsd... just don't use knfsd, then. Its not like nfs is critical for communicating with Windows, right?
That is still better than proposed solution here -- TALPA breaks with mmap, or when someone does read too soon after write.
Marketing "antivirus" system that is racy be design seems to deserve some manure.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
In reply to David Collier-BrownQuoted 8 lines · David Collier-Brown
Quoted 2 lines · Arjan van de Ven
we do still appreciate your description, since I don't think there's a clear "here's what we really try to protect against" statement yet.
Perhaps I could try: the AV folks are trying to prevent the
execution of either modified normal binaries/files or specifically exploit binaries/files, by machines for which the files are executable or interpretable.
1. We already know how to prevent/detect modifications to normal binaries. See Tripwire etc. As far as I know, no new kernel technology is needed.
2. Preventing execution of exploit binaries/files is not a well-defined problem, because there is no reliable way to recognize an exploit binary. If this is the problem definition, then in practice it will probably be impossible to meet this goal exactly. So this sounds like a kind of "aspirational" goal, but presumably it's not the whole story and it's not a full problem statement, and we need to know more precisely what the goals do and don't include. At some point we have to get beyond slogans and philosophies and move on to specifics.
3. Let me point out that you snipped a key line from Arjan van de Ven's email:
Answering Ted's questions would be a really good start...
And in particular you haven't answered Ted's questions. I agree with Arjan's email: I think we have to know the answer to Ted's questions before we can have a meaningful technical discussion. What's the threat model? What problem, specifically, are we trying to solve? What are the security goals? Given that there are no silver bullets and there's no way to stop all attacks, which class of risks are or aren't in scope?
Bottom line: It's helpful to try to understand each other's point of view and where we're each coming from, and this may be a start on that, but I don't think this answers the questions yet. It seems like we're still talking past each other.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 5 lines · On Mon, 11 Aug 2008 21:53:23 +0000 (UTC) [email protected] (David Wagner)…
Quoted 4 lines · David Collier-Brown
Quoted 2 lines · Arjan van de Ven
we do still appreciate your description, since I don't think there's a clear "here's what we really try to protect against" statement yet.
Quoted 8 lines
Quoted 4 lines
Perhaps I could try: the AV folks are trying to prevent the
execution of either modified normal binaries/files or specifically exploit binaries/files, by machines for which the files are executable or interpretable.1. We already know how to prevent/detect modifications to normal binaries. See Tripwire etc. As far as I know, no new kernel technology is needed.
Tripwire is incredibly ineffecient and ineffectual because we don't have a scalable 'file was modified' notifier
Alan
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
In reply to David WagnerSidebar again...
Quoted 3 lines · David Wagner
3. Let me point out that you snipped a key line from Arjan van de Ven's email:
Answering Ted's questions would be a really good start...
Alas, I don't remember what Ted's question was, so I tried to see if I could start a discussion about the most general one (;-))
--dave (not an AV guy) c-b
Signature · 4 lines
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#
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
In reply to [email protected]Quoted 6 lines · On Wed, Aug 06, 2008 at 12:07:57PM +0100, [email protected] wrote:
Quoted 2 lines
- Some set of requirements suddenly appears out of the void on linux-kernel.
Because previously it was said to go away and come back with a clear list of requirements. And here you make it sound like a negative thing. See what I am talking about?
The list of requirements you came up with was a very low-level set of requirements. This is why Al Viro called it not much better than we want a bunch of hooks here, here, and here.
What is needed is the high-level set of requirements --- which in the case of security fixes, really needs to start with a threat model (or threat models). See my previous message, where I tried to help you guys out on this. There are scenarios such as "The Linux Desktop", where the Clueless User may be tricked to run random binaries. Then there is the "The Linux Fileserver", where users may upload malware via CIFS, NFS, et. al, but there aren't any Clueless Users to start the malware running on said Linux Fileserver, etc. When you do threat analysis you need to know whether the malware is likely to have
compromised root (superuser) access or not. Etc.
Low-level requirements are things like "this code must take the number, multiply by it 7, and add 42". High-level requirements answer the question, why the heck are you trying to do this in the first place?!?
- Ted
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
In reply to [email protected]Quoted 19 lines · On Wed, Aug 06, 2008 at 11:05:43AM +0100, [email protected] wrote:
Greg KH wrote on 05/08/2008 21:26:21:
Quoted 2 lines
Quoted 2 lines
[JON PRESS] I wouldn't call it lazy, actually. It's more like "economical" or "ergonomic" -- or, dare I say it -- "user-friendly."
In
Quoted 7 lines
Quoted 6 lines
this case, the users are the AV vendors who will have to write to the API that will come out of this spec. We will be more inclined to appreciate the SDK (for want of a better term) if it covers all the bases, rather than force us to go elsewhere for some of our requirements. When we write SDKs, we try to make sure that our users will find whatever they need.
Quoted 6 lines
But realize that you are adding an overhead on us, the kernel community, to make your life easier. We are the ones that are taking our time to review and comment on this code. We are the ones who will have to live with this code for forever, and maintain it over the lifetime of linux. So far, you all have shown no willingness to give anything back to us at all.
Quoted 2 lines
We all? How is that true? I for example wrote some code and am willing to help maintain it if it gets accepted.
You did? I didn't see any patches from you here, did I just happen to miss them?
If Eric's code was based on yours, that's great, but it didn't imply maintenance, especially as it doesn't look like your original patches much :)
thanks,
greg k-h
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 23 lines · Greg KH
Quoted 19 lines · On Wed, Aug 06, 2008 at 11:05:43AM +0100, [email protected] wrote:
Greg KH wrote on 05/08/2008 21:26:21:
Quoted 2 lines
Quoted 2 lines
[JON PRESS] I wouldn't call it lazy, actually. It's more like "economical" or "ergonomic" -- or, dare I say it -- "user-friendly."
In
Quoted 7 lines
Quoted 6 lines
this case, the users are the AV vendors who will have to write to the API that will come out of this spec. We will be more inclined to appreciate the SDK (for want of a better term) if it covers all the bases, rather than force us to go elsewhere for some of our requirements. When we write SDKs, we try to make sure that our users will find whatever they need.
Quoted 6 lines
But realize that you are adding an overhead on us, the kernel community, to make your life easier. We are the ones that are taking our time to review and comment on this code. We are the ones who will have to live with this code for forever, and maintain it over the lifetime of linux. So far, you all have shown no willingness to give anything back to us at all.
Quoted 2 lines
We all? How is that true? I for example wrote some code and am willing to help maintain it if it gets accepted.
Quoted 6 lines
You did? I didn't see any patches from you here, did I just happen to miss them?
If Eric's code was based on yours, that's great, but it didn't imply maintenance, especially as it doesn't look like your original patches much :)
First copyrights in all those files are Sophos. Tvrtko is where the basis for most of these code came from. Although ongoing maintenance has not been discussed, he and Sophos deffinitely get the credit for working on code.
-Eric
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
In reply to Press, JonathanQuoted 11 lines · Jonathan
Quoted 2 lines
Also, it seems to me that for my purposes, close is discrete enough.
It
Quoted 1 line
tells me that there is now something out there that should be looked
at.
So, if you hook glibc to catch all calls to close, is that sufficient?
[JON PRESS] Let's see...I'm going to use inotify for some events, glibc for others, and this API for the rest. Would you really want to write an application like that?
so you have to do 2 cases:
1) inotify to notice files changing
(no need to hook glibc for that, and no need to hook close() since you already get a notify for the change)
This is to catch the *creation* of "bad" content (say a browser saving a download or somesuch)
By nature this is asynchronous for both performance and "what could you do if" reasons.
(but so would the close() scan be, and again please explain how you deal with write-to-mmap-after-close)
2) A synchronous check on open() or exec()
This is to prevent *use* of "bad" content, either by an application opening a bad file, or by executing a "bad" program.
For neither do you need to hook the kernel; ld preload works great for this.
This does assume that at some point you have a transition from "ok" program to the first time you run a "bad" one (via exec or open); and that you catch it at that point.
I don't yet buy the argument "but what if the virus corrupted your ld preload", because if it can do that your own virus scanner is also corrupted.
Can you explain what gap is left after you do these two things?
Signature · 3 lines
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
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
Quoted 2 lines · Arjan van de Ven
and again please explain how you
deal with write-to-mmap-after-close)
http://marc.info/?l=linux-security-module&m=121796172212429&w=2
Write after close will invalidate the close time caching decision, but will still get caught on the next open....
-Eric
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linuxinterfaceforon access scanning
In reply to Arjan van de VenQuoted 10 lines · Arjan van de Ven
This does assume that at some point you have a transition from "ok" program to the first time you run a "bad" one (via exec or open); and that you catch it at that point.
I don't yet buy the argument "but what if the virus corrupted your ld preload", because if it can do that your own virus scanner is also corrupted.
Can you explain what gap is left after you do these two things?
Actually, the real question (and the reason why I question the personal integrity of the people in "AV community" pushing that kind of trash) is very simple:
Where Is Your Threat Profile?
Various people had been asking for _years_ to define what the hell are you trying to prevent. Not only there'd been no coherent answer (and no, this list of requirements is _not_ that - it's "what kind of hooks do we want"), you guys seem to be unable to decide whether you expect the malware in question to be passive or to be actively evading detection with infected processes running on the host that does scanning.
Moreover, the answer seems to be changing back and forth to suit the needs of the moment in the argument. Slightly exaggregated it goes like this:
-- Why don't you do $FOO?
-- Running virus would be able to evade $FOO, of course!
-- No shit, Sherlock; it would also be able to evade much more intrusive $BAR you are proposing; here's how <obvious evasion method>
-- Oh, but that's not a problem; think of Linux server with Windows clients and Windows viruses...
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
In reply to Arjan van de VenQuoted 9 lines · Arjan van de Ven
Quoted 4 lines · Jonathan
However, I want to point out that scanning on close is still an integral part of AV protection, even if intercepting opens and execs theoretically catches everything.
Quoted 4 lines
but close is... very limited in value. Open is a discrete event traditionally associated withh permission checks.
Close... not so. (And if you mmap memory, you can then close the file and still write to it via the mmap)
Thankfully my implementation will invalidate that close time check and caching result. It does the invalidating the same place we update mtime and my understanding is that mmap has been updating mtime for quite a while now. So again, it might not be perfect, but that situation should get caught the next time around. I see close time checking as more of a performance win and as a way to help close some of the length bad information could exist than anything since its done in a non-blocking path.
I think we all agree that open is the most interesting time for scanning operations, but as Jonathan points out there is some value (even if not perfect value) in looking at closes as well.
Quoted 4 lines
Lets ask it differently: what will you do if you find something nasty? You can't fail the close... so why block for it?
And if you don't block for it... all you would need is an asynchronous notification... something like... inotify
I actually already have an async non-blocking close notification built in. Instead of waiting for a userspace response we just queue the close notification and move along. When userspace gets around to it scanning and allow/deny caching can then take place at a later time.
-Eric
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
Quoted 11 lines · On Tue, 05 Aug 2008 14:39:34 -0400 Eric Paris <[email protected]> wrote:
Quoted 4 lines · Arjan van de Ven
but close is... very limited in value. Open is a discrete event traditionally associated withh permission checks.
Close... not so. (And if you mmap memory, you can then close the file and still write to it via the mmap)Thankfully my implementation will invalidate that close time check and caching result. It does the invalidating the same place we update mtime and my understanding is that mmap has been updating mtime for quite a while now.
Then isn't the close time check superfluous, since you do the checks at change time already?
Signature · 1 line
All rights reversed.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
Quoted 9 lines · Rik van Riel
Quoted 7 lines · On Tue, 05 Aug 2008 14:39:34 -0400 Eric Paris <[email protected]> wrote:
Quoted 4 lines · Arjan van de Ven
but close is... very limited in value. Open is a discrete event traditionally associated withh permission checks.
Close... not so. (And if you mmap memory, you can then close the file and still write to it via the mmap)
Quoted 7 lines
Quoted 4 lines
Thankfully my implementation will invalidate that close time check and caching result. It does the invalidating the same place we update mtime and my understanding is that mmap has been updating mtime for quite a while now.
Then isn't the close time check superfluous, since you do the checks at change time already?
In the patches I posted, "checks" are done at open and close if the result is not already in the cache. Every write invalidates the cache and thus the next open/close will do a "check."
So the longer a process keeps a file open the longer it is susceptible to "unclean" data existing in that file.
Sidebar to [malware-list] [RFC 0/5] [TALPA] Intro to a linux interface for on access scanning
In reply to Eric ParisQuoted 4 lines · Jonathan
Quoted 4 lines
but close is... very limited in value. Open is a discrete event traditionally associated withh permission checks.
Close... not so. (And if you mmap memory, you can then close the file and still write to it via the mmap)
Quoted 3 lines · Eric Paris
I think we all agree that open is the most interesting time for scanning operations, but as Jonathan points out there is some value (even if not perfect value) in looking at closes as well.
Open for read is the "traditional" time for scanning, but the
sequence (open for write) -> change -> (time passes or close happens) is specifically a good time to do content checking, so as to have the answer to the check available for the open for read.
I'd suggest "read" and "write" are the two cases that are interesting, and that we've been using 'open" an "close" for a not very good approximation to them (;-))
--dave
Signature · 4 lines
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#
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
In reply to Press, JonathanQuoted 3 lines · Jonathan
You can say that there are four parts to the malware life cycle -- getting on a machine, residing there, causing local damage, and propagating elsewhere.
We're getting close.
What exactly are the threat models you want to protect against?
Once we have the answer to that question, we can figure out whether the current patch set addresses the threat model or whether alternate approaches are needed.
Signature · 1 line
All rights reversed.
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interfaceforon access scanning
Quoted 5 lines · Rik van Riel
What exactly are the threat models you want to protect against?
Once we have the answer to that question, we can figure out whether the current patch set addresses the threat model or whether alternate approaches are needed.
Alas, we've been here before.
http://article.gmane.org/gmane.linux.kernel/608634
Quoted 2 lines · Al Viro
Incidentally, I would really love to see the threat profile we are talking about.
Exactly.
Please come up with a set of requirements that can be reviewed by the core kernel folk, and perhaps then focus on how to meet those requirements once they have been accepted.
To be very clear, so we don't waste any _more_ time and effort on this:
The anti-malware folk need to first provide a clearly understandable and complete description of the problem including a characterization of the threat.
The next step is to propose a design which addresses the problem, and to clearly and completely demonstrate how it does so.
Only then will it be possible to conduct an informed discussion on the underlying case for malware scanning and its possible implementation.
- James
Signature · 2 lines
James Morris <[email protected]>
Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interface foron access scanning
In reply to Press, JonathanQuoted 5 lines · Jonathan
Also... I was one of the people who brought up the idea of a process exclusion when the requirements list was being developed. I intended it as a way that an AV application could exclude specific OTHER processes by name (as selected by the AV user)
There's no fixed process name in Linux that cannot be easily faked:
Use process name -- every process can change that by writing to its own environment.
Use comm name -- there's a prctl to change that and there can be collisions Use path name of binary -- breaks with chroot and name spaces. Also existing binaries can be subverted.
Use inode of binary -- can be faked with fuse and breaks when the binaries is copied ...
Use dev, inode -- breaks when copying binary and when running on network file systems without a device node
-Andi
Eric Paris wrote on 05/08/2008 01:32:54:
Quoted 2 lines · Greg KH
Quoted 1 line
Why would userspace care about these meta-file things, what does it
want
Quoted 5 lines
Quoted 1 line
with them?
Honstely? I don't know. Maybe someone with access to the black magic source code will stand up and say if most of this metadata is important and if so how.
In general this metadata provides more context to the event that happened. For example reporting - log message/UI popup/centralised something can be displayed saying which user running which application was involved with bad stuff. Also we can find out where the user is logged in and send him a message there.
It is more descriptive than just failing the access with -EACCESS which becomes ambigious.
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
10. Filesystem exclusions
-------------------------
One pretty important optimization is not to scan things like /proc,
/sys
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
or similar. Basically all filesystems where user can not store arbitrary, potentially malicious, content could and should be
excluded
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
from scanning.
Why, does scanning these files take extra time? Just curious.
Perf win, why bothering looking for malware in /proc when it can't exist? It doesn't take longer it just takes time having to do
Quoted 6 lines
userspace -> kernel -> userspace -> kernel -> userspace
just to cat
/proc/mounts, all of this could probably be alliviated if we cached access on non block backed files but then we have to come up with a way to exclude only nfs/cifs. I'd rather list the FSs that don't need scanning every time than those that do....
Agreed.
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Closing remarks
---------------
Although some may argue some of the filters are not necessary or may better be implemented in userspace, we think it is better to have
them
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
in kernel primarily for performance reasons.
Why? What numbers do you have that say the kernel is faster in implementing this? This is the first mention of such a requirement,
we
Quoted 6 lines
Quoted 1 line
need to see real data to back it up please.
In kernel caching is clearly a huge perf win. I couldn't even measure a change in kernel build time when I didn't run a userspace client. If anyone can explain a way to get race free in kernel caching and out of
kernel redirection and scanning I'd love it :)
When you don't run an userspace client cache should not come into play because nothing will be cached (in this iteration at least). So I guess you meant something different here? Like not running an userspace client and having the filter disabled (or even not) will produce very little overhead, probably not observable without micro-benchmarking. Having an userspace client which just replies with "allow" should have even less performance impact because most inodes will get cached which means filter chain will be shorter on subsequent accesses to the same inode.
In either case it will become obvious how huge performance win is to have in kernel caching once you get the numbers. Let me know if I can help you with that somehow.
Tvrtko
Sophos Plc, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom.
Company Reg No 2096520. VAT Reg No GB 348 3873 20.
Quoted 8 lines · Greg KH
I don't see anything in the list above that make this a requirement that the code to do this be placed within the kernel.
What is wrong with doing it in glibc or some other system-wide library (
LD_PRELOADhooks, etc.)?
A linux virus would trivially get around that by doing its own syscalls instead of using glibc. (It might still link dynamically to glibc so you don't get suspicious, but won' actually use it when doing bad stuff.)
Helge Hafting
Quoted 6 lines · Helge Hafting
Quoted 5 lines · Greg KH
I don't see anything in the list above that make this a requirement that the code to do this be placed within the kernel.
Quoted 7 lines
Quoted 3 lines
What is wrong with doing it in glibc or some other system-wide library (
LD_PRELOADhooks, etc.)?A linux virus would trivially get around that by doing its own syscalls instead of using glibc. (It might still link dynamically to glibc so you don't get suspicious, but won' actually use it when doing bad stuff.)
That's fine, then the file is corrupted. It is when the "normal" program goes to load the file that we want to block and determine if we have a problem or not in the data.
virus scanners are not a security model in the aspect of SELinux or SMACK. If they were, they would just use the LSM interface. virus scanners are interested in blocking "normal" programs from reading invalid data from disk before acting on it or executing it.
thanks,
greg k-h
Quoted 9 lines · Eric Paris
Please contact me privately or (preferably the list) for questions, comments, discussions, flames, names, or anything. I'll do complete rewrites of the patches if someone tells me how they don't meet their needs or how they can be done better. I'm here to try to bridge the needs (and wants) of the anti-malware vendors with the technical realities of the kernel. So everyone feel free to throw in your two cents and I'll try to reconcile it all. These 5 patches are part 1. They give us a working able solution.
Quoted 5 lines
Quoted 1 line
From my point of view patches forthcoming and mentioned below should
help with performance for those who actually have userspace scanners but also could presents be implemented using this framework.
The LSM list (CCed) should be included in this discussion.
Quoted 2 lines
Background
...
If we had stackable LSMs then the required functionality could simply be built into the LSM interface. Then the anti-malware would simply stack itself with other LSMs. In my opinion this is a perfect example for the argument of stackable LSMs. So far we mainly have LSMs which provide an extra access control mechanism (in addition to DAC). IMHO, Ideally DAC could be another stackable LSM (enabled by default). Other security schemes such as intrusion detection, firewalls/netfilter, anti-malware, and application restrictions (sandboxes such as jails or finer grained restrictions such as AppArmor) could all register LSMs onto the stack.
Additional infrastructure would be necessary. Permissible security remains a item of contention. Perhaps I am naive but I think most LSMs could work based on accept/reject. Where every LSM must accept an action in order for it to be carried out.
MHO,
Cliffe.
Quoted 27 lines · Casey Schaufler
Quoted 9 lines · Eric Paris
Please contact me privately or (preferably the list) for questions, comments, discussions, flames, names, or anything. I'll do complete rewrites of the patches if someone tells me how they don't meet their needs or how they can be done better. I'm here to try to bridge the needs (and wants) of the anti-malware vendors with the technical realities of the kernel. So everyone feel free to throw in your two cents and I'll try to reconcile it all. These 5 patches are part 1. They give us a working able solution.
Quoted 5 lines
Quoted 1 line
From my point of view patches forthcoming and mentioned below should
help with performance for those who actually have userspace scanners but also could presents be implemented using this framework.
The LSM list (CCed) should be included in this discussion.
Quoted 2 lines
Background
...Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 1 line · Cliffe
If we had stackable LSMs then the required functionality could simply be built into the LSM interface. Then the anti-malware would simply stack itself with other LSMs. In my opinion this is a perfect example for the argument of stackable LSMs.
No argument from me.
Quoted 1 line
So far we mainly have LSMs which provide an extra access control mechanism (in addition to DAC).
Yes. This is the design center for the LSM.
Quoted 1 line
IMHO, Ideally DAC could be another stackable LSM (enabled by default).
Yup. Search the archives for "authoritative hooks".
Quoted 1 line
Other security schemes such as intrusion detection, firewalls/netfilter, anti-malware, and application restrictions (sandboxes such as jails or finer grained restrictions such as AppArmor) could all register LSMs onto the stack.
Stacking is easy for files. It's a real pain in the backside for UDP packets.
Quoted 1 line
Additional infrastructure would be necessary. Permissible security remains a item of contention. Perhaps I am naive but I think most LSMs could work based on accept/reject. Where every LSM must accept an action in order for it to be carried out.
Please propose patches.
Quoted 1 line
MHO,
Oh, humility isn't all it's cracked up to be. Show us all up and write the code. I'm serious, I don't think there's anyone here who would object to a really good stacking scheme.
Quoted 10 lines · Casey Schaufler
Quoted 1 line · Cliffe
Additional infrastructure would be necessary. Permissible security remains a item of contention. Perhaps I am naive but I think most LSMs could work based on accept/reject. Where every LSM must accept an action in order for it to be carried out.
Please propose patches.
Quoted 1 line
MHO,
Oh, humility isn't all it's cracked up to be. Show us all up and write the code. I'm serious, I don't think there's anyone here who would object to a really good stacking scheme.
Ah, I'd love to give it a shot but I have this little PhD thesis and related LSM and tools I need to work on. I just thought I'd put my 5c in.
Cliffe.
Quoted 8 lines · Casey Schaufler
Quoted 4 lines · Cliffe
Other security schemes such as intrusion detection, firewalls/netfilter, anti-malware, and application restrictions (sandboxes such as jails or finer grained restrictions such as AppArmor) could all register LSMs onto the stack.
Stacking is easy for files. It's a real pain in the backside for UDP packets.
How is it any better/worse for UDP packets than files?
Signature · 2 lines
paul moore linux @ hp
Quoted 9 lines · Paul Moore
Quoted 7 lines · Casey Schaufler
Quoted 5 lines · Cliffe
Other security schemes such as intrusion detection, firewalls/netfilter, anti-malware, and application restrictions (sandboxes such as jails or finer grained restrictions such as AppArmor) could all register LSMs onto the stack.
Quoted 6 lines
Quoted 3 lines
Stacking is easy for files. It's a real pain in the backside for UDP packets.
How is it any better/worse for UDP packets than files?
On delivery you'd need to decide what security scheme is actually available on the packet and in what order to interpret any inbound security data. If you had an MLS scheme that uses CIPSO, an integrity mechanism using IPSEC and a DAC scheme that assigns user ids by host address getting the ordering right and every domain registered properly in the networking stack would be a trick. Plus, making sure that any state the security scheme requires is tricky. Maybe it's not actually worse if the schemes agree on what qualifies as a security element, but if one scheme does access control outbound while another does inbound it will get hairy.
Quoted 11 lines · Casey Schaufler
Quoted 10 lines · Paul Moore
Quoted 8 lines · Casey Schaufler
Quoted 4 lines · Cliffe
Other security schemes such as intrusion detection, firewalls/netfilter, anti-malware, and application restrictions (sandboxes such as jails or finer grained restrictions such as AppArmor) could all register LSMs onto the stack.
Stacking is easy for files. It's a real pain in the backside for UDP packets.
Quoted 8 lines
Quoted 1 line
How is it any better/worse for UDP packets than files?
On delivery you'd need to decide what security scheme is actually available on the packet and in what order to interpret any inbound security data. If you had an MLS scheme that uses CIPSO, an integrity mechanism using IPSEC and a DAC scheme that assigns user ids by host address getting the ordering right and every domain registered properly in the networking stack would be a trick.
I still don't understand how that is any different from a file or some other resource, local or remote. Assuming a single security label (tag, mark, mode, etc.) on an entity on which you wish to apply an access control decision the problem boils down to how do you internalize the security label in such a way that it can be useful for the security mechanism(s). In the case of a single LSM you do this once, in the case of multiple, stacked LSMs you do this multiple times.
With multiple security markings on an entity then you have to decide if you want to consider every marking at each LSM instance, or a subset. The complexity in this case does go up dramatically, but I think the key point for our discussion is that it doesn't matter if the entity is a file or a packet.
Quoted 5 lines
Plus, making sure
that any state the security scheme requires is tricky. Maybe it's not actually worse if the schemes agree on what qualifies as a security element, but if one scheme does access control outbound while another does inbound it will get hairy.
Once again, these points apply equally to files as they do to packets.
Signature · 2 lines
paul moore linux @ hp
Quoted 3 lines · Paul Moore
With multiple security markings on an entity then you have to decide if you want to consider every marking at each LSM instance, or a subset. The complexity in this case does go up dramatically, but I think the key point for our discussion is that it doesn't matter if the entity is a file or a packet.
Perhaps you're right. I'm thinking in terms of the notion that each LSM can have an independent file system attribute, but if they all want to use IP options we're talking about a very limited resource. No real biggie, I mostly wanted to point out that there's more to stacking than fetching multiple xattrs.
Quoted 3 lines · Cliffe
If we had stackable LSMs then the required functionality could simply be built into the LSM interface. Then the anti-malware would simply stack itself with other LSMs.
Could it really? How would such an interface work?
Remember, the big issue here isn't the kernel "hooks", but the fact that a lot of people are yet to be convinced that something like this needs to be within the kernel itself.
Perhaps we should dig up the proposals for the filesystem-notify type patches, something like that might be all the majority of the virus people need, as they want to just scan things for Windows viruses, not Linux ones, and to do so "lazily" might be sufficient.
thanks,
greg k-h
Quoted 7 lines · Greg KH
Quoted 2 lines · Cliffe
If we had stackable LSMs then the required functionality could simply be built into the LSM interface. Then the anti-malware would simply stack itself with other LSMs.
Could it really? How would such an interface work?
Quoted 9 lines
Remember, the big issue here isn't the kernel "hooks", but the fact that a lot of people are yet to be convinced that something like this needs to be within the kernel itself.
Perhaps we should dig up the proposals for the filesystem-notify type patches, something like that might be all the majority of the virus people need, as they want to just scan things for Windows viruses, not Linux ones, and to do so "lazily" might be sufficient.
From memory Dazuko is a LSM designed for this purpose, although it cannot be used on systems running other LSMs due to the lack of stacking support. It is used by a bunch of anti-malware programs including ClamAV and AVG.
Quoted 22 lines · Cliffe
Quoted 11 lines · Greg KH
Quoted 5 lines · Cliffe
If we had stackable LSMs then the required functionality could simply be built into the LSM interface. Then the anti-malware would simply stack itself with other LSMs.
Could it really? How would such an interface work?
Quoted 9 lines
Remember, the big issue here isn't the kernel "hooks", but the fact that a lot of people are yet to be convinced that something like this needs to be within the kernel itself.
Perhaps we should dig up the proposals for the filesystem-notify type patches, something like that might be all the majority of the virus people need, as they want to just scan things for Windows viruses, not Linux ones, and to do so "lazily" might be sufficient.
Quoted 3 lines
From memory Dazuko is a LSM designed for this purpose, although it cannot be used on systems running other LSMs due to the lack of stacking support. It is used by a bunch of anti-malware programs including ClamAV and AVG.
Sorry to say stacking support really does need to be taken with a grain of salt.
Deeper the stack worse the issue of creating system lag.
Anti-malware stacking into LSM adding there own hooks need to be looked at as more of a problem than a solution.
Lets take a simple example of Dazuko. It catches all filesystem
accesses and can alter them. Side effect all protected documents by
the LSM could end up going threw Dazuko so if a flaw is in the anti virus that can be exploited straight up complete system exposed.
So really LSM stacking is not the correct solution. More correct
solution would be list out what features malware and virus scanners need and extend LSM interfaces so the main LSM could control where the antivirus/malware scanner was accessing. Yes there are times you don't want virus scanners or malware scanners seeing everything.
Containers is another issue around stacking. Containers being added
to Linux are providing more and more controls. Currently LSM's are
independent to this. People have responded that it is light weight
virtualisation so dones not need the need to run a different LSM
secuirty construct inside a container. Its that it is
virtualistation is why it kinda need to.
Now any stacking design of LSM's have to take into account the needs of containers.
Of course prefered is no stacking for containers and some form of cross LSM mapping. Like prime kernel LSM being selinux, OS contained being smack so smack secuirty files coveted to selinux with host OS's limitations applied so container maintains its secuirty.
Same could be applied to chroot's. This is a common over site of the
current LSM model. chroot or containers running different
distrobution inside there is no preformated way of picking up the
secuirty. Note could even be the same distrubtion different version
just at one point of time they changed secuirty systems. So user is running a chroot or a container to run a old application that is
needed. But now its running without secuirty. This is could become
a major issue in time.
So yes needs of stacking have some major headaches. Its not just a malware issue.
Peter Dolding
Quoted 3 lines
Remember, the big issue here isn't the kernel "hooks", but the fact that a lot of people are yet to be convinced that something like this needs to be within the kernel itself.
Mostly the same people who said that about LSM I note 8)
Quoted 4 lines
Perhaps we should dig up the proposals for the filesystem-notify type patches, something like that might be all the majority of the virus people need, as they want to just scan things for Windows viruses, not Linux ones, and to do so "lazily" might be sufficient.
The key difference between a lazy scan and an active intervention is tiny
- the ability to block in the security decision to open a file.
Once you have that bit you have the ability to hand the file handle up to a daemon to chew on and return a status. The same co-incidentally gives you the hooks for doing various kinds of HSM as you can block an open while you retrieve the archived content from wherever it was warehoused.
Alan
Quoted 39 lines · Eric Paris
Please contact me privately or (preferably the list) for questions, comments, discussions, flames, names, or anything. I'll do complete rewrites of the patches if someone tells me how they don't meet their needs or how they can be done better. I'm here to try to bridge the needs (and wants) of the anti-malware vendors with the technical realities of the kernel. So everyone feel free to throw in your two cents and I'll try to reconcile it all. These 5 patches are part 1. They give us a working able solution.
Quoted 1 line
From my point of view patches forthcoming and mentioned below should
help with performance for those who actually have userspace scanners but also could presents be implemented using this framework.
Background
++++++++++
There is a consensus in the security industry that protecting against malicious files (viruses, root kits, spyware, ad-ware, ...) by the way of so-called on-access scanning is usable and reasonable approach. Currently the Linux kernel does not offer a completely suitable interface to implement such security solutions. Present solutions involve overwriting function pointers in the LSM, in filesystem operations, in the sycall table, and other fragile hacks. The purpose of this project is to create a fast, clean interface for userspace programs to look for malware when files are accessed. This malware may be ultimately intended for this or some other Linux machine or may be malware intended to attack a host running a different operating system and is merely in transit across the Linux server. Since there are almost an infinite number of ways in which information can enter and exit a server it is not seen as reasonable to move these checks to all the applications at the boundary (MTA, NFS, CIFS, SSH, rsync, et al.) to look for such malware on at the border.For this Linux kernel interface speed is of particular interest for those who have it compiled into the kernel but have no userspace client. There must be no measurable performance hit to just compiling this into the kernel.
Quoted 8 lines
Security vendors, Linux distributors and other interested parties have come together on the malware-list mailing list to discuss this problem and see if they can work together to propose a solution. During these talks couple of requirement sets were posted with the aim of fleshing out common needs as a prerequisite of creating an interface prototype.
Collated requirements
+++++++++++++++++++++
I suspect that what people actually want is a requirement of what it is they are trying to do. Not a list of demands on the kernel that they think are needed to implement what they think is the right way to solve some problem that they define.
Quoted 1 line
5. Define which filesystems are cacheable and which are not
This is practically impossible to do completely without rewriting a lot of code (which will never be accepted). I don't see why it is needed though as the filesystem cache is supposed to be kept coherent with disk.
Nick Piggin wrote on 05/08/2008 19:08:05:
Quoted 5 lines · Eric Paris
Quoted 1 line
5. Define which filesystems are cacheable and which are not
This is practically impossible to do completely without rewriting a lot of code (which will never be accepted). I don't see why it is needed
though
Quoted 1 line
as the filesystem cache is supposed to be kept coherent with disk.
Problem is with network filesystems. So could it be a flag somewhere per filesystem which would say something like "this filesystem guarantees content of a file cannot change without get_write_access or file_update_time being called locally"? That doesn't sound like a lot of code so what am I missing?
Tvrtko
Sophos Plc, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom.
Company Reg No 2096520. VAT Reg No GB 348 3873 20.
Quoted 9 lines · On Wednesday 06 August 2008 19:44, [email protected] wrote:
Nick Piggin wrote on 05/08/2008 19:08:05:
Quoted 5 lines · Eric Paris
Quoted 1 line
5. Define which filesystems are cacheable and which are not
This is practically impossible to do completely without rewriting a lot of code (which will never be accepted). I don't see why it is needed
though
Quoted 7 lines
Quoted 1 line
as the filesystem cache is supposed to be kept coherent with disk.
Problem is with network filesystems. So could it be a flag somewhere per filesystem which would say something like "this filesystem guarantees content of a file cannot change without
get_write_accessorfile_update_timebeing called locally"? That doesn't sound like a lot of code so what am I missing?
Maybe... but that's not the same as what requirement 5 calls for.
But depending on exactly what semantics you really call for, it can get tricky to account for all of pagecache. Writes can happen through page tables or get_user_pages. True that a process has to at some point have write permission to the file, but the cache itself could be modified even after the file is closed and all mmaps disappear.
Nick Piggin <[email protected]> wrote on 06/08/2008 12:10:58:
Quoted 6 lines · On Wednesday 06 August 2008 19:44, [email protected] wrote:
Quoted 5 lines
Nick Piggin wrote on 05/08/2008 19:08:05:
Quoted 4 lines · Eric Paris
Quoted 1 line
5. Define which filesystems are cacheable and which are not
This is practically impossible to do completely without rewriting a
lot
Quoted 7 lines
Quoted 7 lines
Quoted 1 line
of code (which will never be accepted). I don't see why it is needed
though
Quoted 1 line
as the filesystem cache is supposed to be kept coherent with disk.
Problem is with network filesystems. So could it be a flag somewhere
per
Quoted 3 lines
Quoted 3 lines
filesystem which would say something like "this filesystem guarantees content of a file cannot change without
get_write_accessorfile_update_timebeing called locally"? That doesn't sound like a lot
of
Quoted 3 lines
Quoted 1 line
code so what am I missing?
Maybe... but that's not the same as what requirement 5 calls for.
I see what you mean, it should have been worded better. Nevertheless that is what was intended by it - to enable caching only on filesystems where it is safe to do so.
Quoted 5 lines
But depending on exactly what semantics you really call for, it can get tricky to account for all of pagecache. Writes can happen through page tables or
get_user_pages. True that a process has to at some point have write permission to the file, but the cache itself could be modified even after the file is closed and all mmaps disappear.
I don't have a very good understanding of the VM subsystem I must admit. So in other words with the current kernel file modification time is not necessarily correct - it represents when the file was last opened for modification, not when it was actually modified? (While those two points in time can be arbitrarily separated)
How would I use those methods for file modification? I am curious to make a test case..
Tvrtko
Sophos Plc, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom.
Company Reg No 2096520. VAT Reg No GB 348 3873 20.
Quoted 9 lines · On Wednesday 06 August 2008 21:29, [email protected] wrote:
Nick Piggin <[email protected]> wrote on 06/08/2008 12:10:58:
Quoted 3 lines
Quoted 1 line
code so what am I missing?
Maybe... but that's not the same as what requirement 5 calls for.
I see what you mean, it should have been worded better. Nevertheless that is what was intended by it - to enable caching only on filesystems where it is safe to do so.
That is exactly what you cannot do. Otherwise you have to rewrite filesystems not to use the pagecache, and probably have to do disallow or do some horrible hacks to support mmap.
The requirement you actually intend is more like what you said before, along the lines of "file can't be changed in given set of circumstances".
Quoted 11 lines
Quoted 5 lines
But depending on exactly what semantics you really call for, it can get tricky to account for all of pagecache. Writes can happen through page tables or
get_user_pages. True that a process has to at some point have write permission to the file, but the cache itself could be modified even after the file is closed and all mmaps disappear.I don't have a very good understanding of the VM subsystem I must admit. So in other words with the current kernel file modification time is not necessarily correct - it represents when the file was last opened for modification, not when it was actually modified? (While those two points in time can be arbitrarily separated)
It is a best effort thing. When you start mmapping, that allows get_user_pages, which in turn may be able to take pages and modify them at fairly arbitrary points in time.
Quoted 2 lines
How would I use those methods for file modification? I am curious to make a test case..
Even just with mmap (we do a much better job of it now, but) you can probably write to a file after mtime if you write to already dirty pages.
Quoted 14 lines · Eric Paris
Please contact me privately or (preferably the list) for questions, comments, discussions, flames, names, or anything. I'll do complete rewrites of the patches if someone tells me how they don't meet their needs or how they can be done better. I'm here to try to bridge the needs (and wants) of the anti-malware vendors with the technical realities of the kernel. So everyone feel free to throw in your two cents and I'll try to reconcile it all. These 5 patches are part 1. They give us a working able solution.
Quoted 1 line
From my point of view patches forthcoming and mentioned below should
help with performance for those who actually have userspace scanners but also could presents be implemented using this framework.
Quoted 5 lines
Background
++++++++++
There is a consensus in the security industry that protecting against malicious files (viruses, root kits, spyware, ad-ware, ...) by the way of so-called on-access scanning is usable and reasonable approach.
Can you point to any helpful explanations of that concensus?
Off-hand it's surprising. (A defense that depends on cataloging every possible individual attack sounds difficult!)
--b.
J. Bruce Fields wrote on 05/08/2008 23:55:24:
Quoted 10 lines · Eric Paris
Quoted 9 lines
Please contact me privately or (preferably the list) for questions, comments, discussions, flames, names, or anything. I'll do complete rewrites of the patches if someone tells me how they don't meet their needs or how they can be done better. I'm here to try to bridge the needs (and wants) of the anti-malware vendors with the technical realities of the kernel. So everyone feel free to throw in your two cents and I'll try to reconcile it all. These 5 patches are part 1. They give us a working able solution.
Quoted 2 lines
Quoted 2 lines
Quoted 1 line
From my point of view patches forthcoming and mentioned below should
help with performance for those who actually have userspace scanners
but
Quoted 10 lines
Quoted 8 lines
also could presents be implemented using this framework.
Background
++++++++++
There is a consensus in the security industry that protecting against malicious files (viruses, root kits, spyware, ad-ware, ...) by the way of so-called on-access scanning is usable and reasonable approach.Can you point to any helpful explanations of that concensus?
I can't, but everyone is doing it so that is at least an implied consensus.
Quoted 2 lines
Off-hand it's surprising. (A defense that depends on cataloging every possible individual attack sounds difficult!)
Maybe it is not how you imagine it? It is not a database of every possible individual attack but there are more intelligent methods. But I am not an expert in this field to explain it better..
Tvrtko
Sophos Plc, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom.
Company Reg No 2096520. VAT Reg No GB 348 3873 20.
Quoted 10 lines · Tvrtko
J. Bruce Fields wrote on 05/08/2008 23:55:24:
Quoted 6 lines · Eric Paris
Quoted 3 lines
There is a consensus in the security industry that protecting against malicious files (viruses, root kits, spyware, ad-ware, ...) by the way of so-called on-access scanning is usable and reasonable approach.
Can you point to any helpful explanations of that concensus?
I can't, but everyone is doing it so that is at least an implied consensus.
I don't think there is any such consensus, so I'm not expecting a technical explanation. As best as I can tell, the primary explanation for why so many A/V vendors are doing it seems to be that it's a damn effective business model, and that may have as much of an effect on its widespread use as any technical merits or demerits.
Think about it: you get users to buy your A/V, then you tell them they need to pay a monthly subscription fee to get the latest virus signatures updates. It's like crack. Once you convince IT managers that "every machine needs to run A/V software", it's basically a guaranteed revenue stream for the A/V industry. It's lucrative stuff, so it's no surprise that the A/V industry is nursing this for as long as it can go. And on many Microsoft platforms, the level of pain has been high enough that IT managers are willing to accept anything that reduces the level of pain even partially, so it's no surprise that A/V is so widely used today. It doesn't necessarily mean that it's the right way to go for the future, or that it's the right model for Linux, though.
Quoted 2 lines
Quoted 2 lines
Off-hand it's surprising. (A defense that depends on cataloging every possible individual attack sounds difficult!)
Of course. Simple signature-based file-scanning has got deep technical limitations. It can detect copycats and script kiddies but you'd be foolish to rely upon it to detect any kind of sophisticated attack.
Let's put some numbers on it, for real commercial A/V software. I was at the Usenix Security conference last week, where one group of researchers presented a paper that included a chart showing how quickly McAfee A/V was able to detect new malware samples. The researchers collected a large set of malware samples, and ran McAfee on it once a day or so to see how long it took for McAfee's signature database to be updated so it could detect those malware samples. As I recall, the basic stats looked like this: about 30% of zero-day malware samples were detected on the first day they were released (and 70% weren't). The median number of days until a new malware sample was detected was about 40 days. If you wanted hundreds of days, asymptotically McAfee was able to detect about 70% of the samples (and 30% were never detected). I expect the situation to get worse in the future, not better.
And keep in mind it's easy for an attacker to write a polymorphic or "metamorphic" virus that is basically undetectable with straightforward signature-based file scanning, so in an arms race the attackers have most of the advantages.
Quoted 7 lines · David Wagner
As I recall, the basic stats looked like this: about 30% of zero-day malware samples
were detected on the first day they were released (and 70% weren't). The median number of days until a new malware sample was detected was about 40 days. If you wanted hundreds of days, asymptotically McAfee was able to detect about 70% of the samples (and 30% were never detected). I expect the situation to get worse in the future, not better.
This is similar to the stats published by AusCert a couple of years back where they claimed that AV software failed to detect 80% of new malware:
Interestingly, AusCert still describe up-to-date anti-virus software as being "essential", per http://www.auscert.org.au/render.html?it=6891
In any case, the above relates to Windows desktops -- we are yet to see a rationale for adding AV support to the Linux kernel.
- James
Signature · 2 lines
James Morris <[email protected]>
Quoted 2 lines
In any case, the above relates to Windows desktops -- we are yet to see a rationale for adding AV support to the Linux kernel.
s/we/you/
Clearly some people do see a rationale. At least some parts of it also seem to make sense for picking up stuff in transit and for catching stuff 'in flight' between systems that might be more vulnerable.
It does appear possible to create a meaningful set of functionality for a subset of the problem space - assuming no local compromise.
- open for write causes some kind of state transition (even
SELinux label change)
- last close notifies a userspace tool of some form (be it an
indexer or a scanner or whatever)
- tool may or may not take some kind of action such as
relabelling.
At that point you can use selinux rules to say things like 'samba cannot access content in 'change-in-progress' state.
Whether you allow opens to block for a scan really comes down to a risk tradeoff. The "safe" approach is 'sorry someone has it open for writing go away'. The lax approach is "yeah whatever, we may be unlucky if something passes across our file server at the right moment" (allowing anyone to read change-in-progress files) and somewhere in between is the "wait a moment while I scan it" case, which reduces the time window of attack considerably with a very high chance of detection if the attacker gets it wrong).
Alan
David Wagner wrote on 06/08/2008 23:24:01:
First of all you dropped all CC so I only found this by chance.
Quoted 4 lines
Quoted 3 lines · Tvrtko
J. Bruce Fields wrote on 05/08/2008 23:55:24:
Quoted 2 lines · Eric Paris
Quoted 1 line
There is a consensus in the security industry that protecting
against
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
malicious files (viruses, root kits, spyware, ad-ware, ...) by the
way
Quoted 13 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
of so-called on-access scanning is usable and reasonable approach.
Can you point to any helpful explanations of that concensus?
I can't, but everyone is doing it so that is at least an implied consensus.
I don't think there is any such consensus, so I'm not expecting a technical explanation. As best as I can tell, the primary explanation for why so many A/V vendors are doing it seems to be that it's a damn effective business model, and that may have as much of an effect on its widespread use as any technical merits or demerits.
Quoted 3 lines
Think about it: you get users to buy your A/V, then you tell them they need to pay a monthly subscription fee to get the latest virus signatures updates. It's like crack. Once you convince IT managers
that
Quoted 5 lines
"every machine needs to run A/V software", it's basically a guaranteed revenue stream for the A/V industry. It's lucrative stuff, so it's no surprise that the A/V industry is nursing this for as long as it can go. And on many Microsoft platforms, the level of pain has been high enough that IT managers are willing to accept anything that reduces the level
of
Quoted 1 line
pain even partially, so it's no surprise that A/V is so widely used
today.
Quoted 1 line
It doesn't necessarily mean that it's the right way to go for the
future,
Quoted 1 line
or that it's the right model for Linux, though.
You are entitled to your opinion and I am not in a position to get involved into these kinds of discussions.
Quoted 1 line
Quoted 1 line
Quoted 1 line
Off-hand it's surprising. (A defense that depends on cataloging
every
Quoted 5 lines
Quoted 1 line
Quoted 1 line
possible individual attack sounds difficult!)
Of course. Simple signature-based file-scanning has got deep technical limitations. It can detect copycats and script kiddies but you'd be foolish to rely upon it to detect any kind of sophisticated attack.
So why you deleted my quote where I say signature based detection is not all we do?
Quoted 11 lines
Let's put some numbers on it, for real commercial A/V software. I was at the Usenix Security conference last week, where one group of researchers presented a paper that included a chart showing how quickly McAfee A/V was able to detect new malware samples. The researchers collected a large set of malware samples, and ran McAfee on it once a day or so to see how long it took for McAfee's signature database to be updated so it could detect those malware samples. As I recall, the basic stats looked like this: about 30% of zero-day malware samples were detected on the first day they were released (and 70% weren't). The median number of days until a new malware sample was detected was about 40 days. If you wanted hundreds of days, asymptotically McAfee
was
Quoted 2 lines
able to detect about 70% of the samples (and 30% were never detected). I expect the situation to get worse in the future, not better.
Do you have a link to that paper? It is all about the testing methodology and it would be interesting to read how the actually test in more detail.
To bad they haven't used more than one product. They chose McAfee who, with all respect - and I am not representig my company but saying this privately, are not known for their swiftest response times. See here:
http://blogs.pcmag.com/securitywatch/Results-2008q1.htm , they also seem to be good but not great in proactive detection.
Quoted 4 lines
And keep in mind it's easy for an attacker to write a polymorphic or "metamorphic" virus that is basically undetectable with straightforward signature-based file scanning, so in an arms race the attackers have most of the advantages.
Again this goes back to my quote you deleted. Why is straightforward signature-based detection relevant? Who is doing only that today? For example please read this:
http://www.infosectoday.com/Articles/Behavioral_Genotype.htm from where I quote:
"""
A good example of this is the Storm worm outbreaks that started in October 2006 and continued into February 2007. See figure below. There were many variants, including Dorf and Dref worms, but one single behavioral genotype identity detected nearly 5000 different unique variants. Using traditional signature-based techniques, it would have required reactive detection, which would have taken a lot of man power and been much less effective at stopping the first waves of the threat.
"""
Tvrtko
Sophos Plc, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom.
Company Reg No 2096520. VAT Reg No GB 348 3873 20.
Quoted 7 lines · Eric Paris
5. Fine-grained caching
-----------------------
It is necessary to select which filesystems can be safely cached and which must not be. For example it is not a good idea to allow caching of network filesystems because their content can be changed invisibly. Disk based and some virtual filesystems can be cached safely on the other hand.
Actually local disk file systems can be changed invisibly to the VFS too by directly writing to the block device. This does not change the page cache, but the on disk copy and when a page is pruned from RAM and reloaded VFS will see the new contents without knowing about any change. How would you stop that in your
proposal? I assume you could always require a special LKM that forbids block writes for anything mounted, but that has other problems too and one wuld need to be extremly careful of holes in
such a protection scheme (e.g. overlapping partitions)
[haven't read the rest of the proposal]
-Andi
Quoted 10 lines · Andi Kleen
Quoted 7 lines · Eric Paris
5. Fine-grained caching
-----------------------
It is necessary to select which filesystems can be safely cached and which must not be. For example it is not a good idea to allow caching of network filesystems because their content can be changed invisibly. Disk based and some virtual filesystems can be cached safely on the other hand.
Quoted 9 lines
Actually local disk file systems can be changed invisibly to the VFS too by directly writing to the block device. This does not change the page cache, but the on disk copy and when a page is pruned from RAM and reloaded VFS will see the new contents without knowing about any change. How would you stop that in your
proposal? I assume you could always require a special LKM that forbids block writes for anything mounted, but that has other problems too and one wuld need to be extremly careful of holes in
such a protection scheme (e.g. overlapping partitions)
I didn't consider it. Most likely at the end of the day the finding will be, "if you can write directly to the block device you already won since there as so many other things you can do to subvert the system."
Admittedly its the first technical point brought up on list that I didn't consider at all (lots of other things brought up on list that need more thought that weren't exactly technical details, don't let me seem like I'm downplaying those)
-Eric
Quoted 3 lines
I didn't consider it. Most likely at the end of the day the finding will be, "if you can write directly to the block device you already won since there as so many other things you can do to subvert the system."
This means your scheme is not generally supposed to protect against root?
I assume yes (since I can think of lots of other holes for root), but you should state that explicitely in the spec since it is a major limitation.
On the other hand it will also allow you to optimize significantly:
In particularly it also means that you can trust the permissions and don't need to check any files which cannot be written by users you don't control.
-Andi
Quoted 3 lines · Eric Paris
There is a consensus in the security industry that protecting against malicious files (viruses, root kits, spyware, ad-ware, ...) by the way of so-called on-access scanning is usable and reasonable approach.
This is at odds with my experience. Are you sure you've been talking to the right people? Is it possible you've only been talking to A/V vendors? I find it entirely plausible that there is such a consensus among A/V vendors, but I'm pretty skeptical that the rest of the security community would make this kind of claim. What I hear, instead, is quite a bit of skepticism about the future of A/V.
Here's an experiment for you. Walk up to a random security expert and ask them what they think of blacklisting as a foundation for building secure systems. Ask them what they think of the future of A/V in security and whether they think A/V will be of increasing or decreasing relevance to security in the future. The answers might be educational. Actually, I suspect it's even possible you might find that many knowledgeable A/V insiders privately share some of these same concerns about the future of A/V -- look at how pretty much every major A/V vendor out there is looking to diversify, to expand into other areas of computer security and compliance, and to move beyond signature-based file scanners.
If you picked a bunch of computer security experts who don't work for an A/V vendor and asked them what they thought about all this, I suspect they'd be more likely to line up behind the kinds of comments that Ted Tso has been posting. Personally, I think Ted's comments have been highly constructive, thoughtful, and well worth re-reading.
Quoted 7 lines · Eric Paris
Background
++++++++++
There is a consensus in the security industry that protecting against malicious files (viruses, root kits, spyware, ad-ware, ...) by the way of so-called on-access scanning is usable and reasonable approach. Currently the Linux kernel does not offer a completely suitable interface to implement such security solutions. Present solutions
A long time ago the FUSE developers said something about implementing write-through stacking for FUSE (i.e. 'sudo fusermount -o allow_other encfs / /' would allow mounting on /, and encfs could read/write under its own mount point).
Wouldn't that make more sense? You could i.e. edit /etc/avfs.conf to say "scanner=clamscan" "clamscan=/usr/bin/clamscan" and mount avfs on /...?