dsccommunity / NetworkingDsc

DSC resources for configuring settings related to networking.
https://dsccommunity.org
MIT License
226 stars 90 forks source link

xFirewall doesn't correctly handle Group property #191

Closed PshMike closed 6 years ago

PshMike commented 7 years ago

unable to create / modify a firewall rule and use the group property. Any usage of the this property on Windows Server 2016 node will result in runtime error when applying the configuration.

tysonjhayes commented 7 years ago

Hello @mjenne - could you please post an example config and the resulting errors that you are seeing? This will help us track this down.

PlagueHO commented 7 years ago

Hi @mjenne - is it possible you're seeing something similar to what this issue describes?

daBONDi commented 7 years ago

Got the same Problem here - Windows Server 2016 Standard RTM + CU2 When Rule not Exists it gets created with Group Property, if Rule Exists with Group Property it fails

Don't got a complete Error Message because i'm calling it trough "Ansible" and over WinRM :-)

Passed Back Exception Message in JSON: Parameter set cannot be resolved using the specified named parameters.

AmbiguousParameterSet,Set-NetFirewallRule

 "Exception": {
        "Data": {},
        "ErrorData": {
            "CimClass": {
                "CimClassMethods": [],
                "CimClassProperties": [
                    {
                        "CimType": 6,
                        "Flags": "None",
                        "Name": "CIMStatusCode",
                        "Qualifiers": [],
                        "ReferenceClassName": null,
                        "Value": 0
                    },
                    {
                        "CimType": 14,
                        "Flags": "None",
                        "Name": "CIMStatusCodeDescription",
                        "Qualifiers": [],
                        "ReferenceClassName": null,
                        "Value": null
                    },
                    {
                        "CimType": 4,
                        "Flags": "None",
                        "Name": "error_Category",
                        "Qualifiers": [],
                        "ReferenceClassName": null,
                        "Value": 0
                    },
                    {
                        "CimType": 6,
                        "Flags": "None",
                        "Name": "error_Code",
                        "Qualifiers": [],
                        "ReferenceClassName": null,
                        "Value": 0
                    },
                    {
                        "CimType": 14,
                        "Flags": "None",
                        "Name": "error_Type",
                        "Qualifiers": [],
                        "ReferenceClassName": null,
                        "Value": null
                    },
                    {
                        "CimType": 14,
                        "Flags": "None",
                        "Name": "error_WindowsErrorMessage",
                        "Qualifiers": [],
                        "ReferenceClassName": null,
                        "Value": null
                    },
                    {
                        "CimType": 14,
                        "Flags": "None",
                        "Name": "ErrorSource",
                        "Qualifiers": [],
                        "ReferenceClassName": null,
                        "Value": null
                    },
                    {
                        "CimType": 4,
                        "Flags": "None",
                        "Name": "ErrorSourceFormat",
                        "Qualifiers": [],
                        "ReferenceClassName": null,
                        "Value": 0
                    },
                    {
                        "CimType": 4,
                        "Flags": "None",
                        "Name": "ErrorType",
                        "Qualifiers": [],
                        "ReferenceClassName": null,
                        "Value": 0
                    },
                    {
                        "CimType": 14,
                        "Flags": "None",
                        "Name": "Message",
                        "Qualifiers": [],
                        "ReferenceClassName": null,
                        "Value": null
                    },
                    {
                        "CimType": 14,
                        "Flags": "None",
                        "Name": "MessageID",
                        "Qualifiers": [],
                        "ReferenceClassName": null,
                        "Value": null
                    },
                    {
                        "CimType": 14,
                        "Flags": "None",
                        "Name": "OtherErrorSourceFormat",
                        "Qualifiers": [],
                        "ReferenceClassName": null,
                        "Value": null
                    },
                    {
                        "CimType": 14,
                        "Flags": "None",
                        "Name": "OtherErrorType",
                        "Qualifiers": [],
                        "ReferenceClassName": null,
                        "Value": null
                    },
                    {
                        "CimType": 14,
                        "Flags": "None",
                        "Name": "OWningEntity",
                        "Qualifiers": [],
                        "ReferenceClassName": null,
                        "Value": null
                    },
                    {
                        "CimType": 4,
                        "Flags": "None",
                        "Name": "PerceivedSeverity",
                        "Qualifiers": [],
                        "ReferenceClassName": null,
                        "Value": 0
                    },
                    {
                        "CimType": 4,
                        "Flags": "None",
                        "Name": "ProbableCause",
                        "Qualifiers": [],
                        "ReferenceClassName": null,
                        "Value": 0
                    },
                    {
                        "CimType": 14,
                        "Flags": "None",
                        "Name": "ProbableCauseDescription",
                        "Qualifiers": [],
                        "ReferenceClassName": null,
                        "Value": null
                    }
                ],
                "CimClassQualifiers": [],
                "CimSuperClass": null,
                "CimSuperClassName": null,
                "CimSystemProperties": {
                    "ClassName": "MSFT_WmiError",
                    "Namespace": "root/Microsoft/Windows/DesiredStateConfiguration",
                    "Path": null,
                    "ServerName": "localhost"
                }
            },
            "CimInstanceProperties": [
                {
                    "CimType": 6,
                    "Flags": "NotModified",
                    "IsValueModified": false,
                    "Name": "CIMStatusCode",
                    "Value": 5
                },
                {
                    "CimType": 14,
                    "Flags": "NotModified, NullValue",
                    "IsValueModified": false,
                    "Name": "CIMStatusCodeDescription",
                    "Value": null
                },
                {
                    "CimType": 4,
                    "Flags": "NotModified",
                    "IsValueModified": false,
                    "Name": "error_Category",
                    "Value": 5
                },
                {
                    "CimType": 6,
                    "Flags": "NotModified",
                    "IsValueModified": false,
                    "Name": "error_Code",
                    "Value": 5
                },
                {
                    "CimType": 14,
                    "Flags": "NotModified",
                    "IsValueModified": false,
                    "Name": "error_Type",
                    "Value": "MI"
                },
                {
                    "CimType": 14,
                    "Flags": "NotModified",
                    "IsValueModified": false,
                    "Name": "error_WindowsErrorMessage",
                    "Value": "The specified Class does not exist."
                },
                {
                    "CimType": 14,
                    "Flags": "NotModified",
                    "IsValueModified": false,
                    "Name": "ErrorSource",
                    "Value": ""
                },
                {
                    "CimType": 4,
                    "Flags": "NotModified, NullValue",
                    "IsValueModified": false,
                    "Name": "ErrorSourceFormat",
                    "Value": null
                },
                {
                    "CimType": 4,
                    "Flags": "NotModified, NullValue",
                    "IsValueModified": false,
                    "Name": "ErrorType",
                    "Value": null
                },
                {
                    "CimType": 14,
                    "Flags": "NotModified",
                    "IsValueModified": false,
                    "Name": "Message",
                    "Value": "Parameter set cannot be resolved using the specified named parameters."
                },
                {
                    "CimType": 14,
                    "Flags": "NotModified",
                    "IsValueModified": false,
                    "Name": "MessageID",
                    "Value": "AmbiguousParameterSet,Set-NetFirewallRule"
                },
                {
                    "CimType": 14,
                    "Flags": "NotModified, NullValue",
                    "IsValueModified": false,
                    "Name": "OtherErrorSourceFormat",
                    "Value": null
                },
                {
                    "CimType": 14,
                    "Flags": "NotModified, NullValue",
                    "IsValueModified": false,
                    "Name": "OtherErrorType",
                    "Value": null
                },
                {
                    "CimType": 14,
                    "Flags": "NotModified, NullValue",
                    "IsValueModified": false,
                    "Name": "OWningEntity",
                    "Value": null
                },
                {
                    "CimType": 4,
                    "Flags": "NotModified, NullValue",
                    "IsValueModified": false,
                    "Name": "PerceivedSeverity",
                    "Value": null
                },
                {
                    "CimType": 4,
                    "Flags": "NotModified, NullValue",
                    "IsValueModified": false,
                    "Name": "ProbableCause",
                    "Value": null
                },
                {
                    "CimType": 14,
                    "Flags": "NotModified, NullValue",
                    "IsValueModified": false,
                    "Name": "ProbableCauseDescription",
                    "Value": null
                }
            ],
            "CimSystemProperties": {
                "ClassName": "MSFT_WmiError",
                "Namespace": "root/Microsoft/Windows/DesiredStateConfiguration",
                "Path": null,
                "ServerName": "localhost"
            }
        },

Passing Objects/Properties

"DSCConfigObject": {
        "Name": "xFirewall",
        "Property": {
            "Description": "Allow RDP Sessions to the Host from Management Networks - Manged by Ansible",
            "Direction": "Inbound",
            "EdgeTraversalPolicy": "Block",
            "Enabled": "True",
            "Ensure": "Present",
            "Group": "Ansible Managed",
            "LocalPort": [
                "3389"
            ],
            "Profile": [
                "Domain",
                "Private"
            ],
            "Program": "%SystemRoot%\\system32\\svchost.exe",
            "Protocol": "TCP",
            "RemoteAddress": [
                "172.16.11.0/24",
                "172.16.118.0/24",
                "172.16.119.0/24"
            ],
            "Service": "termservice",
            "name": "Ansible - Allow RDP Sessions from Management Networks"
        }
    },
    "Description": "Allow RDP Sessions to the Host from Management Networks - Manged by Ansible",
    "Direction": "Inbound",
    "EdgeTraversalPolicy": "Block",
    "Enabled": "True",
    "Ensure": "Present",
    "Group": "Ansible Managed",
    "LocalPort": 3389,
    "Profile": "Domain, Private",
    "Program": "%SystemRoot%\\system32\\svchost.exe",
    "Protocol": "TCP",
    "RemoteAddress": "172.16.11.0/24, 172.16.118.0/24,172.16.119.0/24",
    "Service": "termservice",
    "changed": true,
    "failed": true,
    "item_name": "Ansible - Allow RDP Sessions from Management Networks",
    "resource_name": "xFirewall"
daBONDi commented 7 years ago

Looks like same as #130

Until the Bug on Set-NetworkRule with Group Params get fixed, there should be an Ignore If Statement or something.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had activity from the community in the last 30 days. It will be closed if no further activity occurs within 10 days. If the issue is labelled with any of the work labels (e.g bug, enhancement, documentation, or tests) then the issue will not auto-close.

stale[bot] commented 6 years ago

This issue has been automatically closed because it is has not had activity from the community in the last 40 days.