<?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 Thales Sperling on Medium]]></title>
        <description><![CDATA[Stories by Thales Sperling on Medium]]></description>
        <link>https://medium.com/@thalesvon?source=rss-508d347fb33c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*UBhQ_GKS4y1Lw3x3UXjmqw.png</url>
            <title>Stories by Thales Sperling on Medium</title>
            <link>https://medium.com/@thalesvon?source=rss-508d347fb33c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 03:38:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@thalesvon/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[2020 — Sophomore (2nd) Professional Year]]></title>
            <link>https://thalesvon.medium.com/2020-sophomore-2nd-professional-year-760b7a1012a0?source=rss-508d347fb33c------2</link>
            <guid isPermaLink="false">https://medium.com/p/760b7a1012a0</guid>
            <category><![CDATA[career-development]]></category>
            <category><![CDATA[carreer]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Thales Sperling]]></dc:creator>
            <pubDate>Wed, 07 Apr 2021 03:06:47 GMT</pubDate>
            <atom:updated>2021-04-07T03:19:53.821Z</atom:updated>
            <content:encoded><![CDATA[<h3>2020 — Sophomore (2nd) Professional Year</h3><blockquote>Following 2019’s trend, I comeback to document my professional year of 2020. It was pretty neat to have a reference that I can look back and see where I’ve been and set clear goal to where I want to go.</blockquote><p>2020… What a year, am I right folks? Well, my focus here is not to mumble about what happened on 2020 but rather focus on the positive things that happened on the past year regarding my career. This year, I will write in English, as my network is now multi cultural.</p><h3><strong>December 19/January</strong></h3><p>In December 2019, I joined AWS as a Cloud Support Associate. I was very excited about this opportunity, I would describe the feeling as a “pat in the back&quot;. After all, getting an abroad job from a big Tech Company it is a dream for most people that decide on the IT/Engineering career path.</p><p>The team I joined was focused on deployment (DevOps) related services which included ECS, EKS, Code Services, Elastic Beanstalk, AWS X-Ray, Batch.</p><p>Coming from a DevOps Engineer Role, I already had experience with most of these services but AWS on-boarding includes a great learning experience. Basically, everything you need to know to perform your role, AWS will teach you.</p><h3>February</h3><ul><li>AWS Certified SysOps Administrator — Associate.</li></ul><h3>March</h3><ul><li>Not big achievement.</li><li>Unrelated Suggestion: If you are ever visiting Ireland, be sure to add Cliffs of Moher to the itinerary, cool place!</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bXn6Km3LZ96WYReS.jpg" /><figcaption>Picture taken from the Internet. When I visited the place, it was raining ice. Reminder: Always have rain gear in Ireland.</figcaption></figure><h3>April</h3><ul><li>Deep Dive Session for an AWS customer</li></ul><p>A Technical Account Manager at AWS had an University customer ready to take their research to the cloud, so they could focus on their research and leave the underlying server management for AWS. The research team was expecting a rapid growth on their website due their most recent research publication which was relevant for authorities dealing with the pandemic.</p><p>So two colleagues and I, decided to put together a Deep Dive Session for Elastic Beanstalk covering three main areas of the customer needs: Auto Scaling, Storage (EFS), Containerized Applications on the Cloud.</p><p>I took on the scalability area and suggested two auto scaling configurations for the customer: one based on the Network Traffic (appropriate for current scenario); one based on the Request Count (appropriate for expected growth). So I made an assessment of their application and started simulating both scaling configurations with a similar WebApp of mine.</p><ul><li>AWS Certified Developer — Associate</li></ul><p>This completed my AWS Certification Trifecta (SAA,SOA,DA). Honestly, if you took the SAA and SOA, the Developer Certification will be a walk in the park. From the three associate level exams, this is the easiest as it covers less AWS services.</p><p>The focus on this exam is to make the developer more complete by knowing the available possibilities the AWS services and its integrations offer. The biggest take away for me on this exam was DynamoDB.</p><p>Coming from a non-developer background, I always thought NoSQL=NoSense, but after taking this exam it was clear to me the advantages on certain use cases and I even started using it on my personal projects.</p><h3>May</h3><ul><li><a href="https://aws.amazon.com/premiumsupport/knowledge-center/elastic-beanstalk-host-attacks/">How do I protect my Elastic Beanstalk environment against attacks from known unwanted hosts?</a> — AWS Premium Support Knowledge Center article. This was my first time writing publicly for AWS and it was amazing! Within a few weeks after my article was released, I found myself and other team members using it as technical reference to customers looking to increase their security on Elastic Beanstalk environments.</li><li><a href="https://aws.amazon.com/premiumsupport/customers/testimonials/#SocialQuantum">AWS Infrastructure Event Management (IEM) — Social Quantum</a>. This was a Cloud Migration project. I reviewed the auto scaling policies and architecture. The company needed an aggressive scale-out for online game sessions and a slow and steady scale-in. Additionally, I was active to support the customer once they experienced production issues.</li></ul><h3>June</h3><ul><li>5 Star Hero Award for Dublin Deployment Team.</li><li>AWS Certified DevOps Engineer - Professional</li></ul><p>When I first started working with the AWS Platform, the DevOps Certification was the certification I had my eyes on. It is a professional level certification and it is TOOOUGH! Seriously, this is a test that you cannot pass without hands-on experience.</p><h3>July</h3><ul><li>Changes to the AWS CodeBuild Troubleshooting section —<a href="https://docs.aws.amazon.com/codebuild/latest/userguide/troubleshooting.html#troubleshooting-unable-to-verify-jobworker"> Error: &quot;Unable to verify JobWorker identity&quot; when opening the CodeBuild console</a>. Turns out IAM roles with a Tag jobId will cause issues on CodeBuild. I found the issue and pushed the changes to be available on the CodeBuild documentation.</li></ul><h3>August</h3><ul><li>Promotion to Cloud Support Engineer.</li></ul><h3>September</h3><ul><li>RDS IAM Authentication in a Cross Account Environment. A little background on the scenario:</li></ul><p>Account A: RDS Database <br>Account B: Batch Environment authenticating to RDS in Account A.</p><p>A simple scenario and what could’ve been a simple support case to resolve the customer’s issue. However the situation escalated after the customer was unable to get the help they needed from AWS Support in their previous interactions. So when I got called to assume the ownership of the case, it was extremely important to deliver an excellent technical reference and also try to regain the customer trust. After a step-by-step on the configuration, a python script to simulate the customer’s Batch Job and a full replication on my side….. drum rolls…. I GOT 5 STARS from the customers! They got exactly what they needed to set-up their Batch Jobs and they learned how to use boto3 and assumed-roles!</p><p>This was definitely the most difficult case I dealt with because of the customer relationship that I needed to rebuild. Everyday, thousands of customers turn to AWS Support when not even StackOverflow has the answers they are looking for, so it is of extreme importance to AWS to have a highly technical support, it was my duty to go above and beyond on this situation. In the end, it was all worth it and I got a feedback that I will take with me for many years:</p><blockquote>I wanted to take a minute to write this while the sentiment is fresh. I truly valued the kind, friendly yet completely professional way that Thales made himself available to assist with what was becoming a major problem for my customer. He was willing to adjust his schedule and did so without even a hint of irritation, which during critical times when the customer is so frustrated and unwilling to meet with support goes quite a long way. The short of it was, that Thales brought exactly what was needed to the table to unblock a major production release. In fact, he went well above even my expectations in terms of the breadth and depth of knowledge because he wasn’t just an expert in the one area of the ticket stated but in all the right areas to truly resolve the matter. — Feedback from the Customer’s Technical Account Manager.</blockquote><h3><strong>October</strong></h3><p>No big achievement.</p><h3>November</h3><ul><li>AWS Blog — <a href="https://aws.amazon.com/blogs/mt/configure-aws-x-ray-tracing-aws-batch-jobs/">How to configure AWS X-Ray tracing for your AWS Batch jobs</a>.</li><li>AWS Samples for the blog —<a href="https://github.com/aws-samples/aws-batch-xray">aws-samples/aws-batch-xray</a>.</li></ul><p>Writing a public blog with my name on the AWS website is a big achievement for me. I was very happy to see through what was an idea and actually became relevant enough to make it available and possibly help customers looking to increase the observability of their environments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PFVXRcDjW_kQs9lZjvR6PA.png" /><figcaption>AWS Blog — Tracing context on Batch Environments</figcaption></figure><h3>December</h3><p>Even thought I was making great progress on AWS, I decided to take my career in a different direction. After all, I remembered my boss saying something about <a href="https://www.youtube.com/watch?v=jwG_qR6XmDQ"><em>Regret Minimization Framework</em></a><em> </em>and something clicked on my mind saying: “Hey, this is not what I want to do”.</p><blockquote>Disclaimer: I haven’t met Jeff Bezos… yet. But his leadership principles are great, if you don’t know what I am talking about, <a href="https://www.amazon.jobs/en/principles">check it out here</a>. Regardless of being an IT professional or not, these principles are rock solid.</blockquote><p>However the lessons I learned at AWS definitely helped me become a better professional .</p><p>As I mentioned earlier, this post is to document my professional year. The target audience is myself 10 years from now.</p><p>Regarding my career’s new direction, when I left AWS I was ready to move to Germany to become a SRE at Joyn.de but life took an unexpected turn and now I am in my home country Brazil working on the DevOps field but for a new company. I started the year taking on a Python Developer Freelance job, which was a great learning experience for me…. Well more about this on next year’s professional year overview. Stay safe my friends! Cheers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=760b7a1012a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2019 — Meu primeiro ano profissional]]></title>
            <link>https://thalesvon.medium.com/2019-meu-primeiro-ano-profissional-1640373e2b12?source=rss-508d347fb33c------2</link>
            <guid isPermaLink="false">https://medium.com/p/1640373e2b12</guid>
            <category><![CDATA[career-development]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[career-paths]]></category>
            <category><![CDATA[professional-development]]></category>
            <dc:creator><![CDATA[Thales Sperling]]></dc:creator>
            <pubDate>Thu, 02 Jan 2020 16:23:15 GMT</pubDate>
            <atom:updated>2020-01-03T10:04:17.209Z</atom:updated>
            <content:encoded><![CDATA[<h3>2019 — Meu primeiro ano profissional</h3><p>Com o final do ano, sempre pensamos nas metas atingidas e tiramos um tempo para avaliar o nosso ano. Seguindo a excelente ideia do <a href="https://medium.com/u/a8708b2576c2">Sidney Cirqueira</a>, decidi escrever um pouco sobre meu 2019 e o que ele significou na minha jornada profissional.</p><p><strong>Nota: </strong>esse post é um relato sobre minha trajetória profissional, escrevi apenas para documentar meu ano de forma interessante. Nem todos os meses tem algo relevante.</p><h3><strong>Dezembro 2018 e Janeiro:</strong></h3><ul><li>Formei como Engenheiro de Redes de Comunicação pela Universidade de Brasília — UnB.</li><li>Comecei meu primeiro emprego como Analista de Infraestrutura Júnior na empresa onde fui estagiário nos anos finais da minha graduação.</li><li>Conduzi a migração do método de autenticação usando pela minha empresa. Migramos do ADFS para utilizar o serviço do AzureAD para funcionalidades de Single Sign-On, de aplicativos baseados em SAML e OpenID. Escrevi um <a href="https://medium.com/@thalesvon/adfs-time-to-say-goodbye-59ba1471ebd8">post</a> sobre.</li></ul><h3><strong>Fevereiro:</strong></h3><p>Nenhum evento.</p><h3><strong>Março:</strong></h3><ul><li><a href="https://www.youracclaim.com/badges/71d25cf6-6e20-4cd4-90d2-62d280c00019/linked_in_profile">Certificação</a> Azure Administrator Associate</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/0*p4xHMHQi86vYiASl.png" /></figure><ul><li>Comecei um novo emprego em São Paulo como DevOps Engineer. Essa mudança de emprego foi um grande passo na minha jornada, estava indo para um ambiente muito mais moderno e avançado tecnologicamente, onde todas as coisas que eu estava ainda estudando, como, Docker, Ansible, AWS, SonarQube e Jenkins já estavam em produção e tudo isso passaria a ser responsabilidade minha. No início o desafio foi grande e cheio de novidades, porém nada que algumas noites e finais de semana de estudo não resolveram. Como DevOps Engineer, assumi responsabilidades técnicas e de governança pela primeira vez. Eu estava a frente de todas as decisões relacionadas a infraestrutura hospedada na nuvem, telefonia e de orçamentos voltado para nuvem. Além da extensa lista de novas responsabilidades, também tive que fazer um mudança grande tecnicamente: saí de um ambiente inteiramente Microsoft e Azure, para um mundo Linux e AWS.</li><li>Escrevi um <a href="https://medium.com/@thalesvon/moving-mailboxes-across-office365-hybrid-deployment-e7e854bbd067">post</a> sobre um erro de migração recorrente para caixas de e-mail hospedadas em Exchange Híbrido.</li></ul><h3><strong>Abril:</strong></h3><p>Nenhum evento.</p><h3><strong>Maio:</strong></h3><ul><li>Primeiro contato com o framework <a href="https://serverless.com/">Serverless</a>, após alguns meses usando a AWS, comecei a procurar automações e otimizações para fazer no ambiente. Cada automação buscava cumprir dois requisitos: 1) Vai reduzir meu esforço operacional de gerenciamento? 2) Vai reduzir custos? A primeira automação que cumpriu ambos requisitos, foi a utilização do framework serverless para ligar e desligar ambientes de teste e homologação de forma sistemática, segue um <a href="https://medium.com/faun/how-can-sysadmins-benefit-from-serverless-cede39cfc88b">post</a> detalhado sobre o assunto.</li></ul><h3><strong>Junho:</strong></h3><ul><li>Virei um escritor registrado para a publicação <a href="https://medium.com/faun">Faun</a>, maior publicação independente sobre DevOps no Medium.</li><li>AWS Summit em São Paulo.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ndlz3UeGRAO58xPUuLYjFg.jpeg" /></figure><ul><li>Conheci o <a href="https://www.meetup.com/pt-BR/awsusergroupsp/?chapter_analytics_code=UA-93929597-1">AWS User Group SP</a>.</li></ul><h3><strong>Julho:</strong></h3><p>Nenhum evento.</p><h3><strong>Agosto:</strong></h3><ul><li>Palestra no AWS User Group São Paulo: ECS e Spot Instances, economizando de forma simples. Nessa palestra falei como utilizar Spot Instances em um cluster ECS sem medo. Tudo foi feito usando o CloudFormation e EC2 bootstrap scripts para atingir a configuração desejada nas máquinas de forma automática e tolerante a falhas. No final, além dos benefícios técnicos da mudança, mostrei também a economia que essa mudança proporcionou, chegando a uma redução de 55% no custo de EC2 mensal da companhia.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*bUl25wvRT6JH_qeC0DadSA.png" /></figure><h3><strong>Setembro:</strong></h3><ul><li>AWS Certified Solutions Architect Associate</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yLH5MmtG3qUA6hnjIb2uBA.jpeg" /></figure><h3><strong>Outubro:</strong></h3><ul><li>Ao iniciar minha jornada como DevOps Engineer na PagueMob, criei algumas metas que gostaria de atingir ainda no ano de 2019 na companhia, eram elas: 1) Redução do custo operacional de nuvem 2) Migração do Jenkins para ferramenta gerenciada de CI /CD e 3) Documentação do ambiente.</li></ul><ol><li>Redução do custo operacional de nuvem: ao chegar na companhia, em março, desconfiava que o ambiente estava com uma capacidade além do necessário e que o consumo estava crescendo de forma descontrolada. Como ainda estava aprendendo e criando maior confiança com a plataforma da AWS, decidi em fazer melhorias conforme aumentava meu conhecimento sobre o assunto e ao longo de 5 meses as alterações feitas geraram uma redução de custo de aproximadamente 64% acumulado sobre o período e tudo isso foi feito de forma documentada no kanban da companhia.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XFGYOOH7AumKkkfWMUSCBg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/324/1*yh5stgTlvA84AXHghfBfJQ.jpeg" /><figcaption>(Esquerda) Histórico do custo operacional AWS, (Direita) Kanban com atividades feitas durante o projeto de redução de custo.</figcaption></figure><p>2) Migração do Jenkins para ferramenta gerenciadas de CI /CD: Jenkins é uma excelente ferramenta de CI/CD, a migração para uma ferramenta diferente foi motivada por: 1) Jenkins precisa ser gerenciado, sua robustez e flexibilidade vem com o custo adicional de gerenciamento e tempo que ele precisa. 2) Jenkins era hospedado na AWS como o master sendo uma instância EC2 e os slaves configuradas como EC2 Spot Fleet, mesmo sendo uma boa configuração da infraestrutura do Jenkins, o custo que ele gerava no fim do mês, ainda era algo considerável na fatura (aproximadamente $350 por mês). Para a migração acontecer, diversas ferramentas foram cogitadas, como, Code Pipeline e CircleCI porém após avaliação, optei por utilizar o GitHub Actions, que apesar de ser uma ferramenta ainda em beta na época, apresentou uma vantagem enorme por ser totalmente gerenciado e de graça durante beta, após o beta o seu preço continuou extremamente competitivo e isso era um ótima oportunidade de aprender uma nova ferramenta. Por estar em beta, passei algum tempo ajustando e alterando meus pipelines, porém o benefício continuou sendo maior que a dor de atualizar um script.</p><p>3) Documentação do ambiente: o ambiente da PagueMob está 100% documentado? Não, isso seria excelente porém não é a realidade que deixei na companhia, mas posso afirmar sem dúvidas, que a documentação está melhor do que encontrei. Finalmente era possível visualizar um diagrama da arquitetura completa, entender os componentes da arquitetura e entender configurações de redes olhando para apenas um desenho detalhado. Além disso, diversos processos que eram apenas conhecimentos dominados por pessoas, foram documentados em wikis disponíveis para a companhia toda. Documentação sempre pode melhorar e tenho a convicção que a documentação que deixei foi uma excelente melhoria para companhia.</p><ul><li>Escrevi minha primeira <a href="https://github.com/marketplace/actions/ecr-login">action</a> pública, disponível no marketplace do GitHub, agora outros usuários do GitHub Actions podem usar minha solução para login em registros de containers privados do ECR.</li></ul><h3>Novembro:</h3><ul><li>Saída da PagueMob e último projeto: AutoScaling para ECS. O ECS utilizando a opção de Fargate, apresenta uma forma muito mais simples de autoscaling, com vários aspectos sendo abstraídos para o cliente. Porém autoscaling usando EC2 é algo um pouco mais o complicado que envolve: autoscaling group, launch configuration, estratégia de scale up/out e down/in, alarmes de escalonamento e tudo isso precisava ser pensando em dois níveis, de máquina e de serviço. Cada nível foi avaliado com suas próprias métricas e suas próprias regras de auto escalonamento. Afinal, do que adianta colocar mais instâncias no seu cluster, se não haverá novas instâncias do serviço sendo executadas. Ou do que adianta mais instâncias do serviço se não há memória disponível no cluster para o serviço estabilizar? Todo o AutoScaling foi implementado com CloudFormation, para garantir os benefícios de Infra as Code.</li><li>Peguei gosto por automação e fiz um bot simples para interação dos recursos da AWS e GSuite por meio do Slack. No futuro, pretendo melhorar esse código e soltar publicamente.</li></ul><p><a href="https://www.linkedin.com/posts/thales-sperling_bot-chatops-slack-activity-6604844206508908544-Ro_l">Thales von Sperling on LinkedIn: #bot #chatops #slack</a></p><h3>Dezembro:</h3><ul><li>Iniciei uma nova jornada como Cloud Support Associate na AWS. Estou aqui há um mês e estou impressionado com tudo. No mais…</li></ul><blockquote>Work hard. Have Fun. Make history — Jeff Bezos</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1640373e2b12" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How can SysAdmins benefit from serverless?]]></title>
            <link>https://faun.pub/how-can-sysadmins-benefit-from-serverless-cede39cfc88b?source=rss-508d347fb33c------2</link>
            <guid isPermaLink="false">https://medium.com/p/cede39cfc88b</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[ec2]]></category>
            <dc:creator><![CDATA[Thales Sperling]]></dc:creator>
            <pubDate>Tue, 28 May 2019 14:16:54 GMT</pubDate>
            <atom:updated>2019-06-22T12:43:34.930Z</atom:updated>
            <content:encoded><![CDATA[<h3>Can SysAdmins benefit from serverless?</h3><p><a href="https://serverless-stack.com/chapters/what-is-serverless.html">Serverless computing </a>has become a very attractive approach to software development, as developers can focus on delivering quality software without worrying about the underlying infrastructure. Well nothing new so far, since every post about serverless, kind of states the same thing as I just did. So let’s focus on something different: Are serverless solutions applicable to IT professionals other than the developers? And the answer is YES!</p><p>On this post, I will share a real use case of how a SysAdmin, like myself, can leverage serverless computing to make life a little easier (and save a couple of bucks while you are at it).</p><p>Using multiple environments (dev, staging, and production), make the product development workflow optimal and guarantees the delivery of more reliable software but, usually, there is really no point of keeping the non-production infrastructure running 24/7 as developers are not testing software all the time, so we can draw up an auto power on/off strategy.</p><p>Achieving such a strategy is no big deal, we can just follow <a href="https://aws.amazon.com/pt/premiumsupport/knowledge-center/start-stop-lambda-cloudwatch/">this</a> tutorial and be happy with it, so go ahead and perform the described steps on AWS Knowledge Center to create properly your Scheduled Jobs. After following this approach I realized it still didn’t quite fulfill all my requirements as these Scheduled Jobs are not flexible enough to be canceled or executed on demand, as developers might need to work extended hours as they get closer to the end of a Sprint for example.</p><p>So let’s build a simple API to start &amp; stop our EC2 instances and additionally create a custom endpoint to change our scheduled jobs. To accomplish this we will use the <a href="https://serverless.com/">Serverless framework</a> and build the architecture shown on the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*FURCswyT0Hw7CnHrIJwo_w.png" /><figcaption>Figure 1 — ec2-instance-manager architecture (a happy SysAdmin using serverless to make his/her life easier).</figcaption></figure><h3>First things first</h3><p>Let’s install the serverless framework within a virtual environment (optional, but if you don’t care about cleaning up, shame on you…lol) and create a service from a template, which we will modify a lot, it just makes things easier as it creates necessary files automatically.</p><pre>$ sudo apt-get install python3<br>$ sudo apt-get install python3-pip<br>$ sudo pip3 install virtualenv</pre><p>Create a virtual environment and activate it:</p><pre>$ mkdir ec2-instance-manager<br>$ cd ec2-instance-manager</pre><pre>$ virtualenv -p python3 ec2<br>$ . ec2/bin/activate</pre><pre>#To stop working on ec2 venv use: deactivate</pre><pre>$ sudo npm install -g serverless</pre><p>Create your service:</p><pre>$ serverless create --template aws-python3 --name ec2-instance-manager</pre><p>At this point, your ec2-instance-manager directory will look like this:</p><pre>. ec2-instance-manager<br>|<br>|__ .gitignore<br>|__ handler.py<br>|__ serverless.yml</pre><p>Go ahead and delete handler.py , and create a folder called src/and three files called start.py stop.py change.py . These files will be the handlers associated with each endpoint of our API Gateway. Now our ec2-instance-manager directory should look like this:</p><pre>. ec2-instance-manager<br>|<br>|__ .gitignore<br>|__ src/<br>|______ start.py<br>|______ stop.py<br>|______ change.py<br>|__ serverless.yml</pre><p>Now let’s look at how our serverless.yml should look like in order to create the architecture of figure 1 and quickly go over what is happening here. I am only gonna explain one of the functions defined in the file, so this post doesn’t turn into a giant, I will post the link to the full source:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/50a5974eb8ac5b02d3a719da665fa098/href">https://medium.com/media/50a5974eb8ac5b02d3a719da665fa098/href</a></iframe><p>As we can see, serverless.yml is very straightforward, first we define our service name and provider information. Notice the customblock, where we load the secrets.json, which holds all variables and secrets used by the serverless framework, it is good practice to have a secrets file, as we can keep it away from VCS. Moving to the package block, here we define how our CloudFormation files, source code and whatever else we need to upload to AWS will be packed together, if you followed all my steps, let’s exclude the ec2 venv files and the README.md from our final <em>.zip</em>. Then, we have our functions block, whatever function we define here will be an endpoint on our API gateway with a lambda function associated with it. So we need to specify our handler file for that lambda, environment variables the lambda uses, how our lambda will be packaged and <strong>events </strong>that trigger that lambda. For the events section, we need to specify the resource (endpoint) and method that will be created on the API gateway.</p><p><strong>Note:</strong> I am not gonna cover the code itself here, as it is very simple and it is not the focus of this post. If you want to see the code, it is available <a href="https://github.com/thalesvon/ec2-instance-manager">here</a>.</p><h3>Deploy everything</h3><p>As we are deploying the solution for the first time, the resources on AWS need to be created so we will use the serverless deploy command, to create a CloudFormation Stack using our serverles.yml :</p><pre>$ serverless deploy -v</pre><p>After the deployment is complete, serverless will output your endpoint and they are ready to be consumed:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vixro734P9CChqm1lr6mpw.png" /></figure><h3>Deploy function separately</h3><p>After the first deploy, we already have our infrastructure in place, so if we only make changes to the code, you can deploy them separately by editing serverless.yml, adding the line individually: true of the service package block and deploy functions separately:</p><pre># serverless.yml</pre><pre>...<br>package:<br>  individually: true<br>  exclude:<br>    - ec2/**<br>    - README.md<br>...</pre><pre>$ serverless deploy function --function change<br>$ serverless deploy function --function start<br>$ serverless deploy function --function stop</pre><h3>What about the slack token? And change endpoint?</h3><p>As you probably noticed, I haven’t commented what is the slack token used for or what is /change on our API. Well /start and /stop are pretty intuitive, they start or stop our instances on demand and /change is responsible for enabling or disabling our Scheduled Jobs. Remember I said sometimes developers need to work extended hour testing some new feature? That is exactly why I created the /change endpoint. So in those events, the developers can disable the job by doing a simple HTTP request that looks like this:</p><pre>curl -H “Content-Type: application/json” — request PUT \<br> — data ‘{“action”:”disable”}’ \<br><a href="https://z4j251h35g.execute-api.us-east-1.amazonaws.com/dev/change">https//APIGW_ID.execute-api.us-east-1.amazonaws.com/dev/change</a></pre><p>And now for the slack token, since I am not the only one that is going to consume this endpoint, there might be times that someone else disables the Scheduled Job without my knowledge and in that case, my lambda will send a message on slack letting me know what happened, so in the morning I can enable the job again (the same curl just change the data to {&quot;action&quot;:&quot;enable&quot;}) and know that my dev and staging instances will be power off on the next day. Here is <a href="https://get.slack.help/hc/en-us/articles/202035138-Add-an-app-to-your-workspace">how you can set-up a simple app on Slack</a> and what the messages I configured look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/1*OQWkSUcqayKddprtaZ4zcg.png" /><figcaption>Figure 3 — Slack message the lambda sends me.</figcaption></figure><h3>NOTES:</h3><ol><li>There a lot of different ways of accomplishing this task, like the one presented at the begging of this post or <a href="https://aws.amazon.com/pt/solutions/instance-scheduler/">AWS Instance Scheduler</a>, which seemed like an overkill for mine purpose. Also, I chose this approach as an opportunity to learn the serverless framework.</li><li>I tried a more clever solution to disable the Scheduled Job by changing the cron expression to only skip the next trigger, which didn’t work.</li><li>I could’ve created more complex events to handle specific instance-ids, but it wasn’t my intent here. I just wanted something functional and that required little maintenance.</li><li>If you deploy this, consider adding some type of authentication to your API.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cede39cfc88b" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/how-can-sysadmins-benefit-from-serverless-cede39cfc88b">How can SysAdmins benefit from serverless?</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Moving mailboxes across Office365 hybrid deployment]]></title>
            <link>https://thalesvon.medium.com/moving-mailboxes-across-office365-hybrid-deployment-e7e854bbd067?source=rss-508d347fb33c------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7e854bbd067</guid>
            <category><![CDATA[exchange-online]]></category>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[exchange]]></category>
            <category><![CDATA[mailbox-migration]]></category>
            <category><![CDATA[hybrid-exchange]]></category>
            <dc:creator><![CDATA[Thales Sperling]]></dc:creator>
            <pubDate>Sat, 16 Mar 2019 23:44:07 GMT</pubDate>
            <atom:updated>2019-03-17T12:54:33.957Z</atom:updated>
            <content:encoded><![CDATA[<p>A while back, I used to manage Office365 in a hybrid deployment and due business network limitations some mailboxes were kept at the on-premise Exchange servers. Every now and then I needed to migrate some mailboxes either to the cloud or from the cloud, pretty regular Office365 admin stuff.</p><p>Moving mailboxes to the cloud always worked flawlessly using PowerShell and the Exchange Admin Center Online and you can find how to do that <a href="https://docs.microsoft.com/en-us/exchange/hybrid-deployment/move-mailboxes">here</a>. Even though this Microsoft document also specifies how to move an online mailbox back to the on-premise server, that process always failed for me, so like any sysadmin, I rolled up my sleeves and started to look why the heck Microsoft’s step-by-step instructions didn’t work for me.</p><h3>The migration error</h3><p>Figure 1 shows the occurring error of a mailbox migration from the cloud back to the exchange server. The error message says <strong><em>MigrationPermanentException: Cannot find a recipient that has mailbox GUID &lt;guid&gt;.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/1*ZF9pp4KZTtNmQWwwzhGqXQ.png" /><figcaption>Figure 1 — The error on EAC online</figcaption></figure><p>This means that the exchange server does not recognize the GUID of the remote (online) mailbox. Usually, this means the mailbox was created on the cloud and the AD parameter <strong>legacyExchangeDN</strong> was not set by the exchange server during the mailbox creation.</p><h3><strong>Correcting the error</strong></h3><p>The first thing to do is to fire up the PowerShell terminal and connect to Office365, which is achievable by executing the following commands:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9245a60081b887916d7aea899b5b0a72/href">https://medium.com/media/9245a60081b887916d7aea899b5b0a72/href</a></iframe><p>P.S.: this gist is a good approach to connect to EAC Online systematically, i.e. scripting. Credentials are set by environment variables and available sessions are checked before creating a new session. For interactive PowerShell, you could use just the lines within the “if” statement.</p><p>Now, there is a remote session established to EAC Online, so execute the following command and <strong>copy</strong> the GUID of the remote mailbox. Figure 2 shows the command:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/427/1*lC2Ynj-tL9BPWCHTIsRnEQ.png" /><figcaption>Figure 2 — Notice the “Exchange Online” label to identify this PowerShell is performing the command on the cloud service</figcaption></figure><p>The second step is to launch an Exchange Management PowerShell on the exchange server. Before setting the GUID on the server let’s check what is the current value (only for demonstration purposes):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*WEo6jXWMvyykI2RuxQIXAQ.png" /><figcaption>Figure 3: Remote Mailbox GUID is set to all zeros.</figcaption></figure><p>If the exchange server does not have the GUID of the remote mailbox configured, roughly, it means the server does not recognize this mailbox in the hybrid deployment domain. So, to correct the error, the GUID needs to set on the on-premise server. This task is done with the <strong>Set-RemoteMailbox</strong> commandlet and the copied GUID from the Exchange Online (step of figure 2), note the commands on this step are executed on the exchange server but they reference a remote mailbox:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*70lztt_XRIOqa1WT1K5REg.png" /><figcaption>Figure 4 — GUID of remote mailbox configured.</figcaption></figure><p>After successfully configuring the GUID of the remote mailbox on the exchange server, the migration process from the cloud to the on-premise server will work fine.</p><p><strong>Optional — Additional step</strong></p><p>On the embedded gist I said that is a good way to systematically connect to EAC Online and, in fact, this whole process could be done by a simple script. Back when I used to manage this environment ( MS Active Directory with Exchange Hybrid Deployment) I automated the user creation process with a PowerShell script, but back then I did not know about this issue dealing with mailboxes created directly on the cloud, but all of this could be avoided with a few extra lines of code in the script. I might add this on the next version of the script.</p><p>In case you are interested in the script, feel free to check it out on <a href="https://github.com/thalesvon/powershell-scripts">here</a> my GitHub. This repository contains the user creation script along with some other useful scripts for an administrator of a Microsoft environment.</p><p>Hope this was helpful. Stay sharp sysadmins.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/276/1*9hSh_5eu9jy5YepXZpBiDQ.jpeg" /><figcaption>Figure 6 — The IT Crowd cast. Our daily inspiration.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7e854bbd067" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ADFS: Time to say goodbye]]></title>
            <link>https://thalesvon.medium.com/adfs-time-to-say-goodbye-59ba1471ebd8?source=rss-508d347fb33c------2</link>
            <guid isPermaLink="false">https://medium.com/p/59ba1471ebd8</guid>
            <category><![CDATA[identity-provider]]></category>
            <category><![CDATA[azure-active-directory]]></category>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[cloud-solutions]]></category>
            <category><![CDATA[single-sign-on]]></category>
            <dc:creator><![CDATA[Thales Sperling]]></dc:creator>
            <pubDate>Mon, 21 Jan 2019 09:01:01 GMT</pubDate>
            <atom:updated>2020-11-09T15:17:26.661Z</atom:updated>
            <content:encoded><![CDATA[<p>Active Directory Federation Services (AD FS) is a service that allows the secure sharing of identities information for third-party application outside your organization(extranet), in other words, it allows you to log in to application using your domain credentials, i.e. single sign-on. Whilst AD FS can provide identities just fine, it is a hassle to configure and maintain the infrastructure.</p><p>According to AD FS <a href="https://docs.microsoft.com/en-us/windows-server/identity/ad-fs/design/federation-server-farm-using-wid-and-proxies">documentation</a>, organizations with 100 or fewer trust relations configured that need to provide internal and external access should use the topology shown in figure 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6oHJ3-RZWuIUWDC_PisRNA.png" /><figcaption>Figure 1: ADFS topology.</figcaption></figure><p>So as we can see, that means managing and updating four servers, well that’s not fun. So is there an alternative? The answer is yes! Azure Active Directory is capable of providing identities as AD FS does and it doesn’t require the management the on-premise solution needs.</p><p>Now that we introduced the subject, let’s talk about how I change my company’s Identity Provider to the cloud. While planing for the migration I came across this very useful <a href="https://aka.ms/migrateapps/adfssolutionguide">document </a>describing everything I needed to know, so I planned accordingly the typical phases of a migration project as figure 2 illustrates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5iAL8GMriiL1gFHVB7BONg.png" /><figcaption>Figure 2: Typical ADFS migration phases.</figcaption></figure><p>On this post I am not gonna cover how to register your app on Azure AD, but <a href="https://docs.microsoft.com/en-us/azure/active-directory/manage-apps/add-application-portal">here</a> is some helpful documentation on how to do it.</p><h3>Phase 1 &amp; 2:</h3><p>Discovering what applications are currently using AD FS is easy, on your primary AD FS server, open the <em>AD FS Management &gt; Relying Party Trust. </em>From there, you will be able to list all your apps as well gather some information. In my case, I only had Office 365 and three other apps configured.</p><p>For the three apps, POCs (Proof Of Concept) were conducted using some test users and everything worked fine so I was able to draw up a migration plan. For Office 365 things weren’t so simple.</p><p>Since my company is in a hybrid deployment, Office 365 users, sign-in using the configured method on Azure AD Connect, which was <em>Federation with AD FS </em>and I could not change the user sign-in method during business hours as it is recommended to schedule a two hour window to change the User sign-in method to <em>Password Hash Synchronization</em>. So I didn’t conduct a POC for Office 365 but I draw up a plan after I read some documentation on <a href="https://docs.microsoft.com/en-us/azure/active-directory/hybrid/tutorial-password-hash-sync"><em>Hybrid deployment identities</em></a><em>.</em></p><p>PS: on this phase of the project, make sure you look at your apps endpoints and verify if there are any apps using ARTIFACT binding instead of POST binding. Azure AD only accepts POST bindings.</p><h3>Phase 3:</h3><p>Communicating is a critical part of any migration project, since it may result in some down time during the maintenance window. Make sure you communicate your users about the change and how the change will impact them. In this case, users had to type in their passwords again Monday morning, not that big of a deal but still, better safe than sorry.</p><p>At this point, you already talked to your vendors and exchanged the required federation metadata during the POC. Remember I said to check your endpoints? Make sure you know all of them are POST bindings or you might get yourself in the same place I was, explaining the difference of HTTP GET and POST to one of our vendors and telling them to change their code.</p><p>Since all of our users login to the mentioned apps using single sign-on I needed to assign the apps to all of them on Azure AD and for that, I used a <a href="https://docs.microsoft.com/en-us/azure/active-directory/users-groups-roles/groups-dynamic-tutorial">dynamic group</a> querying <em>(user.objectid -ne null).</em> So now I don’t have to worry if I forgot to assign the app to a specific user nor new users that are created in my directory. #WorkSmarterNotHarder.</p><h3>Time for the migration:</h3><p>At the time of the change I already had all the applications registered on Azure AD, I just had to check if my vendors updated their apps with the metadata I provided them. Once I verified all apps were working properly I still was being redirected to my AD FS login page and the explanation is simple, Azure AD Connect was still configured to authenticate users using AD FS, so let’s change that.</p><p>Once all of my users had gone home and my maintenance window started, it was time to change the user sign-in method to Password Hash Synchronization which was pretty simple. <a href="https://docs.microsoft.com/en-us/azure/active-directory/hybrid/plan-migrate-adfs-password-hash-sync">This tutorial</a> guides you step by step on how to achieve that. After configuration is done you can start a new sync process with PowerShell command: <strong>Start</strong>-<strong>ADSyncSyncCycle -PolicyType Initial.</strong></p><p>PS: While changing the sing-in method on Azure AD Connect you will be prompted to enable SSO. If you get an error while performing this operation, make sure your network firewall is configured to accept connections on outbound port 9090.</p><h3>Phase 4:</h3><p>I am still gaining insights about the change and studying which conditional access policies to implement, but now, let’s go over the benefits this change has brought to my company:</p><p>1 — The infrastructure shown in figure 1 was hosted on Azure as IaaS, costing us something around U$500 per month. Since my company already uses Office 365 Enterprise, all of our users are licensed for Azure AD Premium P1. So this change means the company will save U$6000 this year.</p><p>2 — Still about the infrastructure, my team and I are so happy we won’t have to manage those four servers anymore. No more certificate changes, complicated AD FS tracing or updating these machines.</p><p>These are the main benefits, other positive impacts are reduced management risk, improved reliability, self-service for end users and conditional access compliant with the company’s requirements.</p><p>This was a great project to start of the year. Now it is time to plan for other changes and keep innovating whether it is on Azure or other cloud solutions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=59ba1471ebd8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>