Add RPC, Filter Validation helpers to NtCoreLib.Net.Firewall and PoSH module#85
Open
jcspencer wants to merge 8 commits intogoogleprojectzero:mainfrom
Open
Add RPC, Filter Validation helpers to NtCoreLib.Net.Firewall and PoSH module#85jcspencer wants to merge 8 commits intogoogleprojectzero:mainfrom
NtCoreLib.Net.Firewall and PoSH module#85jcspencer wants to merge 8 commits intogoogleprojectzero:mainfrom
Conversation
…DITION_RPC_OPNUM` condition. * Adds helpers to `FirewallConditionBuilder` for RPC types, and adds support for address family-suffixed IP conditions keys for RPC layers.
…c `Guid` values in respective classes, keeping values consistent.
…cts. This allows setting - for example the `FWPM_CONTEXT_RPC_AUDIT_ENABLED` value for the built-in RPC audit sublayer.
…rs, which report field presence and basic type metadata. Given a loaded FirewallLayer, we can validate: * If the condition field is available for the layer, * If the match type is supported for the data type, and * If the data type of the condition value can be compared with the value in the field (taking into account some documented edge-cases). This is not as robust as building type-safe constructors, but it improves usability somewhat when dealing with arbitrary fields.
…ll conditions dynamically.
…ndition validation support Also adds support for specifying `RawContext`, enabling the addition of RPC filter audit rules.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi there!
Recently, I noticed that Windows 11 / Server 2025 added the
FWPM_CONDITION_RPC_OPNUMcondition to theRPC_UMlayer.Also recently added is the
auditparameterssetting for RPC filters innetsh, which is feature flagged behind theRpcBufferAuditingflag - pretty neat! That feature flag also fixes the age-old issue of named pipe RPC events not having IP information (insideRPCRT4.dll).In order to make this a bit more accessible, I've written up a series of changes on top of the
NtCoreLib.Net.Firewallpackage. Specifically:FWPM_CONDITION_RPC_OPNUMcondition, along with helpers for other common RPC fields._V4/_V6-suffixed keys that the RPC layers use.NamedGuidDictionaryto reflect constants out of theFirewall<Type>Guidsclasses.FWPM_CONTEXT_RPC_AUDIT_ENABLEDin the RPC audit sublayer (as well as the currently-undocumented buffer auditing flags)SpecializeValuemis-cast an RPC field typeFirewallLayerto extract field metadata at runtimeHopefully splitting out the commits helps with merging - if there's any changes you're not too keen on, feel free to cherry-pick!
Thanks for the great library! :)
Code samples of the new features: