<?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: Mike Rozner</title>
    <description>The latest articles on DEV Community by Mike Rozner (@apimike).</description>
    <link>https://dev.to/apimike</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%2F880948%2Ff76bd8b5-8c77-443a-8860-aa82ac0142fb.jpg</url>
      <title>DEV Community: Mike Rozner</title>
      <link>https://dev.to/apimike</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/apimike"/>
    <language>en</language>
    <item>
      <title>An API Validation Aggravation</title>
      <dc:creator>Mike Rozner</dc:creator>
      <pubDate>Thu, 25 Aug 2022 09:48:00 +0000</pubDate>
      <link>https://dev.to/apimike/an-api-validation-aggravation-1fif</link>
      <guid>https://dev.to/apimike/an-api-validation-aggravation-1fif</guid>
      <description>&lt;h2&gt;
  
  
  API specification validation
&lt;/h2&gt;

&lt;p&gt;API specification validation is the process of verifying that an API meets all the requirements specified in its documentation. This includes making sure that the API responds correctly to all requests, that it gives back the right data, and that it doesn't give back any data that wasn't expected.&lt;/p&gt;

&lt;p&gt;It is an important part of the development process as it ensures that the API behaves as expected and that it meets all the requirements of its users. It is also a good way to catch any errors or bugs in the API before they are released to the public.&lt;/p&gt;

&lt;p&gt;API specification validation can be done manually or automatically. By running a series of tests against an API and looking at the results, automated testing tools can make it easier to check if it meets its requirements.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hand testing API
&lt;/h2&gt;

&lt;p&gt;An API can also be tested by hand, but this can take more time and may require more knowledge of the API and how it works.&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%2Fyoncunilo33dkl28w7ei.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%2Fyoncunilo33dkl28w7ei.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;API validation is an important part of developing and releasing a new API. It helps to ensure that the API behaves as expected and that it meets all the requirements of its users. Validating an API can be made easier with automated testing tools and &lt;a href="https://github.com/blst-security/cherrybomb" rel="noopener noreferrer"&gt;CI/CD integrated validation&lt;/a&gt; 💡 tools, but it can also be done by hand.&lt;/p&gt;

&lt;p&gt;When it comes to documenting APIs, there are few tools as widely used and supported as Swagger. In fact, Swagger has become so popular that it is now known as the de facto standard for API documentation.&lt;/p&gt;

&lt;h2&gt;
  
  
  The swagger flaws
&lt;/h2&gt;

&lt;p&gt;But Swagger is not without its flaws, and there’s a new kid on the block that promises to address some of the shortcomings of Swagger 2.0: OpenAPI 3.0.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In this article, we’ll also take a look at the key differences between Swagger 2.0 and OpenAPI 3.0.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;OpenAPI 3.0 is the latest version of the OpenAPI Specification, and it’s not backwards compatible with Swagger 2.0.&lt;/p&gt;

&lt;p&gt;One of the most significant changes in OpenAPI 3.0 is the addition of a new required field: info. This field takes the place of the old swagger.info field. It has information about the API, like the title, description, and how to get in touch with the developers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here are some of the changes.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Host" and "BasePath" combine to form a "Target". In Swagger 2, you declare a single host and base path for all of your resources and operations.&lt;/li&gt;
&lt;li&gt;The parameters are defined at the top level of the resources. In Swagger 2, you define parameters in the operations.&lt;/li&gt;
&lt;li&gt;You can define multiple paths for a resource. In Swagger 2, you can only define one path per resource.&lt;/li&gt;
&lt;li&gt;You can define multiple operations for a resource. In Swagger 2, you can only define one operation per resource.&lt;/li&gt;
&lt;li&gt;You can define multiple responses for an operation. In Swagger 2, you can only define one response per operation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Another notable change is the removal of the consume and produce fields in favor of a new field called requestBody. This new field is used to describe the request body of an API operation.&lt;/p&gt;

&lt;p&gt;In OpenAPI 3.0, the term "schema" has been replaced with the term "media type". This change was made to be more consistent with the way media types are used in HTTP.&lt;/p&gt;

&lt;h2&gt;
  
  
  Significant change in OpenAPI 3.0
&lt;/h2&gt;

&lt;p&gt;Perhaps the most significant change in OpenAPI 3.0 is the addition of the Components object. This object contains a collection of reusable objects that can be used in the specification. Examples of objects that can be stored in the Components object include schemas, responses, parameters, and examples.&lt;/p&gt;

&lt;p&gt;One of the main goals of OpenAPI 3.0 is to be more easily readable and understandable by humans. To that end, the specification includes a new feature called links. Links are used to describe relationships between resources.&lt;/p&gt;

&lt;p&gt;Another goal of OpenAPI 3.0 is to make it easier for tools to generate code and documentation from the specification. To that end, OpenAPI 3.0 includes the concept of callbacks. Callbacks are functions that the API provider can use when certain events happen.&lt;/p&gt;

&lt;p&gt;Overall, OpenAPI 3.0 is a major evolution of the OpenAPI Specification. Even though it doesn't work with Swagger 2.0, it fixes many of the problems with its predecessor. &lt;/p&gt;

&lt;h2&gt;
  
  
  Not everything is fairytale
&lt;/h2&gt;

