<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>DevOps Archives - OVHcloud Blog</title>
	<atom:link href="https://blog.ovhcloud.com/tag/devops/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.ovhcloud.com/tag/devops/</link>
	<description>Innovation for Freedom</description>
	<lastBuildDate>Mon, 30 Sep 2024 22:44:44 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://blog.ovhcloud.com/wp-content/uploads/2019/07/cropped-cropped-nouveau-logo-ovh-rebranding-32x32.gif</url>
	<title>DevOps Archives - OVHcloud Blog</title>
	<link>https://blog.ovhcloud.com/tag/devops/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>F.A.I.R. Principles in Data for AI</title>
		<link>https://blog.ovhcloud.com/f-a-i-r-principles-in-data-for-ai/</link>
		
		<dc:creator><![CDATA[Lex Avstreikh]]></dc:creator>
		<pubDate>Mon, 30 Sep 2024 22:44:43 +0000</pubDate>
				<category><![CDATA[OVHcloud Startup Program]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[AI]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Machine learning]]></category>
		<category><![CDATA[MLops]]></category>
		<category><![CDATA[Public Cloud]]></category>
		<category><![CDATA[Startup Program]]></category>
		<guid isPermaLink="false">https://blog.ovhcloud.com/?p=27422</guid>

					<description><![CDATA[How the FAIR Data Principles apply to Machine Learning Data and Infrastructure At Hopsworks, the FAIR Guiding Principles for scientific data management and stewardship have been a cornerstone of our approach to build a better machine learning platform. F.A.I.R. principles initially became prevalent in academia and diverse fields of research in an effort to make [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Ff-a-i-r-principles-in-data-for-ai%2F&amp;action_name=F.A.I.R.%20Principles%20in%20Data%20for%20AI&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<h5 class="wp-block-heading"><em>How the FAIR Data Principles apply to Machine Learning Data and Infrastructure</em></h5>



<p>At Hopsworks, <a href="https://www.nature.com/articles/sdata201618" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">the FAIR Guiding Principles for scientific data management and stewardship</a> have been a cornerstone of our approach to build a better machine learning platform. F.A.I.R. principles initially became prevalent in academia and diverse fields of research in an effort to make sure that the ever growing amount of data could still be usable and beneficial for the society, and it has since been widely adopted. However, few people mention them in the context of machine learning systems and data management. Yet those principles are even more relevant today in the fast moving AI and <a href="https://www.hopsworks.ai/dictionary/llms-large-language-models" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">LLMs</a> landscape, where <a href="https://www.hopsworks.ai/post/high-risk-ai-in-the-eu-ai-act" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">new legislation</a> is changing the rules of the game.&nbsp;</p>



<p>AI professionals should consider how questions of ethics, data management, and open frameworks may influence their choice of tools and machine learning platforms when implementing <a href="https://www.hopsworks.ai/post/mlops-to-ml-systems-with-fti-pipelines" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">modern ML systems</a>. In Hopsworks, we follow the F.A.I.R. principles in the design of a platform for managing machine learning data and infrastructure.&nbsp;</p>



<h2 class="wp-block-heading"><strong>What are the Four Core Concepts of F.A.I.R.?&nbsp;</strong></h2>



<p>‍<strong>Findable</strong>; referring to mechanics to make the data easily searchable and findable. Infrastructure, stakeholders, and projects need easy-to-use functionality for data discovery.&nbsp;</p>



<ul class="wp-block-list">
<li>Data needs to follow<a href="https://datamanagement.hms.harvard.edu/plan-design/file-naming-conventions#:~:text=The%20file%20name%20should%20be%20descriptive%20and%20provide%20just%20enough%20contextual%20information.&amp;text=A%20good%20format%20for%20date,filename%2C%20use%20the%20format%20YYYYMMDDThhmm." data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer"> clear naming conventions</a>, be indexed for free-text search and have persistent uniquely identified metadata that clearly and explicitly describe the data.&nbsp;</li>



<li>The design and curation of metadata needs to have good system support.</li>
</ul>



<p>‍<strong>Accessible</strong>; allow access not only to the data but the provenance of the data and metadata for the data.&nbsp;</p>



<ul class="wp-block-list">
<li>Open, free, and universally implementable protocols that allow access to the data itself, the metadata and its provenance,</li>



<li>Access control support is required when sharing data. Role-based access control is good, but attribute-based access control and/or dynamic role-based access control provides even more fine-grained support for data sharing and reuse.</li>
</ul>



<p><strong>Interoperable; </strong>data should be easily shared between different computer systems. This is achieved by implementing open standards and formats for data</p>



<ul class="wp-block-list">
<li>Open and accessible file formats and transport protocols for accessing the data.&nbsp;</li>
</ul>



<p><strong>Reusable</strong>; data produced by one system should be easy to reuse in <a href="https://www.hopsworks.ai/dictionary/downstream" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">downstream</a> systems, without copying the data. In order to reuse data, it’s important to include metadata related to the data licenses,, provenance, community standards, and custom metadata that will allow other institutions, teams or groups to be able to reuse the data.</p>



<ul class="wp-block-list">
<li>Versioning, cataloging, provenance/lineage, data integrity, and custom metadata make it easier for users of data to decide on whether they can use the shared data.</li>
</ul>



<h2 class="wp-block-heading"><strong>Why F.A.I.R. is challenging for AI platforms and ML Systems</strong></h2>



<p>Some of the FAIR principles are directly applicable in the context of machine learning systems: there are lots of open source frameworks, file systems, and programming languages that are used for the operation of AI products and services. Still, some very serious challenges do emerge that are specifically due to the way any <a href="https://www.hopsworks.ai/dictionary/ml-systems" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">ML System</a> needs to operate.&nbsp;</p>



<p><strong>Findable</strong>; while strategies that apply metadata and clear nomenclature can be applied in the context of operational machine learning systems, practitioners will find it challenging to create a clear centralized logic between the different data sources and databases needed to operate such services; a modern ML system might need to be connected to multiple sources, some of which may be real-time, or <a href="https://www.hopsworks.ai/dictionary/vector-database" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">vector databases</a> for large languages. Making a clear structure for the assets and the metadata becomes a complex endeavor without a centralized solution capable of catering to the different scenarios.&nbsp;</p>



<p>‍<strong>Interoperable &amp; Accessible; </strong>When open frameworks and open file formats are used; core challenges in regards to accessibility and interoperability should be easier to resolve; in which case it becomes important to consider open standards, compute engines and avoid <a href="https://en.wikipedia.org/wiki/Domain-specific_language" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">DSLs</a>. One additional challenge that can span from the very nature of the underlying data is to make it accessible for auditing (for example; what was the data that the model in production last year trained on?), review and debugging whilst the systems continuously updates and appends data.</p>



<p><strong>Reusability</strong>; Finally a fundamental characteristic of machine learning models is that some of them require the data processing to be directly tied to the model that will be trained; we call these <a href="https://www.hopsworks.ai/dictionary/model-dependent-transformations" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">model-dependent transformations</a>. This process essentially compromises the integrity of the data and the underlying datasets can’t be re-used in a different scenario. And not only does it prevent the reuse of the data itself, it is also harder to understand for a human. This leads to significant holds on the ability of any organization to reuse their data in different models, leading to deduplication and the creation of <a href="https://www.hopsworks.ai/dictionary/monolithic-ml-pipeline" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">monolithic pipelines</a> that are notoriously harder to scale from.&nbsp;</p>



<h2 class="wp-block-heading"><strong>Making Data for AI F.A.I.R. </strong>‍</h2>



<h3 class="wp-block-heading">Use case of<em>Hopsworks with the Human Exposome Assessment Platform</em></h3>



<p>At Hopsworks, we have a strong heritage working with academia and research, participating in projects such as <a href="https://heap-exposome.eu/" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">HEAP</a> (Human Exposome Assessment Project) that manages personal data from numerous medical institutes across the world. We have always been mindful of the evident privacy and security concerns and needs of efficiency in managing data following FAIR principles; when approaching such project; we consider those principles as a blueprint on how to refine our own software;&nbsp;</p>



<ul class="wp-block-list">
<li>Using open frameworks,&nbsp;</li>



<li>Using open languages,</li>



<li>Modular technologies,&nbsp;</li>



<li>Reusable file formats.</li>
</ul>



<p>Additionally, striving to build strong abstractions and APIs that enable users and organizations to have a better understanding of the models they are building and more flexibility in reusing their data pipelines. Those are core aspects of the Hopsworks platform, which we believe all state-of-the-art ML&nbsp; platforms should follow to be within the FAIR framework.</p>



<h2 class="wp-block-heading"><strong>FAIR principles in practice at Hopsworks</strong></h2>



<figure class="wp-block-image"><a href="https://cdn.prod.website-files.com/618399cd49d125734c8dec95/65bbad2d391979288c4153b7_FAIR_lightbox.png" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer"><img decoding="async" src="https://cdn.prod.website-files.com/618399cd49d125734c8dec95/65bbad2d391979288c4153b7_FAIR_lightbox.png" alt="FAIR principles at Hopsworks"/></a></figure>



<h2 class="wp-block-heading">Sources;</h2>



<ul class="wp-block-list">
<li><a href="https://direct.mit.edu/dint/article/2/1-2/10/10017/FAIR-Principles-Interpretations-and-Implementation" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">FAIR Principles: Interpretations and Implementation Considerations | Data Intelligence | MIT Press</a></li>



<li><a href="https://www.nature.com/articles/sdata2018118" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">A design framework and exemplar metrics for FAIRness | Scientific Data</a></li>



<li><a href="https://www.nature.com/articles/sdata201618" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">The FAIR Guiding Principles for scientific data management and stewardship</a></li>
</ul>
<img decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Ff-a-i-r-principles-in-data-for-ai%2F&amp;action_name=F.A.I.R.%20Principles%20in%20Data%20for%20AI&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>5 ground rules to secure your storage</title>
		<link>https://blog.ovhcloud.com/5-ground-rules-to-secure-your-storage/</link>
		
		<dc:creator><![CDATA[Charlotte Letamendia]]></dc:creator>
		<pubDate>Fri, 21 Apr 2023 16:39:01 +0000</pubDate>
				<category><![CDATA[OVHcloud Engineering]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[ObjectStorage]]></category>
		<category><![CDATA[OVHcloud]]></category>
		<category><![CDATA[S3]]></category>
		<guid isPermaLink="false">https://blog.ovhcloud.com/?p=24848</guid>

					<description><![CDATA[My data is an asset. Let&#8217;s share the best practices&#160;to protect your data. If you feel that security is a constraint, it’s time to think again! In this blog post, I will share with you 5 simple rules that can be easily implemented to secure your back-ups without headache thanks to the &#8220;Objects Storage Standard-S3 API&#8221; [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2F5-ground-rules-to-secure-your-storage%2F&amp;action_name=5%20ground%20rules%20to%20secure%20your%20storage&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading">My data is an asset. Let&#8217;s share the best practices&nbsp;to protect your data.</h3>



<p>If you feel that security is a constraint, it’s time to think again! In this blog post, I will share with you <strong>5 simple rules</strong> that can be easily implemented to secure your back-ups without headache thanks to the &#8220;<strong>Objects Storage Standard-S3 API&#8221;</strong> class of storage.</p>



<figure class="wp-block-image aligncenter size-large is-resized"><img fetchpriority="high" decoding="async" src="https://blog.ovhcloud.com/wp-content/uploads/2023/04/IMG_1504-1024x538.jpg" alt="" class="wp-image-25167" width="512" height="269" srcset="https://blog.ovhcloud.com/wp-content/uploads/2023/04/IMG_1504-1024x538.jpg 1024w, https://blog.ovhcloud.com/wp-content/uploads/2023/04/IMG_1504-300x158.jpg 300w, https://blog.ovhcloud.com/wp-content/uploads/2023/04/IMG_1504-768x404.jpg 768w, https://blog.ovhcloud.com/wp-content/uploads/2023/04/IMG_1504.jpg 1199w" sizes="(max-width: 512px) 100vw, 512px" /></figure>



<p><em>I am <strong>DevOps</strong> or <strong>DevSecOps</strong>, I am developing on my platform and want to stay concentrated on my business where I have added value. That is why I am managing by code the deployment and scale of my infrastructures.   I am delegating the management of my infrastructure to my cloud provider.</em></p>



<p><em>While developing my business, the volume of my data grows exponentially,  so my data has value too!</em></p>



<p><em>As my business grows, I collect more data and keep a historical set year after year. I am even deploying in new locations around the world! </em></p>



<p><em>All this data (applications, user data, logs, media, analytics, reporting) are stored and backed up in object storage for flexibility, metadata search, and easy scale. My data represents a great asset in my hand. Data drives my business and I want to protect it.</em></p>



<figure class="wp-block-image aligncenter size-large is-resized"><img decoding="async" src="https://blog.ovhcloud.com/wp-content/uploads/2023/03/blogpostObjectStorage01-1024x538.png" alt="" class="wp-image-24849" width="768" height="404" srcset="https://blog.ovhcloud.com/wp-content/uploads/2023/03/blogpostObjectStorage01-1024x538.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/blogpostObjectStorage01-300x158.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/blogpostObjectStorage01-768x403.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/blogpostObjectStorage01-1536x807.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/blogpostObjectStorage01-2048x1076.png 2048w" sizes="(max-width: 768px) 100vw, 768px" /></figure>



<h4 class="wp-block-heading" id="BlogPostBackupOffsite-Dataisabugassetthatrequiregoodgovernance!">Data is an important asset that requires good governance!&nbsp;</h4>



<p>Please don&#8217;t think, &#8220;cool I have copied my data to a secondary bucket, my backup is complete, I am safe.&#8221; Nope, this is not OK!&nbsp;</p>



<p>What S3 Object Storage doesn’t protect you from is&nbsp;<em>yourself</em>. Let&#8217;s take a look together at the 3 types of risks we need to protect ourselves from.</p>



<p>(1) The number one factor for data loss is human error, accidental deletion, or the overwriting of an object with garbage data. This is a scenario that you want to avoid.</p>



<p>(2) The second category relates to <strong>unpredictable events</strong>: software issues, hardware issues (drive failure), datacenter downtime, or natural/manmade disaster.&nbsp;</p>



<p>(3) The third category is&nbsp;the stuff that causes security experts to lose sleep at night-<strong>malicious actions</strong>: malware, ransomware &amp; viruses, acts of sabotage, DDoS&#8230;</p>



<p>Security is important and non-negotiable, let&#8217;s take a look at <strong>5&nbsp;easy rules</strong>&nbsp;to protect against these risks.</p>



<p>&#8230;and continue to work&nbsp;in all serenity!</p>



<h3 class="wp-block-heading">Rule n° 1 &#8211; versioning</h3>



<p>Versioning helps to protect against accidental overwriting. You can reverse a version after accidental deletion or retrieve a specific version in the event of data corruption.</p>



<p></p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="95" src="https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage02-1024x95.png" alt="" class="wp-image-24850" srcset="https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage02-1024x95.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage02-300x28.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage02-768x71.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage02-1536x142.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage02-2048x189.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading">Rule n° 2 &#8211; immutability</h3>



<p>When your primary storage systems must be open and available, your&nbsp;backup data should be isolated and immutable.&nbsp;</p>



<p>Implement the Write&nbsp;Once,&nbsp;Read&nbsp;Many (WORM) model using S3 object lock API.&nbsp;</p>



<p>You can define different parameters according to your needs, business, and type of data:</p>



<ul class="wp-block-list">
<li>retention periods&nbsp;</li>



<li>legal mode</li>



<li>governance mode</li>



<li>compliance mode</li>
</ul>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="93" src="https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage03-1024x93.png" alt="" class="wp-image-24851" srcset="https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage03-1024x93.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage03-300x27.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage03-768x70.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage03-1536x139.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage03-2048x185.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>This rule helps your organization to respect compliance. To keep logs for a legally limited period, the “compliance mode” will help you set the duration needed. It’s quite handy because logs are generated every second so it can be difficult to keep track. With compliant mode, you don’t need to worry about this anymore, you can set a period of 1, 3, or 5 years and the logs will remain protected throughout the designated period.</p>



<p>read more:&nbsp;<a href="https://docs.ovh.com/ie/en/storage/object-storage/s3/managing-object-lock/" data-wpel-link="exclude">https://docs.ovh.com/ie/en/storage/object-storage/s3/managing-object-lock/</a></p>



<h3 class="wp-block-heading"><strong>Rules n°3 &#8211; data replication off-site</strong></h3>



<p>To be protected against hardware failure issues or geographical events, follow the well-known model : 3+2+1</p>



<p>Before setting your copies of data, you need to evaluate the RPO and RTO of your target&nbsp;</p>



<ul class="wp-block-list">
<li>RPO (real point objective) =&nbsp;in case of geographical failure, what is &#8211; in time &#8211; the most recent snapshot of your data that is acceptable for you to restore your data while losing the minimum amount of data</li>



<li>RTO (real time objective) = in case of geographical failure, what is the acceptable time to recover your data&nbsp;</li>
</ul>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="640" height="960" src="https://blog.ovhcloud.com/wp-content/uploads/2023/04/storage.jpg" alt="data replication off-site" class="wp-image-25165" srcset="https://blog.ovhcloud.com/wp-content/uploads/2023/04/storage.jpg 640w, https://blog.ovhcloud.com/wp-content/uploads/2023/04/storage-200x300.jpg 200w" sizes="auto, (max-width: 640px) 100vw, 640px" /></figure>



<p>Of course, everybody wants a 0-second recovery, but is it necessary?</p>



<p>Such a recovery plan requires costly resources to maintain. Good advice is to&nbsp;sort your data by category of criticality and fine-tune this plan by categories and put into place backup retention policies</p>



<figure class="wp-block-table is-style-regular"><table><thead><tr><th>Type</th><th>Back up policies</th></tr></thead><tbody><tr><td>Nonbusiness critical&nbsp;</td><td>Weekly&nbsp;</td></tr><tr><td>Business critical</td><td>Every day for 1 month then monthly during 1 year</td></tr><tr><td>Archive</td><td>&gt; 1 year</td></tr></tbody></table></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="89" src="https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage05-1024x89.png" alt="" class="wp-image-24853" srcset="https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage05-1024x89.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage05-300x26.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage05-768x67.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage05-1536x134.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage05-2048x178.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>read more :&nbsp;<a href="https://docs.ovh.com/ie/en/storage/object-storage/s3/rclone/" data-wpel-link="exclude">https://docs.ovh.com/ie/en/storage/object-storage/s3/rclone/</a></p>



<h3 class="wp-block-heading">Rules n°4 &#8211; encryption</h3>



<p>When your data is not used you can cipher it with your own key. We use a feature based on the AES-256 protocol.</p>



<p>Encrypt your data: using your own keys and encryption based on AES-256&nbsp;</p>



<p>Note that the data in transit is encrypted thanks to the TLS protocol.</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage06-1024x75.png" alt="" class="wp-image-24854" width="1024" height="75" srcset="https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage06-1024x75.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage06-300x22.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage06-768x56.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage06-1536x112.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage06-2048x149.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>read more :&nbsp;<a href="https://docs.ovh.com/ie/en/storage/object-storage/s3/encrypt-your-objects-with-sse-c/" data-wpel-link="exclude">https://docs.ovh.com/ie/en/storage/object-storage/s3/encrypt-your-objects-with-sse-c/</a></p>



<h3 class="wp-block-heading">Rules n°5 &#8211; user policies&nbsp;</h3>



<p>Grant only the permissions that are required to perform a task using&nbsp;</p>



<ul class="wp-block-list">
<li>User policy</li>



<li>Bucket policy (soon)</li>



<li>Bucket ACL</li>
</ul>



<p>Extract your S3 policies every month and check them; It will not take too much time and can be automized. Verify that you know all users and that the rights are adapted to each profile. Never let a wildcard * provide access to all to a sensible bucket/object.</p>



<figure class="wp-block-image aligncenter size-full is-resized is-style-default"><img loading="lazy" decoding="async" src="https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage07.png" alt="" class="wp-image-24855" width="308" height="272" srcset="https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage07.png 774w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage07-300x265.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage07-768x679.png 768w" sizes="auto, (max-width: 308px) 100vw, 308px" /></figure>



<p>read more:&nbsp;<a href="https://docs.ovh.com/ie/en/storage/object-storage/s3/identity-and-access-management/" data-wpel-link="exclude">https://docs.ovh.com/ie/en/storage/object-storage/s3/identity-and-access-management/</a></p>



<p><strong>Be uncompromising in the implementation of security compliance.</strong></p>



<p>If you are comfortable with these 5 rules you can rest assured. As for all security rules, a regular check-up/training is always useful!&nbsp;</p>



<h3 class="wp-block-heading"><strong>Bonus rule &#8211; Traceability&nbsp;&nbsp;</strong></h3>



<p>When you are audited or you want to audit your architecture of your cloud provider it is important to have all the elements you need.</p>



<p>The S3 logging feature will help you provide the traceability needed in order to know who, when, and why data was accessed.</p>



<p>Thanks to our API, you can set up some triggers in order to be alerted in case of bad or simply abnormal behavior.</p>



<figure class="wp-block-image aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage08-1-1024x595.png" alt="" class="wp-image-24884" width="512" height="298" srcset="https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage08-1-1024x595.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage08-1-300x174.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage08-1-768x447.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage08-1-1536x893.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2023/03/BlogpostObjectStorage08-1-2048x1191.png 2048w" sizes="auto, (max-width: 512px) 100vw, 512px" /></figure>



<h2 class="wp-block-heading">Want to know more about data protection? More blog posts are coming soon!</h2>



<p>Meanwhile, feel free to consult our guides that will assist you in your data security implementation.</p>



<p>And discover OVHcloud Object Storage services with S3 API&nbsp;<a href="https://www.ovhcloud.com/en-ie/public-cloud/object-storage/" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">https://www.ovhcloud.com/en-ie/public-cloud/object-storage/</a></p>



<figure class="wp-block-table"><table><thead><tr><th>Who are you?</th><th>Guides</th></tr></thead><tbody><tr><td>Data protection for<br><strong>SysAdmin&nbsp;</strong></td><td>VMware user ?&nbsp;<br><a href="https://docs.ovh.com/ie/en/storage/object-storage/s3/veeam/" data-wpel-link="exclude">https://docs.ovh.com/ie/en/storage/object-storage/s3/veeam/</a><br>Nutanix user ?&nbsp;<br><a href="https://docs.ovh.com/ie/en/nutanix/hycu-backup/" data-wpel-link="exclude">https://docs.ovh.com/ie/en/nutanix/hycu-backup/</a><br><a href="https://docs.ovh.com/ie/en/nutanix/nutanix-veeam-backup/" data-wpel-link="exclude">https://docs.ovh.com/ie/en/nutanix/nutanix-veeam-backup/</a></td></tr><tr><td>Data protection <strong>with infrastructure as code</strong></td><td>Kubernetes user ?&nbsp;<br><a href="https://docs.ovh.com/fr/kubernetes/backing-up-cluster-with-velero/" data-wpel-link="exclude">https://docs.ovh.com/fr/kubernetes/backing-up-cluster-with-velero/</a><br><a href="https://docs.ovh.com/ie/en/kubernetes/backup-and-restore-cluster-namespace-and-applications-with-trilio/#how-triliovault-for-kubernetes-works" data-wpel-link="exclude">https://docs.ovh.com/ie/en/kubernetes/backup-and-restore-cluster-namespace-and-applications-with-trilio/#how-triliovault-for-kubernetes-works</a></td></tr><tr><td>&nbsp;Data protection for<br><strong>Developpers</strong></td><td>S3 API user ?&nbsp;<br><a href="https://docs.ovh.com/ie/en/storage/object-storage/s3/managing-object-lock/" data-wpel-link="exclude">https://docs.ovh.com/ie/en/storage/object-storage/s3/managing-object-lock/</a><br><a href="https://docs.ovh.com/ie/en/storage/object-storage/s3/rclone/" data-wpel-link="exclude">https://docs.ovh.com/ie/en/storage/object-storage/s3/rclone/</a><br><a href="https://docs.ovh.com/ie/en/storage/object-storage/s3/encrypt-your-objects-with-sse-c/" data-wpel-link="exclude">https://docs.ovh.com/ie/en/storage/object-storage/s3/encrypt-your-objects-with-sse-c/</a><br><a href="https://docs.ovh.com/ie/en/storage/object-storage/s3/identity-and-access-management/" data-wpel-link="exclude">https://docs.ovh.com/ie/en/storage/object-storage/s3/identity-and-access-management/</a><br><a href="https://docs.ovh.com/fr/storage/object-storage/s3/bucket-acl/" data-wpel-link="exclude">https://docs.ovh.com/fr/storage/object-storage/s3/bucket-acl/</a><br><a href="https://docs.ovh.com/fr/storage/object-storage/s3/server-access-logging/" data-wpel-link="exclude">https://docs.ovh.com/fr/storage/object-storage/s3/server-access-logging/</a></td></tr></tbody></table></figure>
<img loading="lazy" decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2F5-ground-rules-to-secure-your-storage%2F&amp;action_name=5%20ground%20rules%20to%20secure%20your%20storage&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Modernize your application deployment &#8211; Part 1</title>
		<link>https://blog.ovhcloud.com/modernize-your-application-deployment-part-1/</link>
		
		<dc:creator><![CDATA[Jean-Daniel Bonnetot]]></dc:creator>
		<pubDate>Wed, 16 Feb 2022 16:47:45 +0000</pubDate>
				<category><![CDATA[OVHcloud Engineering]]></category>
		<category><![CDATA[Application]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[pets vs cattle]]></category>
		<category><![CDATA[sysadmin]]></category>
		<guid isPermaLink="false">https://blog.ovhcloud.com/?p=21581</guid>

					<description><![CDATA[The good old time Many years ago I was a SysAdmin. Do you remember this old job? Let me remind you of a few recurring scenarios: Sure, it was a bit more complicated than a few command lines, but I think you know what I mean. Oh, and does this one sound familiar to many [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fmodernize-your-application-deployment-part-1%2F&amp;action_name=Modernize%20your%20application%20deployment%20%26%238211%3B%20Part%201&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://blog.ovhcloud.com/wp-content/uploads/2022/02/IMG_0803-1024x537.jpeg" alt="Modernize your application deployment - Part 1" class="wp-image-22450" width="512" height="269" srcset="https://blog.ovhcloud.com/wp-content/uploads/2022/02/IMG_0803-1024x537.jpeg 1024w, https://blog.ovhcloud.com/wp-content/uploads/2022/02/IMG_0803-300x157.jpeg 300w, https://blog.ovhcloud.com/wp-content/uploads/2022/02/IMG_0803-768x403.jpeg 768w, https://blog.ovhcloud.com/wp-content/uploads/2022/02/IMG_0803.jpeg 1200w" sizes="auto, (max-width: 512px) 100vw, 512px" /></figure></div>



<h2 class="wp-block-heading" id="the-good-old-time">The good old time</h2>



<p>Many years ago I was a SysAdmin. Do you remember this old job? Let me remind you of a few recurring scenarios:</p>



<pre class="wp-block-code"><code class="">ssh someone@somewhere
apt-get install something
vi /etc/something
/etc/init.d/something restart</code></pre>



<pre class="wp-block-code"><code class="">ssh someone@somewhere
fdisk /dev/sdb
mkfs.ext4 /dev/sdb1
vi /etc/festab
mount /mountpoint</code></pre>



<pre class="wp-block-code"><code class="">ssh someone@somewhere
modeprobe ipt_MASQUERADE
echo 1 &gt; /proc/sys/net/ipv4/ip_forwarding
iptables -t nat ...</code></pre>



<p>Sure, it was a bit more complicated than a few command lines, but I think you know what I mean. Oh, and does this one sound familiar to many of you?</p>



<pre class="wp-block-code"><code class="">ssh someone@somewhere
apt-get install pacemaker
#do many complicated stuffs
vi /etc/corosync/corosync.conf
#do other complicated requirements
crm configure property stonith...
crm configure property quorum...</code></pre>



<p>I spent my time deploying and maintaining systems, building resilient architectures, and debugging or fixing failing servers. It was the good old days!</p>



<p>A few years ago I switched to more customer facing jobs, like product marketing management and technical evangelism, where I used my knowledge to promote products with a good technical approach.</p>



<p>But now guess what? Things has changed. No seriously, when I have to put my fingers on a terminal, a lot of things are different. It&#8217;s not that <code>/etc/init.d</code> has been replaced by <code>systemctl</code> and no one is using <code>screen</code> anymore, but the way of thinking about deployments and resilient architectures is totally different.</p>



<p>Of course I&#8217;m not totally out of it, as I used to play around with OpenStack and understand microservices architectures on paper. But it takes a bit more practice to be comfortable speaking with real customers about real applications, deployed with a scalable architecture or in a cloud-native way on Kubernetes.</p>



<h2 class="wp-block-heading" id="sounds-like-a-new-adventure-begins">Sounds like a new adventure begins</h2>



<p>I therefore suggest that you follow me on this journey: moving from a standalone, rock-solid deployment to an scalable architecture using the new primitives. I know the hype is around Kubernetes, but I also know a lot of people are not ready to go in that direction, because the knowledge base is not that easy to manage and the step is high as it is case for me.</p>



<p>I&#8217;m going to share what I&#8217;m going to discover, I&#8217;ll try to make it as simple as possible and keep an educational approach.</p>



<p>On this journey, I will be taking small steps, one step at a time, and this post is the first describing the basics and theory for building a scalable architecture.</p>



<h2 class="wp-block-heading" id="leaving-pets-village">Leaving <em>pets village</em></h2>



<p>For those unfamiliar with the <em><a href="http://cloudscaling.com/blog/cloud-computing/the-history-of-pets-vs-cattle/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external">pets vs cattle</a></em> analogy, let&#8217;s say we&#8217;re in a village. Each villager has a handful of animals, not many of them. And each animal requires a lot of time from its owner to feed it, take care of it, play and educate it. They are pets, almost members of the family. And of course, our villagers invest affect and more into each animal. Therefore, losing a pet is really critical as it is unique and cannot be replaced.</p>



<p>Coming back to IT, in the past we deployed applications and servers with the same idea. We spent time on installation, maintenance. One server had very little in common with the others and for critical services we invest so much time in building HA (high availability) architectures with voting solutions like <a href="https://en.wikipedia.org/wiki/Quorum_(distributed_computing)" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external">quorum</a> devices, <a href="https://en.wikipedia.org/wiki/Fencing_(computing)" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external">fencing</a> tools like <a href="https://en.wikipedia.org/wiki/STONITH" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external">STONITH</a> (Shoot The Other Node In The Head) drivers, or dormant resources with active/passive components.</p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://blog.ovhcloud.com/wp-content/uploads/2022/02/IMG_0809-1024x819.jpeg" alt="Three questions for a pet based infra" class="wp-image-22462" width="512" height="410" srcset="https://blog.ovhcloud.com/wp-content/uploads/2022/02/IMG_0809-1024x819.jpeg 1024w, https://blog.ovhcloud.com/wp-content/uploads/2022/02/IMG_0809-300x240.jpeg 300w, https://blog.ovhcloud.com/wp-content/uploads/2022/02/IMG_0809-768x614.jpeg 768w, https://blog.ovhcloud.com/wp-content/uploads/2022/02/IMG_0809.jpeg 1212w" sizes="auto, (max-width: 512px) 100vw, 512px" /></figure></div>



<p>We had to address at least those three questions:</p>



<ol class="wp-block-list"><li>How can I scale my architecture when I need more power?<br> Usually the answer was &#8220;add more RAM&#8221; or &#8220;change to a better CPU&#8221;. Even if your infrastructure is virtualized, this approach has some limitations.</li><li>What should I do when something goes wrong?<br>Here was the debugging approach with a little urgency depending on your pet&#8217;s notoriety.</li><li>What if&#8230; (no words, it&#8217;s too hard) what if the worst happen?<br>And yes, you know that, like all of us… “shit happens”. This is where we used some <a href="https://en.wikipedia.org/wiki/Corosync_Cluster_Engine" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external">corosync</a> stuff and other cool tools.</li></ol>



<p>Overall, you might have a smirk on Monday morning if you check the event logs and find that a big infrastructure failure popped up on Saturday night. You were in the middle of the 16th episode of the 5th season of Lost (yes we&#8217;re back in 2009), Locke just asked Ben to kill Jacob, and you completely missed the alert email asking you leave your sofa to fix the infra. But this Monday morning, you discovered with joy and happiness that your fantastic distributed system had worked as intended and put the system in degraded mode. And you were going to celebrate it with a double coffee because now you will have to go from degraded mode to normal mode and debug the failure.</p>



<p>That&#8217;s the pet village, the one many of us know pretty well. But like I said, the time has changed and we are leaving this place.</p>



<p>This is the pet village, the one that many of us know quite well. But as I said, times have changed and we are leaving this place.</p>



<h2 class="wp-block-heading" id="destination-the-cattle-land">Destination: the <em>cattle land</em></h2>



<p>The country we are going to is full of &#8220;collections of fabrics&#8221; or &#8220;groups of things&#8221;. There&#8217;s a big shed, a huge pasture, and you feed your cattle with tools like trucks and grain silos. In a sense, you are managing the cattle, not each head of cattle. I don&#8217;t want to sound like someone who doesn&#8217;t care about animal welfare, but in a cattle, a cow is much like another cow (sorry vegetarians). If a cow is missing, you can easily replace it, you see what I mean?</p>



<p>It&#8217;s the same for us, IT people. In this country, each component is not unique and shares a common configuration with the other in its group. The configuration has been industrialized, like a one-click deployment, and any component can be replaced by a command line, bringing us to a situation where losing a component is not a problem anymore.</p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://blog.ovhcloud.com/wp-content/uploads/2022/02/IMG_0807-1024x695.jpeg" alt="Three questions for a cattle based infra" class="wp-image-22460" width="512" height="348" srcset="https://blog.ovhcloud.com/wp-content/uploads/2022/02/IMG_0807-1024x695.jpeg 1024w, https://blog.ovhcloud.com/wp-content/uploads/2022/02/IMG_0807-300x204.jpeg 300w, https://blog.ovhcloud.com/wp-content/uploads/2022/02/IMG_0807-768x521.jpeg 768w, https://blog.ovhcloud.com/wp-content/uploads/2022/02/IMG_0807.jpeg 1502w" sizes="auto, (max-width: 512px) 100vw, 512px" /></figure></div>



<p>And if we need to answer the precedent questions, it would look like:</p>



<ol class="wp-block-list"><li>How can I scale my architecture when I need more power?<br>Easy, friend, you just need to add another component in the group.</li><li>What should I do when something goes wrong?<br>You could call the vet… but here I know an easier solution. You will say that I am cruel and I will say that I am talking about machines and software, not animals. What did you have in mind…?</li><li>What if the worst happen?<br>Here again, we&#8217;ll have everything to replace it easily.</li></ol>



<h2 class="wp-block-heading" id="on-the-road-to-cattle-land">On the road to <em>cattle land</em></h2>



<p>So the question is: how to do it? How do you move from a standalone deployment to a scalable architecture?</p>



<p>You might think you&#8217;ll have to rewrite everything and drop your app to rewrite a new one, but we&#8217;ve said we will be doing things step by step&#8230; So I would identify three main actions for our first step. These actions need to be addressed to move into <em>cattle land</em>:</p>



<ol class="wp-block-list"><li>Identify the stateless and stateful components</li><li>Move stateful component to managed services</li><li>Industrialize stateless components</li></ol>



<p>At this point, we may need some clarification on what a stateless component is: it&#8217;s a component that doesn&#8217;t store any <em>data</em> or <em>status</em> locally and <em>share-nothing</em>. All data that needs to be <em>persisted</em> should be stored in a <em>stateful storage service</em>, usually a database. In other words, you can lose/kill/remove/destroy (strike the unnecessary ones) any of the stateless components without impacting the application, because you won&#8217;t lose any data.</p>



<p>And the stateful components will be delegated to your cloud provider, like OVHcloud. They will be responsible for managing the high availability elements for you, usually the service offers this option.</p>



<p>Let&#8217;s try to explain it with some drawings.  Let&#8217;s start with an application deployed in the <em>pets village</em>, a basic blog:</p>



<div class="wp-block-image"><figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" src="https://blog.ovhcloud.com/wp-content/uploads/2022/02/IMG_0811.jpeg" alt="An application deployed in the pets village" class="wp-image-22466" width="509" height="317" srcset="https://blog.ovhcloud.com/wp-content/uploads/2022/02/IMG_0811.jpeg 1017w, https://blog.ovhcloud.com/wp-content/uploads/2022/02/IMG_0811-300x187.jpeg 300w, https://blog.ovhcloud.com/wp-content/uploads/2022/02/IMG_0811-768x478.jpeg 768w" sizes="auto, (max-width: 509px) 100vw, 509px" /></figure></div>



<p>The large box represents our standalone server. Highlighted in yellow are the stateful components which are the database and the files (images). This is our data that we don&#8217;t want to lose a single byte. The rest of the application are stateless components.</p>



<p>Now see the target we are speaking about:</p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://blog.ovhcloud.com/wp-content/uploads/2022/02/IMG_0813-1024x949.jpeg" alt="Product innovation enthusiastic. At OVHcloud, focusing on Bare Metal Cloud and Cloud Storage solutions as a Product Marketing Manager" class="wp-image-22474" width="512" height="475" srcset="https://blog.ovhcloud.com/wp-content/uploads/2022/02/IMG_0813-1024x949.jpeg 1024w, https://blog.ovhcloud.com/wp-content/uploads/2022/02/IMG_0813-300x278.jpeg 300w, https://blog.ovhcloud.com/wp-content/uploads/2022/02/IMG_0813-768x711.jpeg 768w, https://blog.ovhcloud.com/wp-content/uploads/2022/02/IMG_0813.jpeg 1275w" sizes="auto, (max-width: 512px) 100vw, 512px" /></figure></div>



<p>We&#8217;ll move our stateful component to managed services at OVHcloud. The MongoDB database will be hosted by <a href="https://www.ovhcloud.com/en/public-cloud/mongodb/" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">Managed Databases for MongoDB</a> service and the images will be pushed to <a href="https://www.ovhcloud.com/en/public-cloud/object-storage/" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">Object Storage</a> service which provide an S3 API.</p>



<p>Now we have dealt with the data, we can work to build our stateless component in a <em>cattle mode</em>. The road to the <em>cattle land</em> is marked out and we can move forward. Let&#8217;s see how to do that in the next post with a practical approach and some real demos.</p>
<img loading="lazy" decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fmodernize-your-application-deployment-part-1%2F&amp;action_name=Modernize%20your%20application%20deployment%20%26%238211%3B%20Part%201&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Erlenmeyer and PromQL compatibility</title>
		<link>https://blog.ovhcloud.com/erlenmeyer-and-promql-compatibility/</link>
		
		<dc:creator><![CDATA[Aurélien Hébert]]></dc:creator>
		<pubDate>Wed, 16 Dec 2020 11:03:27 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Metrics]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Time series]]></category>
		<guid isPermaLink="false">https://www.ovh.com/blog/?p=20123</guid>

					<description><![CDATA[Today in the monitoring world, we see the rise of the Prometheus tool. It&#8217;s a great tool to deploy in your infrastructure, as it allows you to scrap all of your servers or applications to retrieve, store and analyze the metrics. And all you have to do is to extract and run it, it does [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Ferlenmeyer-and-promql-compatibility%2F&amp;action_name=Erlenmeyer%20and%20PromQL%20compatibility&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<p>Today in the monitoring world, we see the rise of the <a href="https://prometheus.io/" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">Prometheus</a> tool. It&#8217;s a great tool to deploy in your infrastructure, as it allows you to scrap all of your servers or applications to retrieve, store and analyze the metrics. And all you have to do is to extract and run it, it does all the work by itself. Of course, Prometheus comes with some trade-offs (pull, how to handle late ingestion), and some limits, as you have your data only for a couple of days.</p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2020/12/IMG_0404-1024x537.png" alt="Erlenmeyer and PromQL compatibility" class="wp-image-20266" width="512" height="269" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/12/IMG_0404-1024x537.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/12/IMG_0404-300x157.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/12/IMG_0404-768x403.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/12/IMG_0404.png 1200w" sizes="auto, (max-width: 512px) 100vw, 512px" /></figure></div>



<h2 class="wp-block-heading">Context</h2>



<p>How is it possible to handle Prometheus long-time storage? A vast amount of Time Series DataBase are now fully compatible with Prometheus. It&#8217;s easy to check that Prometheus ingest is working well, however, how can we validate the PromQL &#8211; or Prometheus queries &#8211; part? A few months ago, <a href="https://promlabs.com/" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">PromLab</a> released a new tool called &#8220;<a href="https://github.com/promlabs/promql-compliance-tester" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">PromQL compliance tester</a>&#8220;. They recently created <a href="https://promlabs.com/promql-compliance-tests" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">this page</a> where they reference the result of several products PromQL compliance tests. On this blog post, we will see how this tool helps us improve our PromQL implementation. </p>



<h3 class="wp-block-heading">Compliance tester</h3>



<p>The <a href="https://github.com/promlabs/promql-compliance-tester" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">PromQL compliance tester</a> is open source and contains a full set of tests. When using this tool, it generates for you around 500 PromQL queries covering the vast majority of the language. It includes tests on simple scalar, selectors, time range functions, operators, and so on. This tool will execute a request on both a Prometheus instance and the tested backend. It will then expect you to get the same result as PromQL output. It expects an exact match for all metadata of a series (tags and names). It&#8217;s more flexible for the ticks as you can set a parameter to round your check at the milliseconds. Finally, the compliance tool checks the equality of both query values, as many things can impact the floating predictability, it computes an approximated equality. </p>



<h3 class="wp-block-heading">Erlenmeyer</h3>



<p>At Metrics, we used a <a href="https://warp10.io/" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">Warp10</a> TSDB with it&#8217;s own analytical query engine <a href="https://warp10.io/content/03_Documentation/04_WarpScript" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">WarpScript</a>. We decided to build an open source tool to transpile PromQL queries into WarpScript called <a href="https://github.com/ovh/erlenmeyer" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">Erlenmeyer</a>. This compliance tester was a great help to validate some of our implementation and to detect which query were not fully ISO.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="573" height="295" src="https://www.ovh.com/blog/wp-content/uploads/2020/12/IMG_0406.png" alt="Erlenmeyer and PromQL compatibility" class="wp-image-20265" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/12/IMG_0406.png 573w, https://blog.ovhcloud.com/wp-content/uploads/2020/12/IMG_0406-300x154.png 300w" sizes="auto, (max-width: 573px) 100vw, 573px" /></figure></div>



<h3 class="wp-block-heading">Set up</h3>



<p>To start testing our PromQL experience, we set up a local Prometheus with a default configuration. This configuration makes Prometheus run and collect some &#8220;Demo&#8221; Metrics, then we forwarded all of them to one of our Metrics regions using Prometheus remote write. We added a local instance of Erlenmeyer to query the data stored in a distributed Warp10 backend. Then, we iterated on each set of tests of the PromLab compliance tool to identify all issues and improved our existing PromQL implementation. </p>



<p>To be compliant, we had to reduce the precision for the value of the compliance tool. We set the precision to <code>0.001</code> instead of <code>0.00001</code>. We also had to remove the Warp10 <code>.app</code> label from the result. As on Warp10 instance, we identify users based on this <code>.app</code> label.</p>



<h3 class="wp-block-heading">A test query</h3>



<p>When running the test, you will get a full report of your failing queries. Let&#8217;s take an example:</p>



<pre class="wp-block-code"><code class="">RESULT: FAILED: Query returned different results:
  model.Matrix{
  	&amp;{
  		Metric: Inverse(DropResultLabels, s`{instance="demo.promlabs.com:10002", job="demo"}`),
  		Values: []model.SamplePair{
  			... // 52 identical elements
  			{Timestamp: s"1606323726.058", Value: Inverse(TranslateFloat64, float64(2.6928936527e+10))},
  			{Timestamp: s"1606323736.058", Value: Inverse(TranslateFloat64, float64(2.691644054725e+10))},
  			{
  				Timestamp: s"1606323746.058",
- 				Value:     Inverse(TranslateFloat64, float64(2.6922272529119648e+10)),
+ 				Value:     Inverse(TranslateFloat64, float64(2.689432207325e+10)),
  			},
  			{Timestamp: s"1606323756.058", Value: Inverse(TranslateFloat64, float64(2.6915188293125e+10))},
  			{Timestamp: s"1606323766.058", Value: Inverse(TranslateFloat64, float64(2.69215848005e+10))},
  			... // 4 identical elements
  		},
  	},
  }</code></pre>



<p>The test reports includes all errors occurring during the test. In this example, we can see, that for a single series we have 56 correct values. However one is invalid, we see it on two lines. The first one is the one starting by &#8220;-&#8220;. This stands for the expected value. And the second one starting by a &#8220;+&#8221; corresponds to the tested instance value. In this case, the value isn&#8217;t precise enough (2.68 instead of 2.69).</p>



<h2 class="wp-block-heading">Results</h2>



<p>Now that we have a full test set-up running, we can see what we improved from its results. If you want to access the full detailed fixes, you can check the code update made <code><a href="https://github.com/ovh/erlenmeyer/pull/48" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">here</a></code>. This tool helped us to fix some implementation, sanitize known issues, to know what PromQL features we missed, and detect a few new bugs! Let&#8217;s review the change.</p>



<h3 class="wp-block-heading">Quick implementation fixes</h3>



<p>Running those test was a great help for us to understand some of implementations errors we had when trying to match PromQL behavior. For example, the time range function was sampling before computing the operation. Reversing those steps provided us a direct match with a native query. It also helped us also fix some minor bugs on how to handle the comparison operators or multiple functions as label_replace, holt_winters, predict_linear or the full set of time functions (hour, minute, month&#8230;). </p>



<p>We improved also our handling of PromQL operator aggregators : by and without. </p>



<h3 class="wp-block-heading">Sanitize known issues</h3>



<p>We discovered recently, that we were not matching PromQL behavior on the series name. As a result we were keeping the name for all compute operations. Prometheus has, however, a different approach as the name is only kept when it&#8217;s relevant. The compliance tester helps us on how to validate this specific update for all queries. </p>



<p>With this tool, we test the validity of a query compared to a native PromQL query, it helps us to sanitize our query output. We knew that, in case of missing values or empty series, we were not ISO compliant. We have corrected the part of the Erlenmeyer software handling the output to match all PromQL cases included in the tests.</p>



<h3 class="wp-block-heading">Unimplemented features</h3>



<p>Running the test, lead us to discover that we missed some PromQL native features. As a matter of fact, Erlenmeyer now supports the PromQL unary or the &#8220;bool&#8221; keywords. The support of unary allows the use of &#8220;-my_series&#8221; for example. In PromQL, the bool keywords convert the result to booleans. It returns as series values 1 or 0 depending on the condition, where 1 stands for true and zero for false.</p>



<h3 class="wp-block-heading">Open issues</h3>



<p>Running all compliance tests and improving our code base lead to us to around 91% of success. For the rest, we open <a href="https://github.com/ovh/erlenmeyer/issues" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">new issues</a> on Erlenmeyer, we detected that: </p>



<ul class="wp-block-list"><li>the handling of the over_time function is not correct when the range is below the data point frequency,</li><li>rate, delta, increase and predict_linear, our result isn&#8217;t precise enough to match PromQL output when then the range is below 5 minutes,</li><li>some minor bugs on series selector (!=), or on the label_replace (some checks are missing on parameters validators),</li><li>the PromQL subqueries, as well as, some functions are not implemented: ^ and % on two series set and the deriv function.</li></ul>



<p>Those are the 4 missing points to cover the full PromQL feature set with Erlenmeyer. Our <a href="https://github.com/ovh/erlenmeyer/blob/master/doc/promql.md" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">documentation</a> already contained all the missing implementations. </p>



<h2 class="wp-block-heading">Actions</h2>



<p>This tool was a great help to improve our PromQL compliance and we are happy with our compliance result. Indeed we reach 91% with the provided test result:  </p>



<pre class="wp-block-code"><code class="">General query tweaks:
*  Metrics test
================================================================================
Total: 496 / 541 (91.68%) passed</code></pre>



<p>Our next action, is to release those fixes and improvements on all our Metrics regions. Looking forward to see what you think about our PromQL implementation! </p>



<p>We now see a lot of projects are implementing Prometheus writes and reads. These projects bring Prometheus a lot of missing features like long-term storage, delete, late ingestion, historical data analysis, HA&#8230; Being able to validate PromQL implementation is a big challenge, and is a great help in choosing the right backend according to the need. </p>
<img loading="lazy" decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Ferlenmeyer-and-promql-compatibility%2F&amp;action_name=Erlenmeyer%20and%20PromQL%20compatibility&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Warden: the self-healing framework for local actions</title>
		<link>https://blog.ovhcloud.com/warden-the-self-healing-framework-for-local-actions/</link>
		
		<dc:creator><![CDATA[Alexandre Gauthier]]></dc:creator>
		<pubDate>Wed, 09 Dec 2020 11:23:14 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Automation]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Self-heal at Webhosting]]></category>
		<category><![CDATA[SRE]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<guid isPermaLink="false">https://www.ovh.com/blog/?p=19951</guid>

					<description><![CDATA[This article is the follow up to Selfheal at Webhosting &#8211; The External Part published on 2020-07-17.Part two below covers the local self-healing system. Introduction With over 15-000 servers dedicated to providing services for 6 million websites and web applications of all sorts, across multiple data-centers and geographical zones, a certain amount of software failures [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fwarden-the-self-healing-framework-for-local-actions%2F&amp;action_name=Warden%3A%20the%20self-healing%20framework%20for%20local%20actions&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<p>This article is the follow up to <a href="https://www.ovh.com/blog/selfheal-at-webhosting-the-external-part/" data-wpel-link="exclude">Selfheal at Webhosting &#8211; The External Part</a> published on 2020-07-17.<br>Part two below covers the local self-healing system.</p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2020/11/IMG_0392-1024x537.png" alt="Warden: the self-healing framework for local actions" class="wp-image-20157" width="768" height="403" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/11/IMG_0392-1024x537.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/11/IMG_0392-300x157.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/11/IMG_0392-768x403.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/11/IMG_0392.png 1200w" sizes="auto, (max-width: 768px) 100vw, 768px" /></figure></div>



<h3 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-Introduction">Introduction</h3>



<p>With over 15-000 servers dedicated to providing services for 6 million websites and web applications of all sorts, across multiple data-centers and geographical zones, a certain amount of software failures are inevitable. They must be handled to ensure the servers are in a functional state to provide continuity-of-service.</p>



<p>The overhead only increases once you account for supporting pieces of the infrastructure that provide the service, or by clients to access and manage their data.</p>



<p>Generally speaking, restarting failed services and reacting to health checks failing with automatic operations can be done swiftly with a simple install of, for example &#8211; <em>Monit</em>, or <em>Systemd</em> Unit Parameters.</p>



<p>Web-hosting infrastructure, however, poses unique challenges that require a holistic response.</p>



<p>It&#8217;s not only large, but it&#8217;s distributed and&nbsp;<a href="https://www.ovh.com/blog/web-hosting-how-to-host-3-million-websites/" data-wpel-link="exclude">highly available</a>. A web host encountering a failure will not degrade the service, as another node in a cluster will immediately take its place to service client requests.</p>



<p>Additionally, providing Shared Hosting as a service means you are mostly running Unknown Workloads. No two websites have the same requirements, performance, or behavior. You can&#8217;t therefore make assumptions about what is normal, and what isn&#8217;t, which in turn makes establishing a baseline for Abnormal Behavior difficult.</p>



<p>In this context, it is generally&nbsp;an inevitable fact of life that sometimes those workloads will misbehave, crash, or put the system into a state it cannot recover from without intervention.</p>



<p>Trying to prevent this is therefore futile. Facilitating recovery within isolated fault domains is a more productive approach and is where self-healing becomes useful. </p>



<h3 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-Self-healingsystems">Self-healing systems</h3>



<p>While the highly available nature of the infrastructure means failure states don&#8217;t necessarily degrade the service &#8211; the cause still needs to be investigated and the system recovered before being returned to the pool of available hosts to serve requests.</p>



<p>Without automated systems in place to achieve this, it can easily turn into a battle of attrition. Systems to diagnose and clear can pile up and eat into actual time spent on improvements and long-term mitigation of failure states.</p>



<p>We therefore employ two self-healing systems at Webhosting to automate the process:</p>



<ul class="wp-block-list"><li><a href="https://www.ovh.com/blog/selfheal-at-webhosting-the-external-part/" data-wpel-link="exclude">Healer: External self-healing</a>, which handles hardware problems, the absence of connectivity, and anything the local systems can&#8217;t resolve locally.</li><li>Warden: A local agent that exposes a framework for self-healing on local nodes.  Warden is the component we will be exploring today.</li></ul>



<h3 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-EnterWarden">Enter Warden</h3>



<div class="wp-block-image"><figure class="alignright size-large is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2020/12/IMG_0393.png" alt="" class="wp-image-20161" width="302" height="236" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/12/IMG_0393.png 604w, https://blog.ovhcloud.com/wp-content/uploads/2020/12/IMG_0393-300x234.png 300w" sizes="auto, (max-width: 302px) 100vw, 302px" /></figure></div>



<p>Warden was designed as a simple, lightweight daemon process that exposes a plugin API, allowing members of the SRE team to quickly write small pluggable python scripts that handle specific conditions found on the local system. It is meant to exist as an agent on every single server of the web-hosting fleet, where it will work to maintain integrity and record information about failure states.</p>



<h3 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-Goals">Goals</h3>



<p>Warden has a few specific long term goals, which are worth going over.</p>



<h4 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-MaximizeSystemAvailability">Maximize system availability</h4>



<p>Warden attempts to detect scenarios that would degrade or otherwise disrupt the service and responds to fault events from the monitoring system. This allows for the quick return of the system to a functional, clean state; allowing it to reintegrate the available hosts pool and serve requests again. Being a local, per-server process, Warden is able to be reactive and process events in a timely fashion, avoiding network round trips and monitoring delays. This contributes to the general health of the infrastructure by keeping the amount of hosts in a failure state at a bare minimum. </p>



<h4 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-Logdiagnosticdataforlateranalysis">Log diagnostic data for later analysis</h4>



<p>Being a local agent present on every system, Warden is in the enviable position of being able to collect all sorts of surrounding data for export upon detecting a failure state.</p>



<p>Warden keeps a detailed record of the failure state and surrounding system state, to be queried later. This ensures diagnosis is not a blocking point for returning the host to duty. It is also important to remember the goal is&nbsp;<strong>not</strong>&nbsp;to sweep failure states under the carpet, or mask them.</p>



<p>Additionally, since many of these failure states are non-critical (as other hosts take over transparently), it may be&nbsp;<em>multiple days</em>&nbsp;by the time someone gets to look at it, at which point the relevant state to inspect is long gone, and we&#8217;re just left with an empty, yet offline server.</p>



<p>The primary goal here is actually to increase visibility into failure states, and to be able to quickly identify trends and underlying issues that must be mitigated or resolved, while ensuring the relevant data is kept while fresh.</p>



<p>At runtime, Warden generates snapshots of interesting system aspects. A long term goal is to capture a meaningful representation of the entire system state at the time of event, preventing the need to perform diagnostics directly on affected hosts.</p>



<h4 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-MinimizeHumanOverhead">Minimise human overhead</h4>



<p>Analysis of failure states can be highly time consuming, especially if you&#8217;re flooded by hundreds of systems reporting mostly the same issue. It can also be irritating to constantly deal with transient failure states that are considered &#8220;normal&#8221;, either due to known popular application bugs, or other known circumstances. Just sorting the signal from the noise can be a full time job, especially if your team is actively trying to maintain general health and resolve the issue long term.</p>



<p>This can quickly turn into a battle of attrition where resources are expended on managing the alerts, failure states and problems over actively working to mitigate and resolve them.</p>



<p>Warden hopes to streamline this process massively, allowing SRE people to focus on what actually matters and makes a difference in terms of Quality of Service.</p>



<h4 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-Makewritingself-healingpluginseasy">Make writing self-healing plugins easy</h4>



<p>The API Warden is meant to be simple. It abstracts much of the nuts and bolts of the implementation process involved in execution.</p>



<p>Plugin authors should not have to worry about scheduling their own run, or writing complex logic to obtain the information they are after, nor should they have to write solid logging code.</p>



<p>All of this should be handled by Warden. Plugin authors should be able to focus on describing their conditions, selecting what relevant data they want to record, and writing an action that hopefully restores functionality.</p>



<h3 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-Howdoesitwork?">How does it work?</h3>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="462" src="https://www.ovh.com/blog/wp-content/uploads/2020/12/IMG_0394-1024x462.png" alt="Warden - How does it work?" class="wp-image-20164" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/12/IMG_0394-1024x462.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/12/IMG_0394-300x135.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/12/IMG_0394-768x346.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/12/IMG_0394-1536x693.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2020/12/IMG_0394.png 1905w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure></div>



<h4 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-WardenCore">Warden Core</h4>



<p>As previously mentioned, Warden is a small daemon written entirely in Python. On boot, it will enumerate the plugins it is configured to activate, and place them in a queue.</p>



<p>Plugins may have configuration values as well, exposing easily tunable thresholds for response, or other settings. The Warden Core essentially serves to orchestrate everything, as well as provide the plugin API.</p>



<p>It also keeps track of various internal decisions, plugin states and how many times a plugin has done a self-healing action.</p>



<p>Then, once booted, the main workflow starts.</p>



<h4 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-StateCollection">State Collection</h4>



<p>Warden immediately goes and collects system states from its available sources. This could be, for example, a monitoring probe sink &#8211; which can be queried remotely as well as locally &#8211; or a snapshot of the process table.</p>



<p>Some deeper information is also generated, on demand, to keep the system load as light as possible.</p>



<p>This information is then sent to plugins matching the type of state collector. For example, plugins that operate on the process table will be gently fed this information.</p>



<h4 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-Pluginhandoff">Plugin hand off</h4>



<p>A Warden plugin consists of essentially three primary callbacks, which should be easy to implement.</p>



<p>Plugins are encouraged to terminate early if they do not find actionable items in the system state.</p>



<h5 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-ScanPhase">Scan Phase</h5>



<p>In this phase, a Warden plugin will receive information about the system state, in a form it can easily digest, using standard Python data structures.<br>The plugin can select some particular pieces of information it would like to further analyze, if necessary.</p>



<p>If an event is detected that the plugin can respond to immediately, then this is recorded to a&nbsp;<strong>Central Store</strong>&nbsp;(provided by our own Logs Data Platform product)</p>



<p>If at this point, a self-heal action is necessary, the plugin can signal it by setting its internal state accordingly.</p>



<h5 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-AnalysisPhase">Analysis Phase</h5>



<p>During this phase, the plugin will further dissect the received status, and/or collect information about the system &#8211; either requesting them from Warden, or collecting them itself.</p>



<p>This is where the diagnostic information will be exported to a&nbsp;<strong>Central Store</strong>, alongside a plethora of useful metadata (where, when, who, how).</p>



<p>At this point, if not already signaled by the previous phase, the plugin can mark its internal state as requiring an action.</p>



<h5 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-HealPhase">Heal Phase</h5>



<p>Warden will then check the internal state of the plugin, and if it needs to perform an action, this final phase will be executed.<br>This is where the logic to resolve the situation is written. Services get restarted, processes get terminated, maintenance scripts called, etc.<br><br>Success (or failure) is reported, and Warden will dutifully log the Action and its results to the&nbsp;<strong>Central Store.</strong></p>



<p>At this point, if an action was taken, Warden will refresh the corresponding state before moving on to the next plugin in the queue.</p>



<p>This process is repeated at configurable intervals that can be kept short, since plugins are lightweight and exit quickly if no issue is found.</p>



<h4 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-DashboardsandVisibility">Dashboards and Visibility</h4>



<p>Extensive Grafana dashboards as well as Graylog interfaces have been built to closely monitor everything the Warden does.</p>



<p>They simply query the Central Store where every single system reports its events and actions.</p>



<p>We can tell how frequently a specific self-heal is triggered, for example, on what amount of systems, and where they occur the most.</p>



<p>We can also easily tell where self-heals fail the most, between individual failure domains, or down to individual systems within a cluster.</p>



<p>They are made to be easy to drill down into, to get a bird eye&#8217;s view of the global state as well as a detailed view of the exact actions taken by a single plugin.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="540" src="https://www.ovh.com/blog/wp-content/uploads/2020/12/Screenshot_2020-12-09-warden-Global-Statistics-Grafana-1024x540.png" alt="" class="wp-image-20168" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/12/Screenshot_2020-12-09-warden-Global-Statistics-Grafana-1024x540.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/12/Screenshot_2020-12-09-warden-Global-Statistics-Grafana-300x158.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/12/Screenshot_2020-12-09-warden-Global-Statistics-Grafana-768x405.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/12/Screenshot_2020-12-09-warden-Global-Statistics-Grafana-1536x810.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2020/12/Screenshot_2020-12-09-warden-Global-Statistics-Grafana.png 1893w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>Keeping this up on a TV Monitor in office has been of incredible value when it comes to casually noticing trends, as well as identifying which problems are recurrent and which are transient.</p>



<h3 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-APracticalExample">A Practical Example</h3>



<p>As a practical example of how Warden can be tied into existing systems and handling their events, there exists a probe on our servers that verifies the availability of the hosting runtime stack, ensuring it functions and is in the correct state to process requests.</p>



<p>It would often raise an alarm after some specific code in our hosting stack either terminates abnormally, or creates a scenario where the stack was incapable of recovering on its own. This would generate an alert, mark the server as unavailable, and remove it from the active pool.</p>



<p>Rebooting the server or restarting the entire stack would obviously resolve the situation and return the system to the pool of available hosts, but this robs us of the opportunity to inspect the issue. Existing metrics and logs only shed partial light into what exactly had occurred in order to cause this; especially since reproducing it will often be dependent on specific applications we host. Not to mention that by the time someone got to look at it, the chances are that the interesting state has long left the system.</p>



<p>In order to mitigate this, a Warden plugin was written with the following logic:</p>



<ul class="wp-block-list"><li>It scans the local alert sink for the failure state (exiting if it is not present)</li><li>During the analysis phase, crash dumps are collected, the filesystem state is recorded, relevant logs are extracted.<br>The exact version of the hosting stack is also collected, alongside everything relevant.<br>This is then sent to the Central Store alongside information about the host, the site, and timestamps.<br>The plugin then marks itself as needing to take action.</li><li>Everything relevant having been collected will mean that the hosting stack is destroyed, cleaned, and relaunched.</li><li>Afterwards, the probe that raised the alert is refreshed. Congratulations, the system is now back online, and in a matter of minutes!</li></ul>



<p>The turnaround time for writing the plugin was also reasonably short, and was deemed complete in two iterations (mostly to collect more data).</p>



<p>This information helped our developers pin-point exactly what was happening, as well as continuing to be a solid metric for gauging the health of our infrastructure.</p>



<h3 class="wp-block-heading" id="Warden:ASelfhealingframeworkforlocalactions-InConclusion">In Conclusion</h3>



<p>So far, Warden has helped not only lower the amount of human resources expended towards diagnosing and resolving issues, but has generated targeted improvements to various components of our stack.</p>



<p>It has also identified issues that would otherwise have gone unnoticed simply by graphing a visual trend of certain non-fatal states, which has led to more fixes and improvements.</p>



<p>On-call duty cycles have also been reasonably more peaceful as the bar for accessibility has been significantly lowered when it comes to automating resolution of simple issues.</p>



<p>It has generally allowed us to better focus our energy where we are able to make a difference, and through further improvements, will hopefully continue to do so.</p>
<img loading="lazy" decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fwarden-the-self-healing-framework-for-local-actions%2F&amp;action_name=Warden%3A%20the%20self-healing%20framework%20for%20local%20actions&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>The Bastion &#8211; Part 4 &#8211; A new era</title>
		<link>https://blog.ovhcloud.com/the-bastion-part-4-a-new-era/</link>
		
		<dc:creator><![CDATA[Stéphane Lesimple]]></dc:creator>
		<pubDate>Thu, 29 Oct 2020 09:25:56 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[The Bastion]]></category>
		<guid isPermaLink="false">https://www.ovh.com/blog/?p=19446</guid>

					<description><![CDATA[This is the last article in the series about The Bastion. In the previous parts, we covered the principles of The Bastion, and talked about how delegation was at the core of the system. Then we explained how Security was at the heart of the design principles, in a detailed but hopefully not too-long article. [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fthe-bastion-part-4-a-new-era%2F&amp;action_name=The%20Bastion%20%26%238211%3B%20Part%204%20%26%238211%3B%20A%20new%20era&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2020/10/IMG_0347-1024x537.png" alt="The Bastion - Part 4 - A new era" class="wp-image-19637" width="768" height="403" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0347-1024x537.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0347-300x157.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0347-768x403.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0347.png 1200w" sizes="auto, (max-width: 768px) 100vw, 768px" /></figure></div>



<p>This is the last article in the series about The Bastion. In the previous parts, we covered <a rel="noreferrer noopener" href="https://www.ovh.com/blog/the-ovhcloud-bastion-part-1/" target="_blank" data-wpel-link="exclude">the principles of The Bastion</a>, and talked about how <a rel="noreferrer noopener" href="https://www.ovh.com/blog/the-ovhcloud-ssh-bastion-part-2-delegation-dizziness/" target="_blank" data-wpel-link="exclude">delegation was at the core of the system</a>. Then we explained how <a rel="noreferrer noopener" href="https://www.ovh.com/blog/the-bastion-part-3-security-at-the-core/" target="_blank" data-wpel-link="exclude">Security was at the heart</a> of the design principles, in a detailed but hopefully not too-long article.</p>



<p>Today, we&#8217;re announcing something special. You might have guessed it already, thanks to the (not so) little breadcrumbs trail we left in the previous articles. Without further ado, and because pictures can say a thousand words on their own:</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="372" src="https://www.ovh.com/blog/wp-content/uploads/2020/10/IMG_0348-1024x372.png" alt="" class="wp-image-19638" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0348-1024x372.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0348-300x109.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0348-768x279.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0348.png 1221w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure></div>



<p>We&#8217;re going open-source! We&#8217;re very excited to share this news with you, and to mark this new milestone in the lifecycle of The Bastion. We think it&#8217;s a perfect reason to bump to the next major version: v3.00.00! Obviously, all previous versions were internal-only.</p>



<p>The code is available at <a rel="noreferrer noopener nofollow external" href="https://github.com/ovh/the-bastion" target="_blank" data-wpel-link="external">GitHub</a>, and we&#8217;re also moving all the non-OVHcloud-specific development there from now on.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="612" height="325" src="https://www.ovh.com/blog/wp-content/uploads/2020/10/bastionstats1.png" alt="" class="wp-image-19624" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/10/bastionstats1.png 612w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/bastionstats1-300x159.png 300w" sizes="auto, (max-width: 612px) 100vw, 612px" /></figure></div>



<p>The <a href="https://ovh.github.io/the-bastion/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external">documentation</a> is also available online (<a rel="noreferrer noopener nofollow external" href="https://github.com/ovh/the-bastion/tree/master/doc/sphinx" target="_blank" data-wpel-link="external">as well as offline</a> as reStructuredText files), we encourage you to read it. For the most impatient, there is also a docker image available on Docker hub if you want to give it a try: the <em>TL;DR</em> section of <a rel="noreferrer noopener nofollow external" href="https://github.com/ovh/the-bastion/blob/master/README.md" target="_blank" data-wpel-link="external">the <em>README.md</em> on GitHub</a> will get you started.</p>



<p>Many of the more advanced features (such as PIV support, 2FA/MFA support, the notion of <em>realms</em>, the HTTPS proxy, etc.) are not yet fully documented, but all the basics are already there. We will enhance this during the next few weeks/months. A few features are not yet open-sourced either, such as the db plugin we talked about in the previous post. But it&#8217;ll make it to the open-source version eventually.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="598" height="328" src="https://www.ovh.com/blog/wp-content/uploads/2020/10/bastionstats2.png" alt="" class="wp-image-19625" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/10/bastionstats2.png 598w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/bastionstats2-300x165.png 300w" sizes="auto, (max-width: 598px) 100vw, 598px" /></figure></div>



<p>We hope it&#8217;ll be of use to the community, as much as it is to us, and we can&#8217;t wait to hear from you! The GitHub page is <a href="https://ovh.github.io/the-bastion/" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">over here</a>.</p>
<img loading="lazy" decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fthe-bastion-part-4-a-new-era%2F&amp;action_name=The%20Bastion%20%26%238211%3B%20Part%204%20%26%238211%3B%20A%20new%20era&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>The Bastion &#8211; Part 3 &#8211; Security at the core</title>
		<link>https://blog.ovhcloud.com/the-bastion-part-3-security-at-the-core/</link>
		
		<dc:creator><![CDATA[Stéphane Lesimple]]></dc:creator>
		<pubDate>Fri, 23 Oct 2020 15:33:49 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[The Bastion]]></category>
		<guid isPermaLink="false">https://www.ovh.com/blog/?p=19407</guid>

					<description><![CDATA[In previous parts, we&#8217;ve covered the basic principles of the bastion. We then explained how delegation was at the core of the system. This time, we&#8217;ll dig into some governing principles of how The Bastion is written. In a nutshell, the main purpose of the bastion is to ensure security, auditability and reliability in all [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fthe-bastion-part-3-security-at-the-core%2F&amp;action_name=The%20Bastion%20%26%238211%3B%20Part%203%20%26%238211%3B%20Security%20at%20the%20core&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<p>In previous parts, we&#8217;ve covered <a href="https://www.ovh.com/blog/the-ovhcloud-bastion-part-1/" data-wpel-link="exclude">the basic principles of the bastion</a>. We then explained how <a href="https://www.ovh.com/blog/the-ovhcloud-ssh-bastion-part-2-delegation-dizziness/" data-wpel-link="exclude">delegation was at the core of the system</a>. This time, we&#8217;ll dig into some governing principles of how The Bastion is written.</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2020/10/IMG_0338-1024x537.png" alt="The Bastion - Part 3" class="wp-image-19442" width="768" height="403" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0338-1024x537.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0338-300x157.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0338-768x403.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0338.png 1200w" sizes="auto, (max-width: 768px) 100vw, 768px" /></figure>



<p>In a nutshell, the main purpose of the bastion is to ensure <strong>security</strong>, <strong>auditability</strong> and <strong>reliability</strong> in all cases. To this end, the bastion is engineered in a very specific way, with some principles that must be respected when implementing new features. Today we&#8217;re going to zoom in on how one of the functionalities of the bastion has been implemented to ensure an in-depth security. There are technical details ahead, so viewer discretion is advised!</p>



<h3 class="wp-block-heading">The operating system is not just a scheduler</h3>



<p>One of the engineering principles of the bastion is to leverage the underlying operating system&#8217;s security features, as additional guards on top of the code&#8217;s logic itself.</p>



<p>Usually, when developing a program, one doesn&#8217;t really need to think about the OS it&#8217;ll be running on, because all the business logic goes directly into the code. At its basic level, the OS&#8217;s job is to ensure the program runs on top of the hardware it has in charge, by abstracting it, along with the other pieces of software that might be sharing this hardware. In other words, most of the time the OS is mainly a scheduler, whose job is to ensure all the programs are running properly, and don&#8217;t step on each other&#8217;s toes.</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2020/10/IMG_0339-1024x423.png" alt="Apps on OS" class="wp-image-19444" width="512" height="212" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0339-1024x423.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0339-300x124.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0339-768x317.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0339.png 1454w" sizes="auto, (max-width: 512px) 100vw, 512px" /></figure>



<p>To this end, an OS has the notion of <strong>user </strong>(or &#8220;account&#8221;), who may be the owner of some running programs and some files on the filesystem, alongside the notion of <strong>group</strong> (of users), so that e.g. a folder can be written to by several users. We&#8217;ll go back to this in a few minutes.</p>



<p>Now, let&#8217;s talk about applications. Most of the time, applications needing to handle users have a database with a &#8220;users&#8221; table, detailing the information about each user. In that case, the application&#8217;s code logic handles all the behaviour the program must have with respect to its users. For example, to authenticate a user, it stores a hash of each user password in the database, and checks whether the entered password&#8217;s hash matches what is stored in the database. If it does, then it deems the user to be successfully logged in. All this logic is entirely expressed in the code, the operating system plays no role in the process whatsoever.</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2020/10/IMG_0340-1024x538.png" alt="Application users &amp; OS users" class="wp-image-19447" width="768" height="404" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0340-1024x538.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0340-300x158.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0340-768x404.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0340.png 1267w" sizes="auto, (max-width: 768px) 100vw, 768px" /></figure>



<p>There is then, only one operating system user dedicated to the application, regardless of how many users exist in the application&#8217;s database. The application will run under this OS user, and all files logically pertaining to different users in the application&#8217;s functional view, will be owned by this same OS user. It works because the segregation between the functional users is done entirely by the code: even if the application can <em>technically </em>access all its users files, it will only allow, through its code logic, access to the proper files for the proper user.</p>



<h3 class="wp-block-heading">Code has bugs, but it shouldn&#8217;t matter</h3>



<p>Now, let&#8217;s imagine we&#8217;re talking about a program &#8211; let&#8217;s name it <em>MySuperCloudApp</em> &#8211; whose job is to store files for its users, so that they can later fetch them from the cloud. Let&#8217;s imagine there is a flaw in the code (of course, <a href="https://www.cvedetails.com/vulnerability-list/" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">this never happens</a>), which doesn&#8217;t properly escape the user&#8217;s requested file name. If, once logged in as my user, I request a download of the file named <code>myfile.txt</code>, the application will allow it because I&#8217;m logged in. </p>



<p>But what happens if I request <code>../somebodyelse/herfile.txt</code>, instead? If the code hasn&#8217;t been engineered to detect and filter out this weird request, it&#8217;ll just pass the read command to the underlying filesystems, which will allow it because, remember, the application runs under one OS user and all the actual user logic is handled by the application itself. All the application files are owned by the same OS user, so the request seems completely legitimate from an OS standpoint. I&#8217;ve just found a way to steal all the other users files. This type of flaw is called a <a href="https://owasp.org/www-community/attacks/Path_Traversal" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">path traversal</a>, and is, unfortunately, pretty common.</p>



<p>For the bastion, the OS is more than a scheduler: every bastion user is actually mapped to an operating system user underneath. Likewise, every bastion group is mapped to an operating system group underneath. So are all the group roles we&#8217;ve talked about in the previous post. This is a strong design choice: we end up with an application that is deeply intertwined with the OS it&#8217;s running on, and this comes with some cons. However, for a security asset, which the bastion is, the pros vastly outgrow them.</p>



<p>Had <em>MySuperCloudApp </em>have adopted this design, mapping its application users to actual OS users, then the attack we&#8217;ve talked about before wouldn&#8217;t have worked. Even if the application&#8217;s code was flawed, and passed the read request to the OS below, the OS would have denied it, because down at the OS level,&nbsp; <code>../somebodyelse/herfile.txt</code> is <strong>not</strong> owned by the same user. This is where the OS comes to rescue a flawed portion of code (which still needs to be corrected in all cases, of course!).</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2020/10/IMG_0341-1024x610.png" alt="The Bastion users mapped on OS users" class="wp-image-19450" width="768" height="458" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0341-1024x610.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0341-300x179.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0341-768x458.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0341.png 1141w" sizes="auto, (max-width: 768px) 100vw, 768px" /></figure>



<p>To take a more Bastion-y example, if a user pertains to <code>groupA</code>, and tricks the code into thinking it also pertains to <code>groupB </code>(because of a flaw in the bastion&#8217;s code logic), then it doesn&#8217;t matter too much because the OS will deny this user access to <code>groupB</code>&#8216;s keys, as he won&#8217;t have access to read the file down to the OS level. So he still won&#8217;t be able to access any of <code>groupB</code>&#8216;s servers. Technically, this is done by offloading the authentication part to <code>sshd</code>, which is well-known and does it quite well. When this phase succeeds, <code>sshd </code>creates a session under the proper OS user, and starts the bastion code entry point under this session.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>We use the OS as an additional safety net in case there is a logic error or a vulnerability in the code: even if the code is tricked into taking bad decisions, the underlying OS will be there to deny the action, hence nullifying the impact.</p></blockquote>



<p>In other words, all the OS bastion users have the bastion code declared as their system shell (instead of the usual <code>/bin/sh</code>). We&#8217;re even going further than that: the code is engineered in such a way that if a user succeeded in getting a real shell on the bastion, i.e. being able to run any command he&#8217;d like on the OS itself, completely bypassing all of the bastion code&#8217;s logic and checks, then he shouldn&#8217;t be able to do much more that what the normal bastion code logic allows him to. That&#8217;s another strong design principle, but helps to drastically reduce the impact of a security vulnerability, should it happen.</p>



<h3 class="wp-block-heading">Trust no one</h3>



<p>For some features to work correctly, the design choices we&#8217;ve outlined above implies that the bastion must sometimes create and delete users on the OS level. This can&#8217;t be done using unprivileged accounts, hence some parts of the code need to run under elevated privileges.</p>



<p>In The Bastion jargon, those portions of the code are called <em>helpers</em>, and are separated from the other portions of the code, normally running under the OS user corresponding to the functional bastion user who&#8217;s running them.</p>



<p>The <em>helpers </em>don&#8217;t trust the rest of the bastion code, so they never blindly trust what is passed as input to them, even if theoretically, this input has already been validated by the bastion code launching the helper. Their higher privilege is granted using the <code>sudo </code>command, with a very strict&nbsp;<code>sudoers </code>configuration which ensures that the caller can only run the helpers it&#8217;s supposed to run, and with the parameters it&#8217;s supposed to be allowed to specify. Once the helper has finished working, it communicates back information to its caller using JSON.</p>



<p>Let&#8217;s take the example of the <code>groupAddServer </code>command. As its name implies, this command is used by a group <code>aclkeeper </code>to add a new server to a bastion group. Let&#8217;s say the user <code>guybrush</code> is a gatekeeper of the bastion group <code>island</code>. On the OS level, the OS user&nbsp;<code>guybrush </code>will be a member of the <code>island-aclkeeper</code> system group. One part of the <code>sudoers </code>configuration will say this:</p>



<pre class="wp-block-code"><code class="">%island-aclkeeper ALL=(island) NOPASSWD: /usr/bin/env perl -T /opt/bastion/bin/helper/osh-groupAddServer --group island *</code></pre>



<p>This line translates to:</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>all the members of the <code>island-aclkeeper</code> system group (i.e. all the aclkeepers of the <code>island </code>bastion group) can run, as the <code>island </code>system user, the <code>osh-groupAddServer</code> perl script, in tainted mode, but with the command line options forced to start with <code>--group island</code></p></blockquote>



<p>The <code>island </code>system user is not mapped to a logical user of the bastion, this is a technical account representing the <code>island </code>bastion group. The file listing the servers of the <code>island </code>bastion group is owned by this system user, and only the <code>aclkeepers</code>, through this <code>sudo </code>rule, can impersonate this system user to add a server to their group. Also note, that the Perl taint mode is used here (-T). This is a special mode that instructs Perl to immediately halt execution of the program (here, the <em>helper</em>) if an attempt is made to use a variable influenced (<em>tainted</em>) by the outside environment, without checking for its validity first. This is an additional protection to ensure that an improperly sanitized input can&#8217;t make it through the program&#8217;s execution flow.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="332" src="https://www.ovh.com/blog/wp-content/uploads/2020/10/IMG_0343-1024x332.png" alt="guybrush, bastion and island" class="wp-image-19464" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0343-1024x332.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0343-300x97.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0343-768x249.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0343-1536x498.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0343.png 1538w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h1 class="wp-block-heading">Going down the rabbit hole with minijail</h1>



<p>For some plugins, we even went one level deeper. For example, we have a plugin to allow users to connect to a PostgreSQL database, using the classic <code>psql </code>client, but directly from the bastion. The idea is that the password to access the database is known to the bastion, not to the user, so the password can be extremely complex, and change every day if necessary. This is completely transparent to the user, who just connects to the bastion and asks to run the database plugin. This scheme is the same than when using SSH on both sides: as seen in the first post of this series, the ingress connection is between the user and the bastion (SSH), and the egress connection is between the bastion and the remote server. The only difference is that, in this case, the egress connection is not SSH, but SQL.</p>



<p>But how to secure <code>psql </code>so that, when running on the bastion, the user can&#8217;t escape from it? The problem is the same with the <code>mysql </code>client. Those programs are engineered to be run from the local computer, where the user can already run any command, so there&#8217;s no real reason to add a configuration option to those programs that forbids local execution of arbitrary commands (shell escape). However on the bastion, we don&#8217;t want to allow that. Of course maintaining a forked version of these SQL clients is a complete no-no, because the time we would allocate to maintaining these forks would be of better use in other projects. Instead, we&#8217;ve used a tool named <a href="https://github.com/google/minijail" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer"><code>minijail</code></a>, whose purpose is to make readily available, to any program, the (not so) recent features from the Linux Kernel &#8211; such as <a href="https://man7.org/linux/man-pages/man7/namespaces.7.html" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">namespaces</a>, <a href="https://man7.org/linux/man-pages/man7/capabilities.7.html" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">capabilities</a>, <a href="https://www.kernel.org/doc/html/v4.16/userspace-api/seccomp_filter.html" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">seccomp</a>, the <a href="https://www.kernel.org/doc/html/latest/userspace-api/no_new_privs.html" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer">no_new_privs</a> <code>prctl()</code> flag, etc. We&#8217;re not going to detail each and every one of these features, there&#8217;s a lot of material online about these, but rather zoom in on how we&#8217;ve used them in the context of The Bastion.</p>



<p>Let&#8217;s start with the conclusion: here is how it looks on the bastion system itself, while somebody is using the database plugin:</p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2020/10/screen2.png" alt="Minijail in action" class="wp-image-19457" width="803" height="206" title="Stephane Lesimple &gt; The Bastion - Part 3 - Security at the core &gt; screen2.png" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/10/screen2.png 803w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/screen2-300x77.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/screen2-768x197.png 768w" sizes="auto, (max-width: 803px) 100vw, 803px" /></figure></div>



<p>Don&#8217;t Panic yet, let&#8217;s go through this line by line.</p>



<p><span style="text-decoration: underline">The first line</span> (PID <code>16</code>) is the <code>sshd </code>system daemon. Nothing fancy here, this is your usual friendly daemon, listening on port 22 for incoming SSH connections.</p>



<p><span style="text-decoration: underline">The second line</span> (PID <code>413</code>) is the privileged process specially spawned when <code>guybrush </code>logged in successfully on the server. This is also completely standard SSH behavior: when somebody logs in, two <code>sshd </code>processes are spawned by the daemon, a privileged one, and an unprivileged one. Both are dedicated to handling the user, while the parent (the daemon) continues listening for new connections.</p>



<p><span style="text-decoration: underline">The third line</span> (PID <code>417</code>) is the corresponding unprivileged <code>sshd </code>process for <code>guybrush</code>. This one is responsible for starting up <code>guybrush</code>&#8216;s shell as soon as he&#8217;s logged in. Note that from now on, and until further notice, all code is executed under the own user&#8217;s (absence of) privileges.</p>



<p><span style="text-decoration: underline">The fourth line</span> (PID <code>418</code>) is <code>guybrush</code>&#8216;s shell. This is where it&#8217;s starting to differ from your usual server. In this case, the shell is not <code>/bin/bash </code>or <code>/bin/zsh</code>, but a portion of the code of the Bastion. As explained above, the bastion is declared as the user&#8217;s shell, so when somebody logs in, this is what gets executed instead of a more regular POSIX shell. This portion of the code is responsible for parsing the command-line the user specified, and executing the corresponding action, if this action is allowed. In this case, the user passed the <code>-i</code> parameter, which asks the bastion to start in interactive mode. This is a special mode where it&#8217;s easier to launch several bastion commands without having to re-authenticate oneself each time. So, this process is listening for commands from the user. Note that, at this stage, the user has already been authenticated by the system &#8211; as this is completely delegated to <code>sshd</code>. If the authentication fails, the user&#8217;s shell (here, the bastion code) is never executed.</p>



<p><span style="text-decoration: underline">The fifth line</span> (PID <code>497</code>) is the child of the interactive process, re-executing the users shell (<code>osh.pl</code>) with new parameters: <code>--osh db</code>, which will instruct this instance of the shell that the user wants to run the <code>db </code>bastion command.</p>



<p><span style="text-decoration: underline">The sixth line</span> (PID <code>502</code>) is the current bastion command the user is executing. This is the <code>db </code>plugin, and we can see part of the command line: <code>--name lechuck</code>, this tells the plugin that the users wants to connect to the database named <code>lechuck</code>.</p>



<p><span style="text-decoration: underline">The seventh line</span> (PID <code>503</code>) is the <code>ttyrec </code>parent process, as explained in the first post series, the entire console output of the session is being recorded by the bastion &#8211; this process is in charge of doing it.</p>



<p><span style="text-decoration: underline">The eighth line</span> (PID <code>504</code>) is the <code>ttyrec </code>child process, needed for pseudo-tty support, which in turn is needed for the recording. If you <em>really</em> want to know more about <code>pseudo-ttys</code>, head on to <a href="https://www.man7.org/linux/man-pages/man3/openpty.3.html" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer"><code>man openpty</code></a> and/or the <a href="https://github.com/ovh/ovh-ttyrec" data-wpel-link="external" target="_blank" rel="nofollow external noopener noreferrer"><code>ttyrec code</code></a> itself.</p>



<p><span style="text-decoration: underline">The ninth line</span> (PID <code>505</code>) is the <code>sudo </code>call to start <code>minijail</code>. This is needed because <code>minijail </code>needs to be <code>root </code>for a proper setup of the jail, before downgrading itself to an unprivileged account</p>



<p><span style="text-decoration: underline">The tenth line</span> (PID <code>506</code>) is <code>sudo</code>&#8216;s child, this one is in charge of starting the subcommand (<code>minijail </code>in that case)</p>



<p><span style="text-decoration: underline">The eleventh line</span> (PID <code>507</code>) is the invocation of <code>minijail</code>. The complete command line we&#8217;re launching is:</p>



<pre class="wp-block-preformatted"><code>/bin/minijail0 --logging=stderr -u guybrush -g&nbsp;guybrush -n -v --uts -d -P /tmp/chroot-guybrush-psql-wsvhp4 -S /etc/bastion/minijail/db-psql.seccomp -b /lib64 -b /lib -b /usr/lib -b /usr/share -k /home/guybrush/.psql /profile bind 0x10100E rw --set-env HOME=/ --set-env USER=guybrush --set-env LOGNAME=guybrush -- /usr/lib/postgresql/11/bin/psql --pset=pager=off -h dbserver.example.org -p 5432 -U lechuck -- lechuck</code></pre>



<p>Quite a beast. But let&#8217;s go through this step by step.</p>



<p>This tells <code>minijail </code>to setup a new IPC namespace (<code>--uts</code>), and to set the <code>no_new_privs</code> flag (-n), so that any part of the process it creates (and those processes own children) will never ever be able to be root again, no matter what. Under a <code>no_new_privs</code> process, even having a wildcard <code>sudoers </code>file, or knowing the root password and attempting to use <code>su</code>, is not enough to get back to UID <code>0</code>. You just can&#8217;t. </p>



<p>We also ask <code>minijail </code>to create a new mount namespace (-v) then <code>pivot_root</code> (<code>-P</code>) to a temporary empty directory, <code>/tmp/chroot-guybrush-psql-wsvhp4</code>, so that the whole filesystem becomes completely inaccessible. As we still need to be able to run an SQL client in this environment, we <code>bind-mount </code>a few important directories in this new namespace, such as <code>/lib64</code>, <code>/lib</code> and such, and also just one directory in read-write, located into the users&#8217;s own home directory, so that from inside this jail, it can still have its <code>.psql_history</code> and <code>.psqlrc</code> files from past sessions. </p>



<p>We also set a few environments variables, so that the SQL CLI is not lost (<code>HOME</code>, <code>USER</code>, <code>LOGNAME</code>), then setup a seccomp policy on top of all that, to limit which syscalls can be made from this environment. For example, the <code>execve()</code> syscall is forbidden: the SQL CLI can not create any other process, or it&#8217;ll get terminated. Last but not least, when all of this has been set up by <code>minijail</code>, it drops its privileges to the <code>guybrush </code>user (<code>-u</code>) and <code>guybrush </code>group (<code>-g</code>), before executing the <code>psql </code>binary.</p>



<p><span style="text-decoration: underline">The twelfth line</span> (PID <code>508</code>) is the <code>psql </code>process itself, running inside the jail we&#8217;ve built above. This way, it is extremely difficult to escape the <code>psql </code>binary and get out of the jail. The whole setup instantly disappears when the user disconnects. The only remains will be his <code>.psql_history</code> and <code>.psqlrc</code> files. Of course, the <code>ttyrec </code>session record of his SQL usage will remain, too (as executed outside of the jail).</p>



<p>This concludes the post, where we&#8217;ve been detailing how some design principles help in delivering a resilient and secure system. Next week, in the final post of this series, we&#8217;ll be announcing something special. Stay tuned!</p>
<img loading="lazy" decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fthe-bastion-part-3-security-at-the-core%2F&amp;action_name=The%20Bastion%20%26%238211%3B%20Part%203%20%26%238211%3B%20Security%20at%20the%20core&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>OVHcloud Predictor, part 1</title>
		<link>https://blog.ovhcloud.com/ovhcloud-predictor-part-1/</link>
		
		<dc:creator><![CDATA[Alexandre Kalatzis]]></dc:creator>
		<pubDate>Mon, 05 Oct 2020 21:33:43 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<guid isPermaLink="false">https://www.ovh.com/blog/?p=19320</guid>

					<description><![CDATA[In our previous article concerning the CVE-2017-9841 vulnerability, we presented our web application firewall (WAF) implemented with NAXSI. Usually, a WAF is run directly on the web server. At OVHcloud, we chose to run our web application firewall upstream, on a very powerful software layer that is specific to our web hosting infrastructures. These are [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fovhcloud-predictor-part-1%2F&amp;action_name=OVHcloud%20Predictor%2C%20part%201&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<p>In our previous article concerning the<a href="https://www.ovh.com/blog/cve-2017-9841-what-is-it-and-how-do-we-protect-our-customers/" data-wpel-link="exclude"> CVE-2017-9841</a> vulnerability, we presented our web application firewall (WAF) implemented with NAXSI.</p>



<p>Usually, a <strong>WAF</strong> is run directly on the web server. At OVHcloud, we chose to run our web application firewall upstream, on a very powerful software layer that is specific to our web hosting infrastructures. These are the ‘<em>Predictors</em>’.</p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2020/10/IMG_0295-1024x537.png" alt="OVHcloud Predictor - Part 1" class="wp-image-19396" width="768" height="403" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0295-1024x537.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0295-300x157.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0295-768x403.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0295.png 1200w" sizes="auto, (max-width: 768px) 100vw, 768px" /></figure></div>



<p>If you would like to learn more about them, this article focuses on them in detail.</p>



<p>They are a very crucial part of our infrastructure, and they’re like heroes you’d read about in fiction — but absolutely real!</p>



<p>Before we start describing the role of Predictors and how they work, we will need to understand how this infrastructure operates, powering 6 million websites.</p>



<p>To work on the internet, websites need a computer that serves queries from web browsers — this is a role a <strong>server </strong>plays.</p>



<p>But just one server is not enough to ensure that a website is available all the time. This means you need to add several servers in case one of them experiences an outage, as well as load balancers to redirect traffic to the right machine.</p>



<p>Websites use and produce data that needs to be conserved, even if the server that makes the website available on the internet goes down. To guarantee security for this data, we externalise storage within two distinct technical building blocks — file servers, and database servers.</p>



<p>These specialised servers have dedicated hardware and software, which offer optimal conservation for data and simplified backup strategies.</p>



<p>Here is a diagram representing the organisation of our web hosting clusters:</p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2020/10/IMG_0293-1024x496.png" alt="Organisation of our web hosting clusters" class="wp-image-19391" width="768" height="372" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0293-1024x496.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0293-300x145.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0293-768x372.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0293-1536x744.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0293.png 1987w" sizes="auto, (max-width: 768px) 100vw, 768px" /></figure></div>



<p>A vast architecture like this requires heavy financial investment. In fact, websites are not using constantly their allocated resources. With several websites hosted on this single infrastructure, the resources can be shared, and costs can be divided. This is the principle behind shared hosting.</p>



<p>At OVHcloud, we also offer hosting plans with guaranteed resources — Performance hosting plans. This means that instead of sharing a server’s resources with other customers, your website is placed on a separate server, and its resources are fully dedicated to you. Our Predictors use their talents here, too!</p>



<p>As you can see, the Predictors are included in the big family of load balancers.</p>



<p>So what sets them apart? They are specific to our web hosting plans, and they use data from our IT system to recognise the domains hosted, as well as the resources allocated to them.</p>



<p>They have four main roles:</p>



<ul class="wp-block-list"><li>Distributing queries depending on our customers offers in different clusters and web servers.</li><li>Ensuring that resources are distributed equally to customers using web servers, and redistributing resources automatically if required.</li><li>Protecting the infrastructure.</li><li>Regulating traffic during incidents, and blocking access to certain servers while the technical team carry out interventions.</li></ul>



<p>Since the subject is so vast, we will detail the first two points in this article, and we’ll cover the other two points in a second article.</p>



<p>To assign the right server for each HTTP request, Predictors use several different criteria.</p>



<h3 class="wp-block-heading">A fair balance of traffic</h3>



<p>To work as load balancers, Predictors analyze all incoming queries in order to determine which web server is best to choose as a target, depending on their domain name.</p>



<p>This process only adds a few milliseconds to the request response time, but adapts Predictors answers with server statuses and website traffic in real-time — in that way we can guarantee optimal service availability.</p>



<p>In nominal operation, websites are reallocated periodically to balance the load for servers, and ensure optimal performance for customers.</p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2020/10/IMG_0297.png" alt="OVHcloud Predictor" class="wp-image-19395" width="389" height="218" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0297.png 723w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0297-300x168.png 300w" sizes="auto, (max-width: 389px) 100vw, 389px" /></figure></div>



<h4 class="wp-block-heading">Reallocation depending on the hosting plan</h4>



<p>Predictors determine which hosting plan is linked to each incoming request. This enables them to redirect traffic to the corresponding web farm.</p>



<p>For example, customers who have opted for Performance offers with guaranteed resources are redirected to a web farm where the resources are dedicated to each website.</p>



<p>Some hosting offers like Cloud Web are grouped on dedicated clusters, which makes them easier to maintain.</p>



<p>With this system, we can also manage situations where the service is being misused. Although they may not do so knowingly, some customers use a high volume of resources on our infrastructure, and this can negatively impact performance for other websites hosted on the same server. To avoid this, a hosting plan can be temporarily redirected to a server cluster that is dedicated to managing these situations on a ‘best effort’ basis. When this happens, the customer is contacted accordingly.</p>



<p>We will discuss this in more detail in the next article.</p>



<h4 class="wp-block-heading">Cache optimization</h4>



<p>On our shared infrastructure, the data stored on hosting plans is grouped onto file servers that support multiple customers.</p>



<p>The web servers connect to these file servers using the <strong>NFS</strong>(Network File System) protocol.</p>



<p>This protocol is known for being robust and flexible, and enables us to share files across the network. Each time a read or write action is performed on the storage space dedicated to a website, data passes through the network before being read or written on the remote storage hardware. The use of this protocol — associated with the remote storage block — is a key factor that makes both the Predictor and the infrastructure resilient against website outages. The website data is instantly available on other web servers, so the website’s traffic can be redirected seamlessly from one server to another.</p>



<p>The simplest way of distributing queries across a web server cluster is to send the same number of queries to each server. But there are smarter ways of going even further to optimize resource usage!</p>



<p>To reduce queries to the storage server and speed up the website, we use a cache layer directly on the web servers to manage the file system.</p>



<p>This means that when a web user visits a website for the first time (whether they are using a CMS like WordPress, Joomla!, etc., or a website coded from scratch), the web server will read the website data on the file server, and store it in-memory via its VFS (Virtual File System) cache. This cache offers an abstraction of the underlying storage system, enabling the web server to use remote storage via NFS protocol — the same way as a local hard drive. For future queries, the HTTP server will avoid querying the network for this file.</p>



<p>But as Phil Karlton said, there are only two hard things in computer science: cache invalidation and naming things (<a href="https://quotesondesign.com/phil-karlton/" target="_blank" rel="noreferrer noopener nofollow external" data-wpel-link="external">https://quotesondesign.com/phil-karlton/</a>). Because with each write operation, the cache needs to be updated — which generates traffic on the network.</p>



<p>To overcome this, the Predictors keep website visitors on the same server — which means the cache doesn’t have to be refreshed on other servers that are only used in the event of an incident, or rebalancing operation.</p>



<p>By assigning a single server to each hosting plan, we can significantly reduce the volume of network queries, which is a strong argument for getting good value for money on an infrastructure.</p>



<p>Predictors can also divide incoming traffic according to certain criteria (e.g. the solution, the source IP address), and balance the load for a single website across several web servers, while getting the optimal performance delivered by this cache optimization — but this is another story, which we’ll focus on in another article.</p>



<h4 class="wp-block-heading">Monitoring</h4>



<p>The Predictors also monitor the web servers constantly by retrieving their statuses. And they don’t just check the machine’s availability (does it ping? Is Apache responding?) — they also verify many other probes that are more specific to our hosting platform, and help us guarantee that websites are working properly.</p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2020/10/IMG_0294-953x1024.png" alt="Predictors: Monitoring" class="wp-image-19392" width="477" height="512" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0294-953x1024.png 953w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0294-279x300.png 279w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0294-768x825.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/10/IMG_0294.png 1078w" sizes="auto, (max-width: 477px) 100vw, 477px" /></figure></div>



<p>If a web server becomes unavailable, the Predictors no longer redirects traffic to it, and the requests that would have been sent there are redirected to a working server. This significantly reduces the impact on the customer’s side.</p>



<p>This is when the self-healing mechanism described in another of our articles comes in: <a href="https://www.ovh.com/blog/selfheal-at-webhosting-the-external-part/" data-wpel-link="exclude">Selfheal at Webhosting – The external part</a></p>



<p>It takes over to repair the web server, before the Predictors re-integrates it in to the cluster, and HTTP requests can be sent on it again.</p>



<h3 class="wp-block-heading">And our final challenge? Resolving how SSL certificates are issued.</h3>



<p>Since 2016, we have delivered all of our web hosting plans with SSL certificates generated by our partner, Let’s Encrypt.</p>



<p>Before we deliver certificates, Let’s Encrypt needs to verify that the requester is legitimate. To verify this, Let’s Encrypt provides ‘challenges’ that can only be resolved by an infrastructure responding behind the domain name of the SSL certificate requester. This verification is carried out via a HTTP request to a single URL dependent on the domain, and is generated when the certificate request is launched by our infrastructure following a customer’s request.</p>



<p>On our infrastructure, the Predictors play a vital role in resolving these challenges! Placed on the critical path upstream from web servers, they can receive the Let’s Encrypt request, and process it without sending queries to the web servers.</p>



<p>This means we can generate SSL certificates with total transparency for our users, and simplify HTTPS access to websites!</p>



<h3 class="wp-block-heading">And is that everything?</h3>



<p>As you will have gathered from this article, Predictors are essential components of the OVHcloud shared hosting infrastructure.</p>



<p>They help us efficiently provide the features we offer, so that we can deliver web hosting solutions at the best price.</p>



<p>Like superheroes, they have more than one trick up their sleeve. And above all, they’re here to protect us!</p>



<p>In our next article, we will show you the benefits of Predictors in terms of security and stability.</p>
<img loading="lazy" decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fovhcloud-predictor-part-1%2F&amp;action_name=OVHcloud%20Predictor%2C%20part%201&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>The OVHcloud SSH Bastion – Part 2: delegation dizziness</title>
		<link>https://blog.ovhcloud.com/the-ovhcloud-ssh-bastion-part-2-delegation-dizziness/</link>
		
		<dc:creator><![CDATA[Stéphane Lesimple]]></dc:creator>
		<pubDate>Fri, 11 Sep 2020 15:05:44 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[The Bastion]]></category>
		<guid isPermaLink="false">https://www.ovh.com/blog/?p=18452</guid>

					<description><![CDATA[This is the second part of a blog series, here is part one. We&#8217;ve previously found that the bastion is not your usual SSH jumphost (in fact, we found it is not a jumphost at all) and we discussed how the delegation was one of the core features we&#8217;d originally needed. So, let&#8217;s dive into [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fthe-ovhcloud-ssh-bastion-part-2-delegation-dizziness%2F&amp;action_name=The%20OVHcloud%20SSH%20Bastion%20%E2%80%93%20Part%202%3A%20delegation%20dizziness&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<p class="has-drop-cap">This is the second part of a blog series, here is <a href="https://www.ovh.com/blog/the-ovhcloud-bastion-part-1/" data-wpel-link="exclude">part one</a>. We&#8217;ve previously found that the bastion is not your usual SSH jumphost (in fact, we found it is not a jumphost at all) and we discussed how the delegation was one of the core features we&#8217;d originally needed. So, let&#8217;s dive into these concepts. There are two compatible accesses models on the bastion: personal and group-based.</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2020/09/IMG_0266-1024x537.png" alt="The OVHcloud Bastion - Part 2" class="wp-image-19254" width="768" height="403" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/09/IMG_0266-1024x537.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/09/IMG_0266-300x157.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/09/IMG_0266-768x403.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/09/IMG_0266.png 1200w" sizes="auto, (max-width: 768px) 100vw, 768px" /></figure>



<h2 class="wp-block-heading">Personal Accesses &#8211; Piece of Cake</h2>



<p>On the bastion, each account has (at least) one set of <strong>personal egress keys</strong>. These beasts are generated when the account is first created. The personal egress <strong>private key</strong> sits in the bastion account home. The account user has no way to see it, or export it out of the bastion, but they can use it through the bastion&#8217;s code logic. The user can retrieve the corresponding <strong>public key</strong> at any time, and install it &#8211; or get it installed &#8211; on the remote servers he needs to access. Depending on your use case &#8211; and the level of autonomy you want to give to the teams &#8211; there are two ways of managing these personal accesses.</p>



<h3 class="wp-block-heading">Help yourself</h3>



<p>The first way mimics how you would manage accesses if you weren&#8217;t using an SSH bastion at all. This is a perfectly valid way to handle accesses on a simple level, without too many users and a limited number of machines. This allows anyone to grant themselves personal accesses on the bastion, without having to ask anyone else to do it. It sounds like a security hole, but it&#8217;s not. If someone adds themself a personal access to the remote server, it will only work if his personal egress public key has <em>already</em> been installed on the remote server. In other words, he either already had access to the remote server to do this &#8211; using means other than the bastion &#8211; or somebody who had access to the remote server accepted the addition of his key. Either way, he cannot magically grant himself personal access without the admins of the remote server first permitting his key.</p>



<h3 class="wp-block-heading">Ask the IT crowd</h3>



<p>Another way to handle this can be to grant a limited number of people, such as security teams, the right to add personal accesses to others. This way people are less autonomous, but it might be useful if adding accesses has to be enacted via normalized processes. It also has some nice effects: as a sysadmin, one of the pros is that you can create 3 separate accounts on the remote machine, and map them to each bastion account you&#8217;re adding. This is a good method for achieving <strong>end-to-end traceability</strong>; including on the remote server; where you might want to install <strong>auditd</strong> or similar tools. It&#8217;s also doable in the <em>help yourself</em> mode, but it may be harder to enforce.</p>



<p>To be clear, this access model doesn&#8217;t scale so efficiently when we&#8217;re dealing with whole teams, or big infrastructures &#8211; this is where group-based access comes handy.</p>



<h2 class="wp-block-heading">Group Accesses &#8211; Let&#8217;s Rock</h2>



<p>A group has three components:</p>



<ul class="wp-block-list"><li>A list of members (accounts, representing individual people)</li><li>At least one set of group egress keys</li><li>A list of servers (actually IPs)</li></ul>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2020/09/IMG_0263.png" alt="Bastion - Group" class="wp-image-19249" width="638" height="343" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/09/IMG_0263.png 850w, https://blog.ovhcloud.com/wp-content/uploads/2020/09/IMG_0263-300x161.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/09/IMG_0263-768x413.png 768w" sizes="auto, (max-width: 638px) 100vw, 638px" /></figure>



<h3 class="wp-block-heading">Servers list</h3>



<p>The servers list is actually a list of IPs, or IP blocks. They map to your servers, network devices, or anything else with SSH capability that has an IP (on which the egress group key has been installed). Technically, this list is actually composed of 3-tuple items: <em>remote user</em>, <em>remote IP</em> (or IP block), <em>remote port</em>. That which applies to the personal accesses, also applies here: adding a server to the list doesn&#8217;t magically give access to it, it is first necessary to install the <strong>egress group public key</strong>. Of course, managing the installation of these keys manually quickly becomes impractical, but you can consider these part of the configuration of the servers, hence they should be managed with whichever centralized configuration system you already use (Puppet, Chef, Ansible, /bin/cp&#8230; <em>wait, no, strike this last one</em>).</p>



<h3 class="wp-block-heading">Members list</h3>



<p>The members are people who can connect to any server listed in the group server list. They&#8217;ll be using the <strong>private egress group key</strong> they have access to, as members of said group. Of course, they have no way to extract this private key for their own use outside of the bastion, they can only use it through the bastion&#8217;s code logic.</p>



<p>Got a new team member? Just add them as a member of your group, and they instantly get access to all the group servers. Somebody leaves the company? Just delete there account on the bastion, and all the accesses are instantly gone. This is the case because all your servers should have incoming SSH sessions limited to your bastions. This way, any rogue SSH key that would have been added, is no longer of any use.</p>



<h3 class="wp-block-heading">And some more</h3>



<p>We&#8217;ve covered the basics of the group-based approach, but as we need a lot of flexibility and delegation, there is a little more to cover. Remember when I said a group had 3 components? Well, I lied. A group has more than just <em>members</em>. Additional group roles include:</p>



<ul class="wp-block-list"><li>Guests</li><li>Gatekeepers</li><li>Aclkeepers</li><li>Owners</li></ul>



<p>All of these are lists of accounts that have a specific role in the group.</p>



<p>First, <strong>guests</strong>. These are a bit like <strong>members</strong>, but with less privileges: they can connect to remote machines using the group key, but not to all the machines of the group, only to a subset. This is useful when somebody outside of the team needs a specific access to a specific server, potentially for a limited amount of time (as such accesses can be set to expire).</p>



<p>Then, <strong>gatekeepers</strong>. Those guys manage the list of members and guests of the group. In other terms, <em>they have the right to give the right to get access</em>. Nothing too complicated here. Then, there are the <strong>aclkeepers</strong>. As you may have guessed, they manage the list of servers that are part of the group. If you happen to have some automation managing the provisioning of servers of your infrastructure, this role could be granted to a robot account whose sole purpose would be to update the servers list on the bastion, in a completely integrated way with your provisioning. You can even tag such accounts so that they&#8217;ll never be able to use SSH through the bastion, even if somebody grants them by mistake!</p>



<p>Last but not least, the <strong>owners</strong> have the highest privilege level on the group, which means they can manage the gatekeepers, aclkeepers and owners list. They are permitted to give the right<em> to give the right</em> to get access. Moreover, users can accumulate these roles, which means some accounts may be a member and a gatekeeper at the same time, for example.</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" src="https://www.ovh.com/blog/wp-content/uploads/2020/09/IMG_0264-1024x833.png" alt="Bastion - Group roles" class="wp-image-19252" width="768" height="625" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/09/IMG_0264-1024x833.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/09/IMG_0264-300x244.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/09/IMG_0264-768x625.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/09/IMG_0264.png 1359w" sizes="auto, (max-width: 768px) 100vw, 768px" /></figure>



<h2 class="wp-block-heading">Global roles &#8211; Come Get Some</h2>



<p>Beyond the roles we have just described &#8211; which are all scoped to a group &#8211; there are two additional roles, which are scoped to the whole bastion: the &#8216;superowner&#8217; and the &#8216;bastion admin&#8217;.</p>



<p>In a nutshell, a <strong>superowner</strong> is the implicit owner of all groups present on the bastion. This comes in handy if the group becomes ownerless, as superowners are able to nominate a brand new owner. See where I&#8217;m going? Superowners are permitted<em> </em>to give the right to give the right<em> to give the right to get access</em>.</p>



<p>Dizzy yet? Now, for the most powerful role: the <strong>bastion admin</strong>. This role should only be given to a few individuals, as they can impersonate anyone (even if, of course, when they do, this is logged, and makes our SIEM go red), and in practice should not be given to anyone who is not already root on the bastion&#8217;s operating system itself. Among other things, they manage the configuration of the bastion, where the superowners are declared. Hold your breath. Ready? They are permitted to give the right to give the right to give the right<em> to give the right </em>to get access. This is why delegation is at the core of the system: everybody has their own set of responsibilities, and potential action, without having to ask the bastion admin.</p>



<h2 class="wp-block-heading">Wrapping up</h2>



<p>All the access management concepts we&#8217;ve talked about are mapped to actual commands. These can be run on the bastion after the user has authenticated himself (the famous ingress connection). They&#8217;re called <em>osh commands</em> in bastion jargon. There are no egress connections in this case, as these commands interact with the bastion itself:</p>



<p><img loading="lazy" decoding="async" width="791" height="1373" class="wp-image-19011" style="width: 700px" src="https://www.ovh.com/blog/wp-content/uploads/2020/07/bastion_help.png" alt="" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/07/bastion_help.png 791w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/bastion_help-173x300.png 173w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/bastion_help-590x1024.png 590w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/bastion_help-768x1333.png 768w" sizes="auto, (max-width: 791px) 100vw, 791px" /></p>



<p>As you may notice in the above screenshot, the version of the bastion software seems to be very close to <strong>3.00.00</strong>! Perhaps, an interesting milestone is coming up?</p>



<p>In the next part of this blog series, we dig into some implementation details of one of those <em>osh plugins</em> and, more precisely, on our <a href="https://www.ovh.com/blog/the-bastion-part-3-security-at-the-core/" data-wpel-link="exclude">security  and defense-programming approach</a>.</p>
<img loading="lazy" decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fthe-ovhcloud-ssh-bastion-part-2-delegation-dizziness%2F&amp;action_name=The%20OVHcloud%20SSH%20Bastion%20%E2%80%93%20Part%202%3A%20delegation%20dizziness&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Selfheal at Webhosting &#8211; The external part</title>
		<link>https://blog.ovhcloud.com/selfheal-at-webhosting-the-external-part/</link>
		
		<dc:creator><![CDATA[Florian Chardin]]></dc:creator>
		<pubDate>Fri, 17 Jul 2020 12:34:38 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Automation]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[Self-heal at Webhosting]]></category>
		<category><![CDATA[SRE]]></category>
		<category><![CDATA[Web Hosting]]></category>
		<guid isPermaLink="false">https://www.ovh.com/blog/?p=18726</guid>

					<description><![CDATA[Introduction With almost 6000000 websites hosted on more than 15000 servers, the OVHcloud Webhosting SRE team manage lots of alerts during their working day. Our infrastructure is constantly growing, but to scale smoothly, the amount of time spent solving alerts should not increase proportionally. We need, therefore, some tools to help us.&#160;&#160;In our team, we [&#8230;]<img src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fselfheal-at-webhosting-the-external-part%2F&amp;action_name=Selfheal%20at%20Webhosting%20%26%238211%3B%20The%20external%20part&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></description>
										<content:encoded><![CDATA[
<h3 class="wp-block-heading" id="OVHCloudblogarticleSelfhealatWebhosting(part1)-Introduction">Introduction</h3>



<p>With almost 6000000 websites hosted on more than 15000 servers, the OVHcloud Webhosting SRE team manage lots of alerts during their working day. </p>



<p>Our infrastructure is constantly growing, but to scale smoothly, the amount of time spent solving alerts should not increase proportionally.</p>



<p>We need, therefore, some tools to help us.&nbsp;&nbsp;In our team, we call it the <em>selfheal</em>.&nbsp;</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="537" src="https://www.ovh.com/blog/wp-content/uploads/2020/07/8C2CA3A8-F3E3-4B73-A4C5-087DACF7E88F-1024x537.jpeg" alt="Selfheal at Webhosting – The external part" class="wp-image-18848" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/07/8C2CA3A8-F3E3-4B73-A4C5-087DACF7E88F-1024x537.jpeg 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/8C2CA3A8-F3E3-4B73-A4C5-087DACF7E88F-300x157.jpeg 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/8C2CA3A8-F3E3-4B73-A4C5-087DACF7E88F-768x403.jpeg 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/8C2CA3A8-F3E3-4B73-A4C5-087DACF7E88F.jpeg 1200w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure></div>



<h3 class="wp-block-heading" id="OVHCloudblogarticleSelfhealatWebhosting(part1)-Whatistheselfheal?">What is the <em>selfheal</em>?</h3>



<p>The <em>selfheal </em>refers to the automation of alert solving in our production environments. The automated process is able to fix well-known issues, with no admin interaction.</p>



<h3 class="wp-block-heading" id="OVHCloudblogarticleSelfhealatWebhosting(part1)-Whydoweneedit?">Why do we need it?</h3>



<p>We must limit the time we spend to solve alerts as far as possible. Not only so we have the time to run and maintain the infrastructure, but also to stay up to date.</p>



<p>With the number of servers we manage, a small issue can represent dozens of alerts.</p>



<p>We need to be efficient by automating as many production chores as possible.</p>



<h4 class="wp-block-heading" id="OVHCloudblogarticleSelfhealatWebhosting(part1)-Hardware">Hardware</h4>



<p>Serving billions of HTTP requests each day requires a lot of resources, which is why we often use physical servers in our datacenters. </p>



<p>Even a single physical server requires a big follow up. It takes a lot of time to diagnose, schedule downtime, request and manage an intervention with datacenter teams, or even to reinstall the operating system when a disk is faulty.</p>



<p>We cannot afford to spend hours on repetitive tasks when they can be automated.</p>



<h4 class="wp-block-heading">Software</h4>



<p>Even if software seems predictable, it will still encounter failure. This is true even when managing the underlying infrastructure&nbsp;that hosts millions of lines of unknown code provided by our client.</p>



<p>While we try to have a stable software stack, we cannot predict all behaviour. Many of the software problems can be solved with a restart or a quick fix, and lots of these operations can also be automated.</p>



<p>We should alert the on-call admin staff as little as possible, only when it&#8217;s absolutely necessary.</p>



<p>The idea is is to log each action done by the <em>selfheal </em>to identify bug or error patterns and then work on longer term fixes.</p>



<h3 class="wp-block-heading" id="OVHCloudblogarticleSelfhealatWebhosting(part1)-Theselfhealatwebhosting">The <em>selfheal </em>at Webhosting</h3>



<p>At Webhosting we split <em>selfheal </em>in two part:</p>



<ol class="wp-block-list"><li>External <em>selfheal </em>which handles hardware problems or anything that can not be solved by the host itself.</li><li>Internal <em>selfheal </em>which is intended to solve software problems on a given system.</li></ol>



<p>In this article, we will discuss the the external part.</p>



<h3 class="wp-block-heading" id="OVHCloudblogarticleSelfhealatWebhosting(part1)-Externalselfheal">External <em>selfheal</em></h3>



<h4 class="wp-block-heading" id="OVHCloudblogarticleSelfhealatWebhosting(part1)-Context">Context:</h4>



<p>As we said earlier, the external part of our <em>selfheal </em>is mainly intended to solve hardware problems that cannot be solved by the server alone.</p>



<p>To accomplish this, we created a small micro-service application that listens &#8211; monitoring events.</p>



<p>We could have chosen an existing tool (like StackStorm), but we didn&#8217;t. Here&#8217;s why:</p>



<ul class="wp-block-list"><li>Building micro-services is really simple and fast at OVH.</li><li>Structured, detailed and simple logs with a uniq uuid to follow each selfheal task in our internal logging system (which allow us to graph them easily).&nbsp;</li><li>Simple integration with our existing tools and ecosystem&nbsp;</li><li>Fast and easy deployment in all our regions</li><li>Simple CI/CD (unit-testing, etc)</li><li>Custom notifications, like chat-bot</li><li>Intelligence and history</li></ul>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="280" src="https://www.ovh.com/blog/wp-content/uploads/2020/07/4FE23E51-6835-45F4-8ACE-819668BB9F16-1024x280.png" alt="External Selfheal" class="wp-image-18826" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/07/4FE23E51-6835-45F4-8ACE-819668BB9F16-1024x280.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/4FE23E51-6835-45F4-8ACE-819668BB9F16-300x82.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/4FE23E51-6835-45F4-8ACE-819668BB9F16-768x210.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/4FE23E51-6835-45F4-8ACE-819668BB9F16-1536x419.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/4FE23E51-6835-45F4-8ACE-819668BB9F16.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure></div>



<h4 class="wp-block-heading" id="OVHCloudblogarticleSelfhealatWebhosting(part1)-Howitworks">How it works</h4>



<p>Everything starts with our monitoring, which scraps the servers probes and sends all alerts in a Kafka topic.</p>



<p>The application consumes Kafka events and then reacts instantly with the correct workflow, depending on the problem.</p>



<p>The app will react with the appropriate workflow depending on the alert it gets. It does this by performing the correct API call to our different services and tools.</p>



<p>All actions performed are stored. This prevents having to do the same fix several times on a given server and to identify complex problems.</p>



<h4 class="wp-block-heading" id="OVHCloudblogarticleSelfhealatWebhosting(part1)-Concreteexampleonfaultydiskreplacement">Concrete example on faulty disk replacement</h4>



<p>One of the top time-consuming alerts we&#8217;ve had to solve was the replacement of unhealthy HDD found by SMART checks.</p>



<p>Being stateless, lots of our servers use a single disk with no raid setup.&nbsp;It also means replacing a disk to reinstall the host; but hopefully, it can be done with a single API call.</p>



<p>To manage this alert, an admin had to do the following actions:</p>



<ol class="wp-block-list"><li>Put the server in maintenance to drain client requests</li><li>Create a datacenter request to replace the HDD</li><li>Reinstall the server</li></ol>



<p>This whole process can take up to 3 hours and is hard to execute manually (managing several issues at once).&nbsp;</p>



<p>The first thing we did, was to automate the check with a probe.</p>



<p>Then, we decided to automate the whole thing with a simple workflow in our self-healing application, then to orchestrate the API call.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="352" src="https://www.ovh.com/blog/wp-content/uploads/2020/07/886B192D-9DF6-4DD7-AF70-77351AA6BFF2-1024x352.png" alt="Internal Selfheal" class="wp-image-18827" srcset="https://blog.ovhcloud.com/wp-content/uploads/2020/07/886B192D-9DF6-4DD7-AF70-77351AA6BFF2-1024x352.png 1024w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/886B192D-9DF6-4DD7-AF70-77351AA6BFF2-300x103.png 300w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/886B192D-9DF6-4DD7-AF70-77351AA6BFF2-768x264.png 768w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/886B192D-9DF6-4DD7-AF70-77351AA6BFF2-1536x528.png 1536w, https://blog.ovhcloud.com/wp-content/uploads/2020/07/886B192D-9DF6-4DD7-AF70-77351AA6BFF2.png 2048w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p>With this process, we are able to replace disks every day without any manual tasks performed by an admin.</p>



<h3 class="wp-block-heading" id="OVHCloudblogarticleSelfhealatWebhosting(part1)-Toconclude">To conclude</h3>



<p>Last month, our external <em>selfheal </em>tool requested more than 70 datacenter interventions to datacenter teams which represents a big time saving.</p>



<p>We won in reactivity. No more lag between the time an alert is detected and when it&#8217;s handled.</p>



<p>Alerts are handled instantly when detected by the monitoring system. It helps us to keep a clean monitoring backlog and to avoid &#8220;batches&#8221; of alert solving, which were complicated for both us and DC.</p>



<p>Now, we just handle alerts that cannot be solved through automation and focus on corner cases, where admin interactions are valuable and required.</p>
<img loading="lazy" decoding="async" src="//blog.ovhcloud.com/wp-content/plugins/matomo/app/matomo.php?idsite=1&amp;rec=1&amp;url=https%3A%2F%2Fblog.ovhcloud.com%2Fselfheal-at-webhosting-the-external-part%2F&amp;action_name=Selfheal%20at%20Webhosting%20%26%238211%3B%20The%20external%20part&amp;urlref=https%3A%2F%2Fblog.ovhcloud.com%2Ffeed%2F" style="border:0;width:0;height:0" width="0" height="0" alt="" />]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
