<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>luidiblu</title><description>Technical articles by luidiblu on software, security, systems and networking.</description><link>https://luidiblu.com/</link><language>en</language><item><title>Understanding Federated Authentication and Authorization Technologies (SAML, SCIM, OIDC)</title><link>https://luidiblu.com/en/posts/autenticacao-federada/</link><guid isPermaLink="true">https://luidiblu.com/en/posts/autenticacao-federada/</guid><description>Understanding federated authentication and authorization technologies: SAML, SCIM, and OpenID Connect.</description><pubDate>Sun, 01 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;h2&gt;What Is Federated Authentication?&lt;/h2&gt;
&lt;p&gt;Federated authentication is an identity management model that allows independent entities to securely share credentials and authentication information.&lt;/p&gt;
&lt;p&gt;In this model, users from one domain can access resources and services in another domain without needing to create new accounts or credentials.&lt;/p&gt;
&lt;p&gt;This is possible by establishing a relationship of mutual trust between identity providers and service providers, and is based on established standards and protocols such as SAML, OAuth, and OpenID Connect.&lt;/p&gt;
&lt;h2&gt;Is Federated Authentication the Same as SSO?&lt;/h2&gt;
&lt;p&gt;No! Although they are often confused or used interchangeably, federated authentication and Single Sign-On (SSO) are not the same concept.&lt;/p&gt;
&lt;p&gt;SSO is a process through which a user can use one set of credentials to access multiple applications or systems, reducing the need for multiple authentications.&lt;/p&gt;
&lt;p&gt;Federated authentication, on the other hand, is a broader identity management model that can include SSO as one of its components, especially in scenarios where authentication needs to be shared between separate systems that may be operated by different organizational entities.&lt;/p&gt;
&lt;h2&gt;What Is the Difference Between Federated Authentication and Delegated Authentication?&lt;/h2&gt;
&lt;p&gt;The main difference between federated authentication and delegated authentication lies in the ownership and management of credentials.&lt;/p&gt;
&lt;p&gt;In federated authentication, user credentials are not transferred or exposed to service providers. In contrast, in delegated authentication, a trusted third party (such as Google or Facebook) is responsible for authenticating the user and then communicating that authentication to the requesting service provider.&lt;/p&gt;
&lt;p&gt;Thus, delegated authentication can be considered a subset of federated authentication, where one system trusts the authentication performed by another system.&lt;/p&gt;
&lt;h2&gt;SAML (Security Assertion Markup Language)&lt;/h2&gt;
&lt;p&gt;SAML is an XML framework used to exchange authentication and authorization data between trusted parties, often used to implement Single Sign-On (SSO) in enterprise systems.&lt;/p&gt;
&lt;p&gt;It allows users to access multiple online services with a single authentication session, improving the user experience and increasing security.&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;/images/saml.png&quot; alt=&quot;Graphical representation of SAML&quot; width=&quot;800&quot; height=&quot;480&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;
&lt;h2&gt;SCIM (System for Cross-domain Identity Management)&lt;/h2&gt;
&lt;p&gt;SCIM is an open standard that facilitates the automated management of user identities in cloud-based applications and services.&lt;/p&gt;
&lt;p&gt;It was designed to promote integration and interoperability between different identity management (IDM) systems and SaaS applications, allowing changes, such as user creation or deletion, to be synchronized automatically through the cloud.&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;/images/scim.png&quot; alt=&quot;Graphical representation of SCIM&quot; width=&quot;985&quot; height=&quot;397&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;
&lt;h2&gt;OIDC (OpenID Connect)&lt;/h2&gt;
&lt;p&gt;OpenID Connect is an identity layer protocol based on OAuth 2.0.&lt;/p&gt;
&lt;p&gt;It allows clients to verify the identity of the end user based on authentication performed by an authorized identity provider, as well as obtain basic profile information about the end user.&lt;/p&gt;
&lt;p&gt;It extends OAuth 2.0 to enable user authentication, providing a mechanism that allows applications to trust the identity assertions supplied.&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;/images/oidc.png&quot; alt=&quot;Graphical representation of OIDC&quot; width=&quot;800&quot; height=&quot;422&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;
&lt;h2&gt;How Do You Implement These Technologies?&lt;/h2&gt;
&lt;p&gt;Implementing federated authentication and OAuth in applications and services requires careful planning and an understanding of the underlying principles. Organizations need to choose the right protocols for their needs, configure infrastructure securely, and work to ensure the best possible user experience.&lt;/p&gt;
&lt;p&gt;This process begins by defining business and security requirements and continues with the integration of the right authentication technologies. A successful implementation must also consider compliance with privacy and data protection regulations, ensuring that authentication practices align with expectations and legal requirements.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Clearly defining the system&apos;s requirements and scope.&lt;/li&gt;
&lt;li&gt;Choosing the appropriate protocol (SAML, OAuth, OpenID Connect, etc.)&lt;/li&gt;
&lt;li&gt;Configuring secure infrastructure, including servers, keys, and certificates.&lt;/li&gt;
&lt;li&gt;Developing or adapting applications and user interfaces for seamless authentication.&lt;/li&gt;
&lt;li&gt;Rigorous and repeated testing to ensure security and effectiveness.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Combining Strengths for Robust Security&lt;/h2&gt;
&lt;p&gt;Adopting these technologies together allows organizations to establish a more robust digital security system. The ability to manage identities consistently and securely, as well as provide streamlined access to a variety of applications, is the foundation of a modern, efficient digital environment.&lt;/p&gt;
&lt;p&gt;Successfully implementing SAML, SCIM, and OIDC depends on understanding the particular characteristics of each standard and designing an architecture that uses them in harmony to maximize benefits and security for the organization and its users.&lt;/p&gt;
</content:encoded><category>identity</category><category>saml</category><category>scim</category><category>oidc</category></item><item><title>Programming fundamentals</title><link>https://luidiblu.com/en/posts/fundamentos-da-programacao/</link><guid isPermaLink="true">https://luidiblu.com/en/posts/fundamentos-da-programacao/</guid><description>An introduction to instructions, intent, and automation.</description><pubDate>Sun, 01 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;First, when we talk about programming, we need to understand what
programming means.&lt;/p&gt;
&lt;p&gt;Ultimately, programming is a series of instructions. You write
this series of instructions and give it to the computer to execute.&lt;/p&gt;
&lt;p&gt;And when the computer executes them, depending on your code, the computer will return
an output or simply keep working.&lt;/p&gt;
&lt;p&gt;The act of writing this series of instructions is called &quot;coding.&quot;
&quot;Programming&quot; is an abstract way of saying that you are telling the computer
what should be done. If you write a recipe, you are programming
another person to follow that recipe. Which is completely different from coding something.&lt;/p&gt;
&lt;p&gt;Okay, but Diego, why do we want computers to do things for us?
Well... Humans and computers are very different. If you ask a computer
to do a thousand tasks, it will do exactly the same thing a thousand times.
Compared to a human, for example, if you ask that human to make 20 hamburgers,
those 20 hamburgers will not turn out the same.&lt;/p&gt;
&lt;p&gt;Why is that? Humans are inconsistent; they get bored repeating the same thing.
It is humanly impossible to always be consistent; there will always be a flaw, some error.
Conversely, computers do not get bored, so if you ask a computer
to make hamburgers, for example, those hamburgers will turn out the same.&lt;/p&gt;
&lt;p&gt;From beginning to end, what I have written so far is the principle of automation:
we delegate boring and repetitive tasks to the computer, so it keeps making
the hamburgers.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;So, we have one point: humans get bored, and computers do not get bored.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;But humans are creative. As a human, if you ask me to &quot;get a present for your mother,&quot;
we can get many different things, because we have context, feelings, and experience.
If you ask a computer, it probably will not know how to respond.&lt;/p&gt;
&lt;p&gt;Computers have no creativity. A calculator cannot create a new cooking recipe,
but it can multiply 2 numbers faster than any human alive.
This means that computers are great at Computation, and we are good at Recognizing Patterns.&lt;/p&gt;
&lt;p&gt;Looking at a person and understanding what emotions they are feeling: that is a pattern.
(I will not get into Artificial Intelligence now, but Artificial Intelligence detects patterns VERY well.)&lt;/p&gt;
&lt;p&gt;So we have humans, with all kinds of creative abilities, but they are not good at repeating tasks.
What we can do is give those tasks to the computer, since computers do them perfectly and super fast.&lt;/p&gt;
&lt;p&gt;Another interesting thing about computers is that they follow exactly what you ordered,
while humans can infer things.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A joke you can already understand about inferring things goes like this:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&quot;A woman sends her programmer husband to the grocery store.&quot;&lt;/p&gt;
&lt;p&gt;She tells him:&lt;/p&gt;
&lt;p&gt;&quot;I need butter, sugar, and cooking oil.&quot;&lt;/p&gt;
&lt;p&gt;&quot;Also, get bread; &lt;em&gt;if they have eggs, get 6.&lt;/em&gt;&quot;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The husband comes home with butter, sugar, cooking oil, and 6 French bread rolls.&lt;/li&gt;
&lt;li&gt;The wife asks: Why the fuck did you bring 6 French bread rolls?&lt;/li&gt;
&lt;li&gt;He replies: They had eggs.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Obviously, in the sentence &lt;em&gt;&quot;Also get bread; if they have eggs, get 6,&quot;&lt;/em&gt; she wanted 6 eggs.
But this programmer husband was taking the sentence literally, so it means
that when he gets to the part about 6, he asks, &quot;6 what?&quot; &quot;6 French bread rolls,
that is what they were talking about.&quot;&lt;/p&gt;
&lt;p&gt;Computers do not make these mistakes, not because they are computers, but because of the way
we communicate with them.&lt;/p&gt;
&lt;p&gt;Since we need to be precisely precise with computers so we do not make mistakes.&lt;/p&gt;
</content:encoded><category>fundamentals</category><category>programming</category></item><item><title>The Art of War in Applications: Sun Tzu&apos;s Strategies Applied to AppSec</title><link>https://luidiblu.com/en/posts/a-arte-da-guerra-em-aplicacoes/</link><guid isPermaLink="true">https://luidiblu.com/en/posts/a-arte-da-guerra-em-aplicacoes/</guid><description>Sun Tzu&apos;s strategies applied to application security, from planning to defense in depth.</description><pubDate>Fri, 24 Nov 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;In an era when battles are fought not with swords but with code, we invoke the wisdom of the ancient general Sun Tzu to guide the modern landscape of application battles. His time-tested maxims resonate with surprising clarity in an AppSec context where every line of code can be a potential battlefield.&lt;/p&gt;
&lt;h2&gt;“Know Yourself and Your Enemy”: Continuous Assessment and Awareness&lt;/h2&gt;
&lt;figure&gt;&lt;img src=&quot;/images/articles/a4e2a0fc0af910334424.webp&quot; alt=&quot;&quot; width=&quot;1024&quot; height=&quot;585&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;Static code analysis (&lt;strong&gt;SAST&lt;/strong&gt;), a little like reviewing a blueprint before building a house, looks for problems in your source code before the software is released or even executed. It is like doing a thorough checkup to make sure everything is in order. This process helps catch errors early so they can be fixed without major headaches.&lt;/p&gt;
&lt;p&gt;In contrast, dynamic application analysis (&lt;strong&gt;DAST&lt;/strong&gt;) is like testing a fire alarm by pressing the test button to make sure it actually works when needed. It tests software while it is running to find flaws that only appear when the system is active — like an alarm that only goes off when there is already a real fire.&lt;/p&gt;
&lt;p&gt;Combining the two gives us Interactive Analysis (&lt;strong&gt;IAST&lt;/strong&gt;), which is like having an inspector check a building while it is being erected, ensuring that everything is safe and working as it should throughout the process. This provides a more complete picture because you are checking the integrity of the product both inside and out, and at different stages.&lt;/p&gt;
&lt;p&gt;Beyond these analyses, knowing what hackers are doing out there helps a great deal. This is called &lt;strong&gt;Threat Intelligence&lt;/strong&gt; and involves gathering information about the latest techniques attackers might use to strike. Staying informed about these methods helps the application security team prepare to face new and unexpected threats.&lt;/p&gt;
&lt;p&gt;Ultimately, the idea is to have a clear understanding of your application&apos;s security and what is happening in the world of cyberattacks. That way, you can adjust your defenses to always stay one step ahead of attackers.&lt;/p&gt;
&lt;h2&gt;“Every Battle Is Won Before It Is Fought”: The Art of Preparation&lt;/h2&gt;
&lt;figure&gt;&lt;img src=&quot;/images/articles/efbca25bf6befeb4f543.jpg&quot; alt=&quot;&quot; width=&quot;1024&quot; height=&quot;585&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;Sun Tzu teaches that victory is achieved through meticulous planning and preparation. In application security, preparation guards against future threats by establishing a solid security foundation at the beginning of the software development lifecycle.&lt;/p&gt;
&lt;p&gt;Adopting a &lt;strong&gt;Secure by Design&lt;/strong&gt; approach means incorporating security principles from the application&apos;s conception phase. Every feature, function, and line of code is created with security as an intrinsic consideration, following standards and best practices that minimize the likelihood of vulnerabilities.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Threat Modeling&lt;/strong&gt; is a proactive activity that anticipates potential attack vectors. Developers and security analysts work together to identify and assess potential risks and structure appropriate defensive measures. Like strategic role-playing, it allows attack scenarios to be simulated and effective countermeasures to be created.&lt;/p&gt;
&lt;p&gt;Performing a &lt;strong&gt;Secure Code Review&lt;/strong&gt; is similar to a detailed inspection of a fortification to identify weak points. Through systematic source code analysis, it is possible to identify and fix vulnerabilities before they become a real threat to the software&apos;s operational security.&lt;/p&gt;
&lt;p&gt;By grounding software development in these rigorous practices, the odds of success on the cybersecurity battlefield are considerably improved. This aligns security and development teams around a common goal: releasing robust applications that are already secure by nature and can withstand attacks before they even materialize.&lt;/p&gt;
&lt;h2&gt;“The Supreme Art of War Is to Subdue the Enemy Without Fighting”: The Invisible Defense&lt;/h2&gt;
&lt;figure&gt;&lt;img src=&quot;/images/articles/882607b38e576c25e2b0.webp&quot; alt=&quot;&quot; width=&quot;1024&quot; height=&quot;585&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;This phrase sums up the idea of winning without the need for a direct confrontation. In the AppSec world, this means creating multiple layers of security that work together to protect the system without an attacker even noticing their presence.&lt;/p&gt;
&lt;p&gt;Imagine Defense in Depth as a castle with multiple walls. Even if an enemy manages to get past the first one, there are still many other protections they do not expect that will stop them. It is like having multiple security systems, some visible and others invisible, that together create a robust shield around your applications.&lt;/p&gt;
&lt;p&gt;When we talk about protections that act without the attacker knowing, we can mention runtime application protection, known as &lt;strong&gt;RASP&lt;/strong&gt; (Runtime Application Self-Protection). It is like a discreet bodyguard that is always ready to act if something goes wrong, blocking attacks while the application is running.&lt;/p&gt;
&lt;p&gt;And finally, **WAFs (**Web Application Firewalls) act as sentinels that detect and prevent intrusion attempts, guarding your software against known attacks and less familiar ones too. They are a front line in the defense of your web application, filtering suspicious traffic before it even gets close to your castle.&lt;/p&gt;
&lt;p&gt;The central point here is that by establishing these multiple layers of defense, you can effectively neutralize many threats before they become a serious problem, keeping applications secure and running smoothly. Best of all, this can be done so subtly that attackers will not even know why their attacks are not working.&lt;/p&gt;
&lt;h2&gt;“Be Extremely Subtle, Even to the Point of Formlessness”: Deception as a Tactic&lt;/h2&gt;
&lt;figure&gt;&lt;img src=&quot;/images/articles/da48f4136ba743c65302.webp&quot; alt=&quot;&quot; width=&quot;1024&quot; height=&quot;585&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;In application security strategies, discretion and undetectability are fundamental elements. Technically, this manifests in the use of code obfuscation, a process that scrambles source code while preserving its functionality but making it harder for attackers to understand. It is a way of hiding your software&apos;s true instructions in plain sight.&lt;/p&gt;
&lt;p&gt;The technique of minification complements obfuscation by reducing source code to the essentials, removing whitespace, comments, and other elements that are not needed for execution. This not only makes code harder to read for those with malicious intentions, but can also improve performance by reducing file sizes.&lt;/p&gt;
&lt;p&gt;Beyond these methods, adopting an architecture based on microservices and internal APIs that are not exposed externally protects the system as a whole. By segmenting functionality into smaller parts, each operating in isolation, the application&apos;s overall architecture becomes a puzzle for attackers. Without a clear view of all components and how they interact, it becomes much harder for them to find a weak point to exploit.&lt;/p&gt;
&lt;p&gt;By employing these tactics, applications take on a fluid, camouflaged security posture that actively confuses adversaries and protects against unwanted interceptions. By being “subtle to the point of formlessness,” you create an environment where attackers have difficulty identifying clear targets, which helps ward off threats and maintain system integrity.&lt;/p&gt;
&lt;h2&gt;“Let Your Path Be Unpredictable”: The Dynamics of Defenses&lt;/h2&gt;
&lt;figure&gt;&lt;img src=&quot;/images/articles/8b4c2fb6921b50666cf3.webp&quot; alt=&quot;&quot; width=&quot;1024&quot; height=&quot;585&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;Creating defenses that are difficult to predict and react to can be a major asset in protecting applications. One way to do this is by using &lt;a href=&quot;https://en.wikipedia.org/wiki/Honeypot_(computing)&quot;&gt;honeypots&lt;/a&gt;, which are systems or parts of a network designed to look attractive to attackers but are actually a trap. Like bait, they divert attackers&apos; attention and efforts to a place where they cannot cause real damage, while also allowing security specialists to observe attackers in action and learn from their approaches.&lt;/p&gt;
&lt;p&gt;Furthermore, automating the application of security fixes, known as patches, helps keep software up to date and less vulnerable to known attacks. But it is not just about automating simple fixes; strategic, frequent changes to infrastructure, such as rotating server IP addresses and ports, confuse attackers and disrupt the attack patterns they might be trying to use.&lt;/p&gt;
&lt;p&gt;These unpredictable movements make attackers&apos; work more complex and uncertain. Instead of a static, predictable target, your infrastructure resembles a constantly moving target that is difficult to hit. In this way, dynamic defenses not only protect your applications but also provide valuable information about attackers&apos; strategies, which can be used to further strengthen system security.&lt;/p&gt;
&lt;h2&gt;“The Height of Skill Is to Strike the Enemy Without Combat”: The Triumph of Intelligence&lt;/h2&gt;
&lt;figure&gt;&lt;img src=&quot;/images/articles/8c5585a10f0503db4844.webp&quot; alt=&quot;&quot; width=&quot;1024&quot; height=&quot;585&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;Achieving excellence in AppSec often means identifying and neutralizing threats before they materialize into attacks. This is achieved through the intelligent use of behavioral monitoring and incident response tools. For example, Endpoint Detection and Response (&lt;strong&gt;EDR&lt;/strong&gt;) systems and Security Orchestration, Automation, and Response (&lt;strong&gt;SOAR&lt;/strong&gt;) platforms are vital to this proactive approach. They constantly work behind the scenes, analyzing traffic and user activities for warning signs.&lt;/p&gt;
&lt;p&gt;This kind of technology embodies “combat without combat,” as it allows organizations to stay ahead of attackers by identifying and fixing vulnerabilities before they are exploited. Anomalies and suspicious patterns are detected quickly, allowing adjustments to be made automatically, whether in application rules or perimeter defenses.&lt;/p&gt;
&lt;p&gt;Additionally, techniques such as sandboxing help take potential problems out of the picture by confining processes and executions to secure, controlled environments. This allows suspicious behavior to be observed and studied without risk to the rest of the system, making it easier to build more effective defenses without direct confrontation.&lt;/p&gt;
&lt;p&gt;Through this set of strategies and technologies, it is possible not only to block adversaries but also to learn from their intrusion attempts, continuously improving security measures and keeping infrastructure one step ahead of attackers.&lt;/p&gt;
&lt;h2&gt;“Be Swift as the Wind, Compact as the Forest”: The Synergy of DevSecOps&lt;/h2&gt;
&lt;figure&gt;&lt;img src=&quot;/images/articles/1e5dad56deeb9bcf162d.webp&quot; alt=&quot;&quot; width=&quot;1024&quot; height=&quot;585&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;Speed and efficiency in development go hand in hand with a well-organized, resilient structure. With a focus on fast delivery without compromising security, the principles of &lt;strong&gt;DevSecOps&lt;/strong&gt; encourage building applications that can adapt and respond as quickly as needed — like the wind changing direction in an instant.&lt;/p&gt;
&lt;p&gt;The practice of containerization exemplifies this approach, as it allows parts of a system to be isolated in individual containers. This not only accelerates the distribution and scalability of services, but also makes it easier to update each container&apos;s security independently, reducing downtime and service disruption — a strategy similar to a forest, where each tree can grow and adapt individually, but together they form a robust ecosystem.&lt;/p&gt;
&lt;p&gt;Continuous integration and continuous delivery (&lt;strong&gt;CI/CD&lt;/strong&gt;) are also fundamental pieces of this puzzle, allowing code to be developed, tested, and released more efficiently. Pipelines incorporate a series of automated tests, including static and dynamic code analysis, as well as dependency checks, to ensure that any change made is secure and does not introduce new risks.&lt;/p&gt;
&lt;p&gt;This synergy of fast development, agile infrastructure, and embedded security places &lt;strong&gt;DevSecOps&lt;/strong&gt; at the forefront of cybersecurity innovation, where the application is always ready to face challenges without falling behind market demands or emerging threats.&lt;/p&gt;
&lt;h2&gt;“A Good Warrior Is Cautious”: Prudence in Access Governance&lt;/h2&gt;
&lt;figure&gt;&lt;img src=&quot;/images/articles/3d4e9be1c2e2b5c42e8f.webp&quot; alt=&quot;&quot; width=&quot;1024&quot; height=&quot;585&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;Meticulous care is a critical aspect of protecting applications, where &lt;strong&gt;Identity and Access Management — IAM&lt;/strong&gt; stands as a central pillar. This discipline encompasses strategies, technologies, and processes designed to ensure that only credentialed entities — whether individuals or systems — can access the right resources under appropriate conditions.&lt;/p&gt;
&lt;p&gt;The consolidation of &lt;strong&gt;Zero Trust&lt;/strong&gt; principles reflects a new paradigm in security governance: denying trust by default and requiring rigorous verification before granting any access. In place of the traditional security perimeter, continuous credential verification takes center stage, adding a critical layer of security in a world where threats can emerge from anywhere.&lt;/p&gt;
&lt;p&gt;Tools and protocols such as &lt;strong&gt;OAuth&lt;/strong&gt; and &lt;strong&gt;OpenID Connect&lt;/strong&gt; are examples of mechanisms used by modern &lt;strong&gt;IAM&lt;/strong&gt; systems to facilitate token-based access management. These standards not only authenticate users but also define detailed and adaptive access policies, taking into account the context of the access request, geolocation, and user behavior.&lt;/p&gt;
&lt;p&gt;Role-Based Access Control (&lt;strong&gt;RBAC&lt;/strong&gt;) enables fine alignment between access rights and user responsibilities, ensuring that individuals have only the permissions needed to perform their roles. Privileged Access Management (&lt;strong&gt;PAM&lt;/strong&gt;), meanwhile, aims to regulate and monitor access to high-level credentials, protecting against the misuse of essential privileges.&lt;/p&gt;
&lt;h2&gt;Conclusion: The Union of Ancient Wisdom and Modern Security.&lt;/h2&gt;
&lt;figure&gt;&lt;img src=&quot;/images/articles/0922000461fb51da63ac.webp&quot; alt=&quot;&quot; width=&quot;1024&quot; height=&quot;585&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;Just as General Sun Tzu devised strategies thousands of years ago that still hold true in today&apos;s combat, digital battles in AppSec are won through planning, intelligence, and adaptation. In the virtual world, swords are replaced by bits and bytes, but the concepts of vigilance, preparation, and cunning remain as vital as on the classical battlefield.&lt;/p&gt;
&lt;p&gt;“&lt;strong&gt;Continuous Assessment and Awareness&lt;/strong&gt;” teach us to know the strengths and weaknesses of our applications, as well as our enemies&apos; techniques. The modern weapons for this undertaking are code analysis and threat intelligence, which, when applied, fortify our digital strongholds before the enemy reaches the gates.&lt;/p&gt;
&lt;p&gt;“&lt;strong&gt;The Art of Preparation&lt;/strong&gt;,” where we learn that the conflict is decided long before it begins, manifests in anticipating risks and integrating security measures from a project&apos;s conception. “Secure by Design,” threat modeling, and code reviews are pillars of this meticulous planning, promoting development where every line of code is a defensive bastion.&lt;/p&gt;
&lt;p&gt;Maximizing “&lt;strong&gt;The Invisible Defense&lt;/strong&gt;” and “&lt;strong&gt;Deception as a Tactic&lt;/strong&gt;” teaches us the art of winning unseen and without direct confrontation. Defensive strategies mark out territory where attackers perceive security barriers without identifying the source of their failure, giving up without knowing the depth of the defenses that subdue them.&lt;/p&gt;
&lt;p&gt;Based on the premise that “&lt;strong&gt;The Dynamics of Defenses&lt;/strong&gt;” must be unpredictable, we see constant movement and innovation as essential. Honeypots and strategic infrastructure changes ensure that our systems not only resist adversaries&apos; advances but also gather vital information for future strengthening.&lt;/p&gt;
&lt;p&gt;And finally, we reach “&lt;strong&gt;The Triumph of Intelligence&lt;/strong&gt;,” where mastery of AppSec is demonstrated by the ability to neutralize threats without the need for confrontation. Vigilance, automated incident response, and sandboxing are examples of the supremacy of cunning and foresight over brute force.&lt;/p&gt;
&lt;p&gt;The speed and resilience of &lt;strong&gt;DevSecOps&lt;/strong&gt;, “&lt;strong&gt;swift as the wind, compact as the forest&lt;/strong&gt;,” combined with prudence in access governance, reflect the image of a “&lt;strong&gt;good warrior&lt;/strong&gt;,” always cautious and prepared.&lt;/p&gt;
</content:encoded><category>appsec</category><category>sast</category><category>dast</category><category>threat-modeling</category></item><item><title>Federated Authentication and SSO (Or: “Did You Forget Your ‘Badge’?”)</title><link>https://luidiblu.com/en/posts/autenticacao-federada-e-sso/</link><guid isPermaLink="true">https://luidiblu.com/en/posts/autenticacao-federada-e-sso/</guid><description>SAML, SCIM, OpenID Connect, and OAuth explained through federated authentication and SSO.</description><pubDate>Tue, 21 Nov 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Imagine a large international airport: a hub of activity where thousands of passengers, employees, and customers move about every day. Each individual in this space has an identity and a specific purpose, and security is paramount. Let us take the example of a pilot, a central figure in this scenario.&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;/images/articles/cbcd7c73eefbb1d8ab3b.jpg&quot; alt=&quot;&quot; width=&quot;1024&quot; height=&quot;683&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;A pilot needs to access several restricted areas of the airport — from flight briefing rooms to runways. In the past, different areas required different forms of identification, such as physical badges or access codes. However, adopting federated authentication simplifies this process. With it, the pilot uses a single identification badge — a unified credential recognized by all of the airport&apos;s security systems. This credential is validated by a central system, which authenticates the pilot&apos;s identity and provides access to the necessary areas based on their profile and the day&apos;s needs.&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;/images/articles/5ef667f0af083de141f5.jpg&quot; alt=&quot;&quot; width=&quot;860&quot; height=&quot;572&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;Furthermore, the pilot&apos;s access permissions are not static. Depending on the day&apos;s flight, destinations, or security levels, the system, supported by the OAuth protocol, can dynamically adjust access levels. This means that on one day the pilot may have access to an international briefing room, while on another their access is restricted to domestic flights. &lt;strong&gt;OAuth&lt;/strong&gt; allows this flexibility, managing access based on parameters that change in real time, ensuring that access is granted only to the information and areas relevant to the pilot at that specific moment.&lt;/p&gt;
&lt;p&gt;Just as a pilot navigates different areas of an airport, internet users move between various online services and platforms. As the fabric of cyberspace expands, federated authentication emerges not merely as a solution but as a strategic imperative. The era of “Big Data” and “IoT” has not only expanded the scope of identity management but also complicated its nuances.&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;/images/articles/c607dc8c638959d79d0e.jpg&quot; alt=&quot;&quot; width=&quot;1000&quot; height=&quot;667&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;This complexity is caused by the advancement of standards such as &lt;strong&gt;SAML 2.0&lt;/strong&gt;, which now integrates more deeply with cloud technologies, and &lt;strong&gt;OpenID Connect&lt;/strong&gt;, which has evolved to embrace &lt;strong&gt;JWT&lt;/strong&gt; standards, facilitating flexibility and security. Take a look:&lt;/p&gt;
&lt;h2&gt;The Evolution of SAML: From XML to the Cloud&lt;/h2&gt;
&lt;figure&gt;&lt;img src=&quot;/images/articles/37a05f815bfb78cd6c55.png&quot; alt=&quot;&quot; width=&quot;850&quot; height=&quot;567&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;SAML&lt;/strong&gt; (&lt;em&gt;Security Assertation Markup Language&lt;/em&gt;) is an &lt;strong&gt;XML&lt;/strong&gt;-based protocol developed to facilitate secure authentication and authorization communication between distinct domains — essential for enabling the implementation of &lt;strong&gt;SSO&lt;/strong&gt; (&lt;em&gt;Single Sign-On&lt;/em&gt;).&lt;/p&gt;
&lt;p&gt;With &lt;strong&gt;SAML&lt;/strong&gt;-based &lt;strong&gt;SSO&lt;/strong&gt;, users can log in once and gain access to various systems, services, and applications without the need for repeated authentication. This not only enriches the user experience but also strengthens the security posture by reducing the attack surface through fewer authentication points.&lt;/p&gt;
&lt;p&gt;By integrating &lt;strong&gt;SSO&lt;/strong&gt; via &lt;strong&gt;SAML&lt;/strong&gt; with modern security and identity governance controls, organizations can provide streamlined, protected access in line with the highest compliance standards and best practices.&lt;/p&gt;
&lt;h2&gt;SCIM: Identity Synchronization in the Cloud&lt;/h2&gt;
&lt;figure&gt;&lt;img src=&quot;/images/articles/7199fe004ac249b44db8.png&quot; alt=&quot;&quot; width=&quot;600&quot; height=&quot;350&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;SCIM&lt;/strong&gt; (&lt;em&gt;System for Cross-domain Identity Management&lt;/em&gt;) is an open specification that enables the automated maintenance of user identities across various platforms on the internet.&lt;/p&gt;
&lt;p&gt;It serves as a common language that facilitates the automation of identity information exchanges between platforms.&lt;/p&gt;
&lt;p&gt;Taking a &lt;em&gt;REST&lt;/em&gt;-based approach, it provides &lt;em&gt;CRUD&lt;/em&gt; for user identities, facilitating integration with &lt;strong&gt;IDaaS&lt;/strong&gt; (&lt;em&gt;Identity-as-a-Service&lt;/em&gt;) such as &lt;strong&gt;&lt;em&gt;Okta&lt;/em&gt;&lt;/strong&gt; or &lt;strong&gt;&lt;em&gt;Azure AD&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;This allows companies to automate user provisioning and deprovisioning processes, quickly adapting authorizations as employee roles change, etc…&lt;/p&gt;
&lt;p&gt;This automation is highly beneficial in environments that require continuous identity synchronization between &lt;em&gt;on-premise&lt;/em&gt; systems and cloud services, helping reduce the administrative burden and minimize human errors.&lt;/p&gt;
&lt;h2&gt;OIDC and Convergence with Blockchain Technologies&lt;/h2&gt;
&lt;figure&gt;&lt;img src=&quot;/images/articles/96a5d141038d8a708a24.png&quot; alt=&quot;&quot; width=&quot;1024&quot; height=&quot;593&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;OIDC (&lt;em&gt;OpenID Connect&lt;/em&gt;&lt;/strong&gt;) is an authentication layer built on top of the &lt;strong&gt;OAuth&lt;/strong&gt; protocol, allowing clients of all types, whether in web, mobile, or desktop applications, to verify the user&apos;s identity simply and securely. The use of standardized tokens in &lt;strong&gt;JWT&lt;/strong&gt; (&lt;em&gt;JSON Web Token&lt;/em&gt;) format, which contain information about the user&apos;s identity, makes &lt;strong&gt;OIDC&lt;/strong&gt; a powerful and flexible solution for managing digital identities.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Detailed Aspects of OIDC:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;OIDC Protocol Flow:&lt;/strong&gt; Using the token flow of &lt;strong&gt;OAuth 2.0&lt;/strong&gt;, &lt;strong&gt;OIDC&lt;/strong&gt; adds the ID token, a type of digitally signed token containing claims about the user&apos;s authentication. This token is sent to the client after a successful authentication process conducted by the authorization server.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Compliance and Security:&lt;/strong&gt; &lt;strong&gt;OIDC&lt;/strong&gt; plays a fundamental role in providing a verifiable identity across different domains. This is essential for complying with global regulations, such as the &lt;strong&gt;GDPR&lt;/strong&gt;, which requires clients capable of confirming the identity, origin, and time of the user&apos;s authentication.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;OpenID Provider (OP):&lt;/strong&gt; A service that authenticates the user and issues an ID token. The OP can be a familiar identity service, such as Google, or a custom enterprise identity management system.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Current Examples of OIDC Deployment:&lt;/strong&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Social media login:&lt;/strong&gt; Services such as &lt;strong&gt;&lt;em&gt;Google&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;Facebook&lt;/em&gt;&lt;/strong&gt; use &lt;strong&gt;OIDC&lt;/strong&gt; to offer a consistent login experience and secure authentication across different services, for both native applications and websites.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Government Applications:&lt;/strong&gt; Government agencies use &lt;strong&gt;OIDC&lt;/strong&gt; to provide access to portals and systems, ensuring an extra layer of security and traceability.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Healthcare:&lt;/strong&gt; &lt;strong&gt;OIDC&lt;/strong&gt; can be used in healthcare platforms to protect patients&apos; sensitive data, allowing access only to authenticated and authorized users and applications.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;IoT and Smart Devices:&lt;/strong&gt; In a context where smart devices need to authenticate to access cloud services, &lt;strong&gt;OIDC&lt;/strong&gt; provides a suitable, secure, and standardized means of authentication.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The strategic incorporation of &lt;strong&gt;OIDC&lt;/strong&gt; into the authentication and access ecosystem not only provides flexibility and openness to the digital world, but also meets the growing demand for &lt;strong&gt;decentralized authentication methods&lt;/strong&gt; when combined with technologies such as blockchain, enhancing federated authentication capabilities with greater transparency and a reduction in the risks associated with data centralization.&lt;/p&gt;
&lt;p&gt;With its adaptability to different application scenarios and its alignment with technological advances, &lt;strong&gt;OIDC&lt;/strong&gt; is indispensable for architecting a digital infrastructure that is secure, scalable, and user-centered.&lt;/p&gt;
&lt;h2&gt;OAuth 2.0: From API Access to the Token Economy&lt;/h2&gt;
&lt;figure&gt;&lt;img src=&quot;/images/articles/76648ff59fbf041d1a86.png&quot; alt=&quot;&quot; width=&quot;624&quot; height=&quot;268&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;OAuth 2.0&lt;/strong&gt; is an authorization protocol that has become the standard for secure, delegated authentication on the web. With its flexible approach, it allows applications to request limited access tokens, offering secure ways to give users control over access to their data without sharing their credentials.&lt;/p&gt;
&lt;p&gt;The success of &lt;strong&gt;OAuth 2.0&lt;/strong&gt; lies in its simplicity and adaptability. It provides distinct grant flows to suit a variety of application scenarios, from back-end servers to web browser clients and native applications. This enables a customized implementation that best meets the security needs of each case.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Practical Usage Examples:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Third-party Application Integrations:&lt;/strong&gt; Allows services such as Spotify or PayPal to integrate with other applications, granting access to selected data without exposing user credentials.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mobile and Desktop Apps:&lt;/strong&gt; Enables applications to request access to resources such as contacts and files in services like Google and Microsoft OneDrive in a controlled manner.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With its modular and extensible approach, &lt;strong&gt;OAuth 2.0&lt;/strong&gt; serves as a reliable foundation for complex authentication and authorization management strategies across a wide variety of applications, simplifying and standardizing how access to data and services is managed online.&lt;/p&gt;
&lt;h2&gt;To Sum It Up&lt;/h2&gt;
&lt;p&gt;The technologies we have discussed — federated authentication, &lt;strong&gt;SAML&lt;/strong&gt;, &lt;strong&gt;SCIM&lt;/strong&gt;, &lt;strong&gt;OIDC&lt;/strong&gt; and &lt;strong&gt;OAuth 2.0&lt;/strong&gt; — form a backbone of security, much as identification and access systems control the flow of people in a busy airport. Just as a single badge can give a pilot access to various areas of the airport, from the flight briefing room to the runway, federated authentication allows users to move effortlessly around the internet, accessing a variety of services with a single set of credentials.&lt;/p&gt;
&lt;p&gt;The dynamism and efficiency of the &lt;strong&gt;OAuth 2.0&lt;/strong&gt; protocol mirror the flexibility with which airport security must operate — adjusting access precisely as needs and circumstances vary. Each technology covered is like a vital part of the airport&apos;s complex system, essential to maintaining order, efficiency, and security.&lt;/p&gt;
&lt;p&gt;With continuous advances and innovations like these, we are building the infrastructure needed for a secure and accessible digital ecosystem, where freedom of movement for data and applications is as fundamental as it is for people in an airport.&lt;/p&gt;
</content:encoded><category>identity</category><category>saml</category><category>scim</category><category>oidc</category></item><item><title>Are you familiar with every operating system?</title><link>https://luidiblu.com/en/posts/sistemas-operacionais/</link><guid isPermaLink="true">https://luidiblu.com/en/posts/sistemas-operacionais/</guid><description>Kernels, user space, and the differences between Windows, macOS, Linux, and Unix.</description><pubDate>Mon, 05 Oct 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;First of all, an operating system is software that manages everything happening on a computer: it reads, writes, and deletes files on your hard drive. It also manages how a process starts, how processes communicate with one another, and how they terminate. The operating system also handles how memory is allocated to different processes, how network packets are sent and received, and how each program can read each hardware component.&lt;/p&gt;
&lt;p&gt;There are two main parts to an operating system: the kernel and user space. The kernel is the core component of an OS; it communicates directly with our hardware and handles system resources.&lt;/p&gt;
&lt;p&gt;As users, we don&apos;t interact directly with the kernel. Instead, we interact with another part called “user space”. This space is basically everything outside the kernel.&lt;/p&gt;
&lt;p&gt;As you probably know, there are several different operating systems out there. The best known are Windows, Mac OS, and Linux.&lt;/p&gt;
&lt;p&gt;Windows is developed by Microsoft and is widely used by businesses and everyday users. Many computers come with Windows as their default operating system.&lt;/p&gt;
&lt;p&gt;If you buy an Apple computer, it will come with Mac OS preinstalled.&lt;/p&gt;
&lt;p&gt;Linux is an open-source operating system. Open-source software is free to distribute, modify, and share. Linux is heavily used in infrastructure. A large proportion of the world&apos;s servers run Linux, developed by &lt;em&gt;Linus Torvalds.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;We usually use the word “Linux” to refer to both the kernel and the operating system. Today, Linux has a huge community of developers around the world contributing to the system.&lt;/p&gt;
&lt;p&gt;Some of the most common Linux distributions are Ubuntu, Debian, and Red Hat. (Even Chrome OS is based on Linux.)&lt;/p&gt;
&lt;p&gt;You may also have heard of Unix. Unix is an OS developed in the 1970s; before its official release, the OS went through several modifications. The main ideas behind Linux today were based on Unix principles. Many of the tools we use today drew inspiration from Unix.&lt;/p&gt;
&lt;p&gt;The kernel tools and user space of Mac OS are based on a “cousin” of Unix called BSD. Although their graphical interfaces are extremely different, their CLIs are very similar.&lt;/p&gt;
&lt;p&gt;Personally, I use Linux a lot. It&apos;s a completely different world…. Full of possibilities and customizations. What about you? Have you tried Linux today?&lt;/p&gt;
</content:encoded><category>systems</category><category>linux</category><category>unix</category></item><item><title>How does project prioritization work?</title><link>https://luidiblu.com/en/posts/priorizacao-de-projetos/</link><guid isPermaLink="true">https://luidiblu.com/en/posts/priorizacao-de-projetos/</guid><description>A reflection on time, resources, and choosing what matters when prioritizing projects.</description><pubDate>Fri, 25 Sep 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;One of the most baffling problems I&apos;ve seen throughout my programming career is people&apos;s ability to avoid prioritization.&lt;/p&gt;
&lt;p&gt;People&apos;s most common approach is to switch to autopilot, or “someone chooses for me and I do it”.&lt;/p&gt;
&lt;p&gt;Programmers don&apos;t understand that it&apos;s all too easy to post on Twitter about how awful a project&apos;s management is or how bad the company is. But none of them have ever taken responsibility for a project themselves to then criticize with such conviction. It&apos;s not hard to criticize and point fingers; what&apos;s hard is to execute and deliver results. Personally, I don&apos;t usually listen to someone who has no measurable results to show.&lt;/p&gt;
&lt;p&gt;You don&apos;t need to be a SCRUM MASTER or hold a project management certificate to understand the basic concepts of prioritization.&lt;/p&gt;
&lt;p&gt;There is a rare, finite commodity that we tend to sell for very little money, and that commodity is our Time. Time, Resources, Money, and People are all finite.&lt;/p&gt;
&lt;p&gt;Knowing that these things are finite, you need to choose what to do. Of course, if time were infinite, you could put everything off and your nest egg would still be secure. The first thing we usually do when we choose something to work on is plan: like a story, your project needs a beginning, a middle, and an end.&lt;/p&gt;
&lt;p&gt;Prioritization works like this: when you have countless kinds of tasks, large, small, complex, and so on… If you&apos;re not careful, or if you don&apos;t say no, you end up putting those tasks off. This leads to starting the easier, smaller tasks first, and only when the project starts taking shape do you realize it&apos;s too late and the main tasks are still on paper. In other words, you spent your time doing what wasn&apos;t important.&lt;/p&gt;
&lt;p&gt;I like an example I saw online in which someone needs to fit two kinds of balls into a jar: lots of small balls and 4 large balls. If the person puts the small balls in first, there won&apos;t be room for the large ones, and the balls end up sticking out of the jar. With prioritization, however, when the large balls go in before the small ones, everything fits inside the container.&lt;/p&gt;
&lt;p&gt;Now that&apos;s a good example of project management. Good management means making sure that the 1% of the 1% of errors won&apos;t compromise the entire system, or the whole sprint.&lt;/p&gt;
&lt;p&gt;Stopping a sprint midway is one example. Knowing that time is finite, would you rather keep going until the sprint is finished and only fix something in the next one, or cancel immediately and save your time?&lt;/p&gt;
</content:encoded><category>projects</category><category>prioritization</category></item><item><title>What&apos;s the truth about Sidekiq?</title><link>https://luidiblu.com/en/posts/a-verdade-do-sidekiq/</link><guid isPermaLink="true">https://luidiblu.com/en/posts/a-verdade-do-sidekiq/</guid><description>Queues, workers, and asynchronous task processing with Sidekiq and Ruby on Rails.</description><pubDate>Sat, 29 Aug 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Usually, when we talk about the standard architecture (MVC, RAILS + HEROKU), traffic has a long journey to make. Throughout that journey (from request to response), we block our UX from returning &lt;strong&gt;absolutely anything.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The standard Heroku process that handles these requests is also blocked. If the application takes longer than 30 seconds, it closes the connection and returns a &lt;strong&gt;TIMED OUT&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;It (Heroku) does this because what you actually pay for on Heroku is the number of application processes (known as Dynos).&lt;/p&gt;
&lt;p&gt;There are &lt;strong&gt;TWO TYPES&lt;/strong&gt; of Dynos:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Web Dyno&lt;/li&gt;
&lt;li&gt;Worker Dyno&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;At a high level, a Dyno is a process that runs in your Rails application.&lt;br /&gt;
A Web Dyno is a subtype specifically designed to handle web traffic.&lt;/p&gt;
&lt;p&gt;Heroku places all Web Dynos behind something we call a “Routing Mash”.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Request -&amp;gt; HTTP Reverse Proxy -&amp;gt; HTTP cache -&amp;gt; Routing Mash -&amp;gt; Dyno Grid&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In this case, instead of taking 30 seconds, we can add the request to a list and immediately return a message to the user along the lines of “We&apos;ve added your request to our list.”&lt;/p&gt;
&lt;p&gt;Basically, it&apos;s a key-value store without having to model the data in a sequential database (yes, Redis).&lt;/p&gt;
&lt;p&gt;So, instead of calling model.rb to generate the report, we put a message in the queue and it returns to the user immediately. Meanwhile, our queue also communicates with a worker.&lt;/p&gt;
&lt;p&gt;A worker is a &lt;strong&gt;Ruby object&lt;/strong&gt; in a separate process from the one handling the &lt;strong&gt;Web Request&lt;/strong&gt;, within the same deployment.&lt;/p&gt;
&lt;p&gt;Because the service is separate from the Web, it is not subject to the 30-second rules. In other words, when the Worker finishes the process, we can decide what to do with the data. For example, we could send the user an email or upload it to a Bucket.&lt;/p&gt;
&lt;p&gt;We usually add the data to the cache so the user can view it on the Web without having to recalculate it.&lt;/p&gt;
&lt;p&gt;We usually always use Redis with Sidekiq….&lt;/p&gt;
&lt;p&gt;Redis =&amp;gt; Database.&lt;br /&gt;
Sidekiq =&amp;gt; Library for handling processes and Rails applications.&lt;/p&gt;
&lt;p&gt;P.S.: Sidekiq comes with its own UI, which is built in Sinatra, so you need to import Sinatra.&lt;/p&gt;
&lt;p&gt;Examples:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#routes.rb

