Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VAS] Story #11619: Multiple organizations on same domain mail #1695

Merged

Conversation

bbenaissa
Copy link
Collaborator

@bbenaissa bbenaissa commented Mar 19, 2024

Description

L'objectif de cette PR est de faire évoluer Vitamui pour q'un même domaine mail puisse pouvoir être intégré dans deux organisations différentes afin de pouvoir accéder aux archives des organisations.

Cette évolution concerne les parties suivantes :

  • l'authentification dans les modes suivants:
    • Interne
    • SSO en Open Id Connect
    • SSO en Saml2
    • Par Certificat
  • Subrogation avec compte interne et avec compte en délagation.
  • Mise à jour des écrans
  • l'ensemble des Workdlow de gestion des mot de passe

Type de changement:

  • Nouveau Code

  • Correction

Tests:

manuel

environnement

TU

Contributeur

VAS (Vitam Accessible en Service)

@bbenaissa bbenaissa requested a review from leleuj March 19, 2024 11:49
@vitam-devops
Copy link
Collaborator

vitam-devops commented Mar 19, 2024

Logo
Checkmarx One – Scan Summary & Detailsfeefc6dc-edd3-4921-9e8c-e59f574c70fe

New Issues

Severity Issue Source File / Package Checkmarx Insight
HIGH Passwords And Secrets - Generic Password /docker-compose.yml: 20 Query to find passwords and secrets in infrastructure code.
HIGH Passwords And Secrets - Generic Password /docker-compose.yml: 53 Query to find passwords and secrets in infrastructure code.
HIGH Passwords And Secrets - Generic Password /docker-compose.yml: 50 Query to find passwords and secrets in infrastructure code.
HIGH Passwords And Secrets - Generic Password /docker-compose.yml: 18 Query to find passwords and secrets in infrastructure code.
HIGH Passwords And Secrets - Generic Password /docker-compose.yml: 26 Query to find passwords and secrets in infrastructure code.
MEDIUM Cleartext_Submission_of_Sensitive_Information /api/api-iam/iam-internal/src/main/java/fr/gouv/vitamui/iam/internal/server/user/service/UserEmailInternalService.java: 98 Attack Vector
MEDIUM Cleartext_Submission_of_Sensitive_Information /api/api-iam/iam-external-client/src/main/java/fr/gouv/vitamui/iam/external/client/CasExternalRestClient.java: 84 Attack Vector
MEDIUM Container Traffic Not Bound To Host Interface /docker-compose.yml: 14 Incoming container traffic should be bound to a specific host interface
MEDIUM Container Traffic Not Bound To Host Interface /docker-compose.yml: 47 Incoming container traffic should be bound to a specific host interface
MEDIUM Healthcheck Not Set /docker-compose.yml: 41 Check containers periodically to see if they are running properly.
MEDIUM Healthcheck Not Set /docker-compose.yml: 4 Check containers periodically to see if they are running properly.
MEDIUM Memory Not Limited /docker-compose.yml: 4 Memory limits should be defined for each container. This prevents potential resource exhaustion by ensuring that containers consume not more than t...
MEDIUM Memory Not Limited /docker-compose.yml: 41 Memory limits should be defined for each container. This prevents potential resource exhaustion by ensuring that containers consume not more than t...
MEDIUM Privacy_Violation /api/api-iam/iam-external-client/src/main/java/fr/gouv/vitamui/iam/external/client/CasExternalRestClient.java: 211 Attack Vector
MEDIUM Privacy_Violation /api/api-iam/iam-external-client/src/main/java/fr/gouv/vitamui/iam/external/client/CasExternalRestClient.java: 131 Attack Vector
MEDIUM Privacy_Violation /api/api-iam/iam-external-client/src/main/java/fr/gouv/vitamui/iam/external/client/CasExternalRestClient.java: 131 Attack Vector
MEDIUM Privacy_Violation /api/api-iam/iam-external-client/src/main/java/fr/gouv/vitamui/iam/external/client/CasExternalRestClient.java: 158 Attack Vector
MEDIUM Privacy_Violation /api/api-iam/iam-internal/src/main/java/fr/gouv/vitamui/iam/internal/server/rest/CasInternalController.java: 180 Attack Vector
MEDIUM Privacy_Violation /api/api-iam/iam-external/src/main/java/fr/gouv/vitamui/iam/external/server/rest/CasExternalController.java: 100 Attack Vector
MEDIUM Privacy_Violation /api/api-iam/iam-external-client/src/main/java/fr/gouv/vitamui/iam/external/client/CasExternalRestClient.java: 211 Attack Vector
MEDIUM Privacy_Violation /api/api-iam/iam-internal/src/main/java/fr/gouv/vitamui/iam/internal/server/rest/CasInternalController.java: 180 Attack Vector
MEDIUM Privacy_Violation /api/api-iam/iam-external-client/src/main/java/fr/gouv/vitamui/iam/external/client/CasExternalRestClient.java: 131 Attack Vector
MEDIUM Privacy_Violation /api/api-iam/iam-external-client/src/main/java/fr/gouv/vitamui/iam/external/client/CasExternalRestClient.java: 131 Attack Vector
MEDIUM Privacy_Violation /api/api-iam/iam-external-client/src/main/java/fr/gouv/vitamui/iam/external/client/CasExternalRestClient.java: 158 Attack Vector
MEDIUM Privacy_Violation /api/api-iam/iam-internal/src/main/java/fr/gouv/vitamui/iam/internal/server/rest/CasInternalController.java: 180 Attack Vector
MEDIUM Privacy_Violation /api/api-iam/iam-internal/src/main/java/fr/gouv/vitamui/iam/internal/server/rest/CasInternalController.java: 184 Attack Vector
MEDIUM SSRF /api/api-iam/iam-external/src/main/java/fr/gouv/vitamui/iam/external/server/rest/CasExternalController.java: 163 Attack Vector
MEDIUM SSRF /api/api-iam/iam-external/src/main/java/fr/gouv/vitamui/iam/external/server/rest/CasExternalController.java: 163 Attack Vector
MEDIUM SSRF /api/api-iam/iam-external/src/main/java/fr/gouv/vitamui/iam/external/server/rest/CasExternalController.java: 164 Attack Vector
MEDIUM SSRF /api/api-iam/iam-external/src/main/java/fr/gouv/vitamui/iam/external/server/rest/CasExternalController.java: 143 Attack Vector
MEDIUM SSRF /api/api-iam/iam-external/src/main/java/fr/gouv/vitamui/iam/external/server/rest/CasExternalController.java: 142 Attack Vector
MEDIUM SSRF /api/api-iam/iam-external/src/main/java/fr/gouv/vitamui/iam/external/server/rest/CasExternalController.java: 100 Attack Vector
MEDIUM SSRF /api/api-iam/iam-external/src/main/java/fr/gouv/vitamui/iam/external/server/rest/CasExternalController.java: 101 Attack Vector
MEDIUM SSRF /cas/cas-server/src/main/java/fr/gouv/vitamui/cas/authentication/UserAuthenticationHandler.java: 107 Attack Vector
MEDIUM Security Opt Not Set /docker-compose.yml: 4 Attribute 'security_opt' should be defined.
MEDIUM Security Opt Not Set /docker-compose.yml: 41 Attribute 'security_opt' should be defined.
LOW Client_JQuery_Deprecated_Symbols /cas/cas-server/src/main/resources/static/js/cas.js: 74 Attack Vector
LOW Client_JQuery_Deprecated_Symbols /cas/cas-server/src/main/resources/static/js/cas.js: 40 Attack Vector
LOW Client_JQuery_Deprecated_Symbols /cas/cas-server/src/main/resources/static/js/cas.js: 39 Attack Vector
LOW Container Capabilities Unrestricted /docker-compose.yml: 4 Some capabilities are not needed in certain (or any) containers. Make sure that you only add capabilities that your container needs. Drop unnecessa...
LOW Container Capabilities Unrestricted /docker-compose.yml: 41 Some capabilities are not needed in certain (or any) containers. Make sure that you only add capabilities that your container needs. Drop unnecessa...
LOW Cpus Not Limited /docker-compose.yml: 4 CPU limits should be set because if the system has CPU time free, a container is guaranteed to be allocated as much CPU as it requests
LOW Cpus Not Limited /docker-compose.yml: 41 CPU limits should be set because if the system has CPU time free, a container is guaranteed to be allocated as much CPU as it requests
LOW Healthcheck Instruction Missing /Dockerfile: 6 Ensure that HEALTHCHECK is being used. The HEALTHCHECK instruction tells Docker how to test a container to check that it is still working
LOW Heap_Inspection /api/api-iam/iam-internal/src/main/java/fr/gouv/vitamui/iam/internal/server/user/service/UserInternalService.java: 539 Attack Vector
LOW Heap_Inspection /api/api-iam/iam-internal/src/main/java/fr/gouv/vitamui/iam/internal/server/cas/service/CasInternalService.java: 243 Attack Vector
LOW Heap_Inspection /api/api-iam/iam-internal/src/main/java/fr/gouv/vitamui/iam/internal/server/cas/service/CasInternalService.java: 225 Attack Vector
LOW Heap_Inspection /api/api-iam/iam-internal/src/main/java/fr/gouv/vitamui/iam/internal/server/cas/service/CasInternalService.java: 234 Attack Vector
LOW Heap_Inspection /api/api-iam/iam-internal/src/main/java/fr/gouv/vitamui/iam/internal/server/cas/service/CasInternalService.java: 240 Attack Vector
LOW Use_Of_Hardcoded_Password /deployment/scripts/mongod/1.0.0/101_iam_system_demo.js: 315 Attack Vector
LOW Use_Of_Hardcoded_Password /deployment/scripts/mongod/1.0.0/101_iam_system_demo.js: 269 Attack Vector
LOW Use_Of_Hardcoded_Password /cas/cas-server/src/main/java/fr/gouv/vitamui/cas/webflow/configurer/CustomLoginWebflowConfigurer.java: 76 Attack Vector
LOW Use_Of_Hardcoded_Password /cas/cas-server/src/main/java/fr/gouv/vitamui/cas/webflow/configurer/CustomLoginWebflowConfigurer.java: 66 Attack Vector
LOW Use_Of_Hardcoded_Password /cas/cas-server/src/main/java/fr/gouv/vitamui/cas/webflow/configurer/CustomLoginWebflowConfigurer.java: 82 Attack Vector
LOW Use_Of_Hardcoded_Password /cas/cas-server/src/main/java/fr/gouv/vitamui/cas/webflow/configurer/CustomLoginWebflowConfigurer.java: 68 Attack Vector

