001/** 002 * Copyright 2004-2014 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.common.aws.ec2.model.security; 017 018import org.kuali.common.util.Ports; 019 020import com.google.common.collect.ImmutableList; 021 022public enum NamedPermissions { 023 024 ALLOW_SSH_FROM_ANYWHERE(Ports.SSH), // Allow SSH (port 22) from anywhere 025 ALLOW_HTTP_FROM_ANYWHERE(Ports.HTTP), // Allow HTTP (port 80) from anywhere 026 ALLOW_HTTPS_FROM_ANYWHERE(Ports.HTTPS); // Allow HTTPS (port 443) from anywhere 027 028 private final Permission permission; 029 030 private NamedPermissions(int port) { 031 this.permission = Permission.create(port); 032 } 033 034 public Permission getPermission() { 035 return permission; 036 } 037 038 public static final ImmutableList<Permission> APPLICATION_SERVER_PERMISSIONS = ImmutableList.of(ALLOW_SSH_FROM_ANYWHERE.getPermission(), ALLOW_HTTP_FROM_ANYWHERE.getPermission(), ALLOW_HTTPS_FROM_ANYWHERE.getPermission()); 039 040}