require ‘sidekiq/web’
mount Sidekiq::Web =&amp;gt; “/sidekiq”

$ mkdir workers
$ cd workers &amp;amp;&amp;amp; touch report_worker.rb

#report_worker.rb

class ReportWorker
  include Sidekiq::worker
  sidekiq_options retry:false

  def perform(start_date, end_date)
    puts(&quot;#{start_date} até #{end_date}&quot;)
  end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the example above, we use retry: false because, by default, if the worker fails, it will try to run the process until it succeeds.&lt;br /&gt;
Every Sidekiq Worker has a method called “Perform”. It is called when something in the queue is processed.&lt;/p&gt;
&lt;p&gt;You can put parameters in the queue ;).&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#controller.rb

def report
  ReportWorker.perform_async(&quot;01-01-2020&quot;, &quot;01-01-2021&quot;)
  render text: &quot;Request Comum&quot;
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And finally, to at least understand how Sidekiq runs, we use the following to run it in the terminal:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;sidekiq -c 1&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;It runs all processes with one thread (by default), but you can increase that number.&lt;br /&gt;
By default, it knows the queue is in Redis because it reads port 6379 (the Redis default).&lt;/p&gt;
&lt;p&gt;Okay, Diego, but how can I deploy this to the cloud?&lt;/p&gt;
&lt;p&gt;Here&apos;s my answer, my friend:&lt;/p&gt;
&lt;p&gt;In your Rails application, do the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#procfile