@lgheribi lgheribi force-pushed the vas-11619-multiple-organizations-on-same-domain-internal-auth branch 2 times, most recently from 5c69337 to 7d4ad70 Compare March 22, 2024 08:28
@bbenaissa bbenaissa force-pushed the vas-11619-multiple-organizations-on-same-domain-internal-auth branch from 625012c to daa0598 Compare March 26, 2024 14:50
@lgheribi lgheribi force-pushed the vas-11619-multiple-organizations-on-same-domain-internal-auth branch 4 times, most recently from 73fd224 to 50a992f Compare March 27, 2024 13:10
@bbenaissa bbenaissa force-pushed the vas-11619-multiple-organizations-on-same-domain-internal-auth branch 4 times, most recently from 67a8565 to 45d5ada Compare March 29, 2024 10:57
@bbenaissa bbenaissa changed the title Vas 11619 multiple organizations on same domain internal auth Vas 11619 multiple organizations on same domain mail Mar 29, 2024
@bbenaissa bbenaissa force-pushed the vas-11619-multiple-organizations-on-same-domain-internal-auth branch 2 times, most recently from 8637616 to 7dc6645 Compare March 29, 2024 11:12
@GiooDev GiooDev changed the title Vas 11619 multiple organizations on same domain mail [VAS] Story #11619: Multiple organizations on same domain mail Mar 29, 2024
@GiooDev GiooDev added this to the IT 133 milestone Mar 29, 2024
@bbenaissa bbenaissa force-pushed the vas-11619-multiple-organizations-on-same-domain-internal-auth branch 2 times, most recently from 88fd5cc to a272c6b Compare March 30, 2024 09:52
@@ -9,17 +9,17 @@ These components are a set of REST/JSON web services to perform CRUD operations
- profiles
- users.

