<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Fabien BERTEAU on Medium]]></title>
        <description><![CDATA[Stories by Fabien BERTEAU on Medium]]></description>
        <link>https://medium.com/@fabien.berteau?source=rss-2989c4ca96bc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Dum6eP-6DsWMaeA6</url>
            <title>Stories by Fabien BERTEAU on Medium</title>
            <link>https://medium.com/@fabien.berteau?source=rss-2989c4ca96bc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 21:21:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@fabien.berteau/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How we secured calls between microservices at ManoMano]]></title>
            <link>https://medium.com/manomano-tech/microservices-security-c70c2d229920?source=rss-2989c4ca96bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/c70c2d229920</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[istio]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[zero-trust]]></category>
            <dc:creator><![CDATA[Fabien BERTEAU]]></dc:creator>
            <pubDate>Tue, 30 May 2023 07:43:03 GMT</pubDate>
            <atom:updated>2023-05-30T07:57:00.904Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*BwN2-5niFPXGR1Gi.jpeg" /></figure><p>Another step towards zero trust for ManoMano’s information system.</p><p>No matter how strong and high your peripheral protections may be, someone, someday, will manage to overcome them. You should therefore never consider your backend to be a fundamentally secure place.</p><p>If, like us, you have opted for a microservices-based architecture, it means that someone, one day, will take control of one of your components and will try to exploit every opportunity to steal your data or damage your system. Your mission is therefore twofold: on the one hand, to do everything to make their task difficult, if not impossible, and on the other hand, to put in place tools to detect any suspicious activity.</p><p>In this article, I will focus on the first part by explaining to you how, at ManoMano, we limit the possibility for a hacker to navigate as he pleases in our system. Explaining how we monitor will be the subject of another article.</p><p>In a microservices-based architecture, it’s all about the call tree where clients follow paths offered by service providers. It’s a constructive and positive way to look at it, but from a hacker’s perspective, it’s also an opportunity to explore all of your APIs from the moment they’ve managed to break into the system. So the first thing to do is to <strong>limit the possibilities of calls between components to those legitimately accepted by the functional architecture</strong> and to reject all the others.</p><p>In this way, a hacker who has taken control of a component is limited in his movements and in the APIs he can query to those that this component has been authorized to use. Accessing a particular API will require a lot more effort from him since he will have to take the right entry point, the one that will allow him to end up ultimately at the API or backend he is looking for. Finally, this will require on his part a perfect preliminary knowledge of your microservices architecture: things then get slightly complicated for him.</p><h3>Limit the possibilities of calls</h3><p>ManoMano has adopted <a href="https://istio.io/latest/"><strong>Istio</strong></a> as their service mesh to secure communication between microservices by using its <a href="https://istio.io/latest/docs/reference/config/security/authorization-policy/">authorization policies</a>. Istio provides all the necessary components for microservices identification, authentication, and authorization, including a Certificate Authority (CA), an API server for distributing policies and secure naming information, and sidecar and perimeter proxies that function as Policy Enforcement Points (PEPs). Envoy is used to implement PEPs, and the control plane manages configuration from the API server to configure the data plane PEPs. The architecture is illustrated in this diagram provided by Istio documentation:</p><figure><img alt="Istio Security Architecture" src="https://cdn-images-1.medium.com/max/1024/1*lzSgIr4uUbkwzOFPO-Icow.png" /></figure><p>The Istio identity model uses service identity to authenticate and authorize communication between services. Each service instance has its own unique identity, which can be used to establish trust between services in the mesh.</p><p>Service accounts are used as service identities in our Kubernetes platform, while other identities such as user accounts or custom service accounts can be used in other platforms. By using service identities, Istio can provide fine-grained control over access to services, enforce policies, and provide audit trails.</p><p>Istio uses X.509 certificates to provision strong identities to every workload, and automate key and certificate rotation at scale. Istio agents work with <strong><em>istiod</em></strong> to sign certificate signing requests (CSRs) and generate provides all the necessary components for identification, authentication, certificates. Envoy requests the certificate and key from the Istio agent via the Envoy secret discovery service (SDS) API. The Istio agent monitors the certificate’s expiration and performs periodic certificate and key rotation.</p><p>Istio provides two types of authentication:</p><ul><li>peer authentication for service-to-service authentication</li><li>and request authentication for end-user authentication.</li></ul><p>Peer authentication uses <strong>mutual TLS</strong> for transport authentication with strong identity, security, and key management automation. Request authentication supports JSON Web Token (JWT) validation and custom/OpenID Connect providers. Authentication policies are stored in the Istio config store and Istiod keeps them up-to-date for each proxy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*fpfDDjJMdku4PICF9ZANfA.png" /></figure><p>ManoMano has adopted Kubernetes to automate the deployment, scaling, and management of containerized applications.<strong> Istio therefore uses service accounts to identify workloads and provide mTLS connections</strong>. At the moment, we haven’t connected our Keycloak user authorization server to Istio, so we just give it service-to-service authorization but no per request authorization.</p><h3>Service-to-service authorization policies</h3><p>Istio’s access control is enforced through authorization policies, which are specified using YAML files. For example:</p><pre>apiVersion: security.istio.io/v1<br>kind: AuthorizationPolicy<br>metadata:<br> name: httpbin<br> namespace: foo<br>spec:<br> selector:<br>   matchLabels:<br>     app: httpbin<br>     version: v1<br> action: ALLOW<br> rules:<br> - from:<br>   - source:<br>       principals: [&quot;cluster.local/ns/default/sa/sleep&quot;]<br>   - source:<br>       namespaces: [&quot;dev&quot;]<br>   to:<br>   - operation:<br>       methods: [&quot;GET&quot;]<br>   when:<br>   - key: request.auth.claims[iss]<br>     values: [&quot;https://accounts.google.com&quot;]</pre><p>These policies define rules for controlling access to specific microservices or paths within a microservice, based on various criteria but at ManoMano, we base it only on calling microservice identity. When a request is received by an Envoy proxy, it is processed through a chain of filters, including the authorization filter. This filter consults the appropriate authorization policy to determine whether the request should be allowed or denied based on the defined rules.</p><p>Istio’s authorization features are available after installation, and there’s no need to enable them explicitly. However, to enforce access control for your workloads, you’ll need to apply an authorization policy. If there are no authorization policies applied to a workload, Istio will allow all requests. Conversely, <strong>as soon as an authorization policy is applied to a component, all calls not explicitly authorized are now prohibited</strong>. This is an extremely important rule to know when deploying a security policy based on this model.</p><p>Authorization policies in Istio support three actions: ALLOW, DENY, and CUSTOM. You can apply multiple policies with different actions to secure access to your workloads.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/683/1*AonRaHutnhb9TDj6dZs8Cg.png" /></figure><p>To configure an authorization policy in Istio, you create an AuthorizationPolicy custom resource with a selector, action, and rules. The selector specifies the target, the action specifies allow or deny, and the rules specify when to trigger the action based on sources, operations, and conditions. Matching schemas can be used for fields, and exclusion matching is available for negative conditions. Additionally, the “deny by default” behavior applies if there are no ALLOW policies, and the source section can be left empty to allow access for both authenticated and unauthenticated identities.</p><p>At ManoMano, each development team responsible for a client microservice has the ability to push an authorization policy into a service provider’s GIT repository. It results in a merge request which, if accepted, will push the client authorization policy in the Istio infrastructure. But in order to simplify the deployment process for developers and avoid the need for them to support a new technology, ManoMano has decided to integrate the technology into the existing I<em>nfrastructure as Code</em> library as a dedicated extension for dependency management.</p><h3>Spinak-IaC</h3><p>Spinak-IaC is our next-generation <em>Infrastructure as a Code</em> library built on top of <strong>CDK-Terraform </strong>and <strong>CDK8s</strong> to manage application infrastructure. It provides a curated experience to reduce cognitive load and infrastructure complexity, while also embedding security best-practices by default.</p><p>With Spinak-IaC, we improve developer experience, speed up time to production, reduce misconfiguration and infrastructure deployment issues, and get started quickly with a turnkey solution that is secure and ready to go. It allows us to code our infrastructure the same way we code any other application, and provides a powerful and fully customizable pipeline based on our guidelines to help our developers get started with ease.</p><p>SpinaK has a dependency and authorization system that distinguishes between local and external components. Local components are owned by the current project, while external components belong to other projects. Dependency management involves configuring a component with the necessary information, such as environment variables, to access another component using the <strong><em>configureAccess</em></strong> function:</p><pre>target.configureAccess(client);</pre><p>Additionally, SpinaK has added an authorization mechanism to explicitly grant access to specific components between different projects in a controlled and secure way. Each component has its own specific authorization process, but SpinaK provides a common way to manage it by calling a function starting with “<strong><em>grant</em></strong>” on the target component from within the owning project.</p><pre>target.grantAccess(client);</pre><p>The SpinaK service-to-service authorization feature <strong>requires the use of Istio as the service mesh provider</strong>, with the authorization feature enabled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K3BL0Ijp2Dy0z8DluE7QHw.png" /></figure><p>In a scenario where there are two projects (project A and project B) and three services (service A, service B, and service C), service A from project A needs to call both service B from project B and service C from project A.</p><p>To achieve this, the following configuration is required:</p><ul><li>Service A must be configured by an <strong><em>ExternalService</em></strong> B object using the function <strong><em>extServiceB.configureAccess(serviceA)</em></strong> to know how to contact Service B.</li><li>Service A must also be configured by a service C object using the function <strong><em>serviceC.configureAccess(serviceA)</em></strong> to know how to contact Service C.</li><li>Service C must grant access to Service A using the function <strong><em>serviceC.grantAccess(serviceA, {…options})</em></strong>.</li><li>Service B must grant access to Service A using <strong><em>ExternalService</em></strong> A object using the function <strong><em>serviceB.grantAccess(extServiceA, {…options})</em></strong>.</li></ul><p>Below the corresponding SpinaK configuration.</p><p>Project A configuration</p><pre>const app = new App();<br><br>const serviceA = new EksApi(app, ...);<br>const serviceC = new EksApi(app, ...);<br>const extServiceB = new ExternalEksComponent(app, ...);<br><br>extServiceB.configureAccess(serviceA); // Injection of the variables needed to contact service B from service A<br><br>serviceC.configureAccess(serviceA);<br>serviceC.grantAccess(serviceA, {<br>    resources: [<br>        {<br>            paths: [&#39;/api/*&#39;],<br>            methods: [&#39;GET&#39;]<br>        }<br>    ]<br>});<br><br>app.synth();</pre><p>Project B configuration</p><pre>const app = new App();<br><br>const serviceB = new EksApi(app, ...);<br><br>const extServiceA = new ExternalEksComponent(app, ...);<br><br>serviceB.grantAccess(extServiceA, {<br>    resources: [<br>        {<br>            paths: [&#39;/api/*&#39;],<br>            methods: [&#39;GET&#39;]<br>        }<br>    ]<br>});<br><br>app.synth();</pre><p>There are additional factors to consider in achieving the goal of authorizing every service to consume another. The adoption process will result in some services running inside the Istio mesh, which will be authenticated and known by Istio, while others will run outside the mesh and be anonymous from the Istio perspective. This distinction will have significant implications for the ability to authorize services.</p><h4>Deployment</h4><p>When we have implemented this new security model, Istio was not deployed to all of our components. Some were still using our old service mesh. Therefore, we have considered three types of components: those whose consumers and themselves were all managed by Istio, those who were not managed by Istio at all, and those who were managed by Istio themselves but at least one consumer was not.</p><p>The first category is the simplest in terms of security policy. In this category, each component has migrated on Istio and has the ability to deploy an authorization policy. Once all consumers of a service have migrated to Istio, the implementation of authorization policies in a service provider must be done either for all of them at the same time or not at all. This is because upon deploying the first policy, all other calls not explicitly defined by it will be denied, potentially breaking your environment. The service provider itself then operates in STRICT mode, which means that it only accepts mTLS connections. This strict security policy is the target to achieve optimal service security.</p><p>The second category is simply a candidate to be integrated into the first and is therefore included in the Istio deployment roadmap. However, to achieve this goal, it will be necessary to temporarily pass through the third category. In this third category, the Istio deployment is partial, in the sense that the service provider is already supported by Istio, but not all of its consumers. For this, Istio proposes to operate this component in PERMISSIVE mode, which means that it will accept mTLS connections from consumers already supported by Istio and non-secure connections for those who are not yet supported. This is a kind of boundary mode.</p><p>However, it is important to be cautious when deploying authorization policies on a service provider in this mode, as once such a policy is in place, any unauthorized calls, whether by this policy or another, will be automatically rejected. This will inevitably be the case for components that are not yet supported by Istio, as these policies are based on the identity of a component, which can only be known once the consumer is supported by Istio. A workaround would be to implement a very permissive authorization policy that allows all incoming calls, but this would not be very useful and could create problems in the future. It is therefore preferable to do nothing until all consumers have migrated.</p><h3>Conclusion</h3><p>This management of authorized peer-to-peer call paths has substantially increased the difficulty for a hacker who breaks into our backend to compromise our system. This new architecture represents an important step forward in the implementation of our zero trust policy which will require a long phase of adjustment and deployment. However, it calls for other steps, such as superimposing authorization policies based on user requests, or entrusting the validation of internal tokens to Istio rather than to our in-house libraries.</p><h3>We ❤️ learning and sharing</h3><p>If you’d like to get in touch on any of the subjects above or about QA in general, I’m always reachable through my <a href="https://www.linkedin.com/in/fabien-berteau-security-architect/">LinkedIn profile</a>. Drop me a line! Whether you had a similar or totally different experience, I’d love to hear about it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c70c2d229920" width="1" height="1" alt=""><hr><p><a href="https://medium.com/manomano-tech/microservices-security-c70c2d229920">How we secured calls between microservices at ManoMano</a> was originally published in <a href="https://medium.com/manomano-tech">ManoMano Tech team</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Protecting your digital identity: a new approach]]></title>
            <link>https://medium.com/manomano-tech/protecting-your-digital-identity-a-new-approach-31a27d458681?source=rss-2989c4ca96bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/31a27d458681</guid>
            <category><![CDATA[mfa]]></category>
            <category><![CDATA[identity]]></category>
            <category><![CDATA[sso]]></category>
            <category><![CDATA[identity-management]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <dc:creator><![CDATA[Fabien BERTEAU]]></dc:creator>
            <pubDate>Wed, 12 Jan 2022 09:35:16 GMT</pubDate>
            <atom:updated>2022-02-18T09:46:58.078Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uaNeaMIyLHl5Q35kiSbWzw.jpeg" /></figure><p>Relations between internet users and the digital world have changed a lot since the creation of the web, but today we are faced with crucial issues around digital identities: respect for privacy, anonymity, identity theft, trust in the web, user protection and especially the protection of children, etc. The challenges are numerous but a part of the solution might come from the concepts of <strong>Root Digital Identity</strong> (<strong>RDI</strong>) and <strong>Derived Digital Identity</strong> (<strong>DDI</strong>) that I will propose to you.</p><p>After having briefly presented you with a history of authentication on the web and the current problem, I will try to convince you that this new identity model could be the next step in our relationship to the digital world.</p><h3>A little bit of history</h3><p>Before presenting (R|D)DI) to you, I would like to come back for a moment to the history of digital identities over the past 20 years or so, and from the point of view of the identification and authentication steps. I have had the chance to be present near the beginning of the web, and from the moment it started to offer something other than static information, this changing content mainly depended on who was accessing it. We thus had to deal with user <strong>identification</strong> by providing each user with an <strong>unique identifier</strong>, but because the data was mostly private, we also had to be sure that the person requesting it was the legitimate one, so we asked it to prove who it pretended to be: welcome <strong>authentication</strong>!</p><p>This is when the concept of <a href="https://en.wikipedia.org/wiki/Digital_identity"><strong>Digital Identity</strong></a> (<strong>DI</strong>) emerged. It was simply a way for a <strong>physical person</strong> like you and me to tell to a digital application: “<em>Hey, I am Joe, and I can prove it</em>”. A DI is made up of a unique identifier such as “<em>joe</em>”, and a means of proving that you are the natural person who created this identifier. At the beginning this mean was a simple <strong>secret password</strong> that a physical person shared with the application when creating the account.</p><h3>Where problems come</h3><p>It didn’t stay that easy for very long because this approach posed two problems. The first concerns the ease with which a malicious person could take over the real owner of an account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uP03MU-BTvmQdAZGpqgHDQ.png" /></figure><p>The solution first consisted in increasing the password complexity, to finally introduce the principle of <a href="https://en.wikipedia.org/wiki/Multi-factor_authentication"><strong>Multi Factor Authentication</strong></a> (<strong>MFA</strong>), that is to say that in addition to the password, you are also asked for a second verification factor, for example a code received on your phone.</p><h3>SSO</h3><p>The second problem is about the fact that users had to create an account in each website. The proliferation of <strong>credentials</strong> to remember has resulted in overly simple passwords, sticky notes stuck under keyboards and brute force attacks. The solution here was the creation of <a href="https://en.wikipedia.org/wiki/Single_sign-on"><strong>Single Sign On</strong></a> systems (<strong>SSO</strong>), simple principle where a user authenticates once to an SSO trusted by a number of applications. The user can then switch between them without having to authenticate each time. Only one credential to remember… in the perimeter of this group of applications. The actual limit of this approach is that even if this decreases the number of credentials to remember, there are still too many.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*qJBeAOX3si-wekvAaCQRJA.png" /></figure><h3>New requirements</h3><p>Furthermore, you have surely noticed that there is no evidence that the real name of the physical person that use the “<em>joe</em>” identifier is really <em>Joe</em>. Surely the real name in the civil register is not <em>Joe</em>; who knows? Is it a problem ? For the tax administration or the civil register, yes it is, because it is a matter of juridical reliability, security and privacy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*rBNCwk4cTyinJLDug4fsFQ.png" /></figure><p>Nowadays, society is starting to ask itself some healthy questions about digital identities. What if this adult website knew a child was visiting it? Would it continue to allow it? I’m not sure. Until today, digital identities have protected people’s privacy by <strong>masking their real identity</strong> when they were faced with a website, but have they really protected them by connecting them? I’m not sure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*nZhfoVtAEPo53-zmdxKdDQ.png" /></figure><p>For some time now, we have been facing new requirements in terms of identifying the users of an online service. Until then, we have been able to content ourselves with <strong>self-asserting digital identities</strong>, that is to say where the user could declare what he wanted <strong>without any verification</strong> being necessary on the part of the service provider. This is possible when neither the user nor the website is at serious risk for their reputation, financial loss or other possible damage (<a href="https://pages.nist.gov/800-63-3/">NIST 800–63</a>). But this is less and less the case with the proliferation of online services where actors engage their legal responsibility, their finances or their private life and expose them to ever more numerous dangers: identity theft, harassment, invasion of privacy, fraud, etc. We increasingly need to know who is behind the keyboard, but until recently no company could afford to do so.</p><h3>The light comes from above</h3><p>The main factor in the development of digital identities since their inception has been social networks and online business, but for a while now, public services have not been left out. Because knowing precisely the identity of a user was vital for them they have developed initiatives aimed at providing their citizens with <strong>certified and high-quality digital identities</strong> allowing them to authenticate themselves on their own online services (e.g. <a href="https://franceconnect.gouv.fr/">France Connect</a> ). But until recently, these identities were exclusively reserved for their own use, it was impossible for a private company to connect to it. But the trend is changing.</p><p><a href="https://digital-strategy.ec.europa.eu/en/policies/eidas-regulation"><strong>eIDAS</strong></a> (<strong>e</strong>lectronic <strong>ID</strong>entification, <strong>A</strong>uthentication and trust <strong>S</strong>ervices) is an european regulation that simplifies electronic identification and trust services for electronic transactions in the European Union’s internal market. It regulates electronic signatures, electronic transactions, involved bodies, and their embedding processes to provide a safe way for users to conduct business online. Concretely, each state of the European Union is providing public services, private companies and citizens with digital identities guaranteed by the state that created them and can be used with confidence anywhere within the union. For example the french supplier is the <a href="https://lidentitenumerique.laposte.fr/"><strong><em>identité numérique</em></strong></a><strong><em> </em></strong>provided by <em>La Poste</em>. We can find the same types of suppliers in every country of the European Union.</p><p>This is an important step in the direction of better protection of the citizens on the web because this will increase the level of difficulty to impersonate such a digital identity to a level never reached before, and because the highest court will guarantee the accuracy of the data. But our leaders must not forget a crucial point.</p><blockquote>Private companies will be major players in the success of the eIDAS initiative.</blockquote><p>Without them, it will remain a confidential initiative useful only in public services or so. The reason is that it can also be a great opportunity<strong> </strong>for them to greatly facilitate the user experience while significantly reducing the number of frauds they have to face.</p><h3>Corrections to be made</h3><p>But that will not be enough, it will require additional steps. In the same way that obtaining an identity document for free if one asks for it is a fundamental right in our societies, every citizen of the European Union should be able to have an eIDAS digital identity if they request it, which is the case now in France. Then, <strong>we must provide these digital identities for free to all the private companies</strong>. This is the only way to convince them to switch from their own <strong>uncertified</strong> digital identities.</p><blockquote><strong>eIDAS digital identities must not be marketed</strong>.</blockquote><h3>Beyond</h3><p>Finally, we should provide internet users with a way to benefit from the best of both worlds: a <strong>strong digital identity and preservation of their anonymity and privacy</strong>.</p><p>What we need to be aware of is that a <strong>strong digital identity also implies a strong authentication</strong>, therefore of the MFA type, which are provided by all the national suppliers in the EU. Technically speaking, a secured user session will be created at this time, and by means of this digital identity, the website is therefore integrated into a vast <strong>European-scale Single Sign-On system</strong>. In a nutshell, no need for each company to create insecure onboarding processes since they will rely on the user’s eIDAS digital identity. The only parameters necessary for the creation of his account will be extracted and transmitted to the trusted website.</p><p>What I am describing is great for a public service where knowing the precise identity of the user is required, but <strong>users are not always keen on sharing their precise identity</strong> on all the sites that they visit. They should therefore be able to <strong>blur their digital identities</strong>.</p><blockquote>To blur but not to lie.</blockquote><p>The blurring operation should not change the gender, whether we are over 18 or not because that could have serious consequences. On the other side, we should be able to blur our personal address by removing the street name or the city name, but not to change them, because it’s lying, or the country and so on. We should also be able to use a pseudonym, another email address another telephone number depending on the specific application context.</p><h3>(R|D)DI</h3><p>All of this is possible with the concepts of <strong><em>Root Digital Identity</em></strong> (<strong>RDI</strong>) and <strong><em>Derived Digital Identity</em></strong> (<strong>DDI</strong>). Expressed as a regular expression, this gives: <strong>(R|D)DI</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/993/1*GuLtmf7V5krvGJ8q-L6BLA.png" /></figure><p><strong>RDI should be nothing more than the european eIDAS digital identity</strong> of the user. It consists of precise information, certified and protected by the member states of the European Union. The user has no possibility to change any part of it. <strong>This is their digital truth</strong>. Since identifiers will be managed by the eIDAS identity provider, we would thus arrive at the much awaited state where the users would only have to authenticate themselves once with this european-scale SSO.</p><p>From there, the <strong>user can create as many DDIs as he wants from his RDI on a dedicated DDI identity provider</strong>, by blurring some informations but without ever lying, as seen previously. Joe can disguise himself as Mowgli but will always remain a grown man.</p><blockquote><strong>Everyone will know which information is certified and which others are blurred</strong>.</blockquote><p>Thus, a certain level of trust can be established between two digital identities who wish to interact online. These DDI could be used as an avatar for some particular websites. User could even create a different one for each site.</p><blockquote>All the user’s DDIs will be linked to his RDI.</blockquote><p>Websites just have to propose to use one or more trusted intermediaries DDI identity providers (“Connect with <em>&lt;your DDI IDP&gt;</em>”) to automatically fetch certified and blurred data from user in order to create local account. By doing this, the DDI IDP will redirect the user to his eIDAS (<em>RDI</em>) IDP to authenticate himself. The authentication context will define which DDI must be sent to the website.</p><blockquote>The website will at no time have the possibility of obtaining a direct reference to the RDI.</blockquote><p>RDI data will remain completely private at all times. Websites will never have the possibility of knowing exactly who the user is, unless the user wishes, of course. The DDI IDPs can be even chained together step by step up to the RDI eIDAS IDP, and this in a completely transparent way for the user. In this way, a large website could offer their users a local DDI IDP which would be connected to a public one.</p><h3>And what about our childs ?</h3><p>We should then go one step further by providing one to each member of a household as soon as they start school, because <strong>our children are heavy consumers of online services </strong>and need a lot more protection than we can not currently provide them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*u52aVBKBFonUv7LEpHxyaQ.png" /></figure><h3>Close to the goal</h3><p>If the member states of the European Union play the game by providing these digital identities for free and for all the family, and private companies make the effort to provide DDI services and connect their systems to it, then we could be very close to a big step forward in the protection of Internet users of all ages.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31a27d458681" width="1" height="1" alt=""><hr><p><a href="https://medium.com/manomano-tech/protecting-your-digital-identity-a-new-approach-31a27d458681">Protecting your digital identity: a new approach</a> was originally published in <a href="https://medium.com/manomano-tech">ManoMano Tech team</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why we should no longer use bearer tokens to protect sensitive Single Page Applications?]]></title>
            <link>https://medium.com/manomano-tech/why-we-should-no-longer-use-bearer-tokens-to-protect-sensitive-single-page-applications-a7597c6c3097?source=rss-2989c4ca96bc------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7597c6c3097</guid>
            <category><![CDATA[openid-connect]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[platform-engineering]]></category>
            <category><![CDATA[single-page-applications]]></category>
            <category><![CDATA[oauth2]]></category>
            <dc:creator><![CDATA[Fabien BERTEAU]]></dc:creator>
            <pubDate>Wed, 13 Oct 2021 13:30:26 GMT</pubDate>
            <atom:updated>2022-02-03T08:48:44.161Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tR6eiODO_OomMP9FhEGozA.jpeg" /></figure><p>Nowadays, most of the web application are developed in the form of <a href="https://en.wikipedia.org/wiki/Single-page_application">Single Page Applications</a> (SPA), thanks to the many JavaScript frameworks that one can find. These frameworks take care of the presentation and control layers while calling on web services which take care of the data model.</p><p>A SPA needs to authenticate its users and to restrict access to its features. The level of security required depends on the maximum level of risk assumed by the user or by the owner of the application. You don’t securize a simple portal application as a bank accounting one. In the first case a simple login/password may suffice, but a strong <a href="https://en.wikipedia.org/wiki/Multi-factor_authentication">Multi-Factor Authentication</a> (MFA) is required in the last one.</p><p>Many technologies have been proposed in the past to deal with this problem, but few of them seem to be able to respond to these modern architectures. One of them seems to have won all the votes since its evolution in 2012: <a href="https://openid.net/connect/">OpenId Connect</a>. Based on the oldest <a href="https://oauth.net/2/">OAuth 2.0</a>, it is entirely based on the exchange between stakeholders of a bearer type security token.</p><blockquote>This specification describes how to use bearer tokens in HTTP requests to access OAuth 2.0 protected resources. Any party in possession of a bearer token (a “bearer”) can use it to get access to the associated resources (without demonstrating possession of a cryptographic key). To prevent misuse, bearer tokens need to be protected from disclosure in storage and in transport.</blockquote><blockquote>The OAuth 2.0 Authorization Framework: Bearer Token Usage, RFC 6750</blockquote><p>I underline:</p><blockquote>To prevent misuse, <strong>bearer tokens need to be protected from disclosure in storage and in transport</strong>.</blockquote><p>Of course <a href="https://en.wikipedia.org/wiki/Transport_Layer_Security">Transport Layer Security</a> (TLS) is essential and today everywhere present to protect the transport, but what about the storage?</p><p>Yet everything was fine as long as we have isolated the code from the controller and the data layers within our infrastructure in what OAuth calls confidential clients: PHP, Java (etc.) legacy applications. These tokens were never transmitted to the browser because they were stored in the user session. They were retrieved each time the browser called an URL by transmitting the session cookie of the user.</p><p>But there is a slight problem in the case of our dear SPAs, because whatever the care taken to recover this token with <a href="https://connect2id.com/products/nimbus-oauth-openid-connect-sdk/examples/oauth/pkce#:~:text=PKCE%20(pronounced%20%22pixy%22),sneaked%20into%20the%20same%20device.">Proof Key for Code Exchange</a> (PKCE) or any other way, <strong>token is finally stored in the browser and therefore it becomes sensitive to </strong><a href="https://en.wikipedia.org/wiki/Cross-site_scripting"><strong>Cross-Site Scripting</strong></a><strong> (XSS) attacks</strong> than can lead to massive token leaks. Remember that PKCE was designed to protect OAuth public clients from<strong> </strong><a href="https://en.wikipedia.org/wiki/Cross-site_request_forgery">Cross-Site Request Forgery</a><strong> (</strong>CSRF) and authorization code injection attacks,<strong> not from XSS ones</strong>. Explain why all browser storage modes but HTTP only cookie are sensitives to XSS attacks is a question that should not answered here but instead in another article, why not.</p><p>Remember that <strong>anyone who owns a bearer token can use it instead of its rightful owner, and can do whatever this token can do</strong>.</p><p>But everyone knows how difficult it is to protect from XSS attacks. In practice and for a site of a certain importance using a lot of client side technologies, it is practically impossible to be completely protected. Therefore, from the moment where the risk incurred by user or by the service is more than minimal, it becomes obvious that <strong>we can no longer use any technologie based on the storage browser side of a bearer token</strong> in a perimeter where it can be discovered and captured by an XSS attack.</p><p>On a performance side, I could also add that even a small token has a size that can be counted in kilobytes and that most web servers limit the size of the request line and all header fields around 8K. We can easily understand that there is not much room left for other legitimate traffic like cookies or headers. And what about the fact that we have to check token validity and to decode it each time we use it.</p><p>So what remains for us as a solution if we want to continue using OpenID Connect to protect our sensitive API without having to store bearer tokens on client side ?</p><p>I won’t even consider offering you to store these tokens in an HTTP only cookie because of the previous consideration about the header size limit. Some could try to use a reverse proxy. All of them add an overlay on the authorization code flow, aiming to keep the tokens within the infrastructure by translating it in a session cookie and making the authorization server believe that it has to do with a confidential client. Let’s take a look at what it could looks like with an adaptation of the <a href="https://next-auth.js.org/">NextAuth.js</a> framework as a reverse proxy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yGj7h7aIxP0rileqPY394g.png" /></figure><p>I see that we need 9 participants and 43 interactions to be fully authenticated on the application.</p><p>At each web service call, the <strong>API gateway has to translate the session cookie in a standard authorization header</strong> that contains the corresponding access token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tk0KHBnYeF8A7a9LUNbn0w.png" /><figcaption>Web service call with a reverse proxy</figcaption></figure><p>And yet we are in the simplest case. I spare you what happens when the access token has expired and even more so if the refresh token has also expired. I estimate that this type of implementation results in creating a maze system with too many component interactions leading to huge complexity and potentially opening up other as yet unknown flaws.</p><p>For my part the right solution would be to use a technologie that natively use HTTP only and secured session cookies: <a href="https://en.wikipedia.org/wiki/SAML_2.0">SAML v2</a> for example. I can already hear the crowd booing me: how dare I propose such an old XML based thing. Do I remind you that SAML v2 is born in 2005 while OAuth in 2006 ? SAML has continued to evolve since then and will continue to do so for a long time to come I hope. But I am not here to make a detailed and exhaustive comparison of these two protocols, but to draw your attention on two aspects in particular. First, SAML natively use HTTP only and secured session cookies to index the user security context on the server side: no need to add any additional layers and components to protect from any type of attack. And last but not least, it consumes less bandwidth and less resources than a bearer token to be used. Let’s take a look at what it could looks like with the Shibboleth SAML technologie.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PH-LOy4eMsdpfw8ZRS7a0w.png" /></figure><p>You can see that we only need <strong>6 participants and 23 interactions</strong> to achieve the same result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I8-GQWyvXTFVuzH3h33kRQ.png" /><figcaption>SPA call a SAML protected web service</figcaption></figure><p>Interactions are simpler too: the SP plays the role of a gatekeeper in front of the web service.</p><p>So even if the first exchanges are made up of SAML assertions with a bigger size and time to process than a simple <a href="https://jwt.io/">JSON Web Token</a> (JWT), once the session is established, all that is seen is an opaque session cookie for the thousands of calls that will follow until the session expires. Therefore we should not stop at trivial and obsolete ideas about XML technologie, and we should remember that finding a server side session will always be much faster, cheaper and above all more secure than having to systematically validate and decode a client side bearer token. At the same time, I should like to draw your attention to the fact that all this also applies to all other bearer type mechanisms as Google macaroons or other biscuits. Generally speaking, we should be careful not to eat too many sweets.</p><blockquote>If all you got is a hammer everything looks like a nail.</blockquote><p>OpenID Connect is a good technology that can be of great service in many situations, but we need to know its limits and we must equip ourselves with a wider range of tools to respond effectively to all situations. SAML is the technology that wins when the level of risk involved in identity theft becomes certain and should not be judged solely on its technical grounds. It also has a functional depth that OpenID Connect is still far from reaching and that I propose to share with you in other articles.</p><h3>Learning and sharing</h3><p>Feel free to post your feedback below, reach out to me on <a href="https://www.linkedin.com/in/fabien-berteau-b04ab95/">LinkedIn</a>. Whether you had a similar or totally different experience, I’d love to hear about it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7597c6c3097" width="1" height="1" alt=""><hr><p><a href="https://medium.com/manomano-tech/why-we-should-no-longer-use-bearer-tokens-to-protect-sensitive-single-page-applications-a7597c6c3097">Why we should no longer use bearer tokens to protect sensitive Single Page Applications?</a> was originally published in <a href="https://medium.com/manomano-tech">ManoMano Tech team</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>