<?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>DEV Community: coadaflorin</title>
    <description>The latest articles on DEV Community by coadaflorin (@coadaflorin).</description>
    <link>https://dev.to/coadaflorin</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%2F295134%2Fcdaf9319-7030-45e1-9d47-9b3e03b9771d.jpg</url>
      <title>DEV Community: coadaflorin</title>
      <link>https://dev.to/coadaflorin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/coadaflorin"/>
    <language>en</language>
    <item>
      <title>AppSec: Some testing technique explained DAST, SAST, IAST, OSA/SCA</title>
      <dc:creator>coadaflorin</dc:creator>
      <pubDate>Mon, 13 Apr 2020 17:56:25 +0000</pubDate>
      <link>https://dev.to/coadaflorin/appsec-some-testing-technique-explained-dast-sast-iast-osa-sca-1k38</link>
      <guid>https://dev.to/coadaflorin/appsec-some-testing-technique-explained-dast-sast-iast-osa-sca-1k38</guid>
      <description>&lt;p&gt;If you're writing code for one of the many companies out there that care about security there's a chance you heard these acronyms before. If you did not, I'll prepare you in advance for when that happens and try to explain as well as I can what they mean and what they do. &lt;/p&gt;

&lt;h1&gt;
  
  
  What's AppSec Testing?
&lt;/h1&gt;

&lt;p&gt;Application security testing is the process of looking for potential security vulnerabilities in applications. The purpose is to identify them as early as possible in the SDLC, to reduce the remediation costs. Patching issues for an app in production will always be much more expensive than fixing something when you write the code. There are several approaches that people employ to handle this problem. In this post, I'll do a quick run through them. If there's interest in this I'll do a follow-up with pros and cons. &lt;/p&gt;

&lt;h2&gt;
  
  
  Penetration Testing
&lt;/h2&gt;

&lt;p&gt;Despite what by some could be found as a funny name [I often get some giggles from the audience when pronouncing this one for some reason], this is one of the oldest methods of testing applications. &lt;strong&gt;OLD != bad&lt;/strong&gt; &lt;br&gt;
Pen Testing is usually performed by one or more ethical hackers, that will try to infiltrate a system. When directed to applications, this could start: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;No Knowledge of the app - BlackBox Testing&lt;/li&gt;
&lt;li&gt;Some knowledge of the app and how it works - GrayBox Testing&lt;/li&gt;
&lt;li&gt;Complete knowledge of the application and access to code, credentials, etc - WhiteBox Testing &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;_Remember these terms, White, Gray, Black, they apply to other areas of security such as White/Gray/Black Hat hackers, and even other AppSec testing techniques.  &lt;/p&gt;

&lt;p&gt;The main benefit of Pen Testing is the thoroughness you can get, but they can be slow and good hackers don't come cheap. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fcoadaflorin%2FmyImgRepo%2Fblob%2Fmaster%2Fscanners%2Fpen%2520testing%2520white%2520bg.png%3Fraw%3Dtrue" 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%2Fgithub.com%2Fcoadaflorin%2FmyImgRepo%2Fblob%2Fmaster%2Fscanners%2Fpen%2520testing%2520white%2520bg.png%3Fraw%3Dtrue" alt="pentest"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  DAST
&lt;/h2&gt;

&lt;p&gt;Known as, Dynamic Application Security Testing, this is the oldest form of &lt;em&gt;automated&lt;/em&gt; security testing. &lt;br&gt;
The story goes that a long time ago a &lt;strong&gt;Web Application Firewall*&lt;/strong&gt; company was looking at ways to prove the value of their product. The *&lt;strong&gt;WAF&lt;/strong&gt; is supposed to block external attacks. To show the value of their tool, some engineers wrote a little tool that would find some of these vulnerabilities in web applications, show how they can be exploited and then deploy the &lt;strong&gt;WAF&lt;/strong&gt; to show how effective it is. Well, during one demo a customer said, "You're WAF's all nice'n all, but what about that other tool that finds the issues? I want that one." &lt;/p&gt;

&lt;p&gt;This is how DAST came to be. It is a BlackBox (some would say Gray at times) scanner, that can test Web Applications and APIs. The important thing to understand about that it's that it behaves like a "&lt;em&gt;hacker in a box&lt;/em&gt;". It contains a series of tests, that can reveal potential weaknesses in the tested applications. The testing is request based, meaning that the tool will first map out your app or API using various techniques and then will send a LOT [&lt;strong&gt;and I mean A LOT!&lt;/strong&gt;] of tests to the targeted app. Based on the response of the App, the tool can then decide if there's something to be worried or not. &lt;/p&gt;

