|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.fzj.unicore.uas.security.SecurityManager
public final class SecurityManager
access to security components
| Nested Class Summary | |
|---|---|
static class |
SecurityManager.NullAuthoriser
|
| Field Summary | |
|---|---|
static java.util.regex.Pattern |
pattern
|
protected static java.lang.String |
proxyRE
|
| Method Summary | |
|---|---|
static void |
addCallback(AttributeHandlingCallback aac)
add a callback class for dealing with additional security attributes |
static java.util.Map<java.lang.String,java.lang.String[]> |
authorise(eu.unicore.security.xfireutil.SecurityTokens tokens)
Deprecated. Use establishAttributes() |
static void |
checkAuthentication(eu.unicore.security.xfireutil.SecurityTokens tokens,
java.lang.String action,
ResourceDescriptor d)
check whether authentication is OK and conforms to this server's policies |
static void |
checkAuthorisation(de.fzj.unicore.xnjs.aaa.Client c,
java.lang.String action,
ResourceDescriptor d)
check access by evaluating the XACML policies |
static boolean |
checkConsignorEqualsUser(eu.unicore.security.xfireutil.SecurityTokens tokens)
checks if user+consignor DNs are equal (taking into account proxy mode) |
static void |
checkValidityOfTrustDelegation(eu.unicore.security.xfireutil.SecurityTokens tokens)
checks whether the supplied TD is valid thorws an AuthorisationException iff TD is requested, user+consignor differ, but is invalid |
static de.fzj.unicore.xnjs.aaa.Client |
createAndAuthoriseClient(eu.unicore.security.xfireutil.SecurityTokens tokens)
Create an authorised Client object. |
static void |
createAttributeSource()
Creates AttributeSource used for establishing clients' attributes. |
static java.util.Map<java.lang.String,java.lang.String[]> |
establishAttributes(eu.unicore.security.xfireutil.SecurityTokens tokens)
Returns an attribute map for a set of security tokens |
static java.lang.String |
getAuthoriserConnectionStatus()
get a human-readable description of the current status of the configured authorisers. |
static UASSecurityProperties |
getClaimTrustDelegationProperties(eu.unicore.security.xfireutil.SecurityTokens t)
get a UASSecurityProperties instance suitable for
claiming any trust delegation contained in the security tokens. |
static java.security.cert.X509Certificate |
getGatewayCert()
get the certificate of the gateway, if available, in the following way it can be configured statically, by adding the certificate to the truststore and setting the property IUASSecurityProperties.UAS_GATEWAY_ALIAS to the
alias of the certificate
it is retrieved dynamically by opening an SSL connection to the server at the configured
base url
+ * |
static UASSecurityProperties |
getIssueTrustDelegationProperties(eu.unicore.security.xfireutil.SecurityTokens t,
org.w3.x2005.x08.addressing.EndpointReferenceType epr)
Create a UASSecurityProperties instance suitable for
issuing a trust delegation assertion to the receiver indicated
by the supplied EPR. |
static XacmlPDP |
getPDP()
get the XACML policy decision point |
static java.security.cert.X509Certificate |
getPeerCertificate(java.lang.String url,
IUASSecurityProperties security)
|
static java.security.cert.X509Certificate |
getPeerCertificate(java.lang.String url,
IUASSecurityProperties security,
int timeout)
helper to get the certificate on the other side of a SSL connection to "url" |
static java.security.cert.X509Certificate |
getProxiedUserCert(eu.unicore.security.xfireutil.SecurityTokens tokens)
get the real user cert from either the user cert path or the consignor cert path |
static java.security.cert.X509Certificate |
getRealUserCertFromProxyCertPath(java.security.cert.CertPath cp)
for the given certificate path, return the first entry that is not a proxy cert, i.e. the real user certificate |
static java.security.cert.X509Certificate |
getServerCert()
get the certificate of the server |
static java.lang.String |
getServerDistinguishedName()
get the X500 name of the server in human-friendly form, i.e. using X500Principal.toString() |
static javax.security.auth.x500.X500Principal |
getServerIdentity()
get the server's identity, or null if
no server keystore has been configured |
protected static de.fzj.unicore.xnjs.aaa.Role |
getServerRole()
server role |
static java.lang.String |
handleProxyCert(eu.unicore.security.xfireutil.SecurityTokens tokens)
gets the DN in case of a proxy cert. |
static boolean |
isAccessControlEnabled()
|
static boolean |
isAccessible(de.fzj.unicore.xnjs.aaa.Client client,
java.lang.String serviceName,
java.lang.String wsResourceID,
java.lang.String owner,
java.lang.String action)
Can the given client access the given (server-local!) |
static boolean |
isAdmin(de.fzj.unicore.xnjs.aaa.Client c)
checks whether the given client has the "admin" role |
static boolean |
isLocalCall()
|
protected static boolean |
isNotClear(com.sun.xacml.ctx.ResponseCtx pdpResponse)
check whether the response from the PDP is "NotApplicable" or "Indeterminate" |
protected static boolean |
isPermit(com.sun.xacml.ctx.ResponseCtx pdpResponse)
check whether the response from the PDP is "Permit" |
static boolean |
isProxyDN(java.lang.String dn)
|
static boolean |
isProxyModeEnabled()
|
static boolean |
isServer(java.security.cert.CertPath path)
checks whether the given CertPath is the server identity |
static boolean |
isServer(de.fzj.unicore.xnjs.aaa.Client c)
checks whether the given client has the server identity |
static boolean |
isServer(java.security.cert.X509Certificate cert)
checks whether the given certificate is the server identity |
static boolean |
isTrustedAgent(de.fzj.unicore.xnjs.aaa.Client c)
checks whether the given client has the "trusted agent" role |
protected static de.fzj.unicore.xnjs.aaa.Client |
makeAnonymousClient(java.lang.String dn)
a special client useful for anonymous requests |
static void |
makeAuthoriser()
Deprecated. Use createAttributeSource() |
static void |
registerAuthNCheckingStrategies(AuthNCheckingStrategy... strategies)
register checking strategies |
static void |
setAccessControlEnabled(boolean isAccessControlEnabled)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.lang.String proxyRE
public static final java.util.regex.Pattern pattern
| Method Detail |
|---|
public static void addCallback(AttributeHandlingCallback aac)
aac - - an AttributeHandlingCallbackpublic static java.security.cert.X509Certificate getServerCert()
public static javax.security.auth.x500.X500Principal getServerIdentity()
null if
no server keystore has been configured
X500Principal or nullgetServerCert()public static java.lang.String getServerDistinguishedName()
getServerIdentity()public static java.security.cert.X509Certificate getGatewayCert()
IUASSecurityProperties.UAS_GATEWAY_ALIAS to the
alias of the certificate
X509Certificate of the gatewaypublic static XacmlPDP getPDP()
XacmlPDP
public static java.util.Map<java.lang.String,java.lang.String[]> establishAttributes(eu.unicore.security.xfireutil.SecurityTokens tokens)
throws java.lang.Exception
tokens -
java.lang.Exception
public static void createAttributeSource()
throws java.lang.Exception
java.lang.Exceptionpublic static de.fzj.unicore.xnjs.aaa.Client createAndAuthoriseClient(eu.unicore.security.xfireutil.SecurityTokens tokens)
tokens - - Security tokens
public static java.lang.String handleProxyCert(eu.unicore.security.xfireutil.SecurityTokens tokens)
throws java.security.cert.CertificateException
tokens -
java.security.cert.CertificateException
public static java.security.cert.X509Certificate getProxiedUserCert(eu.unicore.security.xfireutil.SecurityTokens tokens)
throws java.security.cert.CertificateException
tokens -
java.security.cert.CertificateExceptionpublic static java.security.cert.X509Certificate getRealUserCertFromProxyCertPath(java.security.cert.CertPath cp)
cp - - the certpath to check
public static boolean checkConsignorEqualsUser(eu.unicore.security.xfireutil.SecurityTokens tokens)
tokens -
protected static de.fzj.unicore.xnjs.aaa.Role getServerRole()
protected static de.fzj.unicore.xnjs.aaa.Client makeAnonymousClient(java.lang.String dn)
public static void checkAuthentication(eu.unicore.security.xfireutil.SecurityTokens tokens,
java.lang.String action,
ResourceDescriptor d)
tokens - - SecurityTokens from the requestaction - - the method being invokedd - - the resource being accessedpublic static void registerAuthNCheckingStrategies(AuthNCheckingStrategy... strategies)
strategies - - AuthNCheckingStrategy objects
public static void checkAuthorisation(de.fzj.unicore.xnjs.aaa.Client c,
java.lang.String action,
ResourceDescriptor d)
c - action - d - public static boolean isLocalCall()
public static boolean isServer(de.fzj.unicore.xnjs.aaa.Client c)
public static boolean isServer(java.security.cert.X509Certificate cert)
public static boolean isServer(java.security.cert.CertPath path)
public static boolean isTrustedAgent(de.fzj.unicore.xnjs.aaa.Client c)
public static boolean isAdmin(de.fzj.unicore.xnjs.aaa.Client c)
public static void checkValidityOfTrustDelegation(eu.unicore.security.xfireutil.SecurityTokens tokens)
throws AuthorisationException
tokens - - the sec tokens to check
AuthorisationException - iff TD is requested but invalid
public static java.security.cert.X509Certificate getPeerCertificate(java.lang.String url,
IUASSecurityProperties security)
public static java.security.cert.X509Certificate getPeerCertificate(java.lang.String url,
IUASSecurityProperties security,
int timeout)
url - - the URL to connect tosecurity - - the IUASSecurityProperties to usetimeout - - the time to wait for a connection before giving up
public static UASSecurityProperties getIssueTrustDelegationProperties(eu.unicore.security.xfireutil.SecurityTokens t,
org.w3.x2005.x08.addressing.EndpointReferenceType epr)
UASSecurityProperties instance suitable for
issuing a trust delegation assertion to the receiver indicated
by the supplied EPR. This EPR should contain the receiver DN
(@see {@link AddressingUtil#extractServerIDFromEPR(EndpointReferenceType)),
otherwise the receiver has to be set manually before the web service call.
t - - the security tokensepr - - the EPR of the receiver service
public static UASSecurityProperties getClaimTrustDelegationProperties(eu.unicore.security.xfireutil.SecurityTokens t)
UASSecurityProperties instance suitable for
claiming any trust delegation contained in the security tokens.
t - - security tokens, possibly containing trust delegation
public static boolean isAccessible(de.fzj.unicore.xnjs.aaa.Client client,
java.lang.String serviceName,
java.lang.String wsResourceID,
java.lang.String owner,
java.lang.String action)
throws java.lang.Exception
client - - the clientserviceName - - can be nullwsResourceID - - can be nullaction- - method name, can be null
java.lang.Exceptionprotected static boolean isPermit(com.sun.xacml.ctx.ResponseCtx pdpResponse)
pdpResponse -
protected static boolean isNotClear(com.sun.xacml.ctx.ResponseCtx pdpResponse)
pdpResponse -
public static boolean isAccessControlEnabled()
public static void setAccessControlEnabled(boolean isAccessControlEnabled)
public static boolean isProxyModeEnabled()
public static java.lang.String getAuthoriserConnectionStatus()
throws java.lang.Exception
java.lang.Exceptionpublic static boolean isProxyDN(java.lang.String dn)
@Deprecated
public static java.util.Map<java.lang.String,java.lang.String[]> authorise(eu.unicore.security.xfireutil.SecurityTokens tokens)
throws java.lang.Exception
java.lang.Exception
@Deprecated
public static void makeAuthoriser()
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||