&lt;p&gt;There are a few reasons why it might not be possible to convert a Swagger file to OpenAPI 3.0 specification:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Swagger file might be using features that are not yet supported in OpenAPI 3.0. For example, Swagger 2.0 supports arrays and objects as data types, but these are not yet supported in OpenAPI 3.0.&lt;/li&gt;
&lt;li&gt;The Swagger file might be using features that are no longer supported in OpenAPI 3.0. For example, Swagger 2.0 supported the "any" data type, but this has been replaced with the more specific "oneOf" in OpenAPI 3.0.&lt;/li&gt;
&lt;li&gt;The Swagger file might be using deprecated features that have been replaced in OpenAPI 3.0. For example, the "paths" object in Swagger 2.0 has been replaced by the "paths" and "servers" objects in OpenAPI 3.0.&lt;/li&gt;
&lt;li&gt;The Swagger file might be using a different file format than OpenAPI 3.0. Swagger 2.0 used the "swagger.json" or "swagger.yaml" format, while OpenAPI 3.0 uses the "openapi.json" or "openapi.yaml" format.&lt;/li&gt;
&lt;li&gt;The Swagger file might be using a different version of the Swagger specification than OpenAPI 3.0. For example, Swagger 2.0 is based on the Swagger specification version 2.0, while OpenAPI 3.0 is based on the Swagger specification version 3.0.0.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Even if all of these factors are accounted for, it might still not be possible to convert a Swagger file to OpenAPI 3.0 due to incompatibilities between the two specifications. Swagger 2.0 and OpenAPI 3.0 are both based on the same underlying data model, but there are a number of subtle differences between the two specifications. These differences can lead to problems when converting files from one format to the other.&lt;/p&gt;

&lt;p&gt;Don't forget to visit my &lt;a href="https://apimike.com" rel="noopener noreferrer"&gt;API Security&lt;/a&gt; website&lt;/p&gt;

</description>
      <category>api</category>
      <category>openapi</category>
      <category>opensource</category>
      <category>swagger</category>
    </item>
    <item>
      <title>Closing that busines logic attack vector</title>
      <dc:creator>Mike Rozner</dc:creator>
      <pubDate>Mon, 27 Jun 2022 12:16:55 +0000</pubDate>
      <link>https://dev.to/apimike/closing-that-busines-logic-attack-vector-26bb</link>
      <guid>https://dev.to/apimike/closing-that-busines-logic-attack-vector-26bb</guid>
      <description>&lt;h3&gt;
  
  
  Lets start with the steps
&lt;/h3&gt;

&lt;p&gt;🩴The first step in protecting your data is knowing where it is stored and who has access to it. Make sure you have a list of all the places where your sensitive data is stored, including both digital and physical locations. Then, review who has access to each location. If possible, restrict access to only those who absolutely need it.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Implement security measures like firewalls and encryption.
&lt;/h3&gt;

&lt;p&gt;Once you know where your sensitive data is stored, you can start implementing security measures to protect it. Firewalls and encryption are two of the most important measures you can take. Firewalls can help prevent unauthorized access to your network, while encryption can make it difficult for hackers to read your data even if they are able to access it.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Educate your employees about security risks and best practices.
&lt;/h3&gt;

&lt;p&gt;Your employees are one of your biggest assets when it comes to protecting your data. Make sure they are aware of the risks and that they know the best practices for keeping their information safe. This includes things like using strong passwords, not sharing passwords with others, and not clicking on links from unknown sources.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Stay &lt;strong&gt;uptodate&lt;/strong&gt; on the latest security threats.
&lt;/h3&gt;

&lt;p&gt;Threats are constantly evolving, so it’s important to stay uptodate on the latest security risks. One way to do this is to subscribe to security newsletters or RSS feeds. This will help you stay informed about new threats so you can take steps to protect your business.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Have a plan in place in case of a data breach.
&lt;/h3&gt;

&lt;p&gt;Despite taking all the precautions, there’s always a chance that your business could be affected by a data breach. That’s why it’s important to have a plan in place for how you would handle such a situation. This plan should include steps for how you would notify customers, what steps you would take to secure your data, and how you would prevent future breaches from happening&lt;/p&gt;

&lt;h3&gt;
  
  
  The Consequences of a Data Breach
&lt;/h3&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%2Fhrgciik2ty7notzulnyj.jpg" 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%2Fhrgciik2ty7notzulnyj.jpg" alt="The worst what the fuck game in the world"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above steps will bring your security to a good balance, but your F$%&amp;amp;ed if you got to this point reading, as none of the above will help you in stopping a dedicated business logic attack.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is business logic attacks 🧠
&lt;/h3&gt;

&lt;p&gt;A business logic attack is an attack on the application layer of a system that targets the consistency, correctness, and integrity of the data and processes. This type of attack exploits vulnerabilities in the way that the business logic is implemented, often resulting in data or process corruption.&lt;/p&gt;

&lt;p&gt;There are many reasons why it is complex to defend against business logic attacks. One reason is that attackers can exploit many different types of vulnerabilities to gain access to sensitive data or systems. Another reason is that attackers can use a variety of techniques to bypass security controls or to disguise their activities. Finally, businesses often have complex networks and systems, which makes it difficult to identify and fix vulnerabilities.&lt;/p&gt;

&lt;p&gt;In my next articles I will begin a series talking about way to defend from business logic attacks.&lt;/p&gt;

</description>
      <category>api</category>
      <category>apisecurity</category>
      <category>devops</category>
      <category>security</category>
    </item>
  </channel>
</rss>
