<?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 Cyrille M on Medium]]></title>
        <description><![CDATA[Stories by Cyrille M on Medium]]></description>
        <link>https://medium.com/@cyrillem?source=rss-a1eaf6c6022c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*g-IKcFdC0wCfmcD0d1GySw.jpeg</url>
            <title>Stories by Cyrille M on Medium</title>
            <link>https://medium.com/@cyrillem?source=rss-a1eaf6c6022c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 15:01:41 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cyrillem/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[SQL and scripts with privilege escalation for quick and easy development in a secure SMSI]]></title>
            <link>https://medium.com/doctrine/sql-and-scripts-with-privilege-escalation-for-quick-and-easy-development-in-a-secure-smsi-8b2732ce675d?source=rss-a1eaf6c6022c------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b2732ce675d</guid>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Cyrille M]]></dc:creator>
            <pubDate>Fri, 20 May 2022 11:22:03 GMT</pubDate>
            <atom:updated>2022-05-20T11:22:03.541Z</atom:updated>
            <content:encoded><![CDATA[<h4>Security of an SMSI</h4><p>In a good Information Security Management System, information and processes are organised in a secure way. Among other principles, each collaborator has only access to data and processes relevant to their scope, and changes to these former are also subject to a process that can slow down productivity if done wrong. For instance, if a Machine Learning Engineer needs secured data extract to experiment on, he could ask a Data Analyst to script it. The script would require perfect anonymisation, peer review, and good insertion in the production process. This request could go through many people and the result may take days to finish.</p><h4>Development and operational needs of a collaborator</h4><p>Most interactions between a collaborator and the SMSI comprise the following:</p><ul><li>move/process data</li><li>support customers</li><li>run one-timer operations</li></ul><h4>Release Often Release Early, security, and flexibility</h4><p>At Doctrine, security is not negotiable. So all steps of such process need to be carefully thought out to make sure there are no risks and minimize potential mistakes.</p><p>Also at Doctrine, we have the RERO in our core principles (see <a href="https://medium.com/doctrine/2021-retrospective-and-looking-forward-to-2022-79346906e8f3">here</a> for more), so we neither want to slow down our collaborators’ work nor adopt complex and rigid process wherever we can avoid them.</p><h4>The need</h4><p>With all previously discusses in mind, we thought early in the development of Doctrine of a way to reconcile RERO operations of a collaborator with the inflexible security we expect. One way to do so would allow a collaborator to get more privileges for a given action while being peer-reviewed. The action would have a parameterizable context, resources, and isolated context. The action would be registered in an inalterable log accompanied by the given action context. Finally, the process would be easy, fast, and asynchronous to allow actions to be spread over a long period of time.</p><h4>SQL review</h4><p>The first iteration of this idea began on a Tech Day, the perfect timing to experiment with an open mind! Doctrine’s founder @RaphaelChampeimont went for a DIY solution. The idea was to allow any collaborator to run SQL queries with privilege escalation and security in mind. So peer review would be required to check the validity and authorization of such action and an inalterable log would have to be produced. A great collaborative interface already present at Doctrine is Slack, so a simple Node.js app was developed to interact with it. A collaborator runs a Slack command. web app returns a form to enter the query and context. The action is submitted to a Slack chan for peer review and finally, the collaborator can start the action and get feedback in a private message. web app runs queries in isolated context and logs action both to Slack and to a separate inalterable log.</p><figure><img alt="SQL command form" src="https://cdn-images-1.medium.com/max/490/1*RjYVFBSVryh7pyCrLOd8bQ.png" /><figcaption>SQL command form</figcaption></figure><figure><img alt="Peer review asked on Slack" src="https://cdn-images-1.medium.com/max/513/1*B-qs5sE29uZEQ8F4cSVhUw.png" /><figcaption>Peer review asked on Slack</figcaption></figure><figure><img alt="Peer review accepted on Slack" src="https://cdn-images-1.medium.com/max/586/1*u2gblYrOowzQzsRsGceiZg.png" /><figcaption>Peer review accepted on Slack</figcaption></figure><p>Results among collaborators were excellent and so we practically did not have to change this tool since 2018!</p><h4>Command review</h4><p>Following the success of the first tool — sql_review — and since SQL did not cover all the needs of our collaborators, we thought about replicating the principles with more processes to run with elevated privileges. Implementation needed to embrace the diversity of scripts that our teams use, so the richness of CLI as an interface was used. Collaborators clone a repository containing a Python script. Interactively they can insert their command and choose a Kubernetes context. Some common actions are templated. CLI asks a lambda to run the action. A peer review is requested on Slack in the same way as an SQL review. Finally, the Kubernetes context is created. To maintain a state for the lambda, a Redis is used. To keep the result and state of the Kubernetes pods, Datadog is used.</p><figure><img alt="Python CLI" src="https://cdn-images-1.medium.com/max/1024/1*wws-0P7MWnGJ_BqwjnpMyw.png" /><figcaption>Python CLI</figcaption></figure><figure><img alt="Slack peer review" src="https://cdn-images-1.medium.com/max/1024/1*YjBVJ_TCavTNeCUogIsGiw.png" /><figcaption>Slack peer review</figcaption></figure><figure><img alt="Architecture scheme" src="https://cdn-images-1.medium.com/max/1024/1*eKHWI8n0WrmSi7KK0OChSg.png" /><figcaption>Architecture scheme</figcaption></figure><h4>Conclusion</h4><p>Some ready to be used solutions probably exist for the same needs we have, but sql_review and command_review were great opportunities for Doctrine to make quick and user-friendly tools for our collaborators that allowed us to make RERO and security work great.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b2732ce675d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/doctrine/sql-and-scripts-with-privilege-escalation-for-quick-and-easy-development-in-a-secure-smsi-8b2732ce675d">SQL and scripts with privilege escalation for quick and easy development in a secure SMSI</a> was originally published in <a href="https://medium.com/doctrine">Inside Doctrine</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>