reportworker: bundle sidekiq -c 1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This way, it will run the same command we used in our local terminal.&lt;/p&gt;
&lt;p&gt;:) I don&apos;t know how to end an article, so….&lt;/p&gt;
&lt;p&gt;$ systemctl stop medium-text&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;/images/articles/f3b36ea2eb9f8db78764.jpg&quot; alt=&quot;&quot; width=&quot;480&quot; height=&quot;360&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;</content:encoded><category>sidekiq</category><category>queues</category><category>ruby</category></item><item><title>How to generate a QR code with Python</title><link>https://luidiblu.com/en/posts/qr-code-com-python/</link><guid isPermaLink="true">https://luidiblu.com/en/posts/qr-code-com-python/</guid><description>A small experiment to generate a QR code using Python and the qrcode library.</description><pubDate>Fri, 12 Jun 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;QR codes spark a lot of interest, but also raise questions among users.&lt;/p&gt;
&lt;p&gt;So I decided to put together a short tutorial on how to create/generate one of these codes.&lt;/p&gt;
&lt;p&gt;(We&apos;ll use the qrcode and OpenCV libraries.)&lt;/p&gt;
&lt;p&gt;Dependencies:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pip3 install pillow qrcode
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now we can generate our QR code!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import qrcode

# Exemplo de data
data = &quot;https://www.linkedin.com/in/diegopisani/&quot;

