Package org.apache.qpid.server.security.access.plugins

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


        buf.close();

        // Configure plugin
        FirewallConfiguration config = new FirewallConfiguration();
        config.setConfiguration("", new XMLConfiguration(confFile));
        Firewall plugin = new Firewall();
        plugin.configure(config);
        return plugin;
    }
View Full Code Here


    }
   
    public void testDefaultAction() throws Exception
    {
        // Test simple deny
        Firewall plugin = initialisePlugin("deny");
        assertEquals(Result.DENIED, plugin.access(ObjectType.VIRTUALHOST, _address));

        // Test simple allow
        plugin = initialisePlugin("allow");
        assertEquals(Result.ALLOWED, plugin.access(ObjectType.VIRTUALHOST, _address));
    }
View Full Code Here

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

        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

    {
        RuleInfo rule = new RuleInfo();
        rule.setAccess("allow");
        rule.setNetwork("192.168.23.0/24");
       
        Firewall plugin = initialisePlugin("deny", new RuleInfo[]{rule});

        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

    {
        RuleInfo rule = new RuleInfo();
        rule.setAccess("allow");
        rule.setHostname(new InetSocketAddress("127.0.0.1", 5672).getHostName());
       
        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

    {
        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

        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

        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

    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

    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

TOP

Related Classes of org.apache.qpid.server.security.access.plugins.Firewall

Copyright © 2018 www.massapicom. 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.