001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.jetspeed.audit;
018:
019: import javax.sql.DataSource;
020:
021: /**
022: * Gathers information about security auditing activity
023: *
024: * @author <a href="mailto:taylor@apache.org">David Sean Taylor </a>
025: * @version $Id: $
026: */
027: public interface AuditActivity {
028: // user activities
029: public static final String AUTHENTICATION_SUCCESS = "login-success";
030: public static final String AUTHENTICATION_FAILURE = "login-failure";
031: public static final String PASSWORD_CHANGE_SUCCESS = "password-success";
032: public static final String PASSWORD_CHANGE_FAILURE = "password-failure";
033:
034: // admin activities
035: public static final String USER_CREATE = "user-create";
036: public static final String USER_UPDATE = "user-update";
037: public static final String USER_DELETE = "user-delete";
038: public static final String USER_DISABLE = "user-disable";
039: public static final String USER_EXTEND = "user-extend";
040: public static final String USER_EXTEND_UNLIMITED = "user-extend-unlimited";
041:
042: public static final String PASSWORD_EXPIRE = "password-expire";
043: public static final String PASSWORD_RESET = "password-reset";
044: public static final String PASSWORD_ACTIVATE = "password-activate";
045: public static final String PASSWORD_ENABLED = "password-enabled";
046: public static final String PASSWORD_DISABLED = "password-disabled";
047: public static final String PASSWORD_UPDATE_REQUIRED = "password-update-req";
048: public static final String PASSWORD_EXTEND = "password-extend";
049: public static final String PASSWORD_UNLIMITED = "password-unlimited";
050:
051: public static final String USER_ADD_ROLE = "user-add-role";
052: public static final String USER_DELETE_ROLE = "user-delete-role";
053: public static final String USER_ADD_GROUP = "user-add-group";
054: public static final String USER_DELETE_GROUP = "user-delete-group";
055: public static final String USER_ADD_PROFILE = "user-add-profile";
056: public static final String USER_DELETE_PROFILE = "user-delete-profile";
057:
058: public static final String USER_ADD_ATTRIBUTE = "user-add-attr";
059: public static final String USER_DELETE_ATTRIBUTE = "user-delete-attr";
060: public static final String USER_UPDATE_ATTRIBUTE = "user-update-attr";
061:
062: // General Categories
063: public static final String CAT_USER_AUTHENTICATION = "authentication";
064: public static final String CAT_USER_ATTRIBUTE = "user-attribute";
065: public static final String CAT_ADMIN_USER_MAINTENANCE = "user";
066: public static final String CAT_ADMIN_CREDENTIAL_MAINTENANCE = "credential";
067: public static final String CAT_ADMIN_ATTRIBUTE_MAINTENANCE = "attribute";
068: public static final String CAT_ADMIN_AUTHORIZATION_MAINTENANCE = "authorization";
069:
070: /**
071: * Enable or disable the service at runtime
072: *
073: * @param enabled
074: */
075: public void setEnabled(boolean enabled);
076:
077: /**
078: * Get the enabled state of this service
079: * @return
080: */
081: public boolean getEnabled();
082:
083: /**
084: * Log user security-audit-related activity
085: *
086: * @param username
087: * @param ipaddress
088: * @param activity
089: * @param description
090: */
091: public void logUserActivity(String username, String ipaddress,
092: String activity, String description);
093:
094: /**
095: * Log auditable activity by an administrator on behalf of another user
096: *
097: * @param username
098: * @param ipaddress
099: * @param targetUser
100: * @param activity
101: * @param description
102: */
103: public void logAdminUserActivity(String username, String ipaddress,
104: String targetUser, String activity, String description);
105:
106: /**
107: * Log auditable activity by an administrator on credentials on behalf of a user
108: *
109: * @param adminName
110: * @param ipaddress
111: * @param targetUser
112: * @param activity
113: * @param description
114: */
115: public void logAdminCredentialActivity(String username,
116: String ipaddress, String targetUser, String activity,
117: String description);
118:
119: public void logAdminAuthorizationActivity(String username,
120: String ipaddress, String targetUser, String activity,
121: String name, String description);
122:
123: /**
124: * Log auditable activity by an administrator on attirbutes on behalf of a user
125: *
126: * @param username
127: * @param ipaddress
128: * @param targetUser
129: * @param activity
130: * @param name
131: * @param beforeValue
132: * @param afterValue
133: * @param description
134: */
135: public void logAdminAttributeActivity(String username,
136: String ipaddress, String targetUser, String activity,
137: String name, String beforeValue, String afterValue,
138: String description);
139:
140: /**
141: * Log auditable activity by an administrator on attirbutes on behalf of a user
142: *
143: * @param username
144: * @param ipaddress
145: * @param activity
146: * @param name
147: * @param beforeValue
148: * @param afterValue
149: * @param description
150: */
151: public void logUserAttributeActivity(String username,
152: String ipaddress, String activity, String name,
153: String beforeValue, String afterValue, String description);
154:
155: /**
156: * @return DataSource in use by the logger useful for writing decent tests
157: */
158: public DataSource getDataSource();
159:
160: }
|