<?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 Danil Smirnov on Medium]]></title>
        <description><![CDATA[Stories by Danil Smirnov on Medium]]></description>
        <link>https://medium.com/@danil-smirnov?source=rss-541cafe96c3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*_r2wLPlCeUyQWrPg.</url>
            <title>Stories by Danil Smirnov on Medium</title>
            <link>https://medium.com/@danil-smirnov?source=rss-541cafe96c3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 08:05:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@danil-smirnov/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[Ode to Elastic IP]]></title>
            <link>https://blog.smirnov.la/ode-to-elastic-ip-9f2805b1d559?source=rss-541cafe96c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/9f2805b1d559</guid>
            <category><![CDATA[greed]]></category>
            <category><![CDATA[elastic-ip]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Danil Smirnov]]></dc:creator>
            <pubDate>Thu, 21 Dec 2023 18:22:46 GMT</pubDate>
            <atom:updated>2023-12-21T18:22:46.007Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3kLjTzxYrJFi1bpNQ4_k0g.png" /></figure><p>There is a widespread belief that a public Elastic IP address in AWS is a marker of non-optimal architecture. Smart cloud architects expect, that cloud developers always rely on private IPs. Smart and rich. Those rich architects insist on using NAT gateways for egress and load balancers, API gateway, and CDN for ingress traffic. All those services are not free (to say the least) if compared with completely free EIPs (when attached to an EC2 instance).</p><p>At least they were, and they’ll be until February 1, 2024, when AWS will introduce <a href="https://aws.amazon.com/blogs/aws/new-aws-public-ipv4-address-charge-public-ip-insights/">new EIP prices</a> making this option less attractive to those poor souls like mine (but still affordable: a single IP address will cost just $3.6 per month — way less than that luxury NAT gateway).</p><p>Nevertheless, I’d like to show how to use those EIPs like a pro. Why? First, because you can! On a more serious note, sometimes we want to have a separate IP address per EC2 instance, e.g. in the very demanding email communication world.</p><p>But first of all, let’s talk about why EIPs are cool and why they are not. The cool side of them is that we can deploy them instantly and then they will be ours until we delete them explicitly. We can even <a href="https://aws.amazon.com/ru/about-aws/whats-new/2022/10/amazon-virtual-private-cloud-vpc-transfer-elastic-ip-addresses-between-aws-accounts/">transfer them to another account</a> (though in the same region). The not that cool side is that there is a limit of only 5 EIPs per region and AWS is a bit reluctant to increase the limit asking you for a strong reason why you need them.</p><p><strong>How to attach an EIP to an instance on a start-up</strong></p><p>We usually want to run an EC2 instance pre-configured, hence using EC2 launch templates. We can’t reference an existing EIP address directly from a launch template (at least at the moment of writing), so we need to attach it on start-up via a <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html">userdata</a>. We can do it via the following AWS CLI call (having an appropriate IAM role attached to the instance):</p><pre>aws ec2 associate-address \<br>--instance-id ${INSTANCE_ID} \<br>--public-ip ${EIP} \<br>--allow-reassociation</pre><p>However, to make this work, we must have access to AWS API which requires Internet connectivity, which in turn will be provided by that EIP we are trying to associate… Is it a dead loop? Not really, since we already have a private IP automatically assigned to the instance, so we only need to use it to access AWS API… Does it work out of the box? No. :-( (I’m looking at you, AWS!)</p><p>There is a way to “workaround” this, it’s not free though, but affordable. We need to deploy a <a href="https://docs.aws.amazon.com/whitepapers/latest/aws-privatelink/what-are-vpc-endpoints.html#interface-endpoints">VPC Endpoint of Interface type</a> for EC2 service (aka com.amazonaws.region.ec2). (No need to deploy it for all the AZs, one subnet is enough and will cover the entire VPC.)</p><p>Thus, with this solution, we would pay only for EIP (from February 1, 2024) and for one VPC Endpoint of Interface type (~7$ per month), overall around ten bucks per instance (or less, if we make this one a router). However, I feel sad about even those seven bucks I have to pay for the VPC Endpoint, which I need on the instance start-up only!</p><p>There is a way to eliminate even this expense, if we offload the call to AWS API to another instance that has an EIP address already attached and which we might have to keep running anyway. (I hope you have the one, otherwise, you can hire the cheapest EC2 instance of t4g.nano type for ~$3 and delegate this work to it for all other instances, spreading its cost evenly to all of them.)</p><p>The following code in Python (Flask framework) lets us achieve exactly what we did via AWS CLI above:</p><pre>@app.route(&#39;/attach&#39;)<br>def attach():<br>    region = request.args.get(&#39;region&#39;)<br>    ip = request.args.get(&#39;ip&#39;)<br>    instance_id = request.args.get(&#39;instance&#39;)<br>    ec2 = boto3.client(&#39;ec2&#39;, region_name = region)<br>    try:<br>        ec2.associate_address(PublicIp=ip, InstanceId=instance_id, AllowReassociation=True)<br>    except ClientError as e:<br>        logging.error( f&quot;Failed to associate IP address {ip} to the instance {instance_id}:\n{e}&quot; )<br>        abort(make_response(jsonify(message=&#39;Failed to associate IP address&#39;), 500))<br>    return jsonify(status=&#39;ok&#39;)</pre><p>We call our own EIP attaching service from the client EC2 instance via the following curl:</p><pre>curl -H &quot;Host:&lt;hostname&gt;” -sS http://&lt;private IP of the attaching service&gt;/attach?instance=${INSTANCE_ID}\&amp;ip=${EIP}\&amp;region=${REGION}</pre><p>Now we have the most inexpensive Internet connectivity for our EC2 instances and let’s have a Merry Christmas and a Happy New Year too!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9f2805b1d559" width="1" height="1" alt=""><hr><p><a href="https://blog.smirnov.la/ode-to-elastic-ip-9f2805b1d559">Ode to Elastic IP</a> was originally published in <a href="https://blog.smirnov.la/">danil.smirnov</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Select Nginx location by basic HTTP auth user]]></title>
            <link>https://blog.smirnov.la/select-nginx-location-by-basic-http-auth-user-e984e8000ccd?source=rss-541cafe96c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/e984e8000ccd</guid>
            <category><![CDATA[rbac]]></category>
            <category><![CDATA[http-authentication]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[http-auth]]></category>
            <category><![CDATA[api]]></category>
            <dc:creator><![CDATA[Danil Smirnov]]></dc:creator>
            <pubDate>Fri, 28 Oct 2022 13:21:05 GMT</pubDate>
            <atom:updated>2022-12-08T19:16:29.906Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rw5UtkN4fSKRnGll6pNqoA.png" /></figure><p>Google hasn’t brought any recipes to me so I decided to write my own. Why? Well, we can get some basic RBAC using just pure Nginx configuration.</p><p>We can have multiple locations that allow different levels of access to the backend and we can select them based on basic HTTP auth user names found in HTTP request headers.</p><p>The tricky part is Nginx specifics, which require some weird ways to implement location selection logic.</p><p>Nginx has published a dedicated article to clarify this topic:<br><a href="https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/">If is Evil… when used in location context</a></p><p>So let’s follow the best practice they recommend to select a location based on basic HTTP auth user.</p><p>The following configuration defines three locations for Admin, Editor, and Reader users. The Admin user has full access, the Editor is similar but with the /admin path restricted, and the Reader is limited to GET requests only:</p><pre>server {<br>  listen 80 default_server;<br>  server_name _;<br>  # Admin<br>  location / {<br>    proxy_pass &lt;backend&gt;;<br>    auth_basic &quot;Restricted&quot;;<br>    auth_basic_user_file /etc/nginx/.htpasswd-admin;<br>    error_page 418 = @editor;<br>    error_page 419 = @reader;<br>    recursive_error_pages on;<br>    if ($http_authorization = &#39;Basic &lt;base64_auth_editor&gt;&#39;) {<br>      return 418;<br>    }<br>    if ($http_authorization = &#39;Basic &lt;base64_auth_reader&gt;&#39;) {<br>      return 419;<br>    }<br>  }<br>  # Editor<br>  location @editor {<br>    proxy_pass &lt;backend&gt;;<br>    auth_basic &quot;Restricted&quot;;<br>    auth_basic_user_file /etc/nginx/.htpasswd-editor;<br>    if ($uri ~ &#39;^/admin&#39;) {<br>      return 403;<br>    }<br>  # Reader<br>  location @reader {<br>    proxy_pass &lt;backend&gt;;<br>    auth_basic &quot;Restricted&quot;;<br>    auth_basic_user_file /etc/nginx/.htpasswd-reader;<br>    if ($request_method ~ &#39;^(POST|PUT|PATCH|DELETE)$&#39;) {<br>      return 405;<br>    }<br>  }<br>}</pre><p>base64_auth_editor and base64_auth_reader are base64-encoded strings, representing the appropriate users, and may be compiled via e.g. Ansible template like this:</p><pre>if ($http_authorization = &#39;Basic {{ (editor + &#39;:&#39; + editor_pass) | b64encode }}&#39;) {<br>  return 418;<br>}<br>if ($http_authorization = &#39;Basic {{ (reader + &#39;:&#39; + reader_pass) | b64encode }}&#39;) {<br>  return 419;<br>}</pre><p>Where editor/editor_pass and reader/reader_pass are the basic HTTP auth user names and passwords that should be provided to this code via variables.</p><p>Try it and report back in case of any issues. And thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e984e8000ccd" width="1" height="1" alt=""><hr><p><a href="https://blog.smirnov.la/select-nginx-location-by-basic-http-auth-user-e984e8000ccd">Select Nginx location by basic HTTP auth user</a> was originally published in <a href="https://blog.smirnov.la/">danil.smirnov</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integration of ACM with Nginx via AWS Nitro Enclaves]]></title>
            <link>https://blog.smirnov.la/integration-of-acm-with-nginx-via-aws-nitro-enclaves-15d086048323?source=rss-541cafe96c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/15d086048323</guid>
            <category><![CDATA[nitroenclaves]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[nginx]]></category>
            <category><![CDATA[aws-acm]]></category>
            <dc:creator><![CDATA[Danil Smirnov]]></dc:creator>
            <pubDate>Thu, 14 Oct 2021 11:43:34 GMT</pubDate>
            <atom:updated>2022-12-08T19:18:09.143Z</atom:updated>
            <content:encoded><![CDATA[<p>Everyone prises AWS Certificate Manager for its security and operational excellence.</p><p>Operational excellence is because the entire headache of the annual certificate rotation can be healed by the complete integration of the service with those consuming its certificates (e.g. load balancers, CDN, etc).</p><p>Security is because it hides a private key of TLS certificate — it can not be disclosed even to the account admin. And that’s why one can not leverage ACM to feed a local Nginx installation in an EC2 instance.</p><p>Living with this limitation for so many years already, I was quite curious when have heard about <a href="https://aws.amazon.com/about-aws/whats-new/2020/10/announcing-aws-certificate-manager-for-nitro-enclaves/">ACM for Nitro Enclaves</a>. The thing sounds like we can now integrate ACM with the local Nginx in an EC2 instance!</p><p>Today I’ve carried out an experiment to check how does it work and what is a trade-off. Grab a coffee and enjoy. :)</p><h3>Eligible instance types</h3><p>First of all, when reading <a href="https://aws.amazon.com/ru/ec2/nitro/nitro-enclaves/faqs/">Nitro Enclaves FAQS</a>, one might think that there are 2 vCPU instances supported by the technology: “Nitro Enclaves is not currently available on … any instances with only 1 CPU core”.</p><p>When checking eligible EC2 instances on the <a href="https://aws.amazon.com/marketplace/pp/prodview-f4gcl7narsmle">solution page</a> in AWS Marketplace, one can find <em>m5d.large</em> instance type in the list, which has 2 vCPUs. Unfortunately, this is just a mistake and a false promise.</p><p>AWS Nitro Enclaves support only 4 vCPU instances smallest — hence the cheapest one to deploy to your Development environment would be c5a.xlarge. No T-family and no ARM instances are supported. :(</p><h3>Performance concerns</h3><p>Another important question that came to my mind right after reading about the technology was how much this would cost us in terms of performance?</p><p>There must be some loss due to the strong isolation of the enclave from the parent instance via an entire CPU core being handed over to the Nitro Enclaves engine for TLS certificate management.</p><p>Actually, looking at the configuration, you might assume, that assignment of only one vCPU (thread) to the enclave is possible:</p><pre># Enclave general configuration<br>enclave:<br>  # Number of vCPUs to be assigned to the enclave<br>  cpu_count: 2<br>  # Memory (in MiB) to be assigned to the enclave<br>  memory_mib: 256</pre><p>But my experiment has proved that 1 vCPU won’t work — hence the minimal number of instance vCPUs, required by the technology is 4. I’m not sure if this limitation might be lifted in the future or not…</p><h3>Let’s test it</h3><p>To clarify the trade-off of performance and security, brought by ACM to Nginx integration, I’ve deployed two <em>c5a.xlarge</em> instances based on Amazon Linux 2 to the same availability zone.</p><p>After I’ve followed the Nitro Enclaves <a href="https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave-refapp.html#launch-instance">installation guide</a> for one instance, I’ve noticed that two CPU threads have disappeared from thehtop command output. Only 2 vCPUs have remained for Nginx, installed in the parent instance.</p><p>I’ve prepared two identical EC2 instances — the first one with the ACM for Nitro Enclaves solution and the second with a TLS certificate, insecurely stored in the instance filesystem. Both are with the same Nginx version.</p><p>I’ve also deployed my <em>gun</em> instance, from which I was firing both instances on via wrk machine gun.</p><h3>Testing results</h3><p>I was leveraging all 4 threads of the gun machine and never reached a full utilization of its CPU. In the same way, the CPU wasn’t exhausted in both targets in the first shooting session with 10 connections per thread.</p><p>Regular Nginx:</p><pre>Running 1m test @ <a href="https://test.server.com/">https://test.server.com</a><br>  4 threads and 10 connections<br>  Thread Stats   Avg      Stdev     Max   +/- Stdev<br>    Latency   309.67us   72.53us   4.87ms   93.55%<br>    Req/Sec     6.42k   214.94     7.04k    78.82%<br>  Latency Distribution<br>     50%  300.00us<br>     75%  327.00us<br>     90%  362.00us<br>     99%  453.00us<br>  1535437 requests in 1.00m, 5.38GB read<br>Requests/sec:  25548.08<br>Transfer/sec:     91.59MB</pre><p>Nginx with ACM integration:</p><pre>Running 1m test @ <a href="https://test.server.com/">https://test.server.com</a><br>  4 threads and 10 connections<br>  Thread Stats   Avg      Stdev     Max   +/- Stdev<br>    Latency   235.73us   53.61us   6.22ms   88.79%<br>    Req/Sec     8.35k   313.87     9.93k    70.48%<br>  Latency Distribution<br>     50%  227.00us<br>     75%  252.00us<br>     90%  284.00us<br>     99%  369.00us<br>  1996646 requests in 1.00m, 6.99GB read<br>Requests/sec:  33222.49<br>Transfer/sec:    119.10MB</pre><p>Obviously, the TLS management offloading to Nitro Enclave doesn’t help the instance keep good performance in comparison with regular Nginx, which uses all 4 vCPUs available…</p><p>The picture becomes totally clear if we increase connections to a hundred per thread, which causes 100% CPU load in both instances. The difference reaches x2 (that is quite reasonable for 4 vs 2 vCPUs).</p><p>Regular Nginx:</p><pre>Running 1m test @ <a href="https://test.server.com/">https://test.server.com</a><br>  4 threads and 100 connections<br>  Thread Stats   Avg      Stdev     Max   +/- Stdev<br>    Latency     1.33ms  691.18us  97.61ms   96.77%<br>    Req/Sec    18.78k     1.65k   29.56k    94.33%<br>  Latency Distribution<br>     50%    1.30ms<br>     75%    1.38ms<br>     90%    1.48ms<br>     99%    2.69ms<br>  4480876 requests in 1.00m, 15.69GB read<br>Requests/sec:  74644.34<br>Transfer/sec:    267.59MB</pre><p>Nginx with ACM integration:</p><pre>Running 1m test @ <a href="https://test.server.com/">https://test.server.com</a><br>  4 threads and 100 connections<br>  Thread Stats   Avg      Stdev     Max   +/- Stdev<br>    Latency     2.92ms    0.91ms 153.16ms   92.03%<br>    Req/Sec     8.60k   723.09    11.33k    93.36%<br>  Latency Distribution<br>     50%    2.88ms<br>     75%    2.97ms<br>     90%    3.13ms<br>     99%    4.93ms<br>  2049397 requests in 1.00m, 7.17GB read<br>Requests/sec:  34146.39<br>Transfer/sec:    122.41MB</pre><h3>Conclusion</h3><p>ACM to Nginx integration via AWS Nitro Enclaves requires an entire CPU core to be dedicated to the engine which effectively removes half of the CPU resources from 4 vCPU powered instances.</p><p>No tangible gain seems to come from the TLS certificate management offloading to Nitro Enclave in terms of performance.</p><p>Performance overhead would shrink proportionally to the instance size increase — e.g. for a 32 vCPU instance, it will be ~6% only.</p><p>Thus I don’t see a reason to use ACM for Nitro Enclaves solution for instances smaller than… well, quite a large instances. :)</p><p>The dream of unlimited integration AWS ACM with Nginx seems to have failed to come true and remains just a dream for the foreseeable future.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15d086048323" width="1" height="1" alt=""><hr><p><a href="https://blog.smirnov.la/integration-of-acm-with-nginx-via-aws-nitro-enclaves-15d086048323">Integration of ACM with Nginx via AWS Nitro Enclaves</a> was originally published in <a href="https://blog.smirnov.la/">danil.smirnov</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to avoid redirect address disclosure by Postfix bounces]]></title>
            <link>https://blog.smirnov.la/how-to-avoid-redirect-address-disclosure-by-postfix-bounces-77994d78573c?source=rss-541cafe96c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/77994d78573c</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[postfix]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[email]]></category>
            <dc:creator><![CDATA[Danil Smirnov]]></dc:creator>
            <pubDate>Mon, 07 Jun 2021 09:18:23 GMT</pubDate>
            <atom:updated>2022-12-08T19:20:17.645Z</atom:updated>
            <content:encoded><![CDATA[<p>There is a couple of email addresses one should have configured from day 0 for any internet domain to ensure it complies with the best practices. They are postmaster@domain and abuse@domain.</p><p>As per <a href="https://www.ietf.org/rfc/rfc5321.txt">RFC 5321</a>, any errors during the processing of email should be directed to the postmaster@ email address, and as per <a href="https://www.ietf.org/rfc/rfc2142.txt">RFC 2142</a>, any abusive actions, such as spamming, should be reported to the abuse@ email address.</p><p>I often configure those administrative role accounts simply as a Postfix redirects to some service mailbox e.g. in GMail, using the following configuration script (along with my <a href="https://blog.smirnov.la/postfix-in-docker-5bf01e425a47">Postfix Docker image</a>):</p><pre>#!/bin/bash<br>postconf -e &quot;virtual_alias_maps = hash:/etc/postfix/virtual&quot;<br>echo &quot;postmaster@${MAIL_DOMAIN} aggregation_mailbox@gmail.com<br>abuse@${MAIL_DOMAIN} aggregation_mailbox@gmail.com&quot; &gt; /etc/postfix/virtual<br>postmap /etc/postfix/virtual</pre><p>However, if GMail does not accept an incoming email message, Postfix will respond to the sender with the bounce message in the following format:</p><pre>&lt;aggregation_mailbox@gmail.com&gt; (expanded from &lt;postmaster@domain&gt;): host gmail-smtp-in.l.google.com[173.194.73.26] said: 550–5.7.1 [1.2.3.4] Our system has detected that this message is 550–5.7.1 likely unsolicited mail...</pre><p>As you can see, Postfix has expanded and disclosed the mailbox behind the administrative role account. Not good, folks!</p><p>After checking the Postfix <a href="https://github.com/vdukhovni/postfix/blob/51005335d41a148e9b013d5757a7fe8aa32a987d/postfix/src/bounce/bounce_notify_util.c#L688">source code</a>, it appears that this behavior isn’t parametrized, hence can not be disabled easily. Let’s do a workaround then!</p><p>With the following code we can redirect all service messages for our domain to “mailbox@another_domain” and avoid posting them to the sender:</p><pre>#!/bin/bash<br>echo &quot;/^From: MAILER-DAEMON.*/ REDIRECT mailbox@another_domain&quot; &gt; /etc/postfix/header_checks<br>postmap /etc/postfix/header_checks<br>postconf -e &quot;header_checks = regexp:/etc/postfix/header_checks&quot;<br>postconf -e &quot;internal_mail_filter_classes = bounce,notify&quot;</pre><p>This will allow us to protect the redirect address from disclosure while still having those bounce messages saved somewhere at least.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77994d78573c" width="1" height="1" alt=""><hr><p><a href="https://blog.smirnov.la/how-to-avoid-redirect-address-disclosure-by-postfix-bounces-77994d78573c">How to avoid redirect address disclosure by Postfix bounces</a> was originally published in <a href="https://blog.smirnov.la/">danil.smirnov</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The first sale of beautiful tokens]]></title>
            <link>https://medium.com/retention-live/the-first-sale-of-beautiful-tokens-e8ec6b150f29?source=rss-541cafe96c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8ec6b150f29</guid>
            <category><![CDATA[storage]]></category>
            <category><![CDATA[future]]></category>
            <category><![CDATA[nft-collectibles]]></category>
            <category><![CDATA[token-sale]]></category>
            <category><![CDATA[nft]]></category>
            <dc:creator><![CDATA[Danil Smirnov]]></dc:creator>
            <pubDate>Wed, 10 Mar 2021 12:29:50 GMT</pubDate>
            <atom:updated>2021-03-10T12:32:51.884Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/648/1*E0rx8fV58wB646o5_yXOGg.png" /></figure><p>We are happy to announce our first-ever sale of beautiful tokens for <a href="https://retention.live/">Retention.live</a> project. The sale is supported by OpenSea marketplace.</p><p>Beautiful tokens are those with nice ids. (As token id is used in a <a href="https://office.retention.live/faq.html#siteURL">site URL</a> construction, it makes sense to have it nice.)</p><p>Tokens with ids from 1000 and up are available for purchase on the <a href="https://office.retention.live/tokens.html">project site</a>. Tokens which shorter than four digits are considered collectibles.</p><p>This time ten beautiful 3-digit long tokens are available for purchase:</p><ul><li>Token 100</li><li>Token 101</li><li>Token 110</li><li>Token 111</li><li>Token 143</li><li>Token 333</li><li>Token 420</li><li>Token 666</li><li>Token 911</li><li>Token 999</li></ul><p>The sale will last until the 10th of April.</p><p>If interested, please visit the sale’s page in OpenSea marketplace:</p><p><a href="https://opensea.io/collection/retention-live">https://opensea.io/collection/retention-live</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8ec6b150f29" width="1" height="1" alt=""><hr><p><a href="https://medium.com/retention-live/the-first-sale-of-beautiful-tokens-e8ec6b150f29">The first sale of beautiful tokens</a> was originally published in <a href="https://medium.com/retention-live">Retention.live</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to send emails in 2020]]></title>
            <link>https://blog.smirnov.la/how-to-send-emails-in-2020-3ad76a31a7cc?source=rss-541cafe96c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/3ad76a31a7cc</guid>
            <category><![CDATA[spam]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[dkim]]></category>
            <category><![CDATA[spf]]></category>
            <category><![CDATA[email]]></category>
            <dc:creator><![CDATA[Danil Smirnov]]></dc:creator>
            <pubDate>Sun, 08 Nov 2020 12:25:01 GMT</pubDate>
            <atom:updated>2023-03-05T19:13:54.303Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*I8z5Gxa-YP1fsdiGd8WQhg.jpeg" /></figure><p>Sending emails is a complicated topic still due to the anti-SPAM war, which lasts for decades already. One can’t simply send emails using the default installation of MTA (Mail Transport Agent).</p><p>Well, you can send them, obviously, but your recipient won’t get them as they won’t be accepted by his email service provider (ESP) and delivered to her mailbox. Especially if you mass-mailing.</p><p>In this article, I’d like to go through a minimal set of configurations, required to have your emails successfully delivered to their destination. I will use <a href="https://blog.smirnov.la/postfix-in-docker-5bf01e425a47">Postfix in Docker</a> image in code examples.</p><h3>Configure DNS stuff</h3><p>The primary protection mechanism for anti-spam measurements is to use relevant DNS records. You should create two records at least: for SPF and DKIM technologies.</p><p>A typical <strong>SPF record</strong> would look like</p><pre>&quot;v=spf1 a mx ?all&quot;</pre><p>which says that you confirm sending emails from the IP address, defined in the domain’s A record as well as in its MX record.</p><p>The next part is a little more complicated. Modern ESPs love signed emails. You should sign your email to be treated nicely.</p><p>Firstly, you should create a <strong>DKIM key</strong> for your email domain, let’s say example.com :</p><pre>opendkim-genkey -b 2048 -r -s mail -d example.com</pre><p>Find the new key in mail.txt file and put it into the TXT record of the example.com domain.</p><p>Then enable DKIM by mapping a folder with mail.private file to the postfix container as advised in the <a href="https://github.com/danil-smirnov/docker-postfix">docs</a>:</p><pre>docker run -p 25:25 \<br>  -e MAIL_DOMAIN=example.com \<br>  -e MAIL_HOST=mail.example.com \<br>  -e SMTP_USER=user:pwd \<br>  -v /path/to/domainkeys:/etc/opendkim/domainkeys \<br>  --name postfix -d danilsmirnov/postfix</pre><p>The third mandatory thing is a reverse DNS record — <strong>PTR record</strong>. It must match your server HELO/EHLO greeting, which is defined in the code above by MAIL_HOST parameter.</p><p>A way to set the PTR record is highly dependent on the server hosting provider, it can be done using a hosting panel or with the provider support. In the case of AWS please refer to this article:</p><p><a href="https://aws.amazon.com/premiumsupport/knowledge-center/route-53-reverse-dns/">https://aws.amazon.com/premiumsupport/knowledge-center/route-53-reverse-dns/</a></p><blockquote><em>UPDATE of Feb 2021:<br></em><a href="https://aws.amazon.com/about-aws/whats-new/2021/02/amazon-virtual-private-cloud-vpc-customers-customize-reverse-dns-elastic-ips-eip/"><em>https://aws.amazon.com/about-aws/whats-new/2021/02/amazon-virtual-private-cloud-vpc-customers-customize-reverse-dns-elastic-ips-eip/</em></a></blockquote><p>After all those are set, emails sent by the server will get SPF and DKIM checks passed (as Gmail shows):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5mIb3NYvF5uMyc0dxJd5YA.png" /></figure><p>To check the reverse DNS and EHLO, you can use the following service:<br><a href="https://mxtoolbox.com/diagnostic.aspx">https://mxtoolbox.com/diagnostic.aspx</a></p><h3>Slow down delivery to Yahoo</h3><p>Even with all the above carefully configured, there is an ESP that will refuse your mail still. It’s an infamous Yahoo.</p><p>Postmasters have suffered from Yahoo email policies for many years. They are still furious in 2020, see recent citations from the postfix-users@postfix.org mailing list to have an idea of the level of rage:</p><blockquote>Honestly, it is a source of continuing amazement, bafflement, and<br>mystified wonder to me that Yahoo continues to survive at all, in any<br>form. They are not just bad at email, they are bad at EVERYTHING, and<br>they have leaked essentially all of the personal information of<br>essentially all of their users, multiple times. And that was even<br>BEFORE they were bought (gods only know why) by Verizon. (…Well, OK,<br>by a Verizon subsidiary.)</blockquote><blockquote>Honestly the best thing to do would have been to just let Yahoo DIE.<br>It’s long past time.</blockquote><p>and one more:</p><blockquote>Because Yahoo lies and gives an error claiming user complaints that is entirely made-up and has nothing to do with users.</blockquote><blockquote>Really, they are worthless and I made the decision when they had their FIRST massive breech to simply pretend they do not exist (My server will neither send nor receive mail from Yahoo.com) giving an error message explaining why.</blockquote><p>So don’t be surprised if you quickly found all your emails sent to Yahoo and their owned domains (like aol.com or verizon.net) will be “deferred” for an indefinite period of time instead of delivery.</p><p>You won’t find an exact reason or list of requirements to fulfill in any Yahoo docs except very basic and their points of contact won’t respond, even if you carefully prepare a long list of answers to their questionnaire.</p><p>They simply don’t bother, just take it for granted and relax. A solution here is to slow down your mail delivery to Yahoo-related domains to a very low level, which you can then increase gradually.</p><p>As per the advice of Postfix creator Wietse Venema in <a href="https://marc.info/?t=158006889200002&amp;r=1&amp;w=2">this mail thread</a>, the following configuration would force the mail server to send only a few messages to Yahoo per minute:</p><pre>postconf -M yahoo/unix=&quot;yahoo      unix  -       -       n       -       1       smtp -o smtp_mx_session_limit=1 -o smtp_mx_address_limit=5&quot;<br>postconf -e &quot;yahoo_transport_rate_delay = 15s&quot;<br>postconf -e &quot;yahoo_destination_recipient_limit = 2&quot;<br>echo &#39;aim.com        yahoo:<br>aol.com        yahoo:<br>kimo.com       yahoo:<br>rocketmail.com yahoo:<br>verizon.net    yahoo:<br>yahoo.co.in    yahoo:<br>yahoo.com      yahoo:<br>yahoo.com.hk   yahoo:<br>yahoo.com.tw   yahoo:<br>yahoo.co.uk    yahoo:<br>yahoo.fr       yahoo:<br>ymail.com      yahoo:&#39; &gt; /etc/postfix/transport<br>postmap /etc/postfix/transport<br>postconf -e &quot;transport_maps = hash:/etc/postfix/transport&quot;</pre><p>Put this config to postfix.sh file and inject it into the container:</p><pre>docker run -p 25:25 \<br>  -e MAIL_DOMAIN=example.com \<br>  -e MAIL_HOST=mail.example.com \<br>  -e SMTP_USER=user:pwd \<br>  -v /path/to/domainkeys:/etc/opendkim/domainkeys \<br>  -v /path/to/postfix.sh:/configure.sh \<br>  --name postfix -d danilsmirnov/postfix</pre><h3>Play nicely with ESPs</h3><p>There are also many good ESPs like Gmail who you should cooperate with. There is a recommended way to interact with them —<strong> FeedBack Loop (FBL)</strong>.</p><p>In short, you register your mail server with ESP and get users&#39; complaints (when they click the “Spam” button in the ESP UI).</p><p>In case of a user is unhappy, you will get the email, which caused the reaction and perform the necessary measurements to resolve the issue.</p><p>FBL services are usually per-ESP (e.g. <a href="https://sendersupport.olc.protection.outlook.com/snds/">Microsoft</a>), but there are some attempts to aggregate a few of them into one service: <a href="https://fbl.returnpath.net/">https://fbl.returnpath.net/</a>.</p><p>A caveat here is that most probably you get those emails with the user email address obfuscated because of privacy reasons.</p><p>To identify the user, one can implement a custom tagging of every email to be sent, which effectively makes them personalized.</p><h3>Monitor your reputation</h3><p>Some emails might trigger <strong>Anti-spam Blacklists</strong>, so you should monitor them against your IP address constantly.</p><p>I’d recommend this nice tool for the automation of this check:</p><p><a href="https://github.com/adionditsak/blacklist-check-unix-linux-utility">https://github.com/adionditsak/blacklist-check-unix-linux-utility</a></p><p>And, finally, do not send SPAM, please.</p><p>Happy mailing!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3ad76a31a7cc" width="1" height="1" alt=""><hr><p><a href="https://blog.smirnov.la/how-to-send-emails-in-2020-3ad76a31a7cc">How to send emails in 2020</a> was originally published in <a href="https://blog.smirnov.la/">danil.smirnov</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Postfix in Docker]]></title>
            <link>https://blog.smirnov.la/postfix-in-docker-5bf01e425a47?source=rss-541cafe96c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/5bf01e425a47</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[mail]]></category>
            <category><![CDATA[postfix]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[email]]></category>
            <dc:creator><![CDATA[Danil Smirnov]]></dc:creator>
            <pubDate>Sat, 04 Jul 2020 17:46:20 GMT</pubDate>
            <atom:updated>2025-02-21T07:34:07.801Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*RqsRT7B00FmamxmQlsyLZA.png" /></figure><p>To be a maintainer of an email server is hard. One can’t simply apt install default-mta to get a healthy and robust email system. Even now it still requires extra work.</p><p>It takes only a short time after the server has been misconfigured as an <a href="https://en.wikipedia.org/wiki/Open_mail_relay">open relay</a> to have it compromised by spammers and get its IP caught by multiple anti-spam lists!</p><p>A modern email server must support SASL, DKIM and TLS to be treated nicely by huge email providers like GMail.</p><p>As a DevOps Engineer, I tend to use Docker as much as I can to support uniform and well-maintainable infrastructure.</p><p>So there were multiple occasions in the last years when I was looking for some nice Docker image of a good email server, preferable postfix.</p><p>Postfix is the second most-popular mail server in the Internet and default MTA (mail transfer agent) for Ubuntu. (Another one is exim, and they both occupy more than 90% of the Internet servers.)</p><p>If you check Docker Hub, there is a noticeable <a href="https://hub.docker.com/r/catatnight/postfix">catatnight/postfix</a> image by Elliott Ye. 10 millions of pulls suggest it’s good enough for the modern requirements.</p><p>Indeed — it supports SASL authentication as well as DKIM and TLS. If properly configured, they make email service quite well-shaped.</p><p>However, the image is quite outdated, as it was last updated five years ago. Hence I’ve decided to <a href="https://github.com/danil-smirnov/docker-postfix">fork the project</a> and upgrade it to the current best practices.</p><p>Below I will list and comment on all the changes I’ve made in the image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/321/1*pDGv1rBvqiPwll8SCjCm3w.gif" /><figcaption><a href="https://mailman3.com/">Mailman3.com</a> — mailing list SAAS</figcaption></figure><p><strong>Ubuntu:Trusty -&gt; Ubuntu:Focal</strong></p><p>Ubuntu 14.04 LTS distribution was used as the base of the image. 16, 18, 20… Yes! It’s Ubuntu 20.04 LTS now. :)</p><p><strong>Logs to stdout</strong></p><p>In Docker/K8s deployments we are used to collecting logs from containers stdout. And we don’t want to experience uncontrolled log files growth inside the container.</p><p>While all the relevant logs of the new image are redirected to stdout, one extra mail.log file is kept for Fail2ban service, but it’s being cleaned up nightly.</p><p><strong>Mail domain and mail host</strong></p><p>They are not necessarily the same. We should be able to maintain <strong>mail.domain.com</strong> host serving emails for <strong>domain.com</strong> mail domain.</p><p>This is particularly useful for a reverse DNS configuration, which is just another option, treated as mandatory these days.</p><p>While supporting the old approach with MAIL_DOMAIN parameter only, an extra variable MAIL_HOST has been added to distinguish the two.</p><p><strong>Play nicely with the wild Internet</strong></p><p>If you check logs of a SASL-enabled mail server, you will discover a lot of brute-force attempts to guess a password. The attacks are inevitable and persistent.</p><p>Fail2ban intrusion detector has been added to the image with postfix-sasl jail pre-installed. It bans repetitive breaking attempts automatically.</p><p>You can check how many bad IPs has banned using command</p><pre>docker exec -it postfix fail2ban-client status postfix-sasl</pre><p><strong>Add your own configuration easily</strong></p><p>There might be a need for additional configuration, i.e. custom mail aliases to forward particular emails (like to abuse@domain.com) to an external email address.</p><p>You don’t need to build a new image for that purpose. Just put your configuration in a file and mount it as /configure.sh into the container.</p><p>For example:</p><pre>postconf -e &quot;virtual_alias_maps = hash:/etc/postfix/virtual&quot;<br>echo &quot;abuse@${MAIL_DOMAIN} address@externaldomain.com&quot; &gt;&gt; /etc/postfix/virtual<br>postmap /etc/postfix/virtual</pre><p>The image is available for pulling in Docker Hub:<br><a href="https://hub.docker.com/r/danilsmirnov/postfix">https://hub.docker.com/r/danilsmirnov/postfix</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5bf01e425a47" width="1" height="1" alt=""><hr><p><a href="https://blog.smirnov.la/postfix-in-docker-5bf01e425a47">Postfix in Docker</a> was originally published in <a href="https://blog.smirnov.la/">danil.smirnov</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Technology architecture challenges of SLT project]]></title>
            <link>https://medium.com/retention-live/technology-architecture-challenges-of-slt-project-25184966d271?source=rss-541cafe96c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/25184966d271</guid>
            <category><![CDATA[future]]></category>
            <category><![CDATA[storage]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[cloud-architecture]]></category>
            <dc:creator><![CDATA[Danil Smirnov]]></dc:creator>
            <pubDate>Sun, 12 Apr 2020 16:31:05 GMT</pubDate>
            <atom:updated>2020-04-19T20:00:08.077Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vKMCejgf7WntuIs0gs27Tw.jpeg" /><figcaption><a href="http://www.galuzzi.it/"><strong>Luca Galuzzi — www.galuzzi.it</strong></a></figcaption></figure><p>In this article I’d like to review multiple challenges one would face when designing and implementing truly super-long-term (SLT) project, aimed to span multiple centuries and human generations.</p><h3><strong>First challenge: Sustainability</strong></h3><p><strong>Resistance to hard times</strong></p><p>The project must survive in turbulent times like pandemic-caused economic depression with the same confidence as in times of pleasant growth.</p><p>In these days there are too many companies which are desperately dependent of persistent growth to keep their profitability. When hard times come, they can’t keep their business on the go while having financial responsibilities to their clients, hence go bankrupt.</p><p>From the other side, we never lived in such perfect times in terms of on demand-based services. We can now enjoy Pay-As-You-Go pricing allocation so we pay effectively nothing (or close to nothing) in times of low demand. Of course, if the project is properly designed.</p><p><strong><em>Retention.live</em></strong> leans on a <strong>fully serverless and on demand-based setup</strong> with every resource generates an expense only when it’s in use (with few exceptions like DNS zones, that is not game changers here).</p><p>To benefit from serverless computing, the project technology architecture should lean on <strong>event-driven pattern</strong> rather than tightly coupled components.</p><p><strong>Decoupled workers</strong> are sleeping until a new event appears and posting a response back to the event bus after they have completed their tasks.</p><p><strong>Ability to consume high demand</strong></p><p>A mirror issue is also valid here: as user base of the project might experience exponential growth over many years, any resource limit set in advance will be exceeded earlier or later. Solution here is to <strong>not apply any limits at all</strong>, which is perfectly doable in serverless computing world.</p><p>Similarly, in case of rapid demand growth, the project resources shouldn’t be overflown and remain accessible and functional. This also fits well into serverless approach, which is capable to <strong>quickly provide resources on demand</strong>.</p><h3><strong>Second challenge: Cost control</strong></h3><p>A cost control of SLT project must be total and sufficient enough to secure clients’ property over long periods of time — like centuries. There are two major challenges of keeping the promise: cost accumulation and the service misuse prevention.</p><p><strong>Cost accumulation</strong></p><p>Small fee grows to a fortune in a century. For example, you have $1 annual fee when using some service. It hardly looks dangerous, doesn’t it? But it adds as much as $1000 to client’s millennial expense. One simply can’t afford this fee if aims to limit the pricing by $100 for a thousand years.</p><p>The promise must be carefully estimated against super-long periods of time like millennia to ensure it will sustain even very small increase of expenses because it might grow to unacceptable levels because of multiplication by hundreds of years.</p><p><strong><em>Retention.live</em></strong> guarantees one day of user’s data exposition annually for a thousand of years which means that as many as 1000 days (3+ years) of client’s files exposition must be secured. Traffic and requests cost must be properly estimated and protected from abuse with <strong>intelligent CDN solution</strong>.</p><p><strong>Service misuse prevention</strong></p><p>We live in times when DDOS attack costs just a small sum on black market. And sometimes it is not even the attack, but some bright idea of a really smart user who is not aware, that her actions jeopardise the whole project finances.</p><p>The only way to defend the project of possible overuse is sophisticated and carefully designed <strong>monitoring system</strong>. It’s not enough to monitor the project precisely and reliably. The system must react instantly and block compromised resources immediately — before a harm to other users inflicted.</p><h3><strong>Third challenge: Data durability</strong></h3><p>A probability of users’ data corruption or loss is growing over the years. There are two major types of data which must be secured and made as tolerant as possible to passing of time: users’ data and users’ accounts.</p><p>Users’ data can be as reliable as 99.999999999% durability of objects over a given year according to the modern cloud offerings. This durability level corresponds to an average annual expected loss of 0.000000001% of objects, or a <strong>single object from 100 thousands in every millennia</strong>.</p><p>Users’ accounts are more vulnerable to human mistake, especially if many humans maintain them over the centuries. <strong>Blockchain (ledger) technology</strong> has arrived just in time to help <strong><em>Retention.live</em></strong> secure users’ accounts from accidental damage or deletion because of human mistake.</p><p>Unfortunately, 100% protection against passing of time is impossible as per current understanding of science because of an entropy of the Universe. However, we can not predict if the view will remain the same <a href="https://medium.com/retention-live/who-wants-to-live-forever-3c5214112439">in the future</a>…</p><h3>Please subscribe to this publication</h3><p>This is the second article in a series, explaining why <a href="https://retention.live/">Retention.live</a> project has been created in the first place. The next one will be about practical advice of how to collect and store your priceless personal data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25184966d271" width="1" height="1" alt=""><hr><p><a href="https://medium.com/retention-live/technology-architecture-challenges-of-slt-project-25184966d271">Technology architecture challenges of SLT project</a> was originally published in <a href="https://medium.com/retention-live">Retention.live</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Who wants to live forever?]]></title>
            <link>https://medium.com/retention-live/who-wants-to-live-forever-3c5214112439?source=rss-541cafe96c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c5214112439</guid>
            <category><![CDATA[future]]></category>
            <category><![CDATA[personal-data]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[storage]]></category>
            <category><![CDATA[transhumanism]]></category>
            <dc:creator><![CDATA[Danil Smirnov]]></dc:creator>
            <pubDate>Sun, 01 Mar 2020 16:03:55 GMT</pubDate>
            <atom:updated>2020-04-19T19:59:36.179Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9IWO_sUksFEk5uNuAdm0xw.jpeg" /><figcaption>Pyramids at Giza, by <a href="http://liberato.org/">Ricardo Liberato</a>. <a href="https://creativecommons.org/licenses/by-sa/2.0">CC BY-SA 2.0</a></figcaption></figure><h3>Who wants to live forever?</h3><p>Immortality is a longtime dream of humankind. While as organisms we can only hope to be alive for a century (if something like coronavirus won’t make it shorter), we have already invented immortality — in digital dimension!</p><h3>Digital revolution’s introduced digital immortality</h3><p>People of ancient times were keen to save their work for the future generations but, effectively, failed. They leave to us few artifacts like petroglyphs or pyramids but in terms of information it’s nothing. We have no clue how those pyramids were built as there is no README file attached…</p><p>And after only a few thousand years we see those signs of disrepair and we know we lost the vast majority of evidence of the past ages already — because of entropy, which rules in the real world.</p><p>This is not the case in the world of digital, or virtual world. Digital forms of information are effectively immortal and entropy-resistant. No disrepair or even little change could be found in files dated 1970 — half a century ago — which are still in absolutely the same condition as when they were created.</p><p>Time simply makes no damage to digital assets, they live in the world without entropy with no ruthless rules like “what is born will die”. We can keep them fresh and complete effectively forever. As we trust archeology, this is the very first opportunity for humankind in all our history.</p><h3>Digital immortality should make us rethink our ways</h3><p>What does digital immortality mean for humankind? There are a couple of game changer considerations we should realize here.</p><p>1. If data can be stored forever, it can be used in the far future for wonderful things.</p><p>We all agree that a man of the 18th century won’t even imagine things we consider trivial in 2020. In the same manner we won’t predict how yet not known future technologies might be used for doing astonishing things with data, preserved from the past.</p><p>2. The risk of data loss grows alongside with the passage of time and reaches infinity.</p><p>In the world of constant (or even exponential) technologies development a harm of data loss will grow as time goes by. In the farthest future, when it might be possible even to recreate one’s personality using her personal data collected, the price of data loss reaches truly infinite value.</p><h3>A stream of personal data grows rapidly</h3><p>On the other hand, we never lived in times when collecting personal data is so easy, cheap and high quality. The following personal data could be collected by any modern human being automatically or with just minimal effort:</p><p><strong>Thoughts and emotions: </strong>blogs, activity feeds in social networks, emails, chats history, reviews and ratings…</p><p><strong>Visual information: </strong>mobile photo stream, mobile video stream, video surveillance data…</p><p><strong>Physical information: </strong>health data from fitness trackers, records of voice communications…</p><p><strong>Behavioral data: </strong>geo-locations, browsers history, payments and purchases, personal finances applications data, transport data from transport cards, locations data from access cards/digital keys…</p><p>If all this data is collected and organized, one can have quite a complete view on the life of an individual. Watching this data in its chronological order might feel like living someone else’s life. What if this someone is your <em>grand-grand-grand-</em>mother?</p><p>There is another trend going in parallel with the collected data growth. It’s constant improvement of techniques to store that data. Cost of storage falls all the time: 80TB(!) hard drives have been recently announced. Every new generation of data center facilities brings cheaper and larger storage to customers.</p><p>Reliability of storage reaches unbelievable: the cloud storage systems provide as high as 99.999999999% durability of data. As AWS informs their customers: “For example, if you store 10,000,000 objects with Amazon S3, you can on average expect to incur a loss of <em>a single object once every 10,000 years</em>.”</p><h3>The world is not prepared yet</h3><p>If you’ve agreed that the data collection is important and try to find a provider for its reliable storage, you will quickly discover that no service seems adequate to the task. In fact, they all focused on short-term and simply not ready to offer a product for a long run.</p><p>What is meant by ‘long run’ in this context? Well, it must be time, spanning at least two generations of the same family/group members. And how modern services handle this? Actually, quite poorly.</p><p>Accounts are fully dependent on the finance/availability/mental health of their owners. Data storage providers trust you are:</p><ul><li>Alive, active and menthally sane</li><li>Your credit card/bank account is not expired, frozen or devastated</li><li>You keep the same email address and phone number to prove account ownership</li><li>You have good memory to remember your usernames/account ids/secret questions</li></ul><p>Data retention beyond a person’s active life time is not guaranteed. There seems to be no legal basis for account existence beyond its owner’s life. No one simply cares about that!</p><p>Security measures rely on one’s consciousness and memory. One has to be capable of providing all required security credentials , which are tightly coupled with one’s personality. They are far from impersonal and can not be easily transferred to a trusted party or successor.</p><p>Prices are usually for monthly or annual subscription. If you ask how much it would be for a centurial subscription they most probably think you are crazy. And a millennial subscription would cost a fortune simply because they have no clue how to forecast and limit the expenses over such a vast period of time.</p><p>And even if a contract is signed, how one could trust that her account will still be on the list after so many generations of the company management, engineers and sysadmins, especially as the probability of mistakenly deleted user relentlessly grows over the years?</p><p>It looks like humankind’s attention is focused on short-term goals only. It is probably because technological progress is so rapid, that people don’t have time to have a look into the future, which is farther than the next year. We hope to change the mind of a reader by this article.</p><h3>Please subscribe to this publication</h3><p>This is the first article in a series, explaining why <a href="https://retention.live/">Retention.live</a> project has been created in the first place. The next one will be about architecture challenges we faced while creating the service and practical advice of how to collect and store your priceless personal data.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c5214112439" width="1" height="1" alt=""><hr><p><a href="https://medium.com/retention-live/who-wants-to-live-forever-3c5214112439">Who wants to live forever?</a> was originally published in <a href="https://medium.com/retention-live">Retention.live</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The fall of CloudLinux or how to recover cloud instance without networking]]></title>
            <link>https://blog.smirnov.la/the-fall-of-cloudlinux-or-how-to-recover-cloud-instance-without-networking-17aa1cb0ba4e?source=rss-541cafe96c3------2</link>
            <guid isPermaLink="false">https://medium.com/p/17aa1cb0ba4e</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[chroot]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloudlinux]]></category>
            <dc:creator><![CDATA[Danil Smirnov]]></dc:creator>
            <pubDate>Sun, 08 Sep 2019 14:12:28 GMT</pubDate>
            <atom:updated>2019-09-08T14:12:28.385Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mCZAtL-sDyIxN-pQt9BkSA.png" /></figure><h3>The issue</h3><p>We don’t expect that kind of incidents anymore in the modern world. In this epoch of DevOps and automated testing it simply should not happen. We also are quite used to cheap and easy backups in the cloud, e.g. EBS volume lifecycle policies of AWS EC2 service…</p><p>But sometimes stars come to this rare configuration and my friend, who owns a pet SOHO web-hosting, has woken up by alarm, reporting his CloudLinux server in AWS seems dead from 3am of that unfortunate night. :(</p><p>What is even worse, he didn’t configure EBS lifecycle policies for the server, relying on per-client data backups only — hence they are quite useless in this painful situation, when the server doesn’t respond to any requests.</p><p>Reboots didn’t help, and after checking the system logs in AWS console, we quickly discovered that it was a network failure. Networking failed to up on boot with quite vague error:</p><pre>Failed to start LSB: Bring up/down networking</pre><p>The situation looked really bad: googling of the error message has brought to us tons of irrelevant cases and, as the server lives in AWS, there is simply no way to connect to it without networking up and running. Huh.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AUik1nsKuFxibVH9MtvIeg.png" /></figure><p>It was really good luck for my friend to find a root cause of the issue quite quickly: the error would not allow us to identify the problem easily. It was a nasty bug in the last update of CloudLinux distribution — version 7.7:</p><p><a href="https://www.cloudlinux.com/cloudlinux-os-blog/entry/issues-with-cloudlinux-os-7-7-update-on-systems-with-kernel-v3-10-0-862-or-lower">Issues with CloudLinux OS 7.7 update on systems with kernel v3.10.0-862 or lower</a></p><p>After the planned upgrade, which <a href="https://www.cloudlinux.com/cloudlinux-os-blog/entry/cloudlinux-os-7-7-released">requires reboot</a> as one of its steps and automatically applied by cPanel software, the system won’t start and the only way to connect to it in the cloud has been lost.</p><p>I wonder how many system administrators in web-hosting companies all over the world had day full of troubles on Thursday, September 4? How many of them followed wrong way until they realised the root cause of the issue…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dYyo_PZ2IrpWEAoOEs8ihA.png" /></figure><p>I believe that any company in our times (especially with customers like IBM and DELL) should use DevOps methodology to prevent crap software to be released to wide audience… But shit happens and we now need to recover the server.</p><h3>Recovery</h3><p>Hard disk volumes of instance in the cloud can be detached and plugged into another healthy instance with just few clicks — as mounted folder. Of course it’s quite useful for logs examination, but not only.</p><p>It is also possible to “boot” into the volume attached using Linux chroot command:<br><a href="https://en.wikipedia.org/wiki/Chroot">https://en.wikipedia.org/wiki/Chroot</a></p><p>After that it’s possible to run yum/rpm commands to install/upgrade/downgrade faulty packages to its previous version, as it’s recommended by CloudLinux support to fix the issue. After the fix applied, we were able to start the server in the cloud and connect to it as normal.</p><p>I wish this article helps someone in case of such disaster, but I personally prefer to follow DevOps approach treating servers not pets but cattle with everything easily reproducible in automated way.</p><p>Or, even better, get rid of servers completely, moving to serverless approach. :)</p><p>To sleep well, you really deserve this.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17aa1cb0ba4e" width="1" height="1" alt=""><hr><p><a href="https://blog.smirnov.la/the-fall-of-cloudlinux-or-how-to-recover-cloud-instance-without-networking-17aa1cb0ba4e">The fall of CloudLinux or how to recover cloud instance without networking</a> was originally published in <a href="https://blog.smirnov.la/">danil.smirnov</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>