There are composed of the web services themselves (api-iam-server module), the REST clients of these web services (api-iam-client module) and the DTOs shared between the two modules (api-iam-common module).

There are composed of the web services themselves (api-iam-server module), the REST clients of these web services (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pourquoi ces sauts de lignes ici ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simple formatage. Markdown ignore les simples hauts

@@ -135,5 +135,6 @@ public class IdentityProviderDto extends CustomerIdDto {

private Boolean usePkce;

// FIXME : Convert to enum
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

À faire maintenant ou créer une story pour pas l'oublier.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

à faire plus tard en clean code

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attention à la divergence de code avec la future CAS v7.

checkResponse(response);
}

public UserDto getUserByEmail(final ExternalHttpContext context, final String email, final Optional<String> embedded) {
// FIXME : getUserByEmail vs getUser
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

À faire maintenant ou créer une story pour pas l'oublier.

checkResponse(response);
}

public UserDto getUserByEmail(final ExternalHttpContext context, final String email, final Optional<String> embedded) {
// FIXME : getUserByEmail vs getUser
@VisibleForTesting
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

La documentation de l'annotation VisibleForTesting indique :

Do not use this interface for public or protected declarations: it is a fig leaf for bad design, and it does not prevent anyone from using the declaration

(voir https://guava.dev/releases/snapshot-jre/api/docs/com/google/common/annotations/VisibleForTesting.html)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, en plus c'était pas si test only. Je supprime

th:href="@{/css/cas.css}"/>
<link rel="stylesheet" type="text/css" href="../../static/icons/vitamui-icons.css"
th:href="@{/icons/vitamui-icons.css}"/>
<script type="text/javascript" src="../../../../../../deployment/roles/reverse/files/apache/page/js/jquery.min.js"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jquery

th:href="@{/css/cas.css}"/>
<link rel="stylesheet" type="text/css" href="../static/icons/vitamui-icons.css"
th:href="@{/icons/vitamui-icons.css}"/>
<script type="text/javascript" src="../../../../../../deployment/roles/reverse/files/apache/page/js/jquery.min.js"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jquery

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ces changements ne devraient-ils pas être faits dans v7.1 plutôt ?

@ebernard ebernard marked this pull request as ready for review April 2, 2024 15:09
@bbenaissa bbenaissa force-pushed the vas-11619-multiple-organizations-on-same-domain-internal-auth branch from a272c6b to 8c837c0 Compare April 2, 2024 15:22
@ebernard
Copy link
Contributor

ebernard commented Apr 2, 2024

Mes retours sont non bloquants, vous pouvez merger, mais il faudra peut-être les traiter par la suite.

@GiooDev GiooDev merged commit 5efc2ac into develop Apr 2, 2024
1 check passed
@GiooDev GiooDev deleted the vas-11619-multiple-organizations-on-same-domain-internal-auth branch April 2, 2024 15:44

/**
* Tests {@link IdentityProviderHelper}.
*
*
*/
public final class IdentityProviderHelperTest {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je ne vois pas de tests sur les nouvelles méthodes : findAllByUserIdentifier, findByUserIdentifierAndCustomerId et identifierMatchProviderPattern.

throw new ApplicationServerException("Unable to update password : customer not found");
}
User user = findUserByEmailAndCustomerId(email, customerId);
if (UserTypeEnum.NOMINATIVE != user.getType()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exemple de test manquant : je ne crois pas que ce cas soit testé quelque part...

numériques (0-9)
</li>
<li>
caractères spéciaux (!"#$%&£'()*+,-./:;<=>?@[]^_`{|}~)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'ai l'impression que ce bloc est statique + des soucis de substitution :

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants