Examples of Firewall


Examples of org.apache.qpid.server.security.access.plugins.Firewall

    {
        RuleInfo rule = new RuleInfo();
        rule.setAccess("allow");
        String hostname = new InetSocketAddress("127.0.0.1", 0).getHostName();
        rule.setHostname(".*"+hostname.subSequence(hostname.length() - 1, hostname.length())+"*");
        Firewall plugin = initialisePlugin("deny", new RuleInfo[]{rule});

        // Set IP so that we're connected from the right address
        _address = new InetSocketAddress("127.0.0.1", 65535);
        assertEquals(Result.ALLOWED, plugin.access(ObjectType.VIRTUALHOST, _address));
    }
View Full Code Here

Examples of org.apache.qpid.server.security.access.plugins.Firewall

        RuleInfo thirdRule = new RuleInfo();
        thirdRule.setAccess("deny");
        thirdRule.setHostname("localhost");
       
        Firewall plugin = initialisePlugin("deny", new RuleInfo[]{firstRule, secondRule, thirdRule});

        assertEquals(Result.DENIED, plugin.access(ObjectType.VIRTUALHOST, _address));
       
        // Set IP so that we're connected from the right address
        _address = new InetSocketAddress("192.168.23.23", 65535);
        assertEquals(Result.ALLOWED, plugin.access(ObjectType.VIRTUALHOST, _address));
    }
View Full Code Here

Examples of org.apache.qpid.server.security.access.plugins.Firewall

        RuleInfo thirdRule = new RuleInfo();
        thirdRule.setAccess("allow");
        thirdRule.setNetwork("192.168.23.23");
       
        Firewall plugin = initialisePlugin("deny", new RuleInfo[]{firstRule, secondRule, thirdRule});

        assertEquals(Result.DENIED, plugin.access(ObjectType.VIRTUALHOST, _address));
       
        // Set IP so that we're connected from the right address
        _address = new InetSocketAddress("192.168.23.23", 65535);
        assertEquals(Result.ALLOWED, plugin.access(ObjectType.VIRTUALHOST, _address));
    }
View Full Code Here

Examples of org.apache.qpid.server.security.access.plugins.Firewall

    public void testNetmask() throws Exception
    {
        RuleInfo firstRule = new RuleInfo();
        firstRule.setAccess("allow");
        firstRule.setNetwork("192.168.23.0/24");
        Firewall plugin = initialisePlugin("deny", new RuleInfo[]{firstRule});

        assertEquals(Result.DENIED, plugin.access(ObjectType.VIRTUALHOST, _address));
       
        // Set IP so that we're connected from the right address
        _address = new InetSocketAddress("192.168.23.23", 65535);
        assertEquals(Result.ALLOWED, plugin.access(ObjectType.VIRTUALHOST, _address));
    }
View Full Code Here

Examples of org.apache.qpid.server.security.access.plugins.Firewall

    public void testCommaSeperatedNetmask() throws Exception
    {
        RuleInfo firstRule = new RuleInfo();
        firstRule.setAccess("allow");
        firstRule.setNetwork("10.1.1.1/8, 192.168.23.0/24");
        Firewall plugin = initialisePlugin("deny", new RuleInfo[]{firstRule});

        assertEquals(Result.DENIED, plugin.access(ObjectType.VIRTUALHOST, _address));
       
        // Set IP so that we're connected from the right address
        _address = new InetSocketAddress("192.168.23.23", 65535);
        assertEquals(Result.ALLOWED, plugin.access(ObjectType.VIRTUALHOST, _address));
    }
View Full Code Here

Examples of org.apache.qpid.server.security.access.plugins.Firewall

    public void testCommaSeperatedHostnames() throws Exception
    {
        RuleInfo firstRule = new RuleInfo();
        firstRule.setAccess("allow");
        firstRule.setHostname("foo, bar, "+new InetSocketAddress("127.0.0.1", 5672).getHostName());
        Firewall plugin = initialisePlugin("deny", new RuleInfo[]{firstRule});
       
        // Set IP so that we're connected from the right address
        _address = new InetSocketAddress("10.0.0.1", 65535);
        assertEquals(Result.DENIED, plugin.access(ObjectType.VIRTUALHOST, _address));
       
        // Set IP so that we're connected from the right address
        _address = new InetSocketAddress("127.0.0.1", 65535);
        assertEquals(Result.ALLOWED, plugin.access(ObjectType.VIRTUALHOST, _address));
    }
View Full Code Here

Examples of org.jclouds.googlecomputeengine.domain.Firewall

                              .build()))
              .addSourceRange("10.0.0.0/8")
              .addSourceTag("tag1")
              .addTargetTag("tag2");

      Firewall firewall = api().get(FIREWALL_NAME);
      assertNotNull(firewall);
      assertFirewallEquals(firewall, patchedFirewall);
   }
View Full Code Here

Examples of org.jclouds.googlecomputeengine.domain.Firewall

    * @see org.jclouds.googlecomputeengine.features.FirewallAsyncApi#patch(String, org.jclouds.googlecomputeengine.options.FirewallOptions)
    */
   private void getOrCreateFirewall(GoogleComputeEngineTemplateOptions templateOptions, Network network,
                                    String sharedResourceName) {

      Firewall firewall = api.getFirewallApiForProject(userProject.get()).get(sharedResourceName);

      if (firewall != null) {
         return;
      }

View Full Code Here

Examples of org.jclouds.googlecomputeengine.domain.Firewall

                              .build()))
              .addSourceRange("10.0.0.0/8")
              .addSourceTag("tag1")
              .addTargetTag("tag2");

      Firewall firewall = api().get(FIREWALL_NAME);
      assertNotNull(firewall);
      assertFirewallEquals(firewall, patchedFirewall);
   }
View Full Code Here

Examples of org.jclouds.googlecomputeengine.domain.Firewall

      FirewallApi firewallApi = api.getFirewallApiForProject(projectName);
      Set<AtomicReference<Operation>> operations = Sets.newHashSet();

      for (Integer port : templateOptions.getInboundPorts()) {
         String name = naming.name(port);
         Firewall firewall = firewallApi.get(name);
         if (firewall == null) {
            ImmutableSet<Firewall.Rule> rules = ImmutableSet.of(Firewall.Rule.permitTcpRule(port), Firewall.Rule.permitUdpRule(port));
            FirewallOptions firewallOptions = new FirewallOptions()
                    .name(name)
                    .network(network.getSelfLink())
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.