<?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: Kostas P.</title>
    <description>The latest articles on DEV Community by Kostas P. (@kauth).</description>
    <link>https://dev.to/kauth</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%2F534727%2F59418681-715f-4655-a6ff-ff2490586fa9.jpeg</url>
      <title>DEV Community: Kostas P.</title>
      <link>https://dev.to/kauth</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kauth"/>
    <language>en</language>
    <item>
      <title>How to ace your PSM I assessment</title>
      <dc:creator>Kostas P.</dc:creator>
      <pubDate>Thu, 26 May 2022 17:35:39 +0000</pubDate>
      <link>https://dev.to/kauth/how-to-ace-your-psm-i-assessment-1ofk</link>
      <guid>https://dev.to/kauth/how-to-ace-your-psm-i-assessment-1ofk</guid>
      <description>&lt;p&gt;&lt;em&gt;The Professional Scrum Master level I (PSM I) certification from Scrum.org&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Mastering Scrum is a continuous process that requires a lot of on-hand practice. Acquiring a certification is not the end, but merely the beginning of this learning path.&lt;/p&gt;

&lt;p&gt;A Scrum certification, such as the PSM I, can be a great opportunity for beginners to get acquainted with the Scrum framework or for more advanced individuals to solidify and prove their knowledge.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;People who have passed PSM I, achieving certification, demonstrate a fundamental level of Scrum mastery. PSM I certificate holders prove that they understand Scrum as described in the Scrum Guide and how to apply Scrum in Scrum Teams. PSM I holders have a consistent terminology and approach to Scrum. (&lt;a href="https://www.scrum.org/professional-scrum-certifications/professional-scrum-master-assessments"&gt;from Scrum.org&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this article, I will share some of the resources and methodologies I gathered when studying for the PSM I exam. This is not an exhaustive list (I would like to add more items after feedback from readers), it is a proposal of how one can start getting set for their exams.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to prepare 📖
&lt;/h2&gt;

&lt;p&gt;The order in which the following points are written is indicative of the ones to start with.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Learn more about the PSM I certification&lt;/strong&gt;&lt;br&gt;
Before getting your hands dirty and going into the deep with PSM I study material, read about the general overview of the PSM I certification at &lt;a href="https://www.scrum.org/professional-scrum-master-i-certification"&gt;https://www.scrum.org/professional-scrum-master-i-certification&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Read the Scrum Guide&lt;/strong&gt;&lt;br&gt;
Scrum Guide: &lt;a href="https://scrumguides.org/index.html"&gt;https://scrumguides.org/index.html&lt;/a&gt;&lt;br&gt;
The Scrum Guide has more than one version, so make sure to be reading from the latest one available. At the time of writing, this is the “Scrum Guide 2020".&lt;br&gt;
&lt;em&gt;The Scrum Guide should be your go-to place for any Scrum-theory dilemma.&lt;/em&gt;&lt;br&gt;
I would suggest studying from the digital version, since it’s easily searchable (Ctrl+F), highlighting, taking notes on the PDF file, etc. You can also copy-paste specific parts from the guide into a personal note-space, with items that you find are really important or that you easily forget. This way, everything you want to review is centrally and quickly accessible.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Practice with Open Assessments&lt;/strong&gt;&lt;br&gt;
Open Assessments: &lt;a href="https://www.scrum.org/open-assessments"&gt;https://www.scrum.org/open-assessments&lt;/a&gt;&lt;br&gt;
These assessments provide a free way to practice for your Professional Scrum certification assessments.&lt;br&gt;
Do note that the questions on &lt;em&gt;the Open Assessments do not have the same level of difficulty as the certification assessments.&lt;/em&gt;&lt;br&gt;
In order of relevance for your PSM I preparation, try: &lt;a href="https://www.scrum.org/open-assessments/scrum-open"&gt;Scrum Open&lt;/a&gt;, &lt;a href="https://www.scrum.org/open-assessments/product-owner-open"&gt;Product Owner Open&lt;/a&gt;, &lt;a href="https://www.scrum.org/open-assessments/scrum-developer-open"&gt;Scrum Developer Open&lt;/a&gt;&lt;br&gt;
I suggest taking the Open Assessment multiple times and, once again, keeping into a personal note-space the questions you get wrong frequently or want to review (plus after you finish each assessment there is a very helpful &lt;em&gt;Feedback&lt;/em&gt; section for every question).&lt;br&gt;
Try to get a streak of 3–4 assessments with a score of 100%, this will increase your speed and knowledge of the Scrum fundamentals.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Up to this point, the study material is free and comes from sources that we can consider credible regarding what is deemed correct for the PSM I assessment since it all originates from Scrum.org.&lt;br&gt;
In my opinion, this is the minimum one should study to assemble the necessary knowledge and succeed in the assessment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Other tips 📌
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Don’t &lt;a href="https://en.wiktionary.org/wiki/cargo_culting"&gt;cargo-cult&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
While studying, it is important to understand the &lt;em&gt;why&lt;/em&gt; and not just memorize terms. This will help you both in the assessment, and also when you, later on, have to apply Scrum to real-life problems.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Read the &lt;a href="https://www.scrum.org/resources/scrum-glossary"&gt;Scrum Glossary&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
An overview of Scrum-related terms&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;More advanced reads&lt;/strong&gt;&lt;br&gt;
‣ &lt;a href="https://www.scrum.org/pathway/scrum-master"&gt;Scrum Master Learning Path&lt;/a&gt;&lt;br&gt;
‣ &lt;a href="https://www.scrum.org/professional-scrum-competencies"&gt;The Professional Scrum Competencies&lt;/a&gt;&lt;br&gt;
‣ &lt;a href="https://scrumguides.org/revisions.html"&gt;Changes between 2017 and 2020 Scrum Guides&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Free 3rd party practice tests&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;A note of caution here&lt;/strong&gt;:&lt;br&gt;
&lt;em&gt;The answers on these assessments may not always be considered correct (they do not necessarily derive from Scrum.org).&lt;br&gt;
Make sure that these tests consist of questions/answers based on the latest version of the Scrum Guide.&lt;/em&gt;&lt;br&gt;
List:&lt;br&gt;
‣ &lt;a href="https://mplaza.training/exam-simulators/psm/"&gt;https://mplaza.training/exam-simulators/psm/&lt;/a&gt;&lt;br&gt;
‣ &lt;a href="https://mlapshin.com/index.php/scrum-quizzes/sm-real-mode/"&gt;https://mlapshin.com/index.php/scrum-quizzes/sm-real-mode/&lt;/a&gt; &lt;em&gt;(&lt;strong&gt;based on the Scrum Guide v2017&lt;/strong&gt;, update for v2020 is in progress)&lt;/em&gt;&lt;br&gt;
‣ &lt;a href="https://www.thescrummaster.co.uk/assessments/scrum-guide-2020-update-practice-assessment/"&gt;https://www.thescrummaster.co.uk/assessments/scrum-guide-2020-update-practice-assessment/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The exam 📝
&lt;/h2&gt;

&lt;p&gt;You can find the specific instructions on how to register for the exam at &lt;a href="https://www.scrum.org"&gt;https://www.scrum.org&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;At the time of writing, some &lt;a href="https://www.scrum.org/professional-scrum-master-i-certification"&gt;PSM I details&lt;/a&gt; are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Passing score:&lt;/strong&gt; &lt;em&gt;85%&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Time limit:&lt;/strong&gt; &lt;em&gt;60 minutes&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Number of Questions:&lt;/strong&gt; &lt;em&gt;80&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;meaning an average of 45 seconds per question.&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Format:&lt;/strong&gt; &lt;em&gt;Multiple Choice, Multiple Answer and True/False&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Language:&lt;/strong&gt; &lt;em&gt;English only&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Required course:&lt;/strong&gt; &lt;em&gt;None&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Scrum.org certification requires a minimum score on an online assessment. Attending a course is neither required nor sufficient for certification.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://www.scrum.org/certification-list"&gt;List of Professional Scrum Certificate Holders&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  References &amp;amp; Other study material 📚
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.scrum.org/forum/scrum-forum/14149/i-just-passed-psm1-my-selft-how-prepare?gclid=CjwKCAjwjtOTBhAvEiwASG4bCJ5uF9UHQWDc8yrfsdlb6VeqWgGB6cGk9dKs9VAN0NShbkhHUR5yxBoCyA8QAvD_BwE"&gt;Scrum Forum:I just passed the PSM1 for my self… How to prepare&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.linkedin.com/pulse/how-prepare-pass-professional-scrum-master-i-psm-boris-magas/"&gt;https://www.linkedin.com/pulse/how-prepare-pass-professional-scrum-master-i-psm-boris-magas/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://scrumprep.com/"&gt;https://scrumprep.com/&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Disclaimer:&lt;/strong&gt; None of the above material constitutes an endorsement.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Originally published at &lt;a href="https://konpap.medium.com/how-to-ace-your-psm-i-assessment-643c3df7883d"&gt;https://medium.com&lt;/a&gt; on May 7, 2022.&lt;/p&gt;

</description>
      <category>scrum</category>
      <category>psm1</category>
      <category>agile</category>
      <category>scrummaster</category>
    </item>
    <item>
      <title>Hacking my IP camera</title>
      <dc:creator>Kostas P.</dc:creator>
      <pubDate>Mon, 04 Jan 2021 17:00:26 +0000</pubDate>
      <link>https://dev.to/kauth/hacking-my-ip-camera-4fa7</link>
      <guid>https://dev.to/kauth/hacking-my-ip-camera-4fa7</guid>
      <description>&lt;h2&gt;
  
  
  Deauthentication Attack + Physical Security
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;DISCLAIMER: All data and information provided in this article are for informational purposes only. The main goal is to increase security awareness, teach about information security, countermeasures and give readers information on how to implement a safe and functional system. If you plan to use the information for illegal purposes, please leave this website now.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A few days ago &lt;strong&gt;a friend of mine purchased and installed a new Wi-Fi IP camera at his house&lt;/strong&gt;. Wanting to know how safe the system really was &lt;strong&gt;he asked me to take a look and try to “hack” it if possible&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The truth is that the Internet of Things (IoT) is a really hot trend at the moment and &lt;strong&gt;&lt;em&gt;a lot of devices are being distributed into the market, many of which are not that reliable or safe&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;IP cameras are a nice example of such devices that have invaded many households (or even small businesses in some cases) as a smart solution for surveillance and security.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IBvcgQ0v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/iuibclo3d4qxl06muh57.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IBvcgQ0v--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/iuibclo3d4qxl06muh57.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Getting to the point now, &lt;strong&gt;I tried to hack the cameras using two generic techniques&lt;/strong&gt;, not focusing on finding a specific software vulnerability. The two methods I used were a &lt;strong&gt;Deauthentication Attack&lt;/strong&gt; and a &lt;strong&gt;Physical Security Attack&lt;/strong&gt;. So let’s take a closer look at them:&lt;/p&gt;

&lt;h2&gt;
  
  
  Deauthentication Attack
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;A Wi-Fi deauthentication attack is a type of denial-of-service attack that targets communication between a user and a Wi-Fi wireless access point.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;With this attack, one can &lt;strong&gt;&lt;em&gt;disconnect a client from the access point that it is connected to&lt;/em&gt;&lt;/strong&gt;. For more details check out the following links: &lt;a href="https://en.wikipedia.org/wiki/Wi-Fi_deauthentication_attack"&gt;https://en.wikipedia.org/wiki/Wi-Fi_deauthentication_attack&lt;/a&gt; and &lt;a href="https://www.aircrack-ng.org/%7E%7EV:/doku.php?id=deauthentication"&gt;https://www.aircrack-ng.org/~~V:/doku.php?id=deauthentication&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EIcMvmJN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/kh2s98sasztza85bik9u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EIcMvmJN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/kh2s98sasztza85bik9u.png" alt="Alt Text" title="Sequence diagram for a Wi-Fi deauthentication attack"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Deauthentication Attack&lt;/strong&gt; falls under the category of &lt;strong&gt;pre-connection attacks&lt;/strong&gt;, meaning you can &lt;strong&gt;disconnect any device&lt;/strong&gt; from &lt;strong&gt;any network&lt;/strong&gt; before connecting to any of these networks and therefore &lt;strong&gt;without&lt;/strong&gt; the need to know the &lt;strong&gt;password for the network&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Having said that, it was possible to disconnect the IP camera from the access point it was connected to (&lt;strong&gt;without having the AP password&lt;/strong&gt;, as I mentioned earlier, since there wasn’t even the need to connect to the network), making it useless.&lt;/p&gt;

&lt;p&gt;The camera would on normal occasions detect movement and/or noise and notify the user with an email if something was detected. Instead, &lt;strong&gt;&lt;em&gt;during the attack the video feedback of the IP camera app was frozen and no notifications were sent when we triggered the sensors with motion and sound&lt;/em&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Below is &lt;strong&gt;the code I used for this simple attack&lt;/strong&gt; (for a more detailed analysis on how to perform a deauthentication attack there is a great article on &lt;a href="https://hackernoon.com/forcing-a-device-to-disconnect-from-wifi-using-a-deauthentication-attack-f664b9940142"&gt;Hacker Noon&lt;/a&gt;):&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deauthenticating specifically the IP camera (only one client)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aireplay-ng --deauth [number of deauth packets] -a [AP MAC address] -c [IP camera MAC address] [interface]

Ex: aireplay-ng --deauth 1000 -a 11:22:33:44:55:66 -c 00:AA:11:22:33:44 mon0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can possibly find the MAC address of the IP camera if you know the device’s brand since &lt;strong&gt;the first 6-digits of a MAC address identify the manufacturer&lt;/strong&gt; (&lt;a href="https://macvendors.com"&gt;https://macvendors.com&lt;/a&gt;). You can also try to speculate which is the AP’s MAC address by the name of the SSID. Otherwise, you can use a more wide attack with the code below.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deauthenticating all clients in a specific network&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aireplay-ng --deauth [number of packets] -a [AP MAC address] [interface]

Ex: aireplay-ng --deauth 1000 -a 11:22:33:44:55:66 mon0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That wouldn't be the case of course if the camera app was programmed to &lt;strong&gt;&lt;em&gt;periodically check the connection&lt;/em&gt;&lt;/strong&gt; with the router/device and report a lost connection by sending an email to the user for example.&lt;/p&gt;

&lt;p&gt;It is also important to point out, that if the IP camera had a &lt;strong&gt;&lt;em&gt;wired connection and not a wireless one&lt;/em&gt;&lt;/strong&gt;, this attack would not be possible. When using wireless communication we should always keep in mind that the medium is air and air is accessible to all (thus more “hackable”).&lt;/p&gt;

&lt;h2&gt;
  
  
  Physical Security Attack
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Physical security describes security measures that are designed to deny unauthorized access to facilities, equipment and resources and to protect personnel and property from damage or harm (such as espionage, theft, or terrorist attacks).&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It doesn’t do much if you have top quality security “software-wise”, but &lt;strong&gt;&lt;em&gt;the physical devices you are trying to secure are not themselves placed somewhere safe&lt;/em&gt;&lt;/strong&gt;. In our case, the &lt;strong&gt;local distribution frame&lt;/strong&gt; box, where the internet-telephone cables terminate, was in front of my friend's house and &lt;strong&gt;unlocked&lt;/strong&gt;. It would be very easy for someone to &lt;strong&gt;intervene&lt;/strong&gt; in the cabinet, &lt;strong&gt;cut the cables&lt;/strong&gt; and &lt;strong&gt;remove internet connection&lt;/strong&gt; thus disabling the IP camera.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dzIy2K9r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ul6m0zxa2fsim91xqlea.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dzIy2K9r--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ul6m0zxa2fsim91xqlea.jpeg" alt="Alt Text" title="Distribution frame"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Without an Internet connection, the user would be &lt;strong&gt;under the illusion that everything is secure&lt;/strong&gt; since he wouldn’t get an email notification (like he is supposed to if something is detected), and &lt;strong&gt;that his IP camera would alert him&lt;/strong&gt; as soon as someone tried to invade into his house, while the camera would have just stopped working without any warning.&lt;/p&gt;




&lt;p&gt;Below is an extract of a previous article I wrote, &lt;a href="https://hackernoon.com/iot-without-internet-how-does-it-affect-its-functionality-275cff90a018"&gt;“IoT without Internet… how does that affect its functionality?”&lt;/a&gt;, &lt;strong&gt;proposing a solution to this issue&lt;/strong&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;That is why I am proposing that IoT devices that are connected to the Internet should all include a &lt;strong&gt;basic feature&lt;/strong&gt;. That feature is &lt;strong&gt;to notify when internet connectivity is lost from the device&lt;/strong&gt;. If at the side of the IoT device there is no internet access, of course, there aren’t any means of sending an alert. That is why I am suggesting that &lt;strong&gt;at the client side app there should be monitoring&lt;/strong&gt; (at a rate that will be determined by the severity of the device’s task and need to be online) &lt;strong&gt;of the connection between device and controller app&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In our previous IP camera example, the i.e. &lt;strong&gt;smartphone app&lt;/strong&gt; would have &lt;strong&gt;detected the loss of internet connectivity&lt;/strong&gt; of the home router, the user would have been &lt;strong&gt;sent a notification&lt;/strong&gt;, thus taking the appropriate measures to &lt;strong&gt;resolve the problem&lt;/strong&gt; (calling the ISP, sending someone to check, etc).&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;Thanks for reading, leave a like ❤️🦄🔖 if you found the article interesting and of course your feedback 📝!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://medium.com/hackernoon/hacking-my-ip-camera-1ca66682a739"&gt;https://medium.com&lt;/a&gt; on May 02, 2019.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>hacking</category>
      <category>iot</category>
      <category>computers</category>
    </item>
    <item>
      <title>Postman Collection to Swagger UI Documentation</title>
      <dc:creator>Kostas P.</dc:creator>
      <pubDate>Tue, 29 Dec 2020 16:11:44 +0000</pubDate>
      <link>https://dev.to/kauth/postman-collection-to-swagger-ui-documentation-1bm5</link>
      <guid>https://dev.to/kauth/postman-collection-to-swagger-ui-documentation-1bm5</guid>
      <description>&lt;h2&gt;
  
  
  Project Goal 🎯
&lt;/h2&gt;

&lt;p&gt;In this article, we demonstrate how to convert documentation given as a &lt;a href="https://www.postman.com/collection/" rel="noopener noreferrer"&gt;Postman Collection&lt;/a&gt; (that is hosted online) to a Swagger formatted documentation (&lt;a href="https://swagger.io/docs/specification/about/" rel="noopener noreferrer"&gt;OpenAPI Specification&lt;/a&gt;), that is real-time updated according to the Postman Collection given in the beginning. &lt;/p&gt;

&lt;p&gt;To visualize and interact with the documentation we use &lt;a href="https://swagger.io/tools/swagger-ui/" rel="noopener noreferrer"&gt;Swagger UI&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;The technology the project is based on is &lt;a href="https://nodejs.org/en/about/" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;Besides the differences in the User Interface and the basic features between Swagger UI and Postman, there is another reason why we might want to use the former tool.&lt;/p&gt;

&lt;p&gt;At the time of writing, a Postman link is only a snapshot of your collection and you need to create a new link for the most up to date version (&lt;em&gt;source&lt;/em&gt; &lt;a href="https://learning.postman.com/docs/collaborating-in-postman/sharing/#sharing-by-link" rel="noopener noreferrer"&gt;Postman Docs&lt;/a&gt;). At least that is what is true about the free version, while there might be a solution to this limitation using Postman's Pro API (&lt;a href="https://support.postman.com/hc/en-us/articles/212510625-How-do-my-team-members-update-a-collection-link-that-I-created-" rel="noopener noreferrer"&gt;https://support.postman.com/hc/en-us/articles/212510625-How-do-my-team-members-update-a-collection-link-that-I-created-&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;With our implementation, if you are provided with a stable URL for accessing the documentation, you can always have the most up-to-date view of the API docs on Swagger UI, using only Node.js.&lt;/p&gt;

&lt;h2&gt;
  
  
  Specific Application 🎩
&lt;/h2&gt;

&lt;p&gt;The idea for this project was born from studying the &lt;a href="https://developer.skroutz.gr/api/v3/" rel="noopener noreferrer"&gt;API documentation of skroutz.gr&lt;/a&gt;, a Comparison Shopping Engine and e-commerce marketplace.&lt;/p&gt;

&lt;p&gt;The API was given in JSON as a Postman collection in the following &lt;a href="https://developer.skroutz.gr/assets/misc/skroutz_postman_collection.json" rel="noopener noreferrer"&gt;link&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So what we wanted to achieve was:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;to be able to visualize the documentation using Swagger UI&lt;/li&gt;
&lt;li&gt;our Swagger UI documentation to be updated periodically according to the JSON Postman collection that &lt;a href="https://www.skroutz.gr/" rel="noopener noreferrer"&gt;skroutz.gr&lt;/a&gt; initially provided (see &lt;a href="https://developer.skroutz.gr/assets/misc/skroutz_postman_collection.json" rel="noopener noreferrer"&gt;here&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Packages 📦
&lt;/h2&gt;

&lt;p&gt;Shortly, the packages we used for this project are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.npmjs.com/package/express" rel="noopener noreferrer"&gt;express&lt;/a&gt; - a minimalist web framework for node&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.npmjs.com/package/nodemon" rel="noopener noreferrer"&gt;nodemon&lt;/a&gt; - automatically restarts the node application when files change in the directory &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.npmjs.com/package/swagger-ui-express" rel="noopener noreferrer"&gt;swagger-ui-express&lt;/a&gt; - serves swagger-ui generated API docs from express&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.npmjs.com/package/node-fetch" rel="noopener noreferrer"&gt;node-fetch&lt;/a&gt; - a module to make HTTP requests&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.npmjs.com/package/fs" rel="noopener noreferrer"&gt;fs&lt;/a&gt; - access and interaction with the file system&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.npmjs.com/package/api-spec-transformer" rel="noopener noreferrer"&gt;api-spec-transformer&lt;/a&gt; - helps to convert between different API specifications&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.npmjs.com/package/yamljs" rel="noopener noreferrer"&gt;yamljs&lt;/a&gt; - a JavaScript YAML Parser &amp;amp; Encoder&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.npmjs.com/package/dotenv-safe" rel="noopener noreferrer"&gt;dotenv-safe&lt;/a&gt; - ensures that all necessary environment variables are defined&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Let's see some code 🐱‍💻
&lt;/h2&gt;

&lt;p&gt;As a beginner in Node.js myself, I advise you, if you are not aware of it, to study first a bit how Async Programming works in this particular programming language (suggested material: &lt;a href="https://blog.risingstack.com/node-hero-async-programming-in-node-js/" rel="noopener noreferrer"&gt;https://blog.risingstack.com/node-hero-async-programming-in-node-js/&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;As you can see below, in our &lt;em&gt;app.js&lt;/em&gt; file, we used the express package for our API framework and the swagger-ui-express package to produce API docs from express, based on a swagger.json or swagger.yaml file type.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const express = require("express");
const swaggerUi = require("swagger-ui-express");
const ymlfile = require("./documentation")

const app = express();

// load env variables and create .env.example file
const dotenv_safe = require("dotenv-safe");
dotenv_safe.config();

// middleware
app.use('/api', swaggerUi.serve, swaggerUi.setup(ymlfile));

// listening on environment port if defined or 8080
const port = process.env.PORT || 8080;
app.listen(port, () =&amp;gt; {
    console.log(`Node JS API is listening on port: ${port}`);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;In our other JS file, &lt;em&gt;documentation.js&lt;/em&gt;, is where we create our &lt;em&gt;ymlfile&lt;/em&gt;, which we give as an input to swaggerUi in &lt;em&gt;app.js&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;First, we need to query (fetch) periodically the URL where the JSON formatted API documentation is and store it locally into a JSON file. We do this with our &lt;em&gt;createJSONFile&lt;/em&gt; async function:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const fetch = require('node-fetch');
const fs = require('fs').promises;
const transformer = require('api-spec-transformer');
const YAML = require('yamljs');

// set a timeout so that we can periodically query the website where the JSON formatted API documentation is
// currently set at 6 hours
setTimeout(createJSONFile, 21600)

async function createJSONFile() {
  try {
    console.log("ORDER OF EXECUTION: 7")

    const response = await fetch('https://developer.skroutz.gr/assets/misc/skroutz_postman_collection.json')
    const json = await response.json()

    await fs.writeFile("./docs/skroutz_api.json", JSON.stringify(json));
    console.log("The JSON file was saved!");

  } catch (error) {
    console.log(error.response.body);
  }

  console.log("ORDER OF EXECUTION: 8")

};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;After that, we convert the JSON/Postman formatted file of the documentation to the YAML/OpenAPI Specification/Swagger format and store it locally, while also creating &lt;em&gt;ymlfile&lt;/em&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;(async function createYAMLFile() {
  const autoToSwagger = new transformer.Converter(transformer.Formats.AUTO, transformer.Formats.SWAGGER);

  console.log("ORDER OF EXECUTION: 1")

  autoToSwagger.loadFile("./docs/skroutz_api.json", function(err) {
    if (err) {
      console.log(err.stack);
      return;
    }

    console.log("ORDER OF EXECUTION: 4")

    autoToSwagger.convert('yaml')
      .then(function(convertedData) {
        // convertedData is a swagger YAML string
        // console.log(convertedData);

        console.log("ORDER OF EXECUTION: 6")

        fs.writeFile("./docs/skroutz_api.yaml", convertedData, function(err) {
          if(err) {
              return console.log(err);
          }     
        });
        console.log("The YAML file was saved!");

      })
      .catch(function(err){
        console.log(err);
      });

      console.log("ORDER OF EXECUTION: 5")
  });

  console.log("ORDER OF EXECUTION: 2")

})();

console.log("ORDER OF EXECUTION: 3")
const ymlfile = YAML.load('./docs/skroutz_api.yaml');

module.exports = ymlfile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Finally, in order to avoid using anything else but Node.js we do a little trick to always keep the Swagger UI dynamically up to date. In the &lt;em&gt;scripts&lt;/em&gt; in our &lt;em&gt;package.json&lt;/em&gt; file, we use the nodemon package to start our application, since every time a file changes locally nodemon restarts the server. Otherwise, even if our JSON and YAML files were updated, their latest version would not be served by our &lt;em&gt;/api&lt;/em&gt; route. As another possible solution, check out "Modify swagger file on the fly before load" at &lt;a href="https://www.npmjs.com/package/swagger-ui-express" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/swagger-ui-express&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In package.json:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; "scripts": {
    "test": "echo \"Error: no test specified\" &amp;amp;&amp;amp; exit 1",
    "build": "npm install",
    "start": "nodemon app.js",
    "dev": "nodemon app.js"
  },
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;p&gt;Some useful reads:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/isalevine/three-ways-to-retrieve-json-from-the-web-using-node-js-3c88"&gt;Three Ways to Retrieve JSON from the Web using Node.js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.twilio.com/blog/5-ways-to-make-http-requests-in-node-js-using-async-await" rel="noopener noreferrer"&gt;5 Ways to Make HTTP Requests in Node.js using Async/Await&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.risingstack.com/node-js-async-best-practices-avoiding-callback-hell-node-js-at-scale/" rel="noopener noreferrer"&gt;Node.js Async Best Practices &amp;amp; Avoiding the Callback Hell&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Running the project ⚙️
&lt;/h2&gt;

&lt;p&gt;You can find all the above code on the project's GitHub: &lt;/p&gt;
&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&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%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/KAUTH" rel="noopener noreferrer"&gt;
        KAUTH
      &lt;/a&gt; / &lt;a href="https://github.com/KAUTH/Swagger-Skroutz-API" rel="noopener noreferrer"&gt;
        Swagger-Skroutz-API
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      The Skroutz API documented live with Swagger UI
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;In order to run the project, first, clone the repository from GitHub, e.g.&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;git clone https://github.com/KAUTH/Swagger-Skroutz-API.git&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;To run this project locally you need to have &lt;a href="https://www.npmjs.com/get-npm" rel="noopener noreferrer"&gt;npm installed&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;When deploying the project for the first time, install all the required packages by running the&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;npm install&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
 command on a terminal in the root directory.&lt;/p&gt;

&lt;p&gt;After that, to run the project, use the&lt;br&gt;
&lt;br&gt;
 &lt;code&gt;npm start&lt;/code&gt;&lt;br&gt;
&lt;br&gt;
 command.&lt;/p&gt;

&lt;p&gt;The Swagger UI API documentation will then be accessible from &lt;a href="http://localhost:8080/api/" rel="noopener noreferrer"&gt;http://localhost:8080/api/&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Important:&lt;/em&gt; There is 1 .env file (with environment variables) that our project uses, which is not on the repository for security reasons (as a best practice). In order for the project to run properly, you have to create your .env file in the same directory (root directory) that the .env.example file (example of how our .env file looks like) is present in this repository.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enjoy 🎈
&lt;/h2&gt;

&lt;p&gt;The project is deployed with Heroku and can be found online at &lt;a href="http://bit.ly/swagger-skroutz" rel="noopener noreferrer"&gt;http://bit.ly/swagger-skroutz&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thanks for reading, leave a like ❤️🦄🔖 if you found the article interesting and of course your feedback 📝!&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>postman</category>
      <category>swagger</category>
    </item>
  </channel>
</rss>
