Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xFirewall RemoteAddress fails test if CIDR notation is used. #169

Closed
dm3942 opened this issue Dec 13, 2016 · 5 comments
Closed

xFirewall RemoteAddress fails test if CIDR notation is used. #169

dm3942 opened this issue Dec 13, 2016 · 5 comments
Assignees
Labels
bug The issue is a bug. in progress The issue is being actively worked on by someone.

Comments

@dm3942
Copy link

dm3942 commented Dec 13, 2016

xNetworking version 3.0.0.0
RemoteAddress test fails if CIDR notation is used in the configuration. The rule is created, but the test fails.

Recommendations:

  1. Update documentation providing only currently supported formats.
  2. Provide an example.
  3. Provide intellisense option showing a subnet mask notation.
  4. Update code to translate CIDR notation to subnet mask.

----- This firewall will get created successfully but the test will FAIL.
xFirewall myNagiosFw
{
Name = "DSC-Nagios"
Enabled = $true
Action = 'Allow'
LocalPort = 5666
Direction = 'Inbound'
Protocol = 'TCP'
Ensure = 'Present'
RemoteAddress = '10.10.0.0/16' # CAUSE OF TEST FAILURE
}

----- This firewall will get created successfully and the test will PASS.
xFirewall myNagiosFw
{
Name = "DSC-Nagios"
Enabled = $true
Action = 'Allow'
LocalPort = 5666
Direction = 'Inbound'
Protocol = 'TCP'
Ensure = 'Present'
RemoteAddress = '10.10.0.0/255.255.0.0' # CAUSE OF TEST FAILURE
}

We managed to inject some verbose statements into the function Test-RuleProperties
File: C:\Program Files\WindowsPowerShell\Modules\xNetworking\3.0.0.0\DSCResources\MSFT_xFirewall\MSFT_xFirewall.psm1
... code added ....
Write-Verbose "array-----:$ParameterSource----:$ParameterNew -----"
.... output from code ....
VERBOSE: [localhost]: [[xFirewall]myNagiosFw] Test-RuleProperties: RemoteAddress property value '10.10.0.0/255.255.0.0' does not match desired state '10.10.0.0/16'.

@dm3942 dm3942 changed the title RemoteAddress fails test if CIDR notation is used. xFirewall RemoteAddress fails test if CIDR notation is used. Dec 13, 2016
@PlagueHO
Copy link
Member

Thanks for logging this @dm3942

This is expected behavior because the *-NetFirewallAddressFilter cmdlets always returns the address with a netmask rather than in CIDR notation.

It should be possible to to adjust the test in Test-RuleProperties to do a comparison with both the CIDR notation and the netmask.

I'll try and get to this when I can unless someone else gets to this first.

@PlagueHO PlagueHO added bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community. labels Dec 13, 2016
@PlagueHO
Copy link
Member

@dm3942 - I'll look at this problem this week.

@PlagueHO PlagueHO added in progress The issue is being actively worked on by someone. and removed help wanted The issue is up for grabs for anyone in the community. labels Dec 25, 2016
@PlagueHO
Copy link
Member

@dm3942 - I've submitted a fix for this issue in the above PR. Might take a little while to get merged because it is not an insignificant change.

@dm3942
Copy link
Author

dm3942 commented Jan 3, 2017 via email

@PlagueHO
Copy link
Member

PlagueHO commented Jan 7, 2017

@dm3942 - a pleasure doing it. I'm just waiting on my PR to be reviewed so the change can go in.

@tysonjhayes - any chance you might have some time at some point to check over #173 for me - no problems if not sir, I can hassle some of the others a bit 😁 ? I realize it's a bit of a bit large PR because of it includes a bunch of work towards making xNetworking HQRM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug. in progress The issue is being actively worked on by someone.
Projects
None yet
Development

No branches or pull requests

2 participants