forked from wildfly/wildfly
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WFLY-490][WFLY-456] Fixes to JMX rbac/audit log coming from review
- Loading branch information
1 parent
b1fc489
commit 463453c
Showing
29 changed files
with
533 additions
and
264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
controller/src/main/java/org/jboss/as/controller/access/JmxAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source. | ||
* Copyright 2012, Red Hat, Inc., and individual contributors | ||
* as indicated by the @author tags. See the copyright.txt file in the | ||
* distribution for a full listing of individual contributors. | ||
* | ||
* This is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as | ||
* published by the Free Software Foundation; either version 2.1 of | ||
* the License, or (at your option) any later version. | ||
* | ||
* This software is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* Lesser General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public | ||
* License along with this software; if not, write to the Free | ||
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
package org.jboss.as.controller.access; | ||
|
||
|
||
/** | ||
* Encapsulates authorization information about an MBean call. | ||
* | ||
* @author <a href="[email protected]">Kabir Khan</a> | ||
*/ | ||
public class JmxAction { | ||
private final String methodName; | ||
private final Impact impact; | ||
|
||
public JmxAction(String methodName, Impact impact) { | ||
this.methodName = methodName; | ||
this.impact = impact; | ||
} | ||
|
||
/** | ||
* Gets the impact of the call | ||
* | ||
* @return the impact | ||
*/ | ||
public Impact getImpact() { | ||
return impact; | ||
} | ||
|
||
/** | ||
* Gets the {@link javax.management.MBeanServer} method name that was called | ||
*/ | ||
public String getMethodName() { | ||
return methodName; | ||
} | ||
|
||
/** | ||
* The impact of the call | ||
*/ | ||
public enum Impact { | ||
/** The call is read-only */ | ||
READ_ONLY, | ||
/** The call writes data */ | ||
WRITE, | ||
/** The call is special, and will normally only work for a (@link org.jboss.as.controller.access.rbac.StandardRole#SUPERUSER} or a (@link org.jboss.as.controller.access.rbac.StandardRole#ADMINISTRATOR} */ | ||
EXTRA_SENSITIVE | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,33 +19,20 @@ | |
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. | ||
*/ | ||
package org.jboss.as.controller.access; | ||
package org.jboss.as.controller.access.permission; | ||
|
||
import java.util.Set; | ||
|
||
import org.jboss.as.controller.access.Action; | ||
import org.jboss.as.controller.access.Caller; | ||
import org.jboss.as.controller.access.Environment; | ||
import org.jboss.as.controller.access.TargetResource; | ||
|
||
/** | ||
* | ||
* @author <a href="[email protected]">Kabir Khan</a> | ||
*/ | ||
public class JmxTarget { | ||
final boolean superUserOrAdminOnly; | ||
final boolean nonFacadeMBeansSensitive; | ||
final boolean readOnly; | ||
|
||
public JmxTarget(boolean superUserOrAdminOnly, boolean nonFacadeMBeansSensitive, boolean readOnly) { | ||
this.superUserOrAdminOnly = superUserOrAdminOnly; | ||
this.nonFacadeMBeansSensitive = nonFacadeMBeansSensitive; | ||
this.readOnly = readOnly; | ||
} | ||
|
||
boolean isSuperUserOrAdminOnly() { | ||
return superUserOrAdminOnly; | ||
} | ||
|
||
boolean isNonFacadeMBeansSensitive() { | ||
return nonFacadeMBeansSensitive; | ||
} | ||
|
||
public boolean isReadOnly() { | ||
return readOnly; | ||
} | ||
public interface JmxPermissionFactory { | ||
boolean isNonFacadeMBeansSensitive(); | ||
Set<String> getUserRoles(Caller caller, Environment callEnvironment, Action action, TargetResource target); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.