<?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 Felix Luebken on Medium]]></title>
        <description><![CDATA[Stories by Felix Luebken on Medium]]></description>
        <link>https://medium.com/@felixluebken2000?source=rss-21b1c9ecd17c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3azp85dayUI5xQxqYpQeEQ@2x.jpeg</url>
            <title>Stories by Felix Luebken on Medium</title>
            <link>https://medium.com/@felixluebken2000?source=rss-21b1c9ecd17c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 05:25:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@felixluebken2000/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[Deploy Django to Ubuntu with HTTPS]]></title>
            <link>https://medium.com/@felixluebken2000/deploy-django-to-ubuntu-with-https-d976d7f17f3c?source=rss-21b1c9ecd17c------2</link>
            <guid isPermaLink="false">https://medium.com/p/d976d7f17f3c</guid>
            <category><![CDATA[django]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[django-rest-framework]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[dev]]></category>
            <dc:creator><![CDATA[Felix Luebken]]></dc:creator>
            <pubDate>Wed, 07 Jun 2023 15:02:41 GMT</pubDate>
            <atom:updated>2023-06-16T19:21:49.456Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article I will outline the basics of deploying a Django Rest Framework backend to a monolithic Ubuntu server. (the good old fashioned way)</p><p><strong>First lets review our tech stack:</strong></p><ul><li><strong>Django</strong> — our backend framework</li><li><strong>AWS EC2/Lightsail</strong> — our VPS service to host the backend (any VPS running Ubuntu 20.04 LTS will work for this guide)</li><li><strong>Route53</strong> — our DNS manager to route a domain to our backend (any DNS management tool will work for this guide)</li><li><strong>Supervisor &amp; Gunicorn</strong> — process &amp; worker managers for our backend</li><li><strong>Nginx</strong> — web app responsible for serving our content to the public</li></ul><p><strong>Why learn how to deploy like this?</strong></p><ul><li>Very simple and straight forward for small projects</li><li>Easy to debug if something is wrong in the tech stack</li><li>Nice basis of knowledge for other kinds of deployments</li><li>Easy to implement CI/CD &amp; useful for staging environments</li></ul><p><strong>Perquisites:</strong></p><ul><li>You have some sort of VPS provider eg. DigitalOcean and AWS</li><li>You have a domain linked to Route53, or a domain with a DNS manager</li></ul><h4>1. Server setup</h4><p>We start by creating a Lightsail instance to host our Django project. In Lightsail specifically you go to the ‘Instances’ tab, then ‘Create instance’ &gt; ‘Linux/Unix’ &gt; ‘OS Only’ &gt; ‘Ubuntu 20.04 LTS’. Create an ssh keypair, download it, and keep it in a secure location. Make sure you have at least the $5 server plan. You can now connect to your server with this command:</p><pre>ssh -i YOUR_SSH_KEY.pem ubuntu@YOUR_VPS_IP</pre><p><em>You can use any VPS provider. The following steps are applicable to all Ubuntu 20.04 servers</em></p><p>Lets update the Ubuntu instance and install all required packages:</p><pre>sudo apt -y update &amp;&amp; sudo apt -y upgrade<br>sudo apt-get -y install python3.8-dev build-essential libssl-dev python3.8-venv<br><br>#if you are running mysql with your django project make sure to also run<br>sudo apt-get -y install default-libmysqlclient-dev mysql-client libsqlclient-dev default-libmysqlclient-dev</pre><h4>2. Configuring Django</h4><p>We will be using a starting point available on from my Github, which is essentially a Django Rest Framework app with one API endpoint. (I don’t want to rehash how to setup a Django project, since there are millions of other tutorials out there) To get this on your machine an set it up properly run:</p><pre># clone and setup starting point<br>git clone https://github.com/felixluebken/django_tutorials.git<br>cd django_tutorials<br>git checkout -b linux_deployment_starting_point origin/linux_deployment_starting_point<br><br># setup virtual env and install dependencies<br>python3.8 -m venv venv<br>source venv/bin/activate<br>pip3 install -r requirements.txt<br><br># migrate &amp; run server<br>cd example_api<br>python3 manage.py migrate<br>python3 manage.py runserver</pre><p>The Django instance should be running and you should be able to confirm the server is running by running the following command, (in another ssh instance) and getting a json response back.</p><pre>curl http://localhost:8000<br>&gt; {&quot;message&quot;:&quot;hello!&quot;}</pre><h4>3. Setting up Gunicorn &amp; Supervisor</h4><p>Now that we have the codebase on our VPS, we will need to setup something to run the process and deliver a proxy to Nginx. From within the virtual environment, run:</p><pre>pip3 install gunicorn</pre><p>Gunicorn is a web server gateway interface, which will use Django’s wsgi.py to link Django to our Nginx web server. Let’s test if Gunicorn works. From within your virtual environment in the example_api (same as where you run manage.py) directory run:</p><pre>gunicorn --bind 0.0.0.0:8000 example_api.wsgi:application</pre><p>If everything was setup properly you should see an output like such:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*-6987BHtfOp1hDg3x3Xhug.png" /></figure><p>Knowing that Gunicorn can successfully read our wsgi, lets start implementing our process control system. For this we use Supervisor. Let’s install supervisor and setup everything we need</p><pre>#install supervisor<br>sudo apt-get install -y supervisor<br><br>#create a log directory for gunicorn<br>sudo mkdir /var/log/gunicorn                      <br><br>#write process instructions for our gunicorn process<br>sudo nano /etc/supervisor/conf.d/gunicorn.conf</pre><p>Within that file we can write the following declarations:</p><pre>[program:gunicorn]<br>directory=/home/ubuntu/django_tutorials/example_api<br>command=/home/ubuntu/django_tutorials/venv/bin/gunicorn --workers 3 --bind unix:/home/ubuntu/django_tutorials/example_api/app.sock example_api.wsgi:application<br>autostart=true<br>autorestart=true<br>stderr_logfile=/var/log/gunicorn/gunicorn.err.log<br>stout_logfile=/var/log/gunicorn/gunicorn.out.log<br><br>[group:guni]<br>programs:gunicorn</pre><p>To break this config file down:</p><ul><li><strong>directory</strong> — specifies the root directory of the Django project</li><li><strong>command</strong> — runs the Django process with 3 workers using our venv</li><li><strong>autostart</strong> — supervisor will automatically start this process</li><li><strong>autorestart</strong> — supervisor will automatically start this process on restart</li><li><strong>stderr_logfile</strong> — default output file for errors</li><li><strong>stdout_logfile</strong> — default output file for standard out</li></ul><p>Now save the file and run</p><pre><br>#reread supervisor config files<br>sudo supervisorctl reread<br>&gt; guni: available<br><br>#update supervisor process<br>sudo supervisorctl update<br>&gt; guni: added process group<br><br>#restart supervisor<br>sudo supervisorctl restart all<br><br>#if you ever need to stop and restart supervisor you can just run<br>sudo supervisorctl start all<br>sudo supervisorctl stop all</pre><p>In order to check that everything works, list the contents in <strong>django_tutorials/example_api</strong>. You should see a <strong>app.sock</strong> file within that directory</p><p>Great! Lets review everything we have done so far. We successfully cloned the codebase to our VPS, setup our wsgi to work with Gunicorn, and configured Supervisor to run Django wsgi through Gunicorn.</p><p>The next step is to link the Gunicorn socket to a Nginx web server.</p><h4>4. Configuring Nginx</h4><p>First let us install Nginx and configure our server</p><pre>sudo apt-get install -y nginx<br><br>#edit the default Nginx config<br>sudo nano /etc/nginx/sites-available/default</pre><p>In that file we want to remove everything and write the following:</p><pre>server {<br>        listen 80;<br>        server_name api.example_api.com;<br><br>        location / {<br>                include proxy_params;<br>                proxy_pass http://unix:/home/ubuntu/django_tutorials/example_api/app.sock;<br>        }<br>}</pre><p>Some things to note:</p><ul><li>ensure <strong>server_name</strong> includes the proper domain you want to configure. you can introduce any subdomain you would like</li><li><strong>listen</strong> 80 specifies that we listen on port 80 (HTTP)</li><li>the <strong>location</strong> attribute tells Nginx what socket to send incoming connections to</li></ul><p>To complete the Nginx setup we have to test the config file &amp; restart our service:</p><pre>#test nginx configuration file<br>sudo nginx -t<br>&gt; nginx: the configuration file /etc/nginx/nginx.conf syntax is ok<br>&gt; nginx: configuration file /etc/nginx/nginx.conf test is successful<br><br>#restart nginx service<br>sudo service nginx restart</pre><p>…and we are live! We can confirm this by running this on your local machine</p><pre>curl YOUR_VPS_IP<br>&gt; {&quot;message&quot;:&quot;hello!&quot;}</pre><h4>5. HTTPS via Certbot</h4><p>In order to certify your api endpoint, you want to first point your domain to the public IP address of your VPS. You do so by creating an <strong>A record</strong> like such:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/1*35Y-VX-oEoZfOMywWcNEhw.png" /></figure><p><em>Regardless of what DNS manager you use, there will be the same options.</em></p><p>Depending on what DNS manager you use, you want to wait for the record to propagate. You can check the status of the propagation with something like <a href="https://www.whatsmydns.net/">https://www.whatsmydns.net/</a></p><p>Once the correct IP address shows under your domain, let’s certify our website:</p><pre>#setup snap<br>sudo snap install core; sudo snap refresh core<br><br>#install certbot<br>sudo snap install --classic certbot<br><br>#create required systematic links<br>sudo ln -s /snap/bin/certbot /usr/bin/certbot<br><br>#certify your site<br>sudo certbot --nginx</pre><p>The last command will take a few steps, such as entering you email for certificate updates, and confirming the domain you want. If your desired domain does not point to your VPS’ public IP address <strong>it will not work</strong>.</p><p>The last step is to ensure port 443 is open to the public, as all HTTPS will to though this port. In Lightsail it looks something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*Eh9MI6F1oiRQt6Vxuup8DA.png" /></figure><p><em>You will most likely have similar options for any other VPS service.</em></p><p>Lets test everything out:</p><pre>curl api.example_api.com<br>&gt; {&quot;message&quot;:&quot;hello!&quot;}</pre><p>And that&#39;s it! We have successfully deployed our Django app to a Linux server!</p><h4>Conclusion</h4><p>These were the basic steps of deploying a Django server to Ubuntu. It’s important to note that this is not nearly production grade, as you want to hide all environment secrets and apply some security configuration to your Django settings. This article outlines the basics of things to note when deploying a production grade backend: <a href="https://medium.com/dev-genius/securing-backend-deployments-9e57b93b93a0">https://medium.com/dev-genius/securing-backend-deployments-9e57b93b93a0</a></p><p>Deploying like this is the ‘good old fashioned’ way which has stood the test of time. It’s simple, straight forward, and highly controllable. I would definately recommend these kinds of deployments for small scale apps. You can read more about it here: <a href="https://m.signalvnoise.com/the-majestic-monolith/">https://m.signalvnoise.com/the-majestic-monolith/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d976d7f17f3c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating Beautiful Frontend Apps: A Guide to Consistent Aesthetics]]></title>
            <link>https://medium.com/design-bootcamp/creating-beautiful-frontend-apps-a-guide-to-consistent-aesthetics-d7fdef10eb9a?source=rss-21b1c9ecd17c------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7fdef10eb9a</guid>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[design]]></category>
            <dc:creator><![CDATA[Felix Luebken]]></dc:creator>
            <pubDate>Sun, 04 Jun 2023 19:22:49 GMT</pubDate>
            <atom:updated>2023-06-06T08:36:25.876Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>NOTE: </strong>This is not a step-by-step guide, but rather a handful of rules to follow in order to make a frontend app look good without a lot of effort.</blockquote><p>In terms of pure skill, backend development generally surpasses frontend development, as it necessitates a logical and structured thinking process. However, not all backend developers can create aesthetically pleasing frontend applications, as it demands a certain aptitude for aesthetics. One must comprehend the appropriate placement of colors, effective layouts, and overall cohesiveness among all components. It is an entirely distinct skill set, requiring a different thought process in comparison to the purely logical approach of a backend developer.</p><p>But what if designing frontend apps were easier than many would think and didn’t even require a UX designer to perfect a color palette and layout? Over the past few years, I have designed numerous frontend apps, mostly without any assistance from a UX designer. In this article, I will outline a structured approach to achieving consistent aesthetics, step by step. I will apply these steps to create a resume page for myself, which will be available on GitHub.</p><h4>1. Getting inspiration</h4><p>Okay… perhaps finding inspiration is a stretch. What we are going to do here is search for a specific UX design using a particular query. In my example, I wanted something with a dark theme, preferably with a light purple shade and vibrant colors. I simply went to Google Images and searched for “dark theme purple UX design”. It doesn’t necessarily have to be a Figma template that you need to purchase; it can simply be an image. After browsing through several designs, I found one that was suitable for my resume page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8udc9ow2rSyUzXST3z26_g.jpeg" /><figcaption><a href="https://dribbble.com/shots/14923101-Exploration-Atask-i-To-Do-List-Mobile-App">https://dribbble.com/shots/14923101-Exploration-Atask-i-To-Do-List-Mobile-App</a></figcaption></figure><h4>2. Generating a color palette</h4><p>Now that we have our image of a stunning UI design, let’s begin by analyzing its components. Take note of the approximately 3 colors used to capture attention, various text colors, and 2 types of panel colors. We’ll start with the background. Although it appears to have a glassmorphic effect, let’s keep things simple and create a gradient using the darkest and lightest shades from the background. To accomplish this, visit <a href="https://cssgradient.io/"><strong>https://cssgradient.io</strong></a> and experiment with different options until you discover a gradient that appeals to you.</p><p>For the remaining elements, I prefer generating 9 color variants ranging from light to dark to introduce more variety when coloring the components. To accomplish this, I identify the lightest and darkest shades and utilize <a href="https://coolors.co/gradient-palette/ffcb6b-3d8bff?number=7"><strong>https://coolors.co/gradient-palette/ffcb6b-3d8bff?number=7</strong></a> to create a color scale. Moving on to the text, I once again select the lightest and darkest text colors from the entire UI design and input them into the color generator.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eusSF_9UDZeWiZ1jYMJPdA.png" /><figcaption><a href="https://coolors.co/gradient-palette/ffcb6b-3d8bff?number=7">https://coolors.co/gradient-palette/ffcb6b-3d8bff?number=7</a></figcaption></figure><p>I follow the same process with the panel colors and the 3 vibrant colors. In cases where there isn’t much color variation, you can manually adjust the shades by using a color generator to darken or lighten the colors. Ensure that you organize your colors appropriately within your chosen framework. By the end of this process, you should have a well-organized collection of colors like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pAZOSosvVc4rR4keRUqISg.png" /></figure><h4>3. Libraries, packages, and frameworks</h4><p>In general, the specifics of your frontend tech stack are not of utmost importance. Feel free to utilize any framework that suits your preferences, as they are merely tools to accomplish the task at hand. Personally, I prefer using React to build my static pages. When it comes to component libraries, I recommend using Chakra-UI. It provides a range of pre-built components that handle layout and styling, allowing you to achieve an appealing visual appearance without the need for extensive customization.</p><p>In terms of iconography, there are numerous icon libraries available that can meet your needs. Personally, I find react-icons to be a great choice. This library offers a wide range of icon groups, each with its own unique style. Two of my favorite icon sets within react-icons are Heroicons and Tabler Icons. These sets provide an extensive collection of icons that effectively convey various concepts and messages. Whether you’re looking for icons related to navigation, actions, or any other design element, Heroicons and Tabler Icons have got you covered. With their comprehensive selection, you’ll find it easy to find the perfect icons to enhance the visual appeal and usability of your frontend applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fm2YF29MfjrCuD9_5wIFMQ.png" /><figcaption><a href="https://react-icons.github.io/react-icons/icons?name=hi">https://react-icons.github.io/react-icons/icons?name=hi</a></figcaption></figure><h4>4. Putting everything together</h4><p>Having successfully organized our colors, components, and icons, the next step is to seamlessly integrate all these elements into a cohesive whole. In today’s digital landscape, where mobile web visits have become increasingly prevalent, it is essential to prioritize designing for mobile devices. With the widespread use of smartphones and tablets, ensuring a seamless user experience on smaller screens is of paramount importance.</p><p>With that being said, I have come to use a certain technique over and over again: breaking the page structure down into single columns that elegantly unwrap into multiple columns when viewed on larger screen devices. This simple approach not only streamlines the design process but also seamlessly accommodates any screen size with minimal complexities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*XvgZ4dwka68Fzr0Cl4tneg.gif" /></figure><p>With your layout, you can start creating your components and apply colors to them. Utilize a variety of the colors generated in step 2, while considering where you want to draw the user’s focus. For example, in a darker layout, you might want to use a lighter font for titles to attract attention. It is also important to avoid excessive use of bright colors and only apply them to components to make them stand out. Here is my final product.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*eQptDjwZQ-GXB_39CS6qAQ.gif" /></figure><p><em>This is the repo to the React app of the final result: </em><a href="https://github.com/felixluebken/resume_page"><em>https://github.com/felixluebken/resume_page</em></a></p><h4>Conclusion</h4><p>Creating a frontend app is no easy endeavor. It requires more than just logical thinking but also a certain feel for how things should look. Therefore, laying out a set of steps to make all frontend apps look good is not straightforward. However, I follow these set of rules to consistently create aesthetically pleasing apps without requiring extensive resources.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7fdef10eb9a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/design-bootcamp/creating-beautiful-frontend-apps-a-guide-to-consistent-aesthetics-d7fdef10eb9a">Creating Beautiful Frontend Apps: A Guide to Consistent Aesthetics</a> was originally published in <a href="https://medium.com/design-bootcamp">Bootcamp</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lessons Learned: Deploying an App for over 100k Users]]></title>
            <link>https://medium.com/@felixluebken2000/lessons-learned-deploying-an-app-for-over-100k-users-338981770e91?source=rss-21b1c9ecd17c------2</link>
            <guid isPermaLink="false">https://medium.com/p/338981770e91</guid>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[infrastructure]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Felix Luebken]]></dc:creator>
            <pubDate>Sun, 21 May 2023 21:40:26 GMT</pubDate>
            <atom:updated>2023-05-21T21:40:26.991Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uhb3j75Ag0pAHDkRqgoxdQ.jpeg" /></figure><p>As many of you engineers, I learned to develop, design, and deploy web-apps through a collective of YouTube videos, Medium articles, and Stack Overflow answers. While these valuable resources provided essential knowledge, they often lacked practical insights into building scalable applications and navigating infra challenges.</p><p>In this article, I aim to share my firsthand experience from developing one of the largest apps in the Netherlands. I will outline the valuable lessons I’ve learned over the past months, shedding light on the practical aspects of building a scalable application and addressing common caveats that arise during infrastructure decisions.</p><h4><strong>Scalability</strong></h4><p>While monolithic server architectures offer advantages such as faster development speeds, lower complexities, and better performance in low-traffic environments, scalability becomes a significant challenge for these deployments. In approximately 90% of cases, a monolithic server meets the requirements for deploying an application. However, issues arise when server load becomes highly unpredictable, characterized by high peak times and low off-peak times.</p><p>To address this challenge, we opted for a serverless solution or a container orchestration platform. In our case, we chose to leverage AWS’ EKS for Kubernetes deployment. While KOPS is a popular cluster provisioning tool, EKS offers a comprehensive set of built-in features such as auto-scaling, robust infrastructure, and simplified control plane management. These capabilities empowered us to effortlessly scale our infrastructure to any desired size, effectively handling varying workloads.</p><p>But that’s not all! Horizontal scaling of our infrastructure alone wasn’t enough. To tackle pod scalability, we integrated our main deployment with HPA (Horizontal Pod Autoscaling). This empowered each pod to dynamically scale, ensuring we meet the criteria for an enterprise-grade infrastructure.</p><h4>Infrastructure Monitoring</h4><p>With a complex micro-serviced based architecture comes a challenge of ensuring that all components run as intended. It may not always be easy to debug an issue occuring in your microservices in the cloud. What may be even more difficult is identifying an vulnerability occuring in the tech stack.</p><p>A few helpful developers guided us to use an amazing tool named NewRelic. The amazing thing with NewRelic is that it allows you to seamlessly connect your whole infrastructure to one singular monitoring service. This includes integration with common languages, such as Python, Javascript, or Go, as well as platforms, like Kubernetes. NewRelic also allows you to monitor all your AWS resources from one intuitive panel.</p><h4>Shielding</h4><p>Potentially, the biggest mistake during the rushed deployment process is the absence of any WAF shielding. WAF shields not only prevent DDoS attacks but also identify numerous common malicious actors who exploit vulnerabilities such as XSS, CSRF, or SQL injections. When such actors are identified, the WAF shield promptly blocks incoming and outgoing connections.</p><p>Considering the ease of performing DDoS attacks using readily available online tools, implementing a WAF is crucial to prevent service denials caused by amateur script kiddies.</p><p>Well-known examples of WAF solutions include Cloudflare and AWS’s own WAFshield. While Cloudflare may possess more data to determine the legitimacy of visitors, AWS provides seamless integration with load balancers within its ecosystem.</p><h4>Access Tokens</h4><p>Although in many cases, a built-in JWT or session token manager from a backend framework is sufficient, a large-scale app requires a more robust solution. While traditional OAuth libraries are generally considered secure, they can still introduce potential errors:</p><p>Firstly, storing tokens in the browser’s local storage is not necessarily safe. An XSS attack can allow a malicious user to access tokens, bypassing the implemented OAuth library. Secondly, traditional OAuth libraries store access and refresh tokens in the database linked to the ORM, which can be suboptimal in the event of a database breach. Lastly, misconfigurations in the authentication layer can create vulnerabilities.</p><p>Fortunately, there are several solutions to address these issues, which can be implemented manually. One valuable lesson we have learned during the development process is to entrust a trusted third party to handle token management and IAM (Identity and Access Management). This approach not only simplifies the process but also delegates the responsibility of securing tokens and user data to a specialized service. In our case, we utilized Auth0 to manage all tokens and access management.</p><p>In conclusion, deploying a large-scale app can be a complex undertaking with numerous potential challenges. From my personal experience, the initial deployment of such an app provided me with more valuable lessons in the first three days than I had learned throughout my previous year as a software engineer. The aim of this article is to share some of the mistakes we made and shed light on the hurdles involved in the demanding task of creating secure, scalable, and efficient infrastructures.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=338981770e91" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Securing Backend Deployments]]></title>
            <link>https://blog.devgenius.io/securing-backend-deployments-9e57b93b93a0?source=rss-21b1c9ecd17c------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e57b93b93a0</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[django]]></category>
            <category><![CDATA[cors]]></category>
            <category><![CDATA[jwt]]></category>
            <dc:creator><![CDATA[Felix Luebken]]></dc:creator>
            <pubDate>Mon, 26 Sep 2022 16:38:55 GMT</pubDate>
            <atom:updated>2023-05-21T19:26:27.381Z</atom:updated>
            <content:encoded><![CDATA[<p>Deploying a backend server in a secure manner may not always be clear. Many developers tend to forget important steps, which could lead to vulnerabilities in production stage. In this article I will compile a checklist, which I have gathered over several years of backend development.</p><p><em>DISCLAIMER: I am by no means an expert in cyber security. This is merely a list of best practices, which I have gathered over time</em></p><h4>Open Ports</h4><p>Having inappropriate ports open during production could leave an entry point for hackers to gain access to the resources, storing your deployment. A good rule of thumb is to close all ports which are not 80 (http) and 443 (https) in your production server. The same applies to database servers, where only the resource housing the production backend, should be able to connect. All other connections need to be blocked.</p><h4>Environment Variables</h4><p>Whether you’re dockerizing your backends, or deploying straight to a linux server, you are going to need to hide all sensitive information. In the case of a hacker gaining access to your resources, you do not want them to gain access to your database, or AWS credentials. So ensure that all your sensitive keys are placed securely in an environment variable, or config file.</p><h4>Debug Settings</h4><p>This one is quite a no-brainer, but you’d be surprised at how many people forget to turn off debug in production. An error like such could allow a hacker to see error logs at certain endpoints, exploring vulnerabilities. Please double check your debug settings.</p><h4>Preventing SQL-Injections</h4><p>With most “batteries-included” backend frameworks, you get a built in ORM (Object Relational Mapper). This includes Rails, Django, or any Javascript framework utilising something like Prisma. These frameworks come built in with SQL-Injection preventative measures. However, in certain edge cases, you will want to use raw SQL queries to improve performance on large datasets. In this case, ensure your string insertions are injection proof.</p><h4>Expiring JWT Tokens</h4><p>Although an unlikely candidate, having your JWT tokens last too long can allow hackers to steal tokens. When your JWT tokens last for a short amount of time, a hacker may steal the token, only to find out that they have expired.</p><h4>TFA</h4><p>Applying TFA to your backend may increase production costs, as most providers, such as Twilio, charge per authorization. Nevertheless, this is one of the most important progressions in terms of security in the past decade. A hacker can steal your users password, but will have a hard time retrieving the TFA code.</p><h4>Redirecting HTTP to HTTPS</h4><p>This is another no-brainer, as HTTPS has been the default for quite a while, ensuring that our requests are encrypted. What is not so apparent, is that your app may be improperly configured, allowing users to accidentally send requests via HTTP. This could leave passwords and usernames vulnerable. In Django this will look like SECURE_SSL_REDIRECT=True</p><h4>Encrypted Cookies</h4><p>Similar to regular requests, your cookies may also be send unencrypted. This is BAD. If a hacker retrieves a users cookies, they can find ways to steal their account credentials. In production, ensure that settings such as CSRF_COOKIE_SECURE=True. Also ensure that the age of your cookies has a definite expiry.</p><h4>Configuring CSP Properly</h4><p>Configuring your CSPs properly mostly applies to SSR frameworks such as Django, Rails, or Redwood. This does not apply to REST based backends such as Express, or Django Rest Framework. If your CSPs aren’t set up properly, a hacker may inject unsafe scripts into your webpage. To make sure that no malicious content get injected, never use ‘unsafe-eval’, and specify your external contents.</p><h4>HSTS</h4><p>HSTS stands for HTTP Strict Transport Security. It is a policy mechanism preventing main-in-the-middle attacks. Configuring this stuff can be a headache, since you have to ensure your certificates being in order. Once again most “batteries-included” come with some sort of HSTS policy. Your job is to configure them properly.</p><h4>NOSNIFF</h4><p>Applying NOSNIFF to all of your secure content types prevents MIME type sniffing. When adding the NOSNIFF to the request headers, it will prevent acceptance of MIME executables, which may execute malicious code.</p><h4>Specifying CORS Origins</h4><p>Without a CORS header, an attacker can gain access to unauthenticated content. If implemented badly, CORS can leak API keys or other sensitive information. By specifying ports and specific domains for your frontend, you can avoid CORS attacks. The browsers SOP will prevent loading scripts from other resources. Read this Medium article for more details: <a href="https://medium.com/@ehayushpathak/security-risks-of-cors-e3f4a25c04d7">https://medium.com/@ehayushpathak/security-risks-of-cors-e3f4a25c04d7</a></p><p>No backend is truly secure, as there may always be a way to maliciously hack the servers. Even enterprise backends constantly suffer data-leaks in a variety of ways. However using these rules of thumb, you may mitigate the risk of an attack by quite a lot. These are merely some rules which I have gathered over time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e57b93b93a0" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/securing-backend-deployments-9e57b93b93a0">Securing Backend Deployments</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>