# Nomeamos o arquivo 
filename = &apos;qrcode.png&apos;

# Geramos o QR Code
img = qrcode.make(data)

# Salvamos a img num file
img.save(filename)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This code will generate a QR code pointing to LinkedIn (in this case, my profile).&lt;/p&gt;
&lt;p&gt;And that&apos;s the tutorial o/&lt;/p&gt;
</content:encoded><category>python</category><category>qr-code</category></item><item><title>How does a basic SQL Injection attack work?</title><link>https://luidiblu.com/en/posts/sql-injection-basico/</link><guid isPermaLink="true">https://luidiblu.com/en/posts/sql-injection-basico/</guid><description>An introduction to the risks of SQL queries built with untreated input.</description><pubDate>Sat, 28 Mar 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;First, we need to know what SQL and databases are. A database is a collection of information organized into columns and rows, forming a table. SQL is a very powerful language, and we need to know about it to understand the attack. In the example below, we see a common scenario: a page where users enter their login and password to access their accounts. Below, we can see a simple SQL query:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;select * from login where usuario = &apos;Luke&apos; and senha = &apos;skyw@lk3r!&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The SQL query above shows the table where there is a user named Luke and his corresponding password. But what would happen if you only had access to the username? You might have thought we would not be able to access the table. However, we can comment out the part that asks for the user&apos;s password by commenting out this small section of code using: ‘ — ‘.&lt;/p&gt;
&lt;p&gt;By injecting this comment, everything written after the symbols will be disregarded and ignored.&lt;/p&gt;
&lt;p&gt;In this case, we can see that even if we entered a password different from the one in the database, we could still access the table, because the section that requests the password would be ignored due to the code acting as a comment.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;select * from login where usuario = &apos;Luke&apos; -- and senha = &apos;skyw@lk3r!&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Another way to gain access through SQL Injection is when we have neither a username nor a password. We then use the following string in the code, in both the name field and the password field: &lt;strong&gt;‘or’ 1 = 1 —&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;or&lt;/strong&gt; instruction tells the database that if one condition cannot be met, another can be.&lt;/p&gt;
&lt;p&gt;Using this code, our query would look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;select * from login where usuario = &apos;&apos; or 1 = 1 -- and senha = &apos;teste senha&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can see that because the name is empty, it will move on to the or instruction, which will ask whether 1 equals 1. (Of course it does.) It will then access the first registered user and ignore the password.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;ATTACK STRINGS TO ENTER IN THE FIELDS:&lt;br /&gt;
1) — ‘&lt;br /&gt;
2) ‘ — ‘&lt;br /&gt;
3) ‘or’ 1=1&lt;br /&gt;
4) ‘or’ 1=1 —&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Nowadays, software companies and their programmers already handle this type of vulnerability. However, flaws like these are still common in applications created by beginners or people who focus on usability without thinking about security.&lt;/p&gt;
</content:encoded><category>security</category><category>sql-injection</category></item><item><title>How to run a basic scan with NMAP</title><link>https://luidiblu.com/en/posts/varredura-basica-com-nmap/</link><guid isPermaLink="true">https://luidiblu.com/en/posts/varredura-basica-com-nmap/</guid><description>An introduction to TCP connections, ports, and network service inventories with Nmap.</description><pubDate>Thu, 27 Feb 2020 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;NMAP is a scan based on TCP Connect, that is, a TCP connection. When we use the scan, it attempts to establish a connection with the target machine following the three-way TCP protocol. When we use a TCP connection, our computer makes this three-way connection, which we call a handshake. If computer 1 wants to talk to computer 2, it sends a SYN packet to computer 2, which responds with a SYN/ACK packet. Computer 1 then receives the SYN/ACK packet and responds with ACK, thus establishing the connection between the computers.&lt;/p&gt;
&lt;p&gt;With this in mind, NMAP sends a SYN packet and receives a SYN/ACK packet from the target, and the connection is established with an ACK packet. Based on this information, it can check which ports are open.&lt;br /&gt;
Example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nmap -sT -p- 192.168.0.1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the command above, -sT means that we will use a scan based on a TCP connection, and -p- means that we will scan all ports. We can scan a specific port, which is recommended, since it would generate less traffic on the network. So, if we wanted to scan port 80, we would replace -p- with -p80.&lt;br /&gt;
Example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nmap -sT -p80 192.168.0.1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If we need to scan several IPs, we can separate them with commas or use a hyphen to scan a range of IPs.&lt;br /&gt;
Example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# Sintaxe abaixo escaneia do 192.168.0.1 até 192.168.0.253

