Buckets:

download
raw
5.09 kB
{
"role_mappings": [
{
"role": "Subject",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "No in-repo client (the SGI web UI is not part of this repo); callers of the services' REST endpoints are outside the repo. Inter-service RestTemplate clients (OAuth2ClientConfiguration) send client-credentials JWTs, not session ids, and were not used."
},
{
"role": "Authentication enforcer",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "Missing (credential-type rule, sec. 6): the default chain securityFilterChain (sgi-framework-spring/src/main/java/org/crue/hercules/sgi/framework/web/config/SgiWebSecurityConfig.java:76) enforces a stateless Keycloak JWT through oauth2ResourceServer().jwt() (line 89-90), not an opaque session id. The session-based oauth2Login flow (oauth2Login + KeycloakOidcUserService + KeycloakLogoutHandler, lines 116-124) is off by default because spring.security.oauth2.enable-login defaults to false (line 46)."
},
{
"role": "Verifier",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "Missing: on the default path, Spring's BearerTokenAuthenticationFilter/JwtAuthenticationProvider.authenticate (sgi-framework-spring/src/main/java/org/crue/hercules/sgi/framework/web/config/SgiWebSecurityConfig.java:90) checks the JWT signature with the injected JwtDecoder, and SgiJwtAuthenticationConverter.convert (SgiJwtAuthenticationConverter.java:26) builds the principal. That is verifiable-token validation, not a session lookup. The session verification in the oauth2Login branch (sgi-framework-spring/src/main/java/org/crue/hercules/sgi/framework/web/config/SgiWebSecurityConfig.java:120) is disabled by default."
},
{
"role": "Session manager",
"status": "missing",
"symbol": "",
"file": "",
"lines": "",
"notes": "Missing: sessionManagement(IF_REQUIRED) (sgi-framework-spring/src/main/java/org/crue/hercules/sgi/framework/web/config/SgiWebSecurityConfig.java:81) only lets Spring's HttpSessionSecurityContextRepository create a session as a side effect; the principal comes from the JWT on every request. A real session store is used only by the off-by-default oauth2Login flow (sgi-framework-spring/src/main/java/org/crue/hercules/sgi/framework/web/config/SgiWebSecurityConfig.java:116-124)."
},
{
"role": "Authorisation enforcer",
"status": "external",
"symbol": "invoke",
"file": "sgi-framework-spring/src/main/java/org/crue/hercules/sgi/framework/web/config/SgiSecurityConfig.java",
"lines": "18",
"notes": "After authentication the request reaches controller methods annotated @PreAuthorize (e.g. ConfigController.java:83); Spring's MethodSecurityInterceptor.invoke enforces them, activated by @EnableGlobalMethodSecurity(prePostEnabled = true) in SgiSecurityConfig (extended by sgi-csp-service/.../config/SecurityConfig.java:7), which plugs in the SgiMethodSecurityExpressionHandler (createExpressionHandler, line 34). Denials go to WebSecurityExceptionHandler (SgiWebSecurityConfig.java:134)."
},
{
"role": "Decider",
"status": "present",
"symbol": "hasAnyAuthorityNameForAnyUO",
"file": "sgi-framework-spring/src/main/java/org/crue/hercules/sgi/framework/security/access/expression/SgiMethodSecurityExpressionRoot.java",
"lines": "225",
"notes": "The @PreAuthorize expression hasAuthorityForAnyUO('CSP-CNF-E') (ConfigController.java:83) evaluates on SgiMethodSecurityExpressionRoot (created by SgiMethodSecurityExpressionHandler.createSecurityExpressionRoot) and flows hasAuthorityForAnyUO (line 132) -> hasAnyAuthorityForAnyUO (line 146) -> hasAnyAuthorityNameForAnyUO, which returns true/false by matching the required authority against the principal's authorities (UO suffix ignored)."
},
{
"role": "Policy provider",
"status": "present",
"symbol": "getAuthorities",
"file": "sgi-framework-spring/src/main/java/org/crue/hercules/sgi/framework/security/access/expression/SgiMethodSecurityExpressionRoot.java",
"lines": "296",
"notes": "Called by hasAnyAuthorityNameForAnyUO (line 227): returns the principal's granted authorities (via role hierarchy) stripped of UO suffixes. The authorities themselves are Keycloak realm_access roles mapped by jwtGrantedAuthoritiesConverter's convert (SgiWebSecurityConfig.java:213); the required privilege per action is the literal in each @PreAuthorize."
},
{
"role": "System",
"status": "present",
"symbol": "replaceConfiguracion",
"file": "sgi-csp-service/src/main/java/org/crue/hercules/sgi/csp/controller/ConfigController.java",
"lines": "84",
"notes": "Representative protected handler reached after the authentication chain and the @PreAuthorize check at line 83; it updates the CSP configuration via service.update. Many other controllers across the services follow the same pattern."
}
]
}

Xet Storage Details

Size:
5.09 kB
·
Xet hash:
85b5fd9b6ee70c6ef1315d5dce2facb6f4d1d664a796b944944d5a4f566cca24

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.