Esempio n. 1
0
        public override void ExecuteCmdlet()
        {
            base.ExecuteCmdlet();
            var psAzureFirewallFqdnTags = AzureFirewallFqdnTagHelper.GetAzureFirewallAllowedFqdnTags(this.AzureFirewallFqdnTagClient);

            WriteObject(psAzureFirewallFqdnTags, true);
        }
Esempio n. 2
0
        public override void Execute()
        {
            base.Execute();

            if (FqdnTag != null)
            {
                this.Protocol = PSAzureFirewallApplicationRuleProtocol.AllProtocols().ToArray();
                FqdnTag       = AzureFirewallFqdnTagHelper.MapUserInputToAllowedFqdnTags(FqdnTag, this.AzureFirewallFqdnTagClient).ToArray();
            }

            var protocolsAsWeExpectThem = MapUserProtocolsToFirewallProtocols(Protocol?.ToList());

            var applicationRule = new PSAzureFirewallApplicationRule
            {
                Name            = this.Name,
                Description     = this.Description,
                SourceAddresses = this.SourceAddress?.ToList(),
                SourceIpGroups  = this.SourceIpGroup?.ToList(),
                Protocols       = protocolsAsWeExpectThem,
                TargetFqdns     = this.TargetFqdn?.ToList(),
                FqdnTags        = this.FqdnTag?.ToList()
            };

            WriteObject(applicationRule);
        }
Esempio n. 3
0
        public override void Execute()
        {
            base.Execute();

            if (FqdnTag != null)
            {
                this.Protocol = new string[] { "http", "https" };
                FqdnTag       = AzureFirewallFqdnTagHelper.MapUserInputToAllowedFqdnTags(FqdnTag, this.AzureFirewallPolicyFqdnTagClient).ToArray();
            }

            var protocolsAsWeExpectThem = MapUserProtocolsToFirewallPolicyProtocols(Protocol?.ToList());

            var applicationRule = new PSAzureFirewallPolicyApplicationRule
            {
                Name            = this.Name,
                SourceAddresses = this.SourceAddress?.ToList(),
                SourceIpGroups  = this.SourceIpGroup?.ToList(),
                Protocols       = protocolsAsWeExpectThem,
                TargetFqdns     = this.TargetFqdn?.ToList(),
                FqdnTags        = this.FqdnTag?.ToList(),
                RuleType        = "ApplicationRule"
            };

            WriteObject(applicationRule);
        }
Esempio n. 4
0
        public override void Execute()
        {
            base.Execute();

            if (FqdnTag != null)
            {
                this.Protocol = new List <string> {
                    "http", "https"
                };
                FqdnTag = AzureFirewallFqdnTagHelper.MapUserInputToAllowedFqdnTags(FqdnTag);
            }

            var protocolsAsWeExpectThem = MapUserProtocolsToFirewallProtocols(Protocol);

            var applicationRule = new PSAzureFirewallApplicationRule
            {
                Name            = this.Name,
                Description     = this.Description,
                SourceAddresses = this.SourceAddress,
                Protocols       = protocolsAsWeExpectThem,
                TargetFqdns     = this.TargetFqdn,
                FqdnTags        = this.FqdnTag
            };

            WriteObject(applicationRule);
        }