<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Leonardo Felicissimo</title>
    <description>The latest articles on Forem by Leonardo Felicissimo (@leofelicissimo).</description>
    <link>https://forem.com/leofelicissimo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F542346%2Ffc29fedb-1649-41f2-b336-581bac9180da.jpeg</url>
      <title>Forem: Leonardo Felicissimo</title>
      <link>https://forem.com/leofelicissimo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/leofelicissimo"/>
    <language>en</language>
    <item>
      <title>Threats Driven - Web Applications Security, Part 2</title>
      <dc:creator>Leonardo Felicissimo</dc:creator>
      <pubDate>Sun, 07 Nov 2021 21:07:39 +0000</pubDate>
      <link>https://forem.com/leofelicissimo/threats-driven-web-applications-security-part-2-1f7o</link>
      <guid>https://forem.com/leofelicissimo/threats-driven-web-applications-security-part-2-1f7o</guid>
      <description>&lt;p&gt;In the previous &lt;a href="https://dev.to/leofelicissimo/why-im-studying-this-web-applications-security-part-1-3el6"&gt;article&lt;/a&gt; I've started writing a quite about why I'm currently studying about Securing Web Applications. Now moving on, I'm going to deeper to the theme starting from the STRIDE Microsoft Model and exploring the Basic Security Design Principles from a &lt;a href="http://web.mit.edu/Saltzer/www/publications/protection/index.html"&gt;paper&lt;/a&gt; of 1975 published by John H. Saltzer at MIT.&lt;/p&gt;

&lt;p&gt;Sometimes when building an application, we think the only way to make it secure is to avoid hackers attack and this is not for devs, but a job for the operations team. Let's talk the true here (secure env). Which words come on your mind when you think about security? Password and Hackers (right?). &lt;/p&gt;

&lt;p&gt;But, the process of secure an application starts when we firstly get an answer to the question: What might we fighting against?&lt;/p&gt;

&lt;p&gt;The propose of Saltzer's paper is explore "the mechanics of protecting computer-stored information from unauthorized use or modification". Saltzer goes from the basic security design principles to state of art. The funny thing is that the points from the paper called as security &lt;em&gt;basic principles&lt;/em&gt;, to me has sound like a WOW! (HHAHAH Jesus, what a gap I had!).&lt;/p&gt;

&lt;p&gt;Once we have understood privacy protection and so, information security as the main security strategies objective, Saltzer helps giving a definition for the terms:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The words "privacy," "security," and "protection" are frequently used in connection with information-storing systems. Not all authors use these terms in the same way. This paper uses definitions commonly encountered in computer science literature.&lt;/p&gt;

&lt;p&gt;The term "privacy" denotes a socially defined ability of an individual (or organization) to determine whether, when, and to whom personal (or organizational) information is to be released.&lt;/p&gt;

&lt;p&gt;The term "security" describes techniques that control who may use or modify the computer or the information contained in it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Saltzer propose a way of categorize the security issues in the following way:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Unauthorized information release&lt;/td&gt;
&lt;td&gt;an unauthorized person is able to read and take advantage of information stored in the computer&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unauthorized information modification&lt;/td&gt;
&lt;td&gt;an unauthorized person is able to make changes in stored information--a form of sabotage&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unauthorized denial of use&lt;/td&gt;
&lt;td&gt;an intruder can prevent an authorized user from referring to or modifying information&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;I remember in older professional experience where a teammate from Infosec team has schedule a series of meetings related to Threat Modeling. And at least for me at the time it was awesome. Instead of built something based on basic security patterns familiar to us or accounting with what the framework have out of the box, the challenge was to built an architecture considering a couple of security threats from start.&lt;/p&gt;

&lt;p&gt;For this, Microsoft propose a model called &lt;a href="https://docs.microsoft.com/en-us/azure/security/develop/threat-modeling-tool-threats#stride-model"&gt;STRIDE&lt;/a&gt; a acronym that helps to organize the known threats in categories:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Category&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Spoofing&lt;/td&gt;
&lt;td&gt;Illegal access and using of username and password for example&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Tampering&lt;/td&gt;
&lt;td&gt;Malicious modification of data. For example, unauthorized changes to a database&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Repudiation&lt;/td&gt;
&lt;td&gt;A weakness related to a lack of criptography and traceability of a transaction between two parties. One of parties deny has performed an action and the system is unabled to proof the integrity (I confess. It was being a challenge try to explain this part. Feel free to help me on comments! :D)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Information Disclosure&lt;/td&gt;
&lt;td&gt;Users accessing information on resources that they are not granted to access to, or steal information sniffing the traffic&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Denial of Service&lt;/td&gt;
&lt;td&gt;Causes a fall down to a web app, forcing it to be unavailable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Elevation of Privilege&lt;/td&gt;
&lt;td&gt;When a user that doesn't have access to a resource break the deny and gain the access to using some way. SQL Injection for example.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Well, seeing the table and when we do a research about the them, seems that all involves the application data. At the end, all our security strategies have a single one objective, protect the user privacy prevent not authorized access to information.&lt;/p&gt;

