Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ISPN-9599 Require ADMIN permission for getGlobalComponentRegistry
* Deprecate getGlobalComponentRegistry and getComponentRegistry * Require ADMIN permission for both * Require ADMIN permission for configuration getters (getCacheManagerConfiguration, getDefaultCacheConfiguration, getCacheConfiguration) * Remove some internal usages of the configuration getters * Trust org.jboss.as.clustering.infinispan.* packages ISPN-9599 Trust org.jboss.as.clustering.infinispan.* packages
- Loading branch information
1 parent
1480098
commit c938ff4
Showing
129 changed files
with
1,236 additions
and
1,113 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
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
38 changes: 38 additions & 0 deletions
38
...i-interpreter/src/main/java/org/infinispan/cli/interpreter/statement/SecurityActions.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,38 @@ | ||
package org.infinispan.cli.interpreter.statement; | ||
|
||
import java.security.AccessController; | ||
import java.security.PrivilegedAction; | ||
|
||
import org.infinispan.configuration.global.GlobalConfiguration; | ||
import org.infinispan.factories.GlobalComponentRegistry; | ||
import org.infinispan.manager.EmbeddedCacheManager; | ||
import org.infinispan.security.Security; | ||
import org.infinispan.security.actions.GetCacheManagerConfigurationAction; | ||
import org.infinispan.security.actions.GetGlobalComponentRegistryAction; | ||
|
||
/** | ||
* SecurityActions for package org.infinispan.cli.interpreter.statement | ||
* | ||
* Do not move. Do not change class and method visibility to avoid being called from other | ||
* {@link java.security.CodeSource}s, thus granting privilege escalation to external code. | ||
* | ||
* @author Tristan Tarrant | ||
* @since 7.0 | ||
*/ | ||
final class SecurityActions { | ||
private static <T> T doPrivileged(PrivilegedAction<T> action) { | ||
if (System.getSecurityManager() != null) { | ||
return AccessController.doPrivileged(action); | ||
} else { | ||
return Security.doPrivileged(action); | ||
} | ||
} | ||
|
||
static GlobalConfiguration getCacheManagerConfiguration(EmbeddedCacheManager cacheManager) { | ||
return doPrivileged(new GetCacheManagerConfigurationAction(cacheManager)); | ||
} | ||
|
||
static GlobalComponentRegistry getGlobalComponentRegistry(EmbeddedCacheManager cacheManager) { | ||
return doPrivileged(new GetGlobalComponentRegistryAction(cacheManager)); | ||
} | ||
} |
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.