&lt;p&gt;The main benefit of this technique is that it works for most web applications (mostly HTTP focused though), the findings are fairly accurate and can test both production and staging applications.&lt;br&gt;
On the downside automation is possible, but because everything is request based, this is the slowest form of Automated testing. With modern cloud hosting for apps, there's at times a need to notify providers that testing is being done, so your tests don't get sucked into the cloud provider's firewall. Pen Testers also leverage DAST to do quick checks of the apps before they start going for more advanced testing techniques. Developers are not super excited about the findings because they don't directly point to the vulnerable line of code or construct. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fcoadaflorin%2FmyImgRepo%2Fblob%2Fmaster%2Fscanners%2FDAST%2520scanner%2520white%2520bg.png%3Fraw%3Dtrue" 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%2Fgithub.com%2Fcoadaflorin%2FmyImgRepo%2Fblob%2Fmaster%2Fscanners%2FDAST%2520scanner%2520white%2520bg.png%3Fraw%3Dtrue" alt="dast"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  SAST
&lt;/h2&gt;

&lt;p&gt;The next technology that came to market was Static Application Security Testing, which abbreviates to SAST. &lt;br&gt;
SAST is a white box scanner. The SAST tools look at potentially dangerous patterns in your application code, bytecode or binaries, which will be used to highlight findings that will be of interest. (Eg. User input gets appended to database query unsanitised).  You probably noticed I said "potentially" and "highlight findings". The reason I phrased things this way is because SAST is mostly theoretical analysis. It's not the testing DAST does where it sends a request, it mostly analyses code patterns. &lt;/p&gt;

&lt;p&gt;When reviewing the "code"[code, bytecode or binaries] SAST tools will lack the context of where the application is running or what it's trying to do. This means that a finding that can be a vulnerability for some, could be intentional behaviour for others. One example would be if you're writing a banking app, you don't want to allow customers to run their own SQL queries. If there are patterns that show this behaviour as possible, the tools will flag them as SQL Injections and rightly so. However, if you're writing a back-end tool that allows you to easily work with SQL DBs and build your own queries, this behaviour is correct, but the tool will not be able to tell you the difference. It is up to you to decide if a "finding" is a vulnerability or not. &lt;/p&gt;

&lt;p&gt;However, the main benefit of this technique is that once you go past the initial hop of deciding what's of interest to you, it is very easy to automatically your applications during build or even from the IDE. SAST tools also integrate with many tools regularly found in development so using them it's usually just a case of setting up some connectors before we get started. A lot of developers also like the fact that it points directly to the suspect line of code or construct.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fcoadaflorin%2FmyImgRepo%2Fblob%2Fmaster%2Fscanners%2Fsast%2520scanner%2520white%2520bg.png%3Fraw%3Dtrue" 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%2Fgithub.com%2Fcoadaflorin%2FmyImgRepo%2Fblob%2Fmaster%2Fscanners%2Fsast%2520scanner%2520white%2520bg.png%3Fraw%3Dtrue" alt="sast"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  IAST
&lt;/h2&gt;

&lt;p&gt;Interactive Application Security Testing &lt;a href="https://github.com/coadaflorin/myImgRepo/blob/master/scanners/IAST%20scanner%20white%20bg.png?raw=true" rel="noopener noreferrer"&gt;IAST&lt;/a&gt;, it's an interesting one. It is a hybrid between Static &amp;amp; Dynamic of sorts, while at the same time it's not quite testing, it's more an analysis of sorts, like SAST. You can see this one as a grey box testing technique. This tool has been out in the market under various forms for a while now. The first iteration of this was used very closely tied to DAST. IAST agents would be deployed on application servers, and when a vulnerability was reported by the DAST scanner, the IAST agent would return the stack, files, line number to help you link the DAST issue to the code. A nice addition to DAST, but the scan times were quite long due to the nature of DAST.&lt;/p&gt;

&lt;p&gt;Modern iterations of IAST work similar, but there is a significant difference. There is no longer a need for a DAST tool to trigger the analysis anymore. Modern IAST agents can simply de deployed on an application server and during functional, QA and other types of testing, it can see the data passing through the application and makes a decision if that pattern followed by the data is dangerous or not. This is pretty similar to the logic used by SAST tools. If data comes from the user and gets appended to a SQL query, this could be dangerous. As long as there are requests that trigger the application to perform various actions, the IAST agent can investigate them and tell you if they're dangerous or not. &lt;/p&gt;

&lt;p&gt;This technique can be very fast and works great with APIs. However, it's only as good as your functional/QA testing. If your testing is not up to speed, then you will not really get a lot of value from it since you need to trigger those flows in order to be investigated. One important thing to note is that while you might think, "Hey, I can run this in production and see if something's wrong there" keep in mind that the results will usually show you the requests that cause this issue. Using this in production environments could easily breach various privacy laws. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fcoadaflorin%2FmyImgRepo%2Fblob%2Fmaster%2Fscanners%2FIAST%2520scanner%2520white%2520bg.png%3Fraw%3Dtrue" 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%2Fgithub.com%2Fcoadaflorin%2FmyImgRepo%2Fblob%2Fmaster%2Fscanners%2FIAST%2520scanner%2520white%2520bg.png%3Fraw%3Dtrue" alt="iast"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  SCA/OSA
&lt;/h2&gt;