&lt;p&gt;Then, the conclusion at this moment is that if we want design a architecture considering security efforts we shouldn't just thinking on what to do or to use to avoid unauthorized access, but how to prevent from threats modeling security strategies since at start of architectural decisions.&lt;/p&gt;

&lt;p&gt;Before of thinking the main structure of application and how should be the design patterns to use, or how are the test cases, design how should we use or plan for grant that this new API is safe from security threats?&lt;/p&gt;

&lt;p&gt;In many projects we start building things doing the possible for see faster the database result returned on a http request or in a screen. The challenge when we start to consider a secure app, is start answering: How are the possible threats related to that we are going to build? &lt;/p&gt;

&lt;p&gt;Concluding with Saltzer's words:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The objective of a secure system is to prevent all unauthorized use of information, a negative kind of requirement. It is hard to prove that this negative requirement has been achieved, for one must demonstrate that every possible threat has been anticipated. Thus an expansive view of the problem is most appropriate to help ensure that no gaps appear in the strategy. In contrast, a narrow concentration on protection mechanisms, especially those logically impossible to defeat, may lead to false confidence in the system as a whole.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In the next part I want to share the Security Basic Principles propose by Saltzer.&lt;/p&gt;

&lt;p&gt;See ya!&lt;/p&gt;

</description>
      <category>security</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>network</category>
    </item>
    <item>
      <title>Why I'm studying this? - Web Applications Security, Part 1</title>
      <dc:creator>Leonardo Felicissimo</dc:creator>
      <pubDate>Sat, 06 Nov 2021 19:57:37 +0000</pubDate>
      <link>https://forem.com/leofelicissimo/why-im-studying-this-web-applications-security-part-1-3el6</link>
      <guid>https://forem.com/leofelicissimo/why-im-studying-this-web-applications-security-part-1-3el6</guid>
      <description>&lt;p&gt;This and the followings texts will be part of my personal study about security for Web Applications. It represents a big challenge for me. For two reasons: First, because english is not my first language and I couldn't imagine to write a text in english at my life. And second, because security is a gap that I have at this exactly moment. And with this and others texts I want to win this two challenges and get enter in a beautiful and new world!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkp1yv126unmow6lwl190.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkp1yv126unmow6lwl190.png" alt="A scene of the world destroyed. Grays sky, destroyed cars, and empty street"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Just kidding lol, let's move on!&lt;/p&gt;

&lt;h2&gt;
  
  
  The importance of security and my shame
&lt;/h2&gt;

&lt;p&gt;Security is an important them when we are building an information system, because in this kind of application we have private data going from a side to another. Then, it is not without importance (I know that must exists a better term for this) because in case of have our data stolen our users could be prejudiced and all the system would fall.&lt;/p&gt;

&lt;p&gt;But unfortunately when we are building a product not always we are prioritizing build it considering that the best security practices is applied.&lt;/p&gt;

&lt;p&gt;Last days I get interviewed and one of the questions was about security. In that time I see a lack of knowledge that I had in this topic. The question was very simple: "How you will store the password in database with security". And the only response that I gave was: "I could use md5 hash for store" HAHAHAHAHAHAHAHAHAHAHAH Jesus! What a shame!&lt;/p&gt;

&lt;p&gt;This because in all projects that I've contributed the mechanism for security was granted by framework or by other then came before me and built it.&lt;/p&gt;

&lt;p&gt;Then, when I got recovered from my shame feeling and put my self in the path of improving my security skills understanding from zero everything related to how to create secure RESTful APIs. I want to share my study path, bringing examples, sharing code and moving between theory and practice.&lt;/p&gt;

&lt;p&gt;My initial point of study is a good text that I found at &lt;a href="https://restfulapi.net/security-essentials" rel="noopener noreferrer"&gt;restfulapi.net&lt;/a&gt;. In this text the author explore an overview about the topic, sharing Security Design Principles and Best Practices in a very broad vision.&lt;/p&gt;

&lt;p&gt;I would like based on this text, understand better each principle and how to apply as well as show in the practice how to implement the best practices using my preferred languages (I need to decide what first 😰).&lt;/p&gt;

&lt;p&gt;Then for now, I'm just introducing the method. If you need to have faster more info about the theme. Start reading the restfulapi.net, it seems a very useful introduction! But If you are interested in follow my path, read the text and come back here to follow with me, I will try to start writing the next asap, I swear!&lt;/p&gt;

&lt;p&gt;UPDATE: Continue to the next part &lt;a href="https://dev.to/leofelicissimo/threats-driven-web-applications-security-part-2-1f7o"&gt;here&lt;/a&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>beginners</category>
      <category>network</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
