Security Descriptor in FwpmFilterAdd0 RRS feed

  • Question

  • Hi,

    I'm searching for an example or explanation where a own Security Descriptor (SD) is directly passed as Argument while calling FwpmFilterAdd0 function to add own security rules to the new filter. In the examples in the MSDN I only see that there is passed NULL while creating and in the "Hindering Filter deletion" example the SD is created later. Passing NULL while creating the filter tells the WFP to you the SD from the Sublay, right? (inheritance)

    The second questing is nearly the same. How do I create easiest a own SD? Should I use the FwpmSubLayerGetSecurityInfoByKey0 to fetch the SD from the Sublayer where I plan to add my filter and then modify it or must I use a other way? (BuildSecurtyDescriptor function and build it completly new on my own?)

    If someone can provide me information on SDs I will be very grateful.

    Tuesday, May 19, 2009 4:06 PM


  • Hi,

    The Security Descriptor is actually inherited from the FWPM_FILTER0 container (This is true for the other objects as well i.e. The Security Descriptor for FwpmSubLayerAdd0() is by default inherited from teh FWPM_SUBLAYER0 container).  The ACL on the Filters by default is:


    THis represents a Security Descriptor where the Owner (O:) is the Local System(LS), the Group(G:) is the Local System (LS), the DACL (D:) is auto inherited (AI) and the rest are the
    ACE strings i.e. (ACCESS_ALLOWED (A;) InHerited (ID;)  Access Rights (0xF07FF;) for Built-in Administrators SID (BA))

    The default can be changed by using FwpmFilterSetSecurityDescriptor0() and passing 0 in for the 2nd paramter (again the other objects follow the same suit).

    Probably the easiest way to create your Security Descriptors is to use the SDDL language and associated APIs to create the Security Descriptor.

    More informatrion on SDDL can be found at http://msdn.microsoft.com/en-us/library/aa379567.aspx.

    I hope this help.
    Dusty Harper [MSFT]
    Wednesday, May 27, 2009 5:39 AM