nmap -sT -p80 192.168.0.1-253
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The scan will return something like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;root@root:/home# nmap -sT -p- 192.168.0.13
Starting Nmap 7.60 ( http://nmap.org ) at 2020-02-26 19:56 BRST
mass_dns: warning: Unable to determine any DNS servers. Reverse DNS is disabled. Try using --system-dns or specify valid servers with --dns-servers
Nmap scan report for 192.168.0.13
Host is up (0.00066s latency).
Not shown: 65528 closed ports
PORT   STATE SERVICE
22/tcp   open ssh
80/tcp   open http
111/tcp   open rpcbind
139/tcp   open netbios-ssn
445/tcp   open microsoft-ds
3790/tcp   open quickbooksrds
53668/tcp   open unknown
Nmap done 1 IP address ( 1 host up ) scanned in 3.29 seconds
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We can see that when we scan the machine, we get several services with their open ports identified, and these are the ports we could attack in the future.&lt;/p&gt;
</content:encoded><category>networking</category><category>nmap</category><category>tcp</category></item><item><title>The aerospace bug</title><link>https://luidiblu.com/en/posts/o-bug-aeroespacial/</link><guid isPermaLink="true">https://luidiblu.com/en/posts/o-bug-aeroespacial/</guid><description>The story of Ariane 5 and how a small software decision can have major consequences.</description><pubDate>Thu, 10 Oct 2019 00:00:00 GMT</pubDate><content:encoded>&lt;h2&gt;The bug that blew up a rocket&lt;/h2&gt;
&lt;p&gt;Exploring space has become such a common routine that technological advances no longer make the news with as much emphasis. Just at the end of 2018, for example, NASA managed to land the Insight probe on Mars, where it is now acting as a base for studying the planet&apos;s interior.&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;/images/articles/27ade6cbc6726ef272b9.jpg&quot; alt=&quot;&quot; width=&quot;660&quot; height=&quot;360&quot; loading=&quot;lazy&quot; /&gt;&lt;figcaption&gt;The Insight probe on Mars.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;We used a robotic arm to place a seismometer on the Martian soil, which will not only listen to but also measure asteroid impacts, landslides, and earthquakes. Knowing the frequency and intensity of marsquakes is extremely important so that we can start thinking about how we will build our housing developments there soon.&lt;br /&gt;
In addition, Insight dug a hole 5 meters deep over 3 months to check how much heat Mars lets escape.&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;/images/articles/f927a0cb77109bb50521.jpg&quot; alt=&quot;&quot; width=&quot;602&quot; height=&quot;338&quot; loading=&quot;lazy&quot; /&gt;&lt;figcaption&gt;Illustration of how Insight measured the heat of Mars.&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;A lot also happened here on Earth: the Space Station was resupplied by SpaceX rockets, and in Alcântara the Brazilian Air Force successfully took five experiments to an altitude of 120 km. What did not go so well was the return of the rocket that went to the Space Station, which, while trying to land, &lt;a href=&quot;https://www.youtube.com/watch?v=ewxM7_RqBaQ&quot;&gt;&lt;strong&gt;had a problem with one of its stabilizers and began to spin out of control&lt;/strong&gt;&lt;/a&gt;. Thanks to incredible structural resilience and control algorithms, however, the rocket headed toward the sea, where it was then recovered without major damage.&lt;/p&gt;
&lt;p&gt;These events serve as a reminder of how difficult it is to explore space, with unexpected things able to happen at any moment and for the most trivial reasons. In this article, I will describe a case involving Ariane 5, a rocket that cost 7 billion dollars to build and &lt;a href=&quot;https://www.youtube.com/watch?v=PK_yguLapgA&quot;&gt;&lt;strong&gt;exploded 39 seconds into its first flight&lt;/strong&gt;&lt;/a&gt;: an absurd loss that could have been prevented with a few more lines of code.&lt;/p&gt;
&lt;p&gt;To understand how to handle unexpected failures, let&apos;s start by writing a simple little program that will take two integers and divide them to give us a result. With that, we already have everything we need to write a Java method that calculates exactly that:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;public class Div {

  static int divisao(int a, int b) {
    return (a/b);
  }

  public static void main(String args[]) {
    System.out.println(divisao(25, 5));
    System.out.println(divisao(40, 2));
    System.out.println(divisao(100, 10));
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the code above, we perform ordinary division (25 by 5, 40 by 2, and 100 by 10). As you can see, our program seems to be working. The problem is that we forgot certain details! For example, when we enter 1 divided by 2, we get 0 instead of 0.5 because integer division in Java always rounds down.&lt;/p&gt;
&lt;p&gt;To solve the problem above, we will introduce floating-point numbers, abbreviated as “floats,” into our code. Numbers stored this way can represent rational numbers by shifting the “.” that separates the integer part from the fractional part of a number, using scientific notation. The code will look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;public class Div {

  static float divisao(float a, float b) {
    return (a/b);
  }

  public static void main(String args[]) {
    System.out.println(divisao(25, 5));
    System.out.println(divisao(40, 2));
    System.out.println(divisao(100, 10));
  
    System.out.println(divisao(1, 2));
  }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In our example, the point floats all the way out, and a multiplication by 10 to the power of -1 takes its place, giving us the expected result: 0.5. We increased the precision of our program&apos;s results by using floats. If you know how to count in binary, what matters now is that the more bits we have to represent a floating-point number, the greater its precision will also be. Right now, we are programming with a 32-bit float, but Java gives us the option of using a “double,” which has 64.&lt;/p&gt;
&lt;p&gt;Similarly, there is an integer type called “short” that uses 2 bytes instead of 4. Converting a number from one type to another is possible, but it can lead to unexpected situations that we will now explore.&lt;/p&gt;
&lt;p&gt;Since each bit can hold 0 or 1, two bytes, 16 bits, can describe 2¹⁶ distinct numbers. Dividing these 65,536 possibilities by two, we can describe values ranging from -32,768 to 32,767. We simply pretend that numbers greater than that do not exist. But if, for some reason, our program returns a larger value, such as 42 thousand, we have to perform an operation called casting, which takes our 2-byte short and turns it into a 32-bit int. Magically, we have a new, much larger range that includes 42 thousand, and we happily carry on.&lt;br /&gt;
Without this operation, our number would have exceeded the established limits, spilling over into unknown territory. (They call this overflow.)&lt;/p&gt;
&lt;p&gt;In programming, our number line is actually a circle, so 32,767 + 1 would result in -32,768. It is because of this circle that doing the reverse (casting 42 thousand to a short, where it does not fit) results in a negative number. The first 32 thousand of the 42 thousand fit, and the rest overflows into the other, negative half of the circle. One way to handle this is with exceptions.&lt;/p&gt;
&lt;p&gt;One condition we have not protected ourselves against yet is what happens when dividing by 0: a fatal error occurs. We can therefore wrap these lines in a block that will try to execute our code but, if something goes wrong, say that something unexpected happened and safely end the program.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;public class Div {
    static float divisao(float a, float b) {
        try {
              return (a/b);
        } catch (Exception e) {
            System.out.println(&quot;Deu ruim, você dividiu por 0!&quot;);
            return Integer.MAX_VALUE;
        }
    }

    public static void main(String args[]) {
       System.out.println(divisao(1, 0));
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now our program finally works as expected! These blocks that handle exceptions can protect us from various bugs, and their absence was partly responsible for the Ariane 5 accident.&lt;/p&gt;
&lt;p&gt;The idea behind the European Space Agency&apos;s development of Ariane 5 was to replace Ariane 4 with a more powerful rocket, capable of taking much larger payloads into space, such as two satellites weighing three tons each. With this, Europe was on the verge of becoming a benchmark in commercial space exploration after an investment of 7 billion dollars (27 billion reais) and 10 years of research. On this first flight, four uninsured satellites worth 500 million dollars were being carried. The flight trajectory itself was controlled by an onboard computer, which, 36.7 seconds after launch, thought that a course correction was needed because of very strange data the inertial guidance system was receiving from instruments such as accelerometers and gyroscopes. These bizarre and impossible readings were actually an error message that was interpreted as valid information; the system itself had crashed and was inoperative.&lt;/p&gt;
&lt;p&gt;This shutdown was caused by an overflow when converting the rocket&apos;s horizontal velocity (which was being stored in a double-precision, 64-bit float) to a 16-bit integer. Reproducing this same problem in our program with 84 thousand divided by 2, for example, we see that we get the same absurd result as before instead of 42 thousand, because the value simply does not fit in 16 bits.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;public class Div {
    static short divisao(double a, double b) {
        return (short) (a/b);
    }

public static void main(String args[]) {
       System.out.println(divisao(84000, 2));
    }
}

#Exemplo do código do foguete
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This part of the rocket&apos;s code was not protected by exceptions because the engineers had basically reused the code from Ariane 4, which was physically incapable of reaching such a high horizontal velocity!&lt;/p&gt;
&lt;p&gt;And worse: this entire calculation was no longer useful at all after liftoff; its only purpose was to make sure everything was in order before launch. But in earlier versions of Ariane, the programmers had already decided to allow a 40-second grace period to make system restarts easier in the event of small delays during the countdown. In other words, when the older rockets were being developed, no one imagined that the source code would simply be reused in later versions.&lt;br /&gt;
And the scientists working on the more modern rocket, seeing portions of a program that were not used, did not test this part, but also did not remove it because doing so could cause a series of additional problems. With the spacecraft&apos;s processor already so overloaded, why spend computational resources handling exceptions in sections that should not even be executed in the first place?&lt;/p&gt;
&lt;p&gt;After the system shut down, control was passed to a backup that was completely redundant because it was an exact copy, leading to the same error mere milliseconds later. As a result, the rocket made an unnecessary course correction, compensating for an incorrect movement that had not occurred. From that point on, Ariane 5 was nothing more than a missile with a surprise target. The forces involved began to tear the rocket apart, which then correctly triggered its self-destruct routine because of the aerodynamic stresses that were ripping off the boosters.&lt;/p&gt;
&lt;p&gt;And that is how, at an altitude of four kilometers over the swamps of French Guiana, what must have been the most expensive fireworks display in history took place.&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;/images/articles/ff51dc60b7335fc20715.png&quot; alt=&quot;&quot; width=&quot;367&quot; height=&quot;241&quot; loading=&quot;lazy&quot; /&gt;&lt;figcaption&gt;Ariane 5&apos;s “Fireworks Display”&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;Today, Ariane 5 is one of the most reliable rockets, with 97 of its 102 launches successful. Exploring space takes work and is difficult, but in the long run it is definitely worth it.&lt;/p&gt;
&lt;p&gt;The greatest challenge is escaping the butterfly effect, which, as happened here, caused a small error to be amplified to the point of causing billions in losses.&lt;/p&gt;
&lt;p&gt;Thank you for reading my article!&lt;br /&gt;
If you made it this far, it means I entertained you!&lt;br /&gt;
Do not be afraid to send me an email!&lt;br /&gt;
diego.luidiblu@gmail.com&lt;/p&gt;
</content:encoded><category>engineering</category><category>ariane-5</category></item><item><title>Identifying devices on the network.</title><link>https://luidiblu.com/en/posts/identificando-dispositivos-na-rede/</link><guid isPermaLink="true">https://luidiblu.com/en/posts/identificando-dispositivos-na-rede/</guid><description>IP addresses, gateways, and discovering devices connected to your own network.</description><pubDate>Thu, 15 Aug 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Have you ever been curious about listing the devices connected to your network?&lt;/p&gt;
&lt;h2&gt;Requirements&lt;/h2&gt;
&lt;p&gt;To list them, we need to use &lt;a href=&quot;https://github.com/nmap/nmap&quot;&gt;&lt;strong&gt;&lt;em&gt;nmap&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sudo apt-get install nmap
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Default Gateway&lt;/h2&gt;
&lt;p&gt;We need the address of the default &lt;a href=&quot;https://pt.wikipedia.org/wiki/Gateway&quot;&gt;&lt;strong&gt;&lt;em&gt;gateway&lt;/em&gt;&lt;/strong&gt;&lt;/a&gt;. If you do not know your default gateway, simply type:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;route -n
&lt;/code&gt;&lt;/pre&gt;
&lt;figure&gt;&lt;img src=&quot;/images/articles/c6af49366424f698b774.png&quot; alt=&quot;&quot; width=&quot;347&quot; height=&quot;154&quot; loading=&quot;lazy&quot; /&gt;&lt;/figure&gt;
&lt;p&gt;On the first line, it lists the default gateway.&lt;br /&gt;
In this example: 192.168.0.1&lt;/p&gt;
&lt;h2&gt;Using nmap&lt;/h2&gt;
&lt;p&gt;With the default gateway in hand, we can use nmap!&lt;br /&gt;
Using the command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nmap -sP (seuGatewayPadrao)/24
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Your terminal will then return a list of all the IPs connected to your network :)&lt;/p&gt;
</content:encoded><category>networking</category><category>ip-addresses</category></item><item><title>Creating gems in Ruby</title><link>https://luidiblu.com/en/posts/criando-gemas-em-ruby/</link><guid isPermaLink="true">https://luidiblu.com/en/posts/criando-gemas-em-ruby/</guid><description>A tutorial on the structure, gemspec, building, and publishing of a Ruby gem.</description><pubDate>Wed, 31 Jul 2019 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Have you ever struggled to figure out how to create gems and make them open-source? Then this article is for you! :D&lt;/p&gt;
&lt;p&gt;After studying some gems that perform more specific functions in depth, I realized that anyone in the community can create a gem. Here is a tutorial:&lt;/p&gt;
&lt;h2&gt;Requirements&lt;/h2&gt;
&lt;p&gt;To create your gem, we need a few tools:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Sublime Text — &lt;a href=&quot;https://www.sublimetext.com/&quot;&gt;https://www.sublimetext.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Ruby — &lt;a href=&quot;https://www.ruby-lang.org/pt/&quot;&gt;https://www.ruby-lang.org/pt/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Git — &lt;a href=&quot;https://git-scm.com/downloads&quot;&gt;https://git-scm.com/downloads&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;RubyGems — &lt;a href=&quot;https://rubygems.org/&quot;&gt;https://rubygems.org/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Initial project structure&lt;/h2&gt;
&lt;p&gt;Create a folder named &lt;strong&gt;sua_gem&lt;/strong&gt;, then use touch to create a &lt;strong&gt;.gemspec&lt;/strong&gt; file. Next, inside your &lt;strong&gt;lib&lt;/strong&gt; directory, create the &lt;strong&gt;.rb&lt;/strong&gt; file for &lt;strong&gt;sua_gem&lt;/strong&gt;. Your files need to look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sua_gem
├── sua_gem.gemspec
└── lib
     └── sua_gem.rb
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Creating the gem&lt;/h2&gt;
&lt;p&gt;Inside &lt;strong&gt;sua_gem.rb&lt;/strong&gt; we will code the gem&apos;s respective functions. In my case, my gem will return the string “Minha primeira gem!” (“My first gem!”):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# lib/sua_gem.rb
class sua_gem
  def self.hello
   puts &quot;Minha primeira gem!&quot;
  end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Configuring the gemspec&lt;/h2&gt;
&lt;p&gt;After coding &lt;strong&gt;sua_gem.rb&lt;/strong&gt;, we will configure the &lt;strong&gt;.gemspec&lt;/strong&gt; for &lt;strong&gt;sua_gem&lt;/strong&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# sua_gem.gemspec
Gem::Specification.new do |s|
 s.name        = &apos;sua_gem&apos;
 s.version     = &apos;0.0.0&apos;
 s.date        = &apos;2019-07-01&apos;
 s.summary     = &quot;Primeira versão da sua gem!&quot;
 s.description = &quot;Minha primeira gem que eu codei&quot;
 s.authors     = [&quot;Alan Turing&quot;]
 s.email       = &apos;alan@turing.com&apos;
 s.files       = [&quot;lib/sua_gem.rb&quot;]
 s.homepage    = &apos;https://github.com/username/gem&apos;
 s.license     = &apos;MIT&apos;
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Keep in mind that:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;name = Your gem&apos;s name&lt;/li&gt;
&lt;li&gt;version = Your gem&apos;s version&lt;/li&gt;
&lt;li&gt;date = Your gem&apos;s modification date&lt;/li&gt;
&lt;li&gt;summary = Your gem&apos;s summary&lt;/li&gt;
&lt;li&gt;description= Your gem&apos;s description&lt;/li&gt;
&lt;li&gt;authors = The gem&apos;s authors&lt;/li&gt;
&lt;li&gt;email = The gem owner&apos;s email&lt;/li&gt;
&lt;li&gt;files = Your gem&apos;s path (where you placed your .rb file)&lt;/li&gt;
&lt;li&gt;homepage = Where your gem was uploaded (GitBucket works too)&lt;/li&gt;
&lt;li&gt;license = Your gem&apos;s license (you can find gem licenses online; in this case, I used ‘MIT’)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Ready to publish&lt;/h2&gt;
&lt;p&gt;At this point, we can use our code, but our friends still cannot install our gem.&lt;br /&gt;
For other programmers to be able to use the gem, you need to run a few commands:&lt;/p&gt;
&lt;p&gt;First, we need to upload our open-source code:&lt;br /&gt;
&lt;em&gt;Github:&lt;/em&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git init
hub create
git add . 
git commit -m &quot;My first gem&quot; 
git push origin master
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Next, we need to create an account on the &lt;a href=&quot;https://rubygems.org/&quot;&gt;&lt;em&gt;RubyGems&lt;/em&gt;&lt;/a&gt; &lt;em&gt;website.&lt;/em&gt;&lt;/p&gt;
&lt;figure&gt;&lt;img src=&quot;/images/articles/031aa1b35a4de3669de9.webp&quot; alt=&quot;&quot; width=&quot;887&quot; height=&quot;415&quot; loading=&quot;lazy&quot; /&gt;&lt;figcaption&gt;Screenshot of the RubyGems website&lt;/figcaption&gt;&lt;/figure&gt;
&lt;p&gt;To set up RubyGems on your computer, we need to run the following command (the command will ask for your RubyGems password):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;curl -u (seu-rubygems-nick) https://rubygems.org/api/v1/api_key.yaml
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Finally, to build our gem, we use a short piece of code in the terminal:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;gem build sua_gema.gemspec
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now, to check that your gem is working, you can find it on RubyGems! c:&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;We have now learned a simple and safe way to create a gem! Do not miss the chance to ask questions or leave a suggestion in the comments :)&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
</content:encoded><category>ruby</category><category>gemspec</category></item></channel></rss>