Giter VIP home page Giter VIP logo

datawave-spring-boot-starter's People

Contributors

alerman avatar billoley avatar brianloss avatar cmitchell avatar dependabot[bot] avatar drewfarris avatar ivakegg avatar jwomeara avatar keith-ratcliffe avatar milleruntime avatar tomnelson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

datawave-spring-boot-starter's Issues

Do not check for principal changes in ProxiedEntityX509Filter

When the ProxiedEntityX509Filter is in the filter chain, the JWTAuthenticationFilter is configured to be run first.

The logic in ProxiedEntityX509Filter.principalChanged, specifically currentAuthentication.getCredentials() instanceof SubjectIssuerDNPair (credentials are an empty String when I debugged) ensure that false is always returned. When I fixed that logic, I saw that if both a JWT and either a client cert or trusted headers were provided with different principals, then a principal change would be detected and the client cert or trusted headers would be used.

To ensure that a provided JWT is used (the intent of putting the JWTAuthorizationFilter first), we need to set setCheckForPrincipalChanges(false) instead of true.

Maintain the list of users in ProxiedUserDetails in chronological (call-time) order

Currently, the collection retrieved by ProxiedUserDetails.getProxiedUsers (which are all users) has the final caller as the first entry followed by the entities in the call chain in the order that they happened. This creates some minor complexity in finding the primaryUser and in explaining this order to others.

Modify the places where ProxiedUserDetails iws created such that the proxied entities are first (already in chronological order) and the final caller is last ..... making it also in chronological order

Allow alternate AllowedCallersFilter to be used in JWTSecurityConfigurer

This is needed to allow the authorization service to use a custom AllowedCallersFilter to permit calls to the oauth operations from entities not on the allowedCallers list. These operations either have their own form of security (/v2/oauth/authorize, /v2/oauth/token) or are meant to be called by all users (/v2/oauth/user, /v2/oauth/users) to get information about a certificate or token.

Use ArrayList instead of LinkedHashSet in ProxiedUserDetails, avoid duplicate users when no proxiedUsers

ProxiedUserDetails currently maintains the list of users as a LinkedHashSet which hides any duplcate users or call chain cycles from our logs and monitoring. Change the LinkedHashSet to an ArrayList and verify that our internal security mechanisms function correctly.

When there are no entries in X-ProxiedEntitiesChain, ProxiedEntityX509Filter currently adds the caller (cert or trusted header) to the list of proxiedUsers. This appears to be unnecessary and is currently being compensated for by using a LinkedHashSet in ProxiedUserDetails. Here are the three WebSecurityConfigurerAdapters that we use:

not remoteauth profile - JWTAuthenticationFilter/JWTAuthenticationProvider decode the Authorization Bearer token (JWT) and use the contained DatawaveUsers

JWTSecurityConfigurer sets up:

filters:

  • AllowedCallersFilter (if a cert provided and enforceAllowedCallers=true, reject if not in list of allowedCallers)
  • X509AuthenticationFilter (spring)
  • JWTAuthenticationFilter (get JWT token and create a JWTPreauthToken which gets used to in the JWTAuthenticationProvider)

authenticationProviders:

  • JWTAuthenticationProvider supports JWTPreauthToken

remoteauth profile - Either JWT token (see above) or RemoteAuthorizationServiceUserDetailsService sends both the caller and proxiedEntities to the authorization service.

RemoteAuthServiceSecurityConfigurer sets up:

filters:

  • AllowedCallersFilter (if a cert provided and enforceAllowedCallers=true, reject if not in list of allowedCallers)
  • X509AuthenticationFilter (spring)
  • JWTAuthenticationFilter (get JWT token and create a JWTPreauthToken which gets used to in the JWTAuthenticationProvider)
  • ProxiedEntityX509Filter (creates a ProxiedEntityPreauthPrincipal which is then used in RemoteAuthorizationServiceUserDetailsService to call the authorization service with X-ProxiedEntitiesChain of the caller + proxiedUsers

authenticationProviders:

  • JWTAuthenticationProvider supports JWTPreauthToken
  • PreAuthenticatedAuthenticationProvider -> RemoteAuthorizationServiceUserDetailsService implements RemoteAuthorizationServiceUserDetailsService supports PreAuthenticatedAuthenticationToken

authorization service - ProxiedEntityUserDetailsService (authorization service) can be modified to add both the caller and proxiedUsers and then the authorization service can ignore the caller in the authorize and whoami operations and use the caller and proxiedUsers in the oauth calls.

AuthorizationSecurityConfigurer sets up:

filters:

  • AllowedCallersFilter (if a cert provided and enforceAllowedCallers=true, reject if not in list of allowedCallers)
  • X509AuthenticationFilter (spring)
  • JWTAuthenticationFilter (get JWT token and authenticates via JWTAuthenticationProvider)
  • ProxiedEntityX509Filter (creates a ProxiedEntityPreauthPrincipal which is then used in AuthenticationUserDetailsService to use the datawaveUsersService to lookup the users (previously proxiedUsers, soon caller + proxiedUsers)

authenticationProviders:

  • JWTAuthenticationProvider supports JWTPreauthToken
  • PreAuthenticatedAuthenticationProvider -> ProxiedEntityUserDetailsService implements AuthenticationUserDetailsService supports PreAuthenticatedAuthenticationToken

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.