<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Javier Antonio Perez Pinto on Medium]]></title>
        <description><![CDATA[Stories by Javier Antonio Perez Pinto on Medium]]></description>
        <link>https://medium.com/@javier.antonio.perez.pinto?source=rss-e7544195d88b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*FDjW61HHHMW1dAbG</url>
            <title>Stories by Javier Antonio Perez Pinto on Medium</title>
            <link>https://medium.com/@javier.antonio.perez.pinto?source=rss-e7544195d88b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 07:28:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@javier.antonio.perez.pinto/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Using Terraform to deploy an ECS with Ubuntu security baseline in Huawei Cloud]]></title>
            <link>https://medium.com/@javier.antonio.perez.pinto/introduction-84188e405842?source=rss-e7544195d88b------2</link>
            <guid isPermaLink="false">https://medium.com/p/84188e405842</guid>
            <category><![CDATA[os-hardening]]></category>
            <category><![CDATA[huawei-cloud]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Javier Antonio Perez Pinto]]></dc:creator>
            <pubDate>Mon, 05 Jan 2026 19:10:18 GMT</pubDate>
            <atom:updated>2026-01-05T19:13:29.126Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Infrastructure as Code (IaC) has become fundamental for deploying cloud resources in a consistent and repeatable way. However, provisioning infrastructure alone is not enough; Security must be embedded from the very first step. Virtual machines deployed without a defined security baseline often inherit insecure default configurations that increase the attack surface and operational risk. There is several standards for this security baseline, for this article I’ll show the overall process for deploying a VM with this configurations since the beginning, that way this process will be applicable for any initial configuration on the VM. The Main idea is to use Terraform to deploy, I’ll show how to set up all necessary resources for deploying our VM.</p><h3>Previous to using Terraform</h3><h4>Instalation</h4><p>Terraform provides installation packages for different environments. For details, see the official terraform downloads page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FZyx0yMdzd2z3VkdC1EZzw.png" /></figure><p>For installing it to windows is very simple, since is a single binary, after downloading it we can either add it to the PATH environment variable or just putting the binary where we will use it. Then we can execute the following commend to check if it’s correctly installed and to initialize Terraform:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v6dcmNAy7wmqn25i_oiNCQ.png" /></figure><h4>Setting up the Huawei Cloud Provider.</h4><p>To deploy any resource in Huawei Cloud we need to first set up the Huawei Cloud provider. This will allow Terraform to Interact through IAM Authentication and to communicate wit the different services. Then we will create a versions.tf file and set up the following code.</p><pre>terraform {<br>  required_providers {<br>    huaweicloud = {<br>      source  = &quot;huaweicloud/huaweicloud&quot;<br>      version = &quot;&gt;= 1.83.0&quot;<br>    }<br>  }<br>}</pre><p>As we can see we need to set up a a name and version on the provider, the source is huaweicloud/huaweicloud, and the version will keep changing, for details we can check the provider page on the terraform website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GHcZi-jfjncbee7cZ408Sg.png" /></figure><p>Another important point is that here we have access to the documentation in case we need to check how is the process for deploying an specific service.</p><h4>Getting AKSK access</h4><p>Now for giving access to the account, we need to get the AKSK of the HuaweiCloud Account where the resources will be deployed. for getting it we go to the IAM section of the console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/1*qyalrSpIiQNfTD6kmemNpg.png" /></figure><p>Now we click the name of the account, and then we can set a AKSK.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L2kfWvwfG4Yip_5m2OMXLQ.png" /></figure><p>Then we go to the security settings where finally after clicking the checkbox we can download the AKSK.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hGAsAJ5QCGTmr_rbYh9KyA.png" /></figure><p>After clicking create it will automatically download a CSV file with the credentials and we can set it in the terraform config. the file structure should be as it follows</p><pre>- Proyect<br>| - main.tf<br>| - versions.tf</pre><p>In the main.tf file we will set the following code now.</p><pre>provider &quot;huaweicloud&quot; {<br>  region =     &quot;*******&quot;   # Region of deploy, like la-south-2<br>  access_key = &quot;*******&quot;   # Obtained AK<br>  secret_key = &quot;*******&quot;   # Obtained SK<br>}</pre><h3>Deploying resources with terraform</h3><p>Now for creating a simple ECS (VM) in Terraform we need to use the following snippet.</p><pre>variable &quot;secgroup_id&quot; {}<br>data &quot;huaweicloud_availability_zones&quot; &quot;myaz&quot; {}<br>data &quot;huaweicloud_compute_flavors&quot; &quot;myflavor&quot; {}<br>data &quot;huaweicloud_vpc_subnet&quot; &quot;mynet&quot; {}<br>data &quot;huaweicloud_images_image&quot; &quot;myimage&quot; {}<br><br>resource &quot;huaweicloud_compute_instance&quot; &quot;ECS&quot; {<br>  name               = &quot;basic&quot;<br>  image_id           = data.huaweicloud_images_image.myimage.id<br>  flavor_id          = data.huaweicloud_compute_flavors.myflavor.ids[0]<br>  security_group_ids = [var.secgroup_id]<br>  availability_zone  = data.huaweicloud_availability_zones.myaz.names[0]<br>  network {<br>    uuid = data.huaweicloud_vpc_subnet.mynet.id<br>  }<br>}</pre><p>It might seem as a lot, but lets break it down:</p><ul><li>secgroup_id is as it says the id of the security group we want the ECS to be asocciated with.</li><li>flavor_id is the flavor of the ECS</li><li>uuid in network is the id of the Subnet that the ECS will be deployed into</li><li>image_id is the id of an image, it can be public or private.</li></ul><p>I will show how to get those ID’s in the console.</p><p>first we will go to the network console, on the huaweicloud website and select security groups, after selecting the one we will use we can see the ID associated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PBXvsigUYN4aDvRpmPcbWA.png" /></figure><p>Same goes for the subnet id</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-1OnfR3D-VU3IkQ2Gu5vJw.png" /></figure><p>For the flavor I will just use “x0.2u.2g” that is a small flavor. And for the Image Id’s we can go to the IMS, and get the ID for both the public and private Images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hUVGE8uK0BPWhnTXiHerbA.png" /></figure><p>Finally the availability zone will depend on our deploy, I will use la-south-2a. that way our simple ECS would have this configuration:</p><pre>resource &quot;huaweicloud_compute_instance&quot; &quot;ECS&quot; {<br>  name               = &quot;basic&quot;<br>  image_id           = &quot;FOUND IMAGE ID&quot;<br>      flavor_id          = &quot;x0.2u.2g&quot;  #or other flavor<br>  security_group_ids = [&quot;found secgroup id &quot;]<br>  availability_zone  = &quot;la-south-2a&quot;<br>network {<br>    uuid = &quot;found subnet id&quot;<br>  }<br>}</pre><h4>Injecting user data.</h4><p>There is several ways we can inject data into the VM’s to have as soon as we start the ECS, we can use tools like ansible or create specific images to make the deploy easier, in case we have several standards or for smaller configurations we can use the user data field in the Terraform deploy, that way for example we can upload different scripts for different VM’s or simply install python on deploy without having to create a specific image for that purpose. For this guide I will use an opensource script for hardening Ubuntu 20.04, the link of the Github repo is the following <a href="https://github.com/Rak3z/CIS-ubuntu20.04-hardening/blob/main/hardening-ubuntu-script.sh">https://github.com/Rak3z/CIS-ubuntu20.04-hardening/blob/main/hardening-ubuntu-script.sh</a></p><p>for this we can use the user_data field in this way:</p><pre>user_data = &lt;&lt;EOF<br>#cloud-config<br>runcmd:<br>  - curl -o /root/ubuntu-hardening.sh https://raw.githubusercontent.com/Rak3z/CIS-ubuntu20.04-hardening/refs/heads/main/hardening-ubuntu-script.sh<br>  - chmod +x /root/ubuntu-hardening.sh<br>  - /root/ubuntu-hardening.sh<br>EOF</pre><p>this way will install the script that hardens Ubuntu on deploy. finally our main file would look something like this:</p><pre>provider &quot;huaweicloud&quot; {<br>  region =     &quot;*******&quot;   # Region of deploy, like la-south-2<br>  access_key = &quot;*******&quot;   # Obtained AK<br>  secret_key = &quot;*******&quot;   # Obtained SK<br>}<br>resource &quot;huaweicloud_compute_instance&quot; &quot;ECS&quot; {<br>  name               = &quot;basic&quot;<br>  image_id           = &quot;FOUND IMAGE ID&quot;<br>      flavor_id          = &quot;x0.2u.2g&quot;  #or other flavor<br>  security_group_ids = [&quot;found secgroup id &quot;]<br>  availability_zone  = &quot;la-south-2a&quot;<br>    user_data = &lt;&lt;EOF<br>    #cloud-config<br>    runcmd:<br>      - curl -o /root/ubuntu-hardening.sh https://github.com/AndyHS-506/Ubuntu-Hardening/blob/main/Hardening-Ubuntu-2024.sh<br>      - chmod +x /root/ubuntu-hardening.sh<br>      - /root/ubuntu-hardening.sh<br>    EOF<br>  network {<br>    uuid = data.huaweicloud_vpc_subnet.mynet.id<br>  }<br>}</pre><h4>Code execution</h4><p>For code execution we can now use some useful commands:</p><pre>terraform validate # this command iwll validate the different files<br>terraform plan     # this command will give us a preview on the plan<br>terraform apply    # this command can apply the configuration we have<br>terraform destroy  # this command will eliminate all the resources specified  in the configuration</pre><p>after applying or destroying we write yes, and it will deploy automatically our VM, we would get this as a summary on what we will deploy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VlMUZ3VZK7NkVOtCJAWY9A.png" /></figure><p>If we Login into the VM we can check for example the section logs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*6oeAeFS0To05zLwuNWYbEQ.png" /></figure><h3>Conclusion</h3><p>Applying a Linux security baseline during ECS deployment is a critical step toward reducing configuration drift and minimizing security risks in cloud environments. By using Terraform, we can integrate infrastructure provisioning with operating system hardening to be in compliance with standards or having any other simple configuration, ensuring that every virtual machine adheres to the same security standards or tweaks from day one.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=84188e405842" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automatic SSL upload in HuaweiCloud with Functiongraph and CCM]]></title>
            <link>https://medium.com/@javier.antonio.perez.pinto/automatic-ssl-upload-in-huaweicloud-with-functiongraph-and-ccm-ccdd325a5e7e?source=rss-e7544195d88b------2</link>
            <guid isPermaLink="false">https://medium.com/p/ccdd325a5e7e</guid>
            <category><![CDATA[huawei-cloud]]></category>
            <category><![CDATA[ssl]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[certbot]]></category>
            <dc:creator><![CDATA[Javier Antonio Perez Pinto]]></dc:creator>
            <pubDate>Fri, 02 Jan 2026 18:10:29 GMT</pubDate>
            <atom:updated>2026-01-02T18:10:29.071Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Automatic SSL upload in Huawei Cloud with Functiongraph and CCM</strong></h3><h3>Introduction</h3><p>The main idea of this blog is to guide the deployment of a function that will act based on OBS triggers to Upload a SSL certificate generated through LetsEncrypt using CertBot to CCM. The main flux on this deploy looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7l7gXjT8xs7UjMa6VZY20A.png" /></figure><p>Basically the idea is to generate a job with Certbot that will update the SSL certificate automatically, and then upload it through a python script to an OBS bucket, then we will have a Functiongraph function that will have the update on that OBS bucket grab that certificate and upload it to some other service, this way we can update automatically the SSL certificate for our website. As an example I will upload it to CCM</p><h3>Previous requisites</h3><h4>OBS Bucket</h4><p>In order to make this flow to work create a OBS Bucket</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K4kJEDrPpl1doN2ChKm8EQ.png" /></figure><p>Now we have to create an Function in Functiongraph with an OBS trigger, we will select the default agency.</p><h3>FG and Agency</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I7cTSUq6fzmk0dAB9MrNRg.png" /></figure><p>For the agency to correctly work it has to have OBS permissions, so we go to the create agency link and modify the permissions for it to have the necessary permit</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YdKMZRE6ndtujABQLRQvzg.png" /></figure><p>We will select the authorize and give OBS Admin permissions, in my case after this I applied the CCM permission.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QBxEWK9CAKU48WrBLoqKkw.png" /></figure><h3>IAM User with code permissions</h3><p>For creating code and calling through API we need to create an IAM User to use authentication. so in the same view we created the agency, we will select on the left menu <em>Users</em> and create User.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AI8CbJ7SAaaMxAil_kaHRg.png" /></figure><p>It is important that he has programmatic Access</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VjUy0d35-3oDSXyegOM0hQ.png" /></figure><p>And for learning purposes only we will give him admin permissions</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kGS88DmCBCaPd_Nw6gFwWw.png" /></figure><h4>Project ID</h4><p>we will need to get the prjectID for using in FunctionGraph, for this we need to go to my credentials and select the correct one, im working in la-south-2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bd0d63GbMnXdnHik03Ph9w.png" /></figure><h3>Deployment</h3><h4>Simple Apache Deployment</h4><p>to start we will simply deploy a server to have an apache deployment with NAT gateway for access to internet and public the apache server, remember that this deploy should be with a WAF for a secure deployment. for this we need to set up the rule in the NAT to pass the port of the apache service (80 in http and 443 in https)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VhdYciq0lRFtxrgPsFqeOA.png" /></figure><p>I also set up a DNS record name to point into that EIP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pl8kJdU87tndy5155CYwcw.png" /></figure><h4>SSL with Certbot and let’s encrypt</h4><p>first we will use the following commands for installing and using certbot</p><pre># Update package list and install snapd (if not already installed)<br>sudo apt update<br>sudo apt install snapd</pre><pre># Ensure you have the latest snapd core<br>sudo snap install core; sudo snap refresh core</pre><pre># Install Certbot via snap<br>sudo snap install --classic certbot</pre><pre># Create a symbolic link to ensure the certbot command is accessible<br>sudo ln -s /snap/bin/certbot /usr/bin/certbot</pre><pre>#for using certbot for apache<br>sudo certbot --apachexx</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*IP9VSBT4HAYMtzdQ2qsIgA.png" /></figure><p>now we will make a script that simply takes the generated SSL certificates and then uploads it to the OBS Bucket</p><pre>import requests<br>import hmac<br>import hashlib<br>import base64<br>from email.utils import formatdate<br># -----------------------------<br># CONFIG<br># -----------------------------<br>USER = &quot;test-ssl&quot;<br>PASS = &quot;Huawei123.&quot;<br>DOMAIN = &quot;HIS_hwstaff_J00944767&quot;<br>PROJECT = &quot;la-south-2&quot;<br>REGION = &quot;la-south-2&quot;<br>BUCKET = &quot;waf-automation-ssl-renew&quot;<br>CERT_DOMAIN = &quot;ssl.tests-sa-moai.cl&quot;<br>FILES = [<br>    (&quot;fullchain.pem&quot;, f&quot;/etc/letsencrypt/live/{CERT_DOMAIN}/fullchain.pem&quot;),<br>    (&quot;privkey.pem&quot;, f&quot;/etc/letsencrypt/live/{CERT_DOMAIN}/privkey.pem&quot;),<br>]<br># -----------------------------<br># IAM TOKEN (PROJECT SCOPED)<br># -----------------------------<br>def get_iam_token():<br>    url = &quot;https://iam.myhuaweicloud.com/v3/auth/tokens&quot;<br>    payload = {<br>        &quot;auth&quot;: {<br>            &quot;identity&quot;: {<br>                &quot;methods&quot;: [&quot;password&quot;],<br>                &quot;password&quot;: {<br>                    &quot;user&quot;: {<br>                        &quot;name&quot;: USER,<br>                        &quot;password&quot;: PASS,<br>                        &quot;domain&quot;: {&quot;name&quot;: DOMAIN}<br>                    }<br>                }<br>            },<br>            &quot;scope&quot;: {<br>                &quot;project&quot;: {&quot;name&quot;: PROJECT}<br>            }<br>        }<br>    }<br>    r = requests.post(url, json=payload)<br>    r.raise_for_status()<br>    return r.headers[&quot;X-Subject-Token&quot;]<br># -----------------------------<br># STS (PROJECT SCOPED)<br># -----------------------------<br>def get_sts_credentials(iam_token):<br>    url = &quot;https://iam.myhuaweicloud.com/v3.0/OS-CREDENTIAL/securitytokens&quot;<br>    headers = {<br>        &quot;X-Auth-Token&quot;: iam_token,<br>        &quot;Content-Type&quot;: &quot;application/json&quot;<br>    }<br>    payload = {<br>        &quot;auth&quot;: {<br>            &quot;identity&quot;: {<br>                &quot;methods&quot;: [&quot;token&quot;],<br>                &quot;token&quot;: {&quot;id&quot;: iam_token}<br>            },<br>            &quot;scope&quot;: {<br>                &quot;project&quot;: {&quot;name&quot;: PROJECT}<br>            }<br>        }<br>    }<br>    r = requests.post(url, headers=headers, json=payload)<br>    r.raise_for_status()<br>    return r.json()[&quot;credential&quot;]<br># -----------------------------<br># OBS SIGNATURE V2 (CORRECTA)<br># -----------------------------<br>def sign_obs(method, content_type, date, resource, obs_headers, sk):<br>    canonical_headers = &quot;&quot;<br>    for k in sorted(obs_headers):<br>        canonical_headers += f&quot;{k}:{obs_headers[k]}\n&quot;<br>    string_to_sign = &quot;\n&quot;.join([<br>        method,<br>        &quot;&quot;,<br>        content_type,<br>        date,<br>        canonical_headers + resource<br>    ])<br>    signature = base64.b64encode(<br>        hmac.new(<br>            sk.encode(),<br>            string_to_sign.encode(),<br>            hashlib.sha1<br>        ).digest()<br>    ).decode()<br>    return signature<br># -----------------------------<br># UPLOAD<br># -----------------------------<br>def upload_obs(creds, object_key, file_path):<br>    ak = creds[&quot;access&quot;]<br>    sk = creds[&quot;secret&quot;]<br>    token = creds[&quot;securitytoken&quot;]<br>    with open(file_path, &quot;rb&quot;) as f:<br>        data = f.read()<br>    method = &quot;PUT&quot;<br>    content_type = &quot;application/octet-stream&quot;<br>    date = formatdate(usegmt=True)<br>    resource = f&quot;/{BUCKET}/{object_key}&quot;<br>    obs_headers = {<br>        &quot;x-obs-security-token&quot;: token<br>    }<br>    signature = sign_obs(<br>        method,<br>        content_type,<br>        date,<br>        resource,<br>        obs_headers,<br>        sk<br>    )<br>    headers = {<br>        &quot;Date&quot;: date,<br>        &quot;Content-Type&quot;: content_type,<br>        &quot;x-obs-security-token&quot;: token,<br>        &quot;Authorization&quot;: f&quot;OBS {ak}:{signature}&quot;<br>    }<br>    url = f&quot;https://{BUCKET}.obs.{REGION}.myhuaweicloud.com/{object_key}&quot;<br>    r = requests.put(url, headers=headers, data=data)<br>    print(f&quot;{object_key}: {r.status_code}&quot;)<br>    if r.status_code not in (200, 201):<br>        print(r.text)<br># -----------------------------<br># MAIN<br># -----------------------------<br>if __name__ == &quot;__main__&quot;:<br>    iam_token = get_iam_token()<br>    creds = get_sts_credentials(iam_token)<br>    for obj, path in FILES:<br>        upload_obs(creds, obj, path)</pre><p>after that is done we can move to the certbot config, for excecuting this script whenever it updates automatically, we will configure the certbot hook</p><pre>sudo certbot renew --deploy-hook &quot;/usr/bin/python3 /usr/local/bin/script.py /etc/letsencrypt/live/domainname.com/fullchain.pem /etc/letsencrypt/live/domainname.com/privkey.pem&quot;</pre><h2>Connection of FunctionGraph and OBS</h2><p>now we the previously created Function we will create a trigger.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8-SFst35wWlCTROLm0ckqA.png" /></figure><p>And will configure it like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*pbpTOdsHWO1we276w70bzA.png" /></figure><p>Being waf-automation-ssl-renew the name of the bucket created previously then we will use the following code for the functionGraph</p><pre>import requests<br>import hmac<br>import hashlib<br>import base64<br>import json<br>from email.utils import formatdate<br>USER = &quot;test-ssl&quot;<br>PASS = &quot;Huawei123.&quot;<br>DOMAIN = &quot;HIS_hwstaff_J00944767&quot;<br>PROJECT = &quot;la-south-2&quot;<br>REGION = &quot;la-south-2&quot;<br>BUCKET = &quot;waf-automation-ssl-renew&quot;<br>CERT_DOMAIN = &quot;ssl.tests-sa-moai.cl&quot;<br>PROJECT_ID = &quot;9b40db1488a140d1a7b5843bcac6299d&quot;  <br># -----------------------------<br># IAM TOKEN<br># -----------------------------<br>def get_iam_token():<br>    url = &quot;https://iam.myhuaweicloud.com/v3/auth/tokens&quot;<br>    payload = {<br>        &quot;auth&quot;: {<br>            &quot;identity&quot;: {<br>                &quot;methods&quot;: [&quot;password&quot;],<br>                &quot;password&quot;: {<br>                    &quot;user&quot;: {<br>                        &quot;name&quot;: USER,<br>                        &quot;password&quot;: PASS,<br>                        &quot;domain&quot;: {&quot;name&quot;: DOMAIN}<br>                    }<br>                }<br>            },<br>            &quot;scope&quot;: {<br>                &quot;project&quot;: {&quot;name&quot;: PROJECT}<br>            }<br>        }<br>    }<br>    r = requests.post(url, json=payload)<br>    r.raise_for_status()<br>    return r.headers[&quot;X-Subject-Token&quot;]<br>  <br># -----------------------------<br># STS CREDENTIALS<br># -----------------------------<br>def get_sts_credentials(iam_token):<br>    url = &quot;https://iam.myhuaweicloud.com/v3.0/OS-CREDENTIAL/securitytokens&quot;<br>    headers = {<br>        &quot;X-Auth-Token&quot;: iam_token,<br>        &quot;Content-Type&quot;: &quot;application/json&quot;<br>    }<br>    payload = {<br>        &quot;auth&quot;: {<br>            &quot;identity&quot;: {<br>                &quot;methods&quot;: [&quot;token&quot;],<br>                &quot;token&quot;: {&quot;id&quot;: iam_token}<br>            },<br>            &quot;scope&quot;: {<br>                &quot;project&quot;: {&quot;name&quot;: PROJECT}<br>            }<br>        }<br>    }<br>    r = requests.post(url, headers=headers, json=payload)<br>    r.raise_for_status()<br>    return r.json()[&quot;credential&quot;]<br>  <br># -----------------------------<br># OBS SIGNATURE V2<br># -----------------------------<br>def sign_obs(method, content_type, date, resource, obs_headers, sk, body=&quot;&quot;):<br>    canonical_headers = &quot;&quot;<br>    for k in sorted(obs_headers):<br>        canonical_headers += f&quot;{k}:{obs_headers[k]}\n&quot;<br>  <br>    string_to_sign = &quot;\n&quot;.join([<br>        method,<br>        &quot;&quot;,<br>        content_type,<br>        date,<br>        canonical_headers + resource<br>    ])<br>  <br>    signature = base64.b64encode(<br>        hmac.new(<br>            sk.encode(),<br>            string_to_sign.encode(),<br>            hashlib.sha1<br>        ).digest()<br>    ).decode()<br>  <br>    return signature<br>  <br># -----------------------------<br># GET OBJECT FROM OBS<br># -----------------------------<br>def obs_get_object(bucket, key, region, ak, sk, token):<br>    method = &quot;GET&quot;<br>    content_type = &quot;&quot;<br>    date = formatdate(usegmt=True)<br>    resource = f&quot;/{bucket}/{key}&quot;<br>  <br>    obs_headers = {<br>        &quot;x-obs-security-token&quot;: token<br>    }<br>  <br>    signature = sign_obs(method, content_type, date, resource, obs_headers, sk)<br>    headers = {<br>        &quot;Date&quot;: date,<br>        &quot;x-obs-security-token&quot;: token,<br>        &quot;Authorization&quot;: f&quot;OBS {ak}:{signature}&quot;<br>    }<br>  <br>    url = f&quot;https://{bucket}.obs.{region}.myhuaweicloud.com/{key}&quot;<br>    r = requests.get(url, headers=headers)<br>    r.raise_for_status()<br>    return r.text<br>  <br># -----------------------------<br># UPDATE CCM CERTIFICATE<br># -----------------------------<br>def update_ccm_certificate(region, certificate_pem, private_key_pem, iam_token):<br>    url = f&quot;https://scm.ap-southeast-1.myhuaweicloud.com/v3/scm/certificates/import&quot;<br>    headers = {<br>        &quot;X-Auth-Token&quot;: iam_token,<br>        &quot;Content-Type&quot;: &quot;application/json&quot;<br>    }<br>    print(&quot;certificate_pem es : &quot;)<br>    print(certificate_pem)<br>    print(&quot;PK es : &quot;)<br>    print(private_key_pem)<br>    body = {<br>        &quot;name&quot;: &quot;Certificate-uploaded&quot;,<br>        &quot;certificate&quot;: certificate_pem,<br>        &quot;private_key&quot;: private_key_pem,<br>        &quot;duplicate_check&quot;: True<br>    }<br>    r = requests.post(url, headers=headers, json=body)<br>    r.raise_for_status()<br>    return r.json()<br>  <br># -----------------------------<br># HANDLER FUNCTIONGRAPH<br># -----------------------------<br>def handler(event, context):<br>    iam_token = get_iam_token()<br>    creds = get_sts_credentials(iam_token)<br>    ak = creds[&quot;access&quot;]<br>    sk = creds[&quot;secret&quot;]<br>    token = creds[&quot;securitytoken&quot;]<br>    fullchain = obs_get_object(BUCKET, &quot;fullchain.pem&quot;, REGION, ak, sk, token)<br>    privkey = obs_get_object(BUCKET, &quot;privkey.pem&quot;, REGION, ak, sk, token)<br>    result = update_ccm_certificate(<br>        REGION,<br>        fullchain,<br>        privkey,<br>        iam_token<br>    )<br>    print(&quot;CCM update result:&quot;, result)<br>    return {&quot;status&quot;: &quot;success&quot;, &quot;ccm_response&quot;: result}</pre><p>After excecuting the script I get this certificate in CCM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*27gjYwv_lxOS0j9DTVisdw.png" /></figure><p>We can with a few tweaks improve this code using other API’s of other services for example for deleting the previous certificate, and apply the new certificate to other Huawei cloud services.</p><h3>Conclusion</h3><p>We have seen a nice way to automate the SSL upload and update, the idea is mainly to use this article as a framework to update different services that might need renewal, for example WAF or ELB.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ccdd325a5e7e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to deploy an end to end cybersecurity Architecture on Huawei Cloud]]></title>
            <link>https://medium.com/@javier.antonio.perez.pinto/how-to-deploy-an-end-to-end-cybersecurity-architecture-on-huawei-cloud-89ff413a8987?source=rss-e7544195d88b------2</link>
            <guid isPermaLink="false">https://medium.com/p/89ff413a8987</guid>
            <category><![CDATA[siem]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[end-to-end-solution]]></category>
            <category><![CDATA[huawei-cloud]]></category>
            <dc:creator><![CDATA[Javier Antonio Perez Pinto]]></dc:creator>
            <pubDate>Wed, 31 Dec 2025 14:44:08 GMT</pubDate>
            <atom:updated>2025-12-31T14:44:08.618Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>In this article we will review how to deploy a end-to-end cybersecurity architecture, using several services to protect different layers on Huawei Cloud, being in compliance with some standards and regulations.</p><h4>Why caring about cybersecurity services.</h4><p>Look, we all know that caring about Cybersecurity is a drag. And in a perfect world, you wouldn’t have to think about hackers, leaks, or attacks. But the thing is ignoring it is like hoping you won’t get caught in the rain without an umbrella, sooner or later, you’re going to get soaked. Think of it as a small investment in calm, so you can focus on building what matters, without that nagging “what if?” in the back of your mind.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*2iNXeBbY39efvK8U9CEXXg.png" /></figure><h4>End-to-end</h4><p>The main idea is to focus on end-to-end cybersecurity, that means we are going to try to reach continuous, unbroken protection for the data and the systems in the whole journey, from start to finish and everywhere in between, for that we will start with the starting point: the server where the data is created). we will include device encryption, strong login authentication, and antiviruses, using Data Encryption Workshop (DEW), and Host Security Service (HSS).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*M1ajkW-TDur_E5AEtMFktw.png" /></figure><h3>Building a secure Server</h3><h4>Data Encryption Workshop (DEW)</h4><p>As a first thing to do, before even deploying a server is to create the strong login authentication, for doing it we will go to the DEW section on the Huawei Cloud Console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2QLGcLRphHKE2kTtgA_YWw.png" /></figure><p>From this service for now we will create a key (where we can select the algorithm used) and a key pair for logging into our ECS securely (ssh key).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/965/1*0_nZiQU9YpFEUSnM30WgAw.png" /></figure><h4>Elastic Cloud Server (ECS)</h4><p>Now going to the ECS page we can buy an ECS, it doesn’t really matter the specs nor the image used for this VM, but there is some special interest points in the creation process:</p><ol><li>- We can enable a default protection using the host security service</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A1djXdTcOYnXxslBk2amXg.png" /></figure><p>2.- We can pick a security group that will network access rules</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bEFC4qOy9cK995kUKUvnyg.png" /></figure><p>3.- For some security solutions a backup using CBR is a must, here we can activate it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yj08ZTDomYXR8ts4jTziaA.png" /></figure><p>4.- We can bind the key we made in the previous step</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f-fRrj9R5AMWTEBi-SNuIw.png" /></figure><h4>How to login</h4><p>Now that we have the VM with a key pair attached to it the only way for us to log in is using SSH, and for that purpose we have to take some extra steps, first we need to configure a NAT gateway for accessing the VM through internet, after we have our configurations we can disable this.</p><h4>NAT Gateway</h4><p>After provisioning a NAT Gateway we will configure the SNAT and DNAT rules respectively for having internet access securely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xdKXJkjvhLvz6HhCEbk99Q.png" /></figure><p>It is important that the public port is the one that will we will communicate with from internet (for security purposes is recommended to use a non standard port, for example 55220), and the private port will be the communicated one in the virtual machine, for SSH the standard is 22</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xdKXJkjvhLvz6HhCEbk99Q.png" /></figure><p>After configuring this internet connection we can use the guide given in the documentation for connecting through PuTTy or another implementation of SSH.</p><h4>HSS</h4><p>For enhanced protection we can go to the HSS page, and from here we can upgrade the edition to professional, installing the agent on the vm will create some dummy files we should not touch, since they are baits in case of being attacked by a ramsomware.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pHPshVGeea3gGgFfsWGFPQ.png" /></figure><h4>DEW (with EVS this time)</h4><p>After we have our VM created, we can now provide more protection encrypting the data disks attached to that machine.</p><p>When buying a data disk when can enable the encryption on that disk.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1_dmsq7enI5K8OAiSo5nVA.png" /></figure><p>“When an encrypted disk is attached, EVS accesses KMS, and KMS sends the data key (DK) to the host memory for use. The disk uses the DK plaintext to encrypt and decrypt disk I/Os. The DK plaintext is only stored in the memory of the host housing the ECS and is not stored persistently on the media. If the custom key is deleted or disabled in KMS, the disk encrypted using the key can still use the DK plaintext stored in the host memory. However, if the disk is detached, the DK plaintext will be deleted from the memory, and the disk cannot be read or written. Before you re-attach this encrypted disk, ensure that the key is enabled.”</p><h3>Deploying a secure web server</h3><h4>DVWA</h4><p>There is a lot of good practices to have while you deploy a web server, for example changing ports, using versions with not so known vulnerabilities, and a really long etc on code best practices. for demo purposes we will not be doing that, and instead we will use the exact opposite, DVWA (Damn Vulnerable Web Application) is a web deploy that will help us to show the most typical scenarios (XSS, SQLInyeciton, etc.) using as the name says, a damn vulnerable web application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Fg-8hFJm2iXtMQgnnsIcg.png" /></figure><h4>HTTPS</h4><p>An specific point to pay attention to is to generate a SSL Certificate and validating it that way we ensure a secure connection between the web and the server since is encrypted, there is several ways for obtaining a SSL certificate, a really easy one is using CertBot for obtaining LetsEncrypt certificates.</p><p>As an optional feature we can upload this certificate on CCM (Cloud certificate manager) for having it available in the deploy of future services</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IyFVW_0JgjEfSNPkao-HyA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-RMGEwfi3vUTooF_dQTxTg.png" /></figure><p>As well in CCM we can provide a free certificate using the DV Basic edition for SSL certificates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ElxIVsw03JeWUp-jxACUA.png" /></figure><p>Note that if we make a certificate this way then we need to apply for the certificate the same way we would with private certificates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p71Q5jDXiVWpc0xmVgVchQ.png" /></figure><h4>Security group</h4><p>Since our Virtual machine needs connection to internet we should filter the traffic in some way, at least by port to not have the SSH port collapsed, for doing that we can configure different rules to allow or deny traffic for all the VM’s attached to that security group.</p><p>This can be done in the VPC View.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/264/1*bXuSVIIw4ZUdEl-uoahaNg.png" /></figure><p>After we click in a security group we can configure the rules for inbound and outbound traffic</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C7js6UGm55qB5vSwwImExw.png" /></figure><h3>More Network Protection</h3><h4>CFW</h4><p>Even if we have a security group we are still unprotected from other attacks, CFW as a plus protects us not only from IP and Port, but aswell from the traffic itself with (IPS) giving us observability and logging on the different events that may occur, that way is easier to audit in case is necessary.</p><p>For enabling the IPS we simply set the IP protection on the CFW service on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ERsbhnEjRjYfQcGE2Wmh-A.png" /></figure><h4>ELB</h4><p>The load balancer provides availability and as well an extra layer of security working as a proxy, one important feature we will be using is the health check, that will stop sending traffic if the server is not working correctly in the specified port.</p><p>When adding a listener we can use a specific port for HTTPS and add the CCM certificate that we made before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vDtmMTL_tiKDpB5Ayyy0Uw.png" /></figure><p>Also when configuring the back-end server group is important to enable the health check mentioned.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eDlHewR4-h2ndiS-azc1AQ.png" /></figure><p>As well using the security group we can block all traffic that doesn’t come from the ELB through the port we have set for the deploy of our APP, for this the IP address we can use in the security group for the whitelist would be the ELB address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WVOjccHvUQ7l56quoWPklA.png" /></figure><h3>Final layer of security</h3><h4>WAF</h4><p>For the application level of protection, regarding for example SQLInyections, XSS, or other types of attacks that focus mainly on the application and not in the network we have Web Application Firewall (WAF) that will protect the application we are deploying using different policies we can tweak.</p><p>For enabling WAF protection we will use the website name and the IP address of the ELB, a good practice to have is to leave the network as closed as posible, from that idea we can whitelist only the WAF IP Adress range, that way the only traffic the ELB will recieve is the one that comes from the WAF.</p><p>When creating the website we can provide the SSL certificate</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5RTbK8eI_A6DwGigRIEUXQ.png" /></figure><p>After creating the website inside the WAF we can check the IP address range of the WAF.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rHYsvReZaRQv9wtFi5yb-w.png" /><figcaption>IP range in this case is 119.8.159.0/26</figcaption></figure><p>Then in the ELB we configure the whitelist</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GVP7oOMmZwtKvW1almsIFA.png" /></figure><h4>DNS</h4><p>The only thing that is left is to write a record into our dns with the CNAME of the WAF, that way the domain name will translate into the WAF’s direction and it will protect the traffic that goes through it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dejzpHf1gqrGkNNugni5RQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n8P6K4AoREKnHahzC-IGPw.png" /></figure><h3>One Center</h3><p>Now we have a full deployment, but in order to be in compliance with several regulations, we must have a SIEM, Huawei Cloud provides a centralized platform that has several important features and can help with that. SecMaster is Huawei Cloud SIEM, can provide us centralized logs, playbooks for automated responses, dashboards, and help wit the development of report documents in case of an auditory.</p><p>And we can select which features we want to use when provisioning it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lb4XOwyVslwujsb8bLhEsg.png" /></figure><p>After we buy the features we want, to start we create a workspace</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xY1TBE5ohhxIeXMDbRAUpA.png" /></figure><p>And then select our workspace</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uccXfe-pHvGv72H72ItNBQ.png" /></figure><h4>Logs</h4><p>One of the main features we have of SecMaster is to have a centralized view for the logs and alerts of other services, we can add logs from outside the cloud as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VF0IRWVqUP-nYmFtoEzexg.png" /></figure><h3>Playbooks</h3><p>Playbooks are predefined, machine-readable workflows that describe a sequence of automated actions to be executed when a specific security condition or alert is triggered within a SOAR platform. They define what actions are taken, in what order, and under which conditions, removing the need for manual intervention during incident handling.</p><p>A practical usage example is the automatic response to a compromised compute instance. When HSS detects an ECS as infected, a playbook can automatically isolate the instance by migrating it to a different VPC. These playbooks can be created from existing templates and further customized to align with specific security policies and operational requirements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OwQfGP0FoXJmoJtGN1nlbg.png" /></figure><h4>Compliance</h4><p>We have sets of instructions and automated scripts to check if our infra is in compliance to certain standards for example NIST</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4NQIKgsv5uZA94No659KxA.png" /></figure><p>Also these are configurable and importable. Some of them are automatic configurations that SecMaster can make, and others are sets of instructions to be in compliance.</p><h3>About attack simulation</h3><p>Now as the last part in the article I will simulate the same attack showed before and will show the responses on the Huawei cloud services.</p><p>for blocking as a start we set the WAF from log only to block mode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6am4bHTKjxS7SWQfgGG6mA.png" /></figure><p>and then we will perform the same command injection showed before in the DVWA section, the first thing we see is the block page from the firewall, plus everything that in this case was involved in blocking the traffic will show a log. In this case would be WAF and SecMaster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Erfw3ShKC5FZUeL0mIh1qA.png" /></figure><p>for SecMaster the logs can be seen in the Cloud Service Access in Log Audit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jzqiyRSZWHn7mMPQGlLz6Q.png" /></figure><h3>Conclusion</h3><p>We have seen a full architecture on end-to-end cybersecurity, even tho it may seem exaggerated to use every security service on this architecture, is important to pick the most important parts for the deployment and adjust this to the customer needs. The main idea on this article was to show this infrastructure as a framework to deploy more secure infra on Huawei Cloud, Feel free to contact me in case of any doubts or leaving a comment in the section below.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89ff413a8987" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to deploy Huawei Solution for Ransomware protection using CBR and HSS]]></title>
            <link>https://medium.com/@javier.antonio.perez.pinto/how-to-deploy-huawei-solution-for-ransomware-protection-using-cbr-and-hss-f54edb94da60?source=rss-e7544195d88b------2</link>
            <guid isPermaLink="false">https://medium.com/p/f54edb94da60</guid>
            <category><![CDATA[huawei-cloud]]></category>
            <category><![CDATA[host-security]]></category>
            <category><![CDATA[cloud-backup]]></category>
            <category><![CDATA[ransomware]]></category>
            <dc:creator><![CDATA[Javier Antonio Perez Pinto]]></dc:creator>
            <pubDate>Wed, 31 Dec 2025 14:06:59 GMT</pubDate>
            <atom:updated>2025-12-31T14:06:59.267Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Ransomware are a type of attacks, in which the attacker locks the data available in a VM or server encrypting the user data, and demands a payment in order to get the information unlocked. In some cases don’t really having the intention to decrypt the victim data and doing it, even after paying the ransom.</p><h4>Main Idea</h4><p>The main idea is to detect early a ransomware attack and having the necessary backup. For this purpose we will be using a combination of HSS and CBR Services for one detecting the Ransomware attack, and two for going back to previous version of the ECS to prevent data-loss.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TZuuUdYM_MHmFogDDfPcLw.png" /><figcaption>Ransomware protection solution</figcaption></figure><p>Using the two regions replication of the CBR Vault will increase the availability of the backups, and using worm will protect the vault from accidental deletion, and the HSS detection will notify us with the use of honeypot files when there was an attack.</p><h3>Prevention</h3><p>According to Statistics the main cause of ransomware attacks are weak passwords, vulnerability exploits and unsafe configuration when setting a server, so as a step 0 we can use strong passwords.</p><p>And even if we can provide a strong password by our own methods, Huawei provides a tool for it in the HSS service, including FTP, SSH, and MySql passwords.</p><p>Here in HSS we can define policies based on password complexity to flag it as a weak password, this hardens the baseline inspection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ab64jfCOg7pQEC1efJkn8A.png" /></figure><p>Here we can add password dictionaries and check if they are common passwords.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rqtWFMjqXB7EGXB83-QbIg.png" /></figure><p>As a final preventive configuration we can fix known vulnerabilities in the vulnerabilities page of the service, By default, HSS automatically performs a comprehensive vulnerability detection every week and provides fixing suggestions. You can fix the vulnerabilities based on the suggestions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nB98ATMVY4zVIvZ7nK1snw.png" /></figure><h3>Ransomware Active Protection</h3><h4>Protection Policy</h4><p>Now for a more active ransomware protection we can enable certain policies and backup for the solution, here is how it works: as a first layer (besides the password and vulnerability check we saw before) we have the HSS honeypot files, these are files that we define inside our server that are dummy files that we shouldn’t touch, because these are used by HSS to detect when they are modified and enable the ransomware protection.</p><p>The honeypot files deployed in random locations are automatically deleted every 12 hours and then randomly deployed again. We can define the type of file, directories, action to take and OS of the VM in the policies page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uRHu0txzBno9QN7CX6iusw.png" /></figure><p>This with several purposes, one to detect the ransomware attack, two to find the process that is locking the files and three killing it.</p><h4>Backup</h4><p>Now we have a way to detect and prevent a ransomware attack, but we have to check all the possible scenarios, so in order to prevent and minimize the loss caused by these type of attacks we can enable the backup for service data periodically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HVUyu9DdxFCY0RFzSoO9tw.png" /></figure><p>Here as well we can change the vault capacity, restore data and in the Event tab we can handle ransomware events, where it will give us details on the events generated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/1*wusUR5B4mvUcyp-FRf5mVg.png" /></figure><p>And in this view as said before we can restore previous data to prevent data-loss.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*iiJ6aieYX34_BUNh67gRQQ.png" /></figure><h3>More about CBR Configurations</h3><h4>Configuring CBR and Enabling Backup Locking</h4><p>Once enabled, all backups in the vault enter a WORM (write once, read many) state. No one can delete backups whose retention periods have not expired, this helps with the malicious or accidental deletion of the backups.</p><p>We just need to go to the CBR service, click on the column related to the locking, and enable from here</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SIZZd_EgdggvI5pmxJpYEA.png" /></figure><h4>Policies</h4><p>in this view as well we have the policies page where we can edit, create or delete backup and replication policies, for having automated backups and replications for more reliability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZCmuqIBASl0sy3hTcfWz9Q.png" /></figure><h4>Manual Backups</h4><p>Often we can do critical operations and the policies may not be sufficient to have a backup, for this occasions we could perform a manual backup.</p><p>Clicking backup on the vault that we want to backup will send us to the manual backup page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ky4_bTSyJoRM2mgODTFDbQ.png" /></figure><p>Here we can select the VM’s that we want to backup and whether is a full or incremental backup</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dqE-0Wi1tXLcMxFDymObuQ.png" /></figure><p>The latest incremental backup depends on the last full backup and intermediate incremental backups. If any backup data block is damaged, subsequent backups may be affected, which will deteriorate the backup reliability. All full backup data is independent and does not depend on previous backups. So full backups are more reliable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bb2RULQaqcOVvFRg-6eNlg.png" /></figure><h4>Performing drills</h4><p>According to the data security law, <strong>data recovery tests must be performed periodically</strong> for the backup and DR data. Recovery means that the backup software is used to restore the backup data to the data source. As the service system is running in most of the time, it is not a good practice to perform recovery tests in the production environment. You can create new backup resources to verify the availability of the backup data, the integrity and reliability of the backup solution, and the system capability to deal with emergencies.</p><p>For doing it I Highly recommend following the tutorial on the documentation for doing drills safely in the CBR best practices.</p><h3>Conclusion</h3><p>Ransomware remains a highly sophisticated and evolving threat, and no single mechanism can guarantee absolute protection. However, a defense-in-depth approach that combines strong preventive controls with fast and reliable backup and recovery capabilities provides an effective way to mitigate its impact. This ensures data integrity, minimizes downtime, and strengthens the availability and overall security of the cloud architecture.</p><p>Feel free to reach out if you have any questions or leave a comment in the section below.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f54edb94da60" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>