&lt;p&gt;Software Composition Analysis (SCA) or Open Source Analysis(OSA) talks about testing 3rd party components/libraries used in your applications. I'd say this is a pretty straight forward testing approach that a lot of people understand. Vulnerabilities show up in 3rd party libraries all the time. As researchers find more and more vulnerabilities, it's hard to keep track of all your libraries and review the security bulleting for all of them. Most time as a developer you'll find something you need to use and import it with your dependency manager of choice. To solve this, OSA will check a lot of security bulletin databases, some public some private, and let you know of any potential vulnerabilities for the libraries you are using. A popular one you might want to check to see how these things look like is &lt;a href="https://nvd.nist.gov/search" rel="noopener noreferrer"&gt;NVD&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The benefit of SCA/OSA scanner is that they are very fast and they can keep you up to date on the latest vulnerabilities for the libraries you are using. What's more, some tools will even help you move (some pretty much automatically) to a version with less risk/vulnerabilities without you having to do any code reforging to cope with new/deprecated APIs. &lt;/p&gt;

&lt;p&gt;Another benefit of this technology is that such scanners can check the licenses attached to each library. This will make it easier for you to stay out of trouble for using a library with a license that could have a negative impact on you. There are some approaches here, some do this as a stand-alone scan, some do it at the same time SAST, some even check if you're actually using the component reported as vulnerable. There are quite a few tools with cool features to choose from. &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.com%2Fcoadaflorin%2FmyImgRepo%2Fblob%2Fmaster%2Fscanners%2FOSA%2520scanner%2520white%2520bg.png%3Fraw%3Dtrue" 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%2Fgithub.com%2Fcoadaflorin%2FmyImgRepo%2Fblob%2Fmaster%2Fscanners%2FOSA%2520scanner%2520white%2520bg.png%3Fraw%3Dtrue" alt="osa"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  End of
&lt;/h3&gt;

&lt;p&gt;So, to summarise I'll use the car service approach:&lt;br&gt;
Pen Testing - Intensive servicing work done by the Mechanic &lt;br&gt;
DAST - Mechanic listening to your car to see what sounds off or maybe doing a very quick drive&lt;br&gt;
IAST - Connecting your car to a diagnostics system to see what goes on when you drive it&lt;br&gt;
SAST - Reviewing the car blueprints to see design flaws &lt;br&gt;
OSA/SCA - Checking the parts you put in your car are not broken/poor quality&lt;/p&gt;

</description>
      <category>appsec</category>
      <category>security</category>
    </item>
    <item>
      <title>Quick Security in VS Code with CodeSweep</title>
      <dc:creator>coadaflorin</dc:creator>
      <pubDate>Tue, 07 Apr 2020 13:01:12 +0000</pubDate>
      <link>https://dev.to/coadaflorin/quick-security-in-vs-code-with-codesweep-1b20</link>
      <guid>https://dev.to/coadaflorin/quick-security-in-vs-code-with-codesweep-1b20</guid>
      <description>&lt;p&gt;&lt;em&gt;I'll start with a disclosure and mention that I'm working for the company that put out this product (HCL AppScan), but I'm writing this as Florin, the guy who write some code and has an interest in Security.&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;Tl;DR: here's a video: &lt;a href="https://www.youtube.com/watch?v=zQvonHi4ak8"&gt;https://www.youtube.com/watch?v=zQvonHi4ak8&lt;/a&gt;&lt;br&gt;
plugin here: &lt;a href="https://hclsw.co/codesweep"&gt;https://hclsw.co/codesweep&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the recent years everyone's been talking more about security, cybersec, IT security, cyber, etc. If you're a developer and did not hear about any of these, I would be very surprised. &lt;br&gt;
One of the key areas companies have been focusing lately is application security. The area of security that focuses on securing applications and making sure they can't be exploited to hurt the company, the customers or its partners. You've seen this happening a bunch of times to various companies. Just a quick Google search could produce a very interesting list for you. There's various types of vulnerabilities that could be exploited to produce harm. I'll classify them in 2 main categories: proprietary code (your code) and 3rd party code (libraries). &lt;/p&gt;

&lt;p&gt;The purpose of HCL AppScan CodeSweep is to help you find potential vulnerabilities in your code as you introduce them. They range from Cross Scripting, SQL Injection, hardcoded credentials, OS Injections to old encryption algorithms, and so on. Created as a VS Code plugin the tool will review your files upon saving them. If there's something potentially dangerous we'll flag it. This will give you two options: Fix it or ignore it. It's up to you what risk you're willing to take, but try to understand the issue before jumping to the conclusion it's not a problem. :) &lt;/p&gt;

&lt;p&gt;If you have any questions feel free to join the community. &lt;/p&gt;

&lt;p&gt;Without adding more words to something that shouldn't take more than 140 characters, you can get the plugin here: &lt;a href="https://hclsw.co/codesweep"&gt;https://hclsw.co/codesweep&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And you can join our community here: &lt;a href="https://hclsw.co/CodeSweepCommunityInvite"&gt;https://hclsw.co/CodeSweepCommunityInvite&lt;/a&gt;&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>appsec</category>
      <category>sast</category>
      <category>security</category>
    </item>
  </channel>
</rss>
