Giter VIP home page Giter VIP logo

Comments (10)

 avatar commented on July 23, 2024

On 11/17/2016 08:55 PM, stephensmalley wrote:

audit2allow is pretty dumb, and for better or worse many users and developers rely on it to produce policy. Enhance it to support automatic generation/suggestion of new domains/types rather than only producing allow rules within the current domain/type space, to provide better assistance with MLS or other constraint denials, to support other macros/interfaces besides refpolicy (e.g. Android), and to help guide the user in making sound choices (e.g. don't allow dac_override if you only need dac_read_search).

AFAIK there is no instance where you don't need dac_override. As a
matter of fact, i believe that we could get rid of dac_read_search
altogether. Since dac_override is checked before dac_read_search and
since dac_override is a superset of dac_read_search.

Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

from selinux.

stephensmalley avatar stephensmalley commented on July 23, 2024

No, you don't want to allow dac_override unless the program truly requires write permission. That's the problem. See SELinuxProject/selinux-kernel#6. Many programs only truly need dac_read_search. The problem is that people keep adding allow dac_override in policy because that is what they see in audit logs.

from selinux.

 avatar commented on July 23, 2024

On 11/17/2016 09:01 PM, stephensmalley wrote:

No, you don't want to allow dac_override unless the program truly requires write permission. That's the problem. See SELinuxProject/selinux-kernel#6. Many programs only truly need dac_read_search. The problem is that people keep adding allow dac_override in policy because that is what they see in audit logs.

If you block/deny the dac_override event, then it , AFAIK, never reaches
the dac_read_search, since dac_override is a superset of dac_read_search.

In other words you in practice you end up having to use dac_override anyway

Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

from selinux.

stephensmalley avatar stephensmalley commented on July 23, 2024

No, that isn't true. The kernel source code tells a different story, see linux/fs/namei.c generic_permission(). It checks CAP_DAC_OVERRIDE first. If that passes, it returns 0 (success). If it fails and the mask did not request MAY_WRITE (i.e. only read/search/execute access), then it checks CAP_DAC_READ_SEARCH. If that passes, then it returns 0 (success).

from selinux.

 avatar commented on July 23, 2024

On 11/17/2016 09:06 PM, stephensmalley wrote:

No, that isn't true. The kernel source code tells a different story, see linux/fs/namei.c generic_permission(). It checks CAP_DAC_OVERRIDE first. If that passes, it returns 0 (success). If it fails and the mask did not request MAY_WRITE (i.e. only read/search/execute access), then it checks CAP_DAC_READ_SEARCH. If that passes, then it returns 0 (success).

Okay if the code say's so. I would be more confident if you could tell
me that you actually were able to confirm the codes story because I
never was able to get it to work that way.

In my experience, dac_override is checked first and if you deny that
access then it never reached dac_read_search and this is way i always
end up using dac_override anyway.

Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

from selinux.

stephensmalley avatar stephensmalley commented on July 23, 2024

I've seen it in practice as well, where I allowed dac_read_search only and not dac_override, and the program worked.

from selinux.

 avatar commented on July 23, 2024

On 11/17/2016 09:12 PM, stephensmalley wrote:

I've seen it in practice as well, where I allowed dac_read_search only and not dac_override, and the program worked.

Okay , thank you

Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

from selinux.

 avatar commented on July 23, 2024

On 11/17/2016 09:13 PM, Dominick Grift wrote:

On 11/17/2016 09:12 PM, stephensmalley wrote:

I've seen it in practice as well, where I allowed dac_read_search only and not dac_override, and the program worked.

Okay , thank you

Yes you were right. I was able to confirm that it works.

In practice it might not always be able to determine whether it works
though.

Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

from selinux.

 avatar commented on July 23, 2024

On 11/17/2016 09:24 PM, Dominick Grift wrote:

On 11/17/2016 09:13 PM, Dominick Grift wrote:

On 11/17/2016 09:12 PM, stephensmalley wrote:

I've seen it in practice as well, where I allowed dac_read_search only and not dac_override, and the program worked.

Okay , thank you

Yes you were right. I was able to confirm that it works.

In practice it might not always be able to determine whether it works
though.

s/able/easy/

Key fingerprint = 5F4D 3CDB D3F8 3652 FBD8 02D5 3B6C 5F1D 2C7B 6B02
https://sks-keyservers.net/pks/lookup?op=get&search=0x3B6C5F1D2C7B6B02
Dominick Grift

from selinux.

stephensmalley avatar stephensmalley commented on July 23, 2024

Yes, that's why i opened the issue on the selinux-kernel project to fix it so that we do not audit dac_override unless we truly need it. But in the meantime, it is something to keep in mind when generating policy.

from selinux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.