AnonymousSpottedToad/securityPatternsRecovery / ground_truth /java /authentication_pwd__scality_osis.json
| { | |
| "role_mappings": [ | |
| { | |
| "patternRole": "Subject", | |
| "entity": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "The login request (POST /api/v1/auth/login with JSON username/password) comes from an external OSIS client outside the repo; no in-repo UI/SDK/CLI sends it (only tests).", | |
| "status": "missing", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Enforcer", | |
| "entity": "LoginProcessingFilter", | |
| "file": "osis-core/src/main/java/com/scality/osis/security/jwt/login/LoginProcessingFilter.java", | |
| "lines": "32", | |
| "notes": "Installed for /api/v1/auth/login by OsisJwtWebSecurityConfigurerAdapter.filterChain (OsisJwtWebSecurityConfigurerAdapter.java:101), active by default (security.jwt.enabled matchIfMissing=true). attemptAuthentication (line 46) reads username/password and calls getAuthenticationManager().authenticate (line 58); unsuccessfulAuthentication (line 68) rejects via the failure handler.", | |
| "status": "present", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Verification manager", | |
| "entity": "authenticate", | |
| "file": "osis-core/src/main/java/com/scality/osis/security/jwt/login/LoginAuthenticationProvider.java", | |
| "lines": "39", | |
| "notes": "Reached from LoginProcessingFilter.java:58 via the AuthenticationManager registered with loginAuthenticationProvider (OsisJwtWebSecurityConfigurerAdapter.java:79). Extracts principal/credentials, loads the user (line 44) and checks the password with encoder.matches (line 49), returning a UserContext token or throwing BadCredentialsException.", | |
| "status": "present", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Password store", | |
| "entity": "loadUserByUsername", | |
| "file": "osis-core/src/main/java/com/scality/osis/security/platform/PlatformUserDetailsService.java", | |
| "lines": "23", | |
| "notes": "Called by LoginAuthenticationProvider.java:44. Single admin identity: access key and secret key come from config/Vault admin file via ScalityAppEnv.getPlatformSecretKey (ScalityAppEnv.java:41); caveat: secret is held in plaintext and bcrypt-hashed on load in PlatformUserDetails constructor (PlatformUserDetails.java:25).", | |
| "status": "present", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Hasher", | |
| "entity": "BCryptPasswordEncoder", | |
| "file": "osis-core/src/main/java/com/scality/osis/security/config/OsisJwtBeans.java", | |
| "lines": "28", | |
| "notes": "Spring Security bcrypt encoder bean instantiated in passwordEncoder() and injected into LoginAuthenticationProvider (OsisJwtBeans.java:34). The same encoder.matches call at LoginAuthenticationProvider.java:49 both hashes the supplied password with the stored salt and compares (one call covers Hasher and Comparator).", | |
| "status": "external", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Pepper store", | |
| "entity": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "No pepper on the login path (LoginAuthenticationProvider, PlatformUserDetailsService, OsisJwtBeans); bcrypt salt is not a pepper. Grep for pepper found nothing.", | |
| "status": "missing", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Encrypter", | |
| "entity": "", | |
| "file": "", | |
| "lines": "", | |
| "notes": "The bcrypt hash is not encrypted with a key on the verification path. AES256GCM (storage-platform-clients/.../security/crypto/AES256GCM.java:30) encrypts storage credentials/admin-file secrets, unrelated to password-hash peppering, so not used.", | |
| "status": "missing", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "Comparator", | |
| "entity": "matches", | |
| "file": "osis-core/src/main/java/com/scality/osis/security/jwt/login/LoginAuthenticationProvider.java", | |
| "lines": "49", | |
| "notes": "Called in LoginAuthenticationProvider.authenticate: BCryptPasswordEncoder.matches (Spring Security) compares the supplied password against the stored bcrypt hash from PlatformUserDetails.getPassword; same call also performs the hashing (Hasher).", | |
| "status": "external", | |
| "nodeId": null | |
| }, | |
| { | |
| "patternRole": "System", | |
| "entity": "onAuthenticationSuccess", | |
| "file": "osis-core/src/main/java/com/scality/osis/security/jwt/login/LoginAuthenticationSuccessHandler.java", | |
| "lines": "44", | |
| "notes": "Invoked by LoginProcessingFilter.successfulAuthentication (LoginProcessingFilter.java:64) after successful verification; issues access and refresh JWTs via JwtTokenFactory and writes them in the response.", | |
| "status": "present", | |
| "nodeId": null | |
| } | |
| ], | |
| "interaction_order": { | |
| "available": true, | |
| "language": "java", | |
| "repo": "scality_osis", | |
| "reason": "", | |
| "entryRole": "Enforcer", | |
| "entryRule": "behaviour", | |
| "interactions": [ | |
| { | |
| "rank": 1, | |
| "interaction": "Enforcer \u2192 Verification manager", | |
| "from": "Enforcer", | |
| "to": "Verification manager", | |
| "file": "osis-core/src/main/java/com/scality/osis/security/jwt/login/LoginProcessingFilter.java", | |
| "line": 58, | |
| "via": [ | |
| "[spring] ProviderManager.authenticate" | |
| ], | |
| "mechanism": "dispatch", | |
| "path": [ | |
| { | |
| "caller": "com.scality.osis.security.jwt.login.LoginProcessingFilter.attemptAuthentication:org.springframework.security.core.Authentication(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)", | |
| "file": "osis-core/src/main/java/com/scality/osis/security/jwt/login/LoginProcessingFilter.java", | |
| "line": 58, | |
| "code": "getAuthenticationManager().authenticate(token)", | |
| "callee": "com.scality.osis.security.jwt.login.LoginAuthenticationProvider.authenticate:org.springframework.security.core.Authentication(org.springframework.security.core.Authentication)", | |
| "mechanism": "dispatch", | |
| "route": "[spring] ProviderManager.authenticate" | |
| } | |
| ], | |
| "parent": "" | |
| }, | |
| { | |
| "rank": 2, | |
| "interaction": "Verification manager \u2192 Password store", | |
| "from": "Verification manager", | |
| "to": "Password store", | |
| "file": "osis-core/src/main/java/com/scality/osis/security/jwt/login/LoginAuthenticationProvider.java", | |
| "line": 44, | |
| "via": [], | |
| "mechanism": "dispatch", | |
| "path": [ | |
| { | |
| "caller": "com.scality.osis.security.jwt.login.LoginAuthenticationProvider.authenticate:org.springframework.security.core.Authentication(org.springframework.security.core.Authentication)", | |
| "file": "osis-core/src/main/java/com/scality/osis/security/jwt/login/LoginAuthenticationProvider.java", | |
| "line": 44, | |
| "code": "this.userService.loadUserByUsername(username)", | |
| "callee": "com.scality.osis.security.platform.PlatformUserDetailsService.loadUserByUsername:org.springframework.security.core.userdetails.UserDetails(java.lang.String)", | |
| "mechanism": "dispatch" | |
| } | |
| ], | |
| "parent": "Enforcer \u2192 Verification manager" | |
| }, | |
| { | |
| "rank": 3, | |
| "interaction": "Password store \u2192 Hasher", | |
| "from": "Password store", | |
| "to": "Hasher", | |
| "file": "osis-core/src/main/java/com/scality/osis/security/platform/PlatformUserDetails.java", | |
| "line": 25, | |
| "via": [ | |
| "com.scality.osis.security.platform.PlatformUserDetails.<init>:void(java.lang.String,java.lang.String)" | |
| ], | |
| "mechanism": "dependency-injection", | |
| "path": [ | |
| { | |
| "caller": "com.scality.osis.security.platform.PlatformUserDetailsService.loadUserByUsername:org.springframework.security.core.userdetails.UserDetails(java.lang.String)", | |
| "file": "osis-core/src/main/java/com/scality/osis/security/platform/PlatformUserDetailsService.java", | |
| "line": 27, | |
| "code": "new PlatformUserDetails(appEnv.getPlatformAccessKey(), appEnv.getPlatformSecretKey())", | |
| "callee": "com.scality.osis.security.platform.PlatformUserDetails.<init>:void(java.lang.String,java.lang.String)", | |
| "mechanism": "call" | |
| }, | |
| { | |
| "caller": "com.scality.osis.security.platform.PlatformUserDetails.<init>:void(java.lang.String,java.lang.String)", | |
| "file": "osis-core/src/main/java/com/scality/osis/security/platform/PlatformUserDetails.java", | |
| "line": 25, | |
| "code": "new BCryptPasswordEncoder()", | |
| "callee": "com.scality.osis.security.config.OsisJwtBeans.passwordEncoder:org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder()", | |
| "mechanism": "dependency-injection" | |
| } | |
| ], | |
| "parent": "Verification manager \u2192 Password store" | |
| }, | |
| { | |
| "rank": 4, | |
| "interaction": "Verification manager \u2192 Hasher", | |
| "from": "Verification manager", | |
| "to": "Hasher", | |
| "file": "osis-core/src/main/java/com/scality/osis/security/jwt/login/LoginAuthenticationProvider.java", | |
| "line": 49, | |
| "via": [], | |
| "mechanism": "dependency-injection", | |
| "path": [ | |
| { | |
| "caller": "com.scality.osis.security.jwt.login.LoginAuthenticationProvider.authenticate:org.springframework.security.core.Authentication(org.springframework.security.core.Authentication)", | |
| "file": "osis-core/src/main/java/com/scality/osis/security/jwt/login/LoginAuthenticationProvider.java", | |
| "line": 49, | |
| "code": "this.encoder.matches(password, user.getPassword())", | |
| "callee": "com.scality.osis.security.config.OsisJwtBeans.passwordEncoder:org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder()", | |
| "mechanism": "dependency-injection" | |
| } | |
| ], | |
| "parent": "Enforcer \u2192 Verification manager" | |
| }, | |
| { | |
| "rank": 5, | |
| "interaction": "Verification manager \u2192 Comparator", | |
| "from": "Verification manager", | |
| "to": "Comparator", | |
| "file": "osis-core/src/main/java/com/scality/osis/security/jwt/login/LoginAuthenticationProvider.java", | |
| "line": 49, | |
| "via": [], | |
| "mechanism": "call", | |
| "path": [ | |
| { | |
| "caller": "com.scality.osis.security.jwt.login.LoginAuthenticationProvider.authenticate:org.springframework.security.core.Authentication(org.springframework.security.core.Authentication)", | |
| "file": "osis-core/src/main/java/com/scality/osis/security/jwt/login/LoginAuthenticationProvider.java", | |
| "line": 49, | |
| "code": "this.encoder.matches(password, user.getPassword())", | |
| "callee": "org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder.matches:<unresolvedSignature>(2)", | |
| "mechanism": "call" | |
| } | |
| ], | |
| "parent": "Enforcer \u2192 Verification manager" | |
| } | |
| ], | |
| "anchoredRoles": [ | |
| { | |
| "role": "Comparator", | |
| "kind": "external" | |
| }, | |
| { | |
| "role": "Encrypter", | |
| "kind": "external" | |
| }, | |
| { | |
| "role": "Enforcer", | |
| "kind": "TYPE_DECL" | |
| }, | |
| { | |
| "role": "Hasher", | |
| "kind": "external" | |
| }, | |
| { | |
| "role": "Password store", | |
| "kind": "METHOD" | |
| }, | |
| { | |
| "role": "Pepper store", | |
| "kind": "external" | |
| }, | |
| { | |
| "role": "Verification manager", | |
| "kind": "METHOD" | |
| } | |
| ], | |
| "skippedRoles": [ | |
| "Subject", | |
| "System" | |
| ] | |
| } | |
| } |
Xet Storage Details
- Size:
- 11.6 kB
- Xet hash:
- aff2464bd6a2f1cc7999cc9bc5d213abffbda90d60579b8d40ee18170294cac1
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.