<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Gowtham on Medium]]></title>
        <description><![CDATA[Stories by Gowtham on Medium]]></description>
        <link>https://medium.com/@gowsundar?source=rss-75ab4a58ddb9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*vtN806PoVCv2HlYnxUdSMA.jpeg</url>
            <title>Stories by Gowtham on Medium</title>
            <link>https://medium.com/@gowsundar?source=rss-75ab4a58ddb9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 10:52:00 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gowsundar/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Docker Security 101 — Hacking and Securing Docker Containers]]></title>
            <link>https://faun.pub/docker-security-101-hacking-and-securing-docker-containers-a760a07f4518?source=rss-75ab4a58ddb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a760a07f4518</guid>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Gowtham]]></dc:creator>
            <pubDate>Fri, 09 Oct 2020 20:52:26 GMT</pubDate>
            <atom:updated>2020-10-09T20:52:26.364Z</atom:updated>
            <content:encoded><![CDATA[<h3>Docker Security 101 — Hacking and Securing Docker Containers</h3><p>Part 1 — Introduction to Docker &amp; Running Applications as ROOT User</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*dl2_bGPZe9AHFqRV" /><figcaption>Photo by <a href="https://unsplash.com/@ndmaslov">Nikolay Maslov</a> on Unsplash</figcaption></figure><p>Note: This is part 1 of a multi-part series.</p><p><strong>Introduction:</strong></p><p>Dear Readers, in this blog series I will cover Security issues related to Docker and how to protect against misconfigurations and attacks.</p><p>Let&#39;s get started.</p><p><strong>Docker Overview:</strong></p><p>According to the official website of Docker, <em>“Docker is the de facto standard to build and share containerized apps — from desktop to the cloud. We are building on our unique connected experience from code to cloud for developers and developer teams.”</em></p><p>In simple words, Docker provides the ability to package and run an application in an isolated environment called a container.</p><p>There are a lot of resources related to understanding docker and the references below will also be helpful;</p><p><a href="https://itnext.io/linux-container-from-scratch-339c3ba0411d">Understanding Containerization By Recreating Docker</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F-YnMr1lj4Z8&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D-YnMr1lj4Z8&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2F-YnMr1lj4Z8%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/0762af8abe63f9fbf11a1befff7005aa/href">https://medium.com/media/0762af8abe63f9fbf11a1befff7005aa/href</a></iframe><p>I will list out security concerns with some tags like [Dockerfile] [Host] or [Both] so that it is easy to understand and do some review if needed.</p><p><strong>[Dockerfile] Do Not Run Applications as ROOT User :</strong></p><p>One of the best practices while running Docker Container is to run processes with a non-root user. This is because if a user manages to break out of the application running as root in the container, may gain root user access on the host. In addition, configuring container to user unprivileged is the best way to prevent privilege escalation attacks.</p><p>Let&#39;s try with creating a simple nodejs application:</p><p>Dockerfile:</p><pre>FROM node:12<br>WORKDIR /usr/src/app<br>COPY package*.json ./<br>RUN npm install<br>COPY . .<br>EXPOSE 8080<br>CMD [ &quot;node&quot;, &quot;server.js&quot; ]</pre><p>Let&#39;s build the docker image,</p><pre>docker build -t myapp:v1 .</pre><p>Once the image is built, run the image by mapping port 8080 port inside of the container to the port 7070 on your host machine.</p><pre>docker run -p 7090:8080 -d myapp:v1</pre><p>Let&#39;s try to access the nodejs app from the host machine,</p><p><strong>Output:</strong></p><pre>$ curl -i localhost:7090<br><br>HTTP/1.1 200 OK<br>X-Powered-By: Express<br>Content-Type: text/html; charset=utf-8<br>Content-Length: 12<br>ETag: W/&quot;c-M6tWOb/Y57lesdjQuHeB1P/qTV0&quot;<br>Date: Sat, 03 Oct 2020 18:46:49 GMT<br>Connection: keep-alive<br><br>Hello world</pre><p>Great. We are now able to run a docker container with a simple nodejs app.</p><p>Now let&#39;s get into the container using exec command, (replace the container id with your respective id/name).</p><pre># Enter the container<br>$ docker exec -it &lt;container id&gt; /bin/bash</pre><p>Now that we are inside the container using the command whoami let&#39;s identify the user,</p><pre>root@d2c94ba1cdfa:/usr/src/app# whoami<br>root</pre><pre>root@d2c94ba1cdfa:/usr/src/app# id<br>uid=0(root) gid=0(root) groups=0(root)<br></pre><p>We can observe user is root when we log in to the container and app also runs as root user. Let&#39;s try to change the USER.</p><p><strong>USER Instruction:</strong></p><p>The USER instruction sets the user name or UID to use when running the image and for any RUN, CMD and ENTRYPOINT instructions that follow it in the Dockerfile.</p><p>Lets checkout the node:12 base image to see if there is an option to check for any USER instruction.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/38f5d104c86e46dff85777ef5067ad30/href">https://medium.com/media/38f5d104c86e46dff85777ef5067ad30/href</a></iframe><p>Though there is no USER instruction specified in the Dockerfile there is a user called node has been created and it&#39;s <strong><em>our responsibility</em></strong> to include the user in our Dockerfile.</p><p>This is quite common in official images where a user is created but just not enabled until you add the USER line in your own downstream Dockerfile.</p><p>Let&#39;s try adding the USER instruction to our Dockerfile and rebuild.</p><pre>FROM node:12<br>WORKDIR /usr/src/app<br>RUN chown -R node:node /usr/src/app</pre><pre>#changing the user to node that has been already created in the base image <br>USER node</pre><pre>#changing ownership of files<br>COPY --chown=node:node package*.json ./<br>RUN npm install<br>COPY --chown=node:node . .<br>EXPOSE 8080<br>CMD [ &quot;node&quot;, &quot;server.js&quot; ]</pre><p>Build the image and run the container.</p><pre>#Building the new image<br>docker build -t myapp:v2 .{Dockerfile}</pre><pre>#running the container<br>docker run -p 7090:8080 -d myapp:v1</pre><p>Let&#39;s try logging in to the container and identify the user,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ifvsmmvuX4WryHnQNXk2yQ.png" /><figcaption>running container as a non-root user</figcaption></figure><p>Observe that we are able to run the node application as non-root user successfully.</p><p>There are also other options to achieve this,</p><ul><li>Using -u flag during runtime This option can be used if the image doesn’t have its own user. Example:</li></ul><pre>docker run -p 7090:8080 --user node myapp:v2</pre><ul><li>Enable USER namespace on the host. This is the host configuration which enables us to run any container as non-root user on the host. Reference — <a href="https://docs.docker.com/engine/security/userns-remap/">https://docs.docker.com/engine/security/userns-remap/</a></li></ul><p><strong>Summary:</strong></p><p>In this article, we explored how applications in the Docker container can be run as Root and Non-Root users. Docker Security does not stop here and there are many best practices and I will post them in the upcoming article.</p><p>Cheers!! Thanks for reading.</p><p><strong>Other References:</strong></p><ul><li><a href="https://docs.docker.com/engine/reference/builder/#user">https://docs.docker.com/engine/reference/builder/#user</a></li><li><a href="https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html">https://cheatsheetseries.owasp.org/cheatsheets/Docker_Security_Cheat_Sheet.html</a></li><li><a href="https://medium.com/@mccode/processes-in-containers-should-not-run-as-root-2feae3f0df3b">https://medium.com/@mccode/processes-in-containers-should-not-run-as-root-2feae3f0df3b</a></li><li><a href="https://americanexpress.io/do-not-run-dockerized-applications-as-root/">https://americanexpress.io/do-not-run-dockerized-applications-as-root/</a></li><li><a href="https://engineering.bitnami.com/articles/why-non-root-containers-are-important-for-security.html">https://engineering.bitnami.com/articles/why-non-root-containers-are-important-for-security.html</a></li><li><a href="http://www.projectatomic.io/blog/2016/01/how-to-run-a-more-secure-non-root-user-container/">http://www.projectatomic.io/blog/2016/01/how-to-run-a-more-secure-non-root-user-container/</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p>👋 <a href="https://faun.dev/join"><strong>Join FAUN today and receive similar stories each week in your inbox!</strong></a><strong> </strong>️ <strong>Get your weekly dose of the must-read tech stories, news, and tutorials.</strong></p><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and </strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷 <strong>and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook</strong></a><strong> and </strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin</strong></a><strong> Groups </strong>💬</p><figure><a href="https://www.faun.dev/join?utm_source=medium.com/faun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_cT0_laE4iPcqW1qrbstAg.gif" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a760a07f4518" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/docker-security-101-hacking-and-securing-docker-containers-a760a07f4518">Docker Security 101 — Hacking and Securing Docker Containers</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Container Security 101 — Scanning images for Vulnerabilities]]></title>
            <link>https://faun.pub/container-security-101-scanning-images-for-vulnerabilities-ec414911d0e6?source=rss-75ab4a58ddb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/ec414911d0e6</guid>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Gowtham]]></dc:creator>
            <pubDate>Wed, 24 Jun 2020 15:40:43 GMT</pubDate>
            <atom:updated>2020-06-24T17:22:51.619Z</atom:updated>
            <content:encoded><![CDATA[<h3>Container Security 101 — Scanning images for Vulnerabilities</h3><p>Part 4 — Scanning Images for Vulnerabilities with <a href="https://anchore.com/">Anchore</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*Bd8olDoudB-Sug9-" /><figcaption>Photo by <a href="https://unsplash.com/@chuttersnap">chuttesnap</a> on Unsplash</figcaption></figure><h3>Quick Recap</h3><p>Note: This is a multi-part series on Container Security.</p><p>In <a href="https://medium.com/faun/container-security-101-scanning-images-for-vulnerabilities-d25c9a7d02f5">Part 1,</a> we talked about AWS Native Image Scanning.</p><p><a href="https://medium.com/faun/container-security-101-scanning-images-for-vulnerabilities-d25c9a7d02f5">Container Security 101 — Scanning images for Vulnerabilities</a></p><p>In <a href="https://medium.com/faun/container-security-101-scanning-images-for-vulnerabilities-28391ee7170e">Part 2</a>, we talked about Docker Trusted Registry Scanning.</p><p><a href="https://medium.com/faun/container-security-101-scanning-images-for-vulnerabilities-28391ee7170e">Container Security 101 — Scanning images for Vulnerabilities</a></p><p>In <a href="https://medium.com/faun/container-security-101-scanning-images-for-vulnerabilities-8030af2441ba">Part 3</a>, explained about how to scan images for vulnerabilities using the tool Trivy.</p><p><a href="https://medium.com/faun/container-security-101-scanning-images-for-vulnerabilities-8030af2441ba">Container Security 101 — Scanning images for Vulnerabilities</a></p><p>In this post I will cover how to scan images using another popular open-source tool anchore-engine.</p><p>Anchore Engine is an open-source project that provides a centralized service for inspection, analysis, and certification of container images. The Anchore Engine is provided as a Docker container image that can be run standalone or within an orchestration platform such as Kubernetes, Docker Swarm, Rancher, Amazon ECS, and other container orchestration platforms.</p><p>Anchore has both Enterprise and Open-Source version and we will discuss about Open-Source as part of this series.</p><p>Official Github Repository: <a href="https://github.com/anchore/anchore-engine">https://github.com/anchore/anchore-engine</a></p><p>Let&#39;s get started.</p><p><strong>Installation / Configuration:</strong></p><p>Anchore Engine is the core service or we can call it as the scanner that can be accessed directly through a RESTful API or via Anchore <a href="https://github.com/anchore/anchore-cli">CLI</a>. Hence, we need to install Anchore CLI as the initial step.</p><p>Anchore CLI GitHub repo — <a href="https://github.com/anchore/anchore-cli">https://github.com/anchore/anchore-cli</a>. It can be installed in many ways using Python pip, YUM package manager, etc.</p><p><em>References on Installing Anchore CLI :</em></p><ol><li><a href="https://github.com/anchore/anchore-cli/blob/master/README.rst">https://github.com/anchore/anchore-cli/blob/master/README.rst</a></li><li><a href="https://docs.anchore.com/current/docs/engine/engine_installation/anchore_cli/">https://docs.anchore.com/current/docs/engine/engine_installation/anchore_cli/</a></li></ol><p>Once installed you can verify the output by using the command anchore-cli</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/701847e93095e553fda4b553c8d36d73/href">https://medium.com/media/701847e93095e553fda4b553c8d36d73/href</a></iframe><p>Now, let’s install Anchore Engine and explore on how to interact with it using Anchore-CLI.</p><p><strong>Anchore Engine Installation:</strong></p><p><em>What is Anchore Engine?</em></p><p>Anchore Engine is a compliance tool available as a docker container to scan images for vulnerabilities against user-defined checks that help in secure container deployments.</p><p><em>How does it work?</em></p><p>Anchore takes a data-driven approach to analysis and policy enforcement. The system essentially has discrete phases for each image analyzed:</p><ol><li><strong>Fetch</strong> the image content and extract it, but never execute it.</li><li><strong>Analyze</strong> the image by running a set of Anchore analyzers over the image content to extract and classify as much metadata as possible.</li><li><strong>Save</strong> the resulting analysis in the database for future use and audit.</li><li><strong>Evaluate</strong> policies against the analysis result, including vulnerability matches on the artifacts discovered in the image.</li><li><strong>Update</strong> to the latest external data used for policy evaluation and vulnerability matches (we call this external data to sync feed sync), and automatically update image analysis results against any new data found upstream.</li><li><strong>Notify</strong> users of changes to policy evaluations and vulnerability matches.</li><li><strong>Repeat</strong> 5 &amp; 6 on intervals to ensure the latest external data and updated image evaluations.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7gb1QeV6gh7ztPAfl-LA7Q.png" /><figcaption>Reference — <a href="https://docs.anchore.com/current/docs/engine/general/">https://docs.anchore.com/current/docs/engine/general/</a></figcaption></figure><p>Anchore Engine is available as Docker Image and it requires a PostgreSQL database to provide persistent storage to hold information about the vulnerabilities from different sources.</p><p>The Anchore Engine container can be deployed manually, using Docker Compose, Kubernetes, or any container orchestration platform.</p><p>Let&#39;s see how it can be installed using Docker Compose:</p><p>Command:</p><pre># curl https://docs.anchore.com/current/docs/engine/quickstart/docker-compose.yaml &gt; docker-compose.yaml<br># docker-compose up -d</pre><p>Output:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cfebd5d1c3c6546651e074f38c82cb74/href">https://medium.com/media/cfebd5d1c3c6546651e074f38c82cb74/href</a></iframe><p>To verify and get the status of Anchore Engine Services:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b029c1da18d67f31cf33f62a8d5f4d2d/href">https://medium.com/media/b029c1da18d67f31cf33f62a8d5f4d2d/href</a></iframe><p>We can see all the services are up and running with Engine DB and Code version. 👍</p><p><strong>Scanning Images with anchore-engine:</strong></p><p><em>Step 1: Adding a container image for analysis</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/98279214638dfc23282d9250a0467bcc/href">https://medium.com/media/98279214638dfc23282d9250a0467bcc/href</a></iframe><p><em>Step 2: Waiting for the image to complete the analysis</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e3649d0655c1c9c062584f8f9f9f8502/href">https://medium.com/media/e3649d0655c1c9c062584f8f9f9f8502/href</a></iframe><p><em>Step 3: View the results</em></p><pre>~ docker-compose exec api anchore-cli image vuln docker.io/library/alpine:3.9.2 all</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JPMx85RqeccZ84l67Jshig.png" /></figure><p>We can view the list of issues identified in the image.</p><p>Let&#39;s see how we can use anchore-cli to interact with anchore-engine and perform the analysis.</p><p><strong>Configuring anchore-cli:</strong></p><p>Now that we have installed anchore-cli, it&#39;s necessary to configure it to interact with anchore-engine to perform analysis. By default, Anchore CLI will try to connect to the Anchore Engine at <a href="http://localhost/v1">http://localhost/v1</a> on port 8228with no authentication.</p><p>You can verify them using the following commands:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7b0a9f1e66f439b14af38b240c71aa8f/href">https://medium.com/media/7b0a9f1e66f439b14af38b240c71aa8f/href</a></iframe><blockquote>Note: It is important to note that we must provide --url along with default username as admin and password as foobar to get the response otherwise Unauthorised error will be displayed.</blockquote><pre>[ec2-user]$ anchore-cli --url <a href="http://localhost:8228/v1">http://localhost:8228/v1</a> system status</pre><pre>Output: &quot;Unauthorized&quot;</pre><blockquote>Tip: Instead of passing these parameters for every call to the cli they can be stores as environment variables.</blockquote><pre>ANCHORE_CLI_URL=http://myserver.example.com:8228/v1<br>ANCHORE_CLI_USER=admin<br>ANCHORE_CLI_PASS=foobar</pre><p><strong>Adding and analyzing Images:</strong></p><p><em>Step 1: Adding a container image for analysis</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/370df985684edc087261692b89192489/href">https://medium.com/media/370df985684edc087261692b89192489/href</a></iframe><p><em>Step 2: Waiting for the image to change the status as “Analyzed”</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eeb39d35b6b601d0ebd449910607a67a/href">https://medium.com/media/eeb39d35b6b601d0ebd449910607a67a/href</a></iframe><p><em>Steps 3: Perform Vulnerability scan and View the results</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a03d880437d06e7ac0292ba1e18b66f4/href">https://medium.com/media/a03d880437d06e7ac0292ba1e18b66f4/href</a></iframe><p>A complete list of anchore-cli command-line options are available <a href="https://gist.github.com/gowth4m/3603dc75cea09ebf08c1c8d9b4f06665">here</a>.</p><p>Great, we are able to scan and perform analysis both with anchore-engine using docker-compose and using anchore-cli.</p><p><strong>Features Overview:</strong></p><p>Anchore Engine can be used in several ways:</p><ul><li>Standalone or interactively.</li><li>As a service integrated with your CI/CD to bring security/compliance/best-practice enforcement to your build pipeline.</li><li>As a component integrated into existing container monitoring and control frameworks via integration with its RESTful API.</li></ul><p>There is also <a href="https://anchore.com/enterprise/">Enterprise Version</a> of anchore-engine which adds a graphical UI (providing policy management, user management, a summary dashboard, security and policy evaluation reports, and many other graphical client controls), and other back-end features and modules.</p><p>Enterprise Service Overview and Architecture can be checked <a href="https://docs.anchore.com/current/docs/overview/architecture/">here</a>.</p><p><strong>Supported Operating Systems</strong></p><ul><li>Alpine</li><li>Amazon Linux 2</li><li>CentOS</li><li>Debian</li><li>Google Distroless</li><li>Oracle Linux</li><li>Red Hat Enterprise Linux</li><li>Red Hat Universal Base Image (UBI)</li><li>Ubuntu</li></ul><p><strong>Supported Packages</strong></p><ul><li>GEM</li><li>Java Archive (jar, war, ear)</li><li>NPM</li><li>Python (PIP)</li></ul><p><strong>Deployment Models</strong></p><p>The Anchore Engine container can be deployed manually, using Docker Compose, Kubernetes, Swarm, Rancher, Amazon ECS, and other container orchestration platforms.</p><p>Check <a href="https://docs.anchore.com/current/docs/engine/engine_installation/helm/">here</a> to install with Helm on Kubernetes and <a href="https://docs.anchore.com/current/docs/engine/engine_installation/helm/amazon_marketplace/">here</a> to install Amazon Marketplace listing with Helm on EKS.</p><h3><strong>Summary:</strong></h3><p>Anchore is suitable for DevSecOps with its CI / CD support for Jenkins, Kubernetes, Circle CI, and other orchestration platforms. With Anchore — Enterprise, many more features are provided suitable for organization requirements.</p><p>Try it out and provide your comments.</p><h4><strong>References:</strong></h4><ul><li><a href="https://docs.anchore.com/current/docs/">Anchore Enterprise Documentation</a></li><li><a href="https://anchore.com/blog/anchore-jenkins-pipeline-configuration/?utm_content=132581005&amp;utm_medium=social&amp;utm_source=twitter&amp;hss_channel=tw-46390865">Anchore and Jenkins Pipeline Configuration</a></li></ul><h4>Blog Articles:</h4><ul><li><a href="https://geekflare.com/anchore-container-security-scanner/">How to Install and use Anchore Container Image Security Scanner</a></li></ul><p>I hope this helps and I would love to hear your feedback/suggestions. Feel free to tweet me <a href="https://medium.com/u/75ab4a58ddb9">@</a>gowsundar. See you in the next article.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p><strong>Subscribe to </strong><a href="https://www.faun.dev/join?utm_source=medium.com/faun&amp;utm_medium=medium&amp;utm_campaign=faunmediumprebanner"><strong>FAUN topics</strong></a><strong> and get your weekly curated email of the must-read tech stories, news, and tutorials </strong>🗞️</p><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and </strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷 <strong>and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook</strong></a><strong> and </strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin</strong></a><strong> Groups </strong>💬</p><figure><a href="https://www.faun.dev/join?utm_source=medium.com/faun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_cT0_laE4iPcqW1qrbstAg.gif" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ec414911d0e6" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/container-security-101-scanning-images-for-vulnerabilities-ec414911d0e6">Container Security 101 — Scanning images for Vulnerabilities</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Container Security 101 — Scanning images for Vulnerabilities]]></title>
            <link>https://faun.pub/container-security-101-scanning-images-for-vulnerabilities-8030af2441ba?source=rss-75ab4a58ddb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/8030af2441ba</guid>
            <category><![CDATA[container-security]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[docker-image]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Gowtham]]></dc:creator>
            <pubDate>Fri, 22 May 2020 10:12:31 GMT</pubDate>
            <atom:updated>2020-07-20T11:15:31.682Z</atom:updated>
            <content:encoded><![CDATA[<h3>Container Security 101 — Scanning images for Vulnerabilities</h3><p>Part 3 — Scanning Images for Vulnerabilities with <a href="https://github.com/aquasecurity/trivy">Trivy</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*rUE0gFlzuxIfXKrb" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske">Markus Spiske</a> on Unsplash.com</figcaption></figure><h3>Quick Recap</h3><p>Note: This is a multi-part series on Container Security.</p><p>In <a href="https://medium.com/faun/container-security-101-scanning-images-for-vulnerabilities-d25c9a7d02f5">Part 1,</a> we talked about AWS Native Image Scanning.</p><p><a href="https://medium.com/faun/container-security-101-scanning-images-for-vulnerabilities-d25c9a7d02f5">Container Security 101 — Scanning images for Vulnerabilities</a></p><p>In <a href="https://medium.com/faun/container-security-101-scanning-images-for-vulnerabilities-28391ee7170e">Part 2</a>, we talked about Docker Trusted Registry Scanning.</p><p><a href="https://medium.com/faun/container-security-101-scanning-images-for-vulnerabilities-28391ee7170e">Container Security 101 — Scanning images for Vulnerabilities</a></p><p>Consequently, in this post, we will discuss how to scan the container images using an open-source tool called Trivy.</p><p>Trivy is an open-source tool from <a href="https://www.aquasec.com/">Aqua Security</a> to scan container images for vulnerabilities in OS packages and application dependencies. In this post I will cover its features, usage, and other available options.</p><p>There are other open-source tools available like Anchore, Clair, etc., I will try to cover them in upcoming posts.</p><p>Trivy Official Github Repository: <a href="https://github.com/aquasecurity/trivy">https://github.com/aquasecurity/trivy</a></p><p><strong>Installation / Configuration:</strong></p><p>Trivy is easy to install and configure. On Mac it can be installed with homebrew. For other installations, check <a href="https://github.com/aquasecurity/trivy#installation">here</a>.</p><pre>brew install aquasecurity/trivy/trivy</pre><p><strong>Quick Start:</strong></p><pre>$ trivy [YOUR_IMAGE_NAME]<br>Example: trivy python:3.4-alpine</pre><p>It is much easier to start Trivy using Docker,</p><pre>On Mac OS</pre><pre>docker run --rm -v $HOME/Library/Caches:/root/.cache/ aquasec/trivy python:3.4-alpine</pre><pre>OR</pre><pre>docker run --rm -v $(pwd):/root/.cache/ aquasec/trivy python:3.4-alpine</pre><p><strong>Output:</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0098cbe3830f47d00c77770441b871ad/href">https://medium.com/media/0098cbe3830f47d00c77770441b871ad/href</a></iframe><p><strong>Features Overview:</strong></p><p>A key feature of Trivy is the ease of configuration and the CI support with customized scanning options comparing to other tools. In addition,</p><ul><li>Supports a wide range of OS Packages and Application Dependencies.</li><li>Multi-image format.</li><li>Simple / Fast.</li><li>DevSecOps (Suitable for CI such as Travis CI, CircleCI, Jenkins, etc.)</li></ul><p>Feature documentation can be referred to <a href="https://github.com/aquasecurity/trivy#features">here</a>.</p><p><strong>Scan Options:</strong></p><p>Trivy also provides an “exit code” option which can be used to break the build when there are vulnerabilities in the images.</p><blockquote>Reference — Video from Liz Rice <a href="https://www.youtube.com/watch?v=AzOBGm7XxOA">here</a>.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*fOc8tgpr1Wyh7YXrjy3miQ.png" /><figcaption>Vulnerabilities are identified in the image — Exit code 1</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OyQr-ktUEuB9OLW9l5IMWA.png" /><figcaption>No Vulnerabilities — Exit code 0</figcaption></figure><ul><li>Supported Image Formats: <a href="https://github.com/aquasecurity/trivy#image-tar-format">.tar</a> / OCI.</li><li>Report Formats: JSON / Template format.</li><li>Results Filter: Filter vulnerabilities by Severity / Type (OS, Library).</li></ul><p>When Trivy starts to scan the image it always updates the database to have the latest information stored and it&#39;s generally quick. But this can be skipped using -skip-update option. It is possible to ignore vulnerabilities that cannot be fixed even after the update using --ignore-unfixed flag.</p><p><strong>Vulnerability Detection:</strong></p><p>Trivy can detect vulnerabilities in the following OS packages and Application Dependencies,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eoyp-JSLvtWUH9C_WWPk1g.png" /><figcaption>Image Reference — <a href="https://github.com/aquasecurity/trivy#vulnerability-detection">https://github.com/aquasecurity/trivy#vulnerability-detection</a></figcaption></figure><p>Application Dependencies:</p><ul><li>Gemfile.lock</li><li>Pipfile.lock</li><li>poetry.lock</li><li>composer.lock</li><li>package-lock.json</li><li>yarn.lock</li><li>Cargo.lock</li></ul><p><strong>Client / Server:</strong></p><p>Trivysupports Client-Server mode which helps the client to avoid downloading vulnerability database during each scan. The Server has the database used to scan images at multiple locations. Refer <a href="https://github.com/aquasecurity/trivy#client--server">here</a> for the configuration.</p><p><strong>Continuous Integration (CI):</strong></p><p>It is essential for any tool to have CI / CD support in DevOps since everything is automated from building code to deployment.</p><p>Trivyprovides CI support for Travis, Gitlab, and Circle CI. This helps to break builds when vulnerabilities are identified during scanning.</p><p>The below option can be set to break the build when a Critical / High severity vulnerability is identified.</p><pre>$ trivy --exit-code 0 --severity MEDIUM,LOW ruby:2.3.0 (Build will not be failed)<br>$ trivy --exit-code 1 --severity CRITICAL,HIGH ruby:2.3.0 (Build Fails when Critical/High severity issues are identified)</pre><p>Detailed Configuration of Trivy in CI can be checked <a href="https://github.com/aquasecurity/trivy#continuous-integration-ci">here</a>.</p><p><em>Other References:</em></p><ul><li><a href="https://aws.amazon.com/blogs/containers/scanning-images-with-trivy-in-an-aws-codepipeline/">Scanning images with Trivy in an AWS CodePipeline</a></li><li><a href="https://medium.com/better-programming/integrating-docker-container-scans-in-ci-builds-991a94b9132b">Integrating With AzureDevOps CI</a></li><li><a href="https://pixelrobots.co.uk/2020/02/use-trivy-and-azure-devops-to-scan-container-images-for-vulnerabilities/">Use Trivy and Azure DevOps to scan container images for Vulnerabilities</a></li><li><a href="https://developer.ibm.com/recipes/tutorials/devsecops-using-aquasec-trivy/">DevSecOps using Aquasec Trivy</a></li></ul><p><strong>Authorization for Private Registries:</strong></p><p>Installing Docker or other 3rd party tools are not required for Trivy to run in the CI process. With the support of Environment Variables and SDK it is easy for authorization in Private Registries like Docker Hub, Amazon ECR (Elastic Container Registry), and GCR (Google Container Registry).</p><p>Configuration for Private Docker Registry can be checked <a href="https://github.com/aquasecurity/trivy#authorization-for-private-docker-registry">here</a>.</p><p><strong>Comparison with other Scanners / Tools:</strong></p><p>Below is the snapshot from Trivy official repository on <a href="https://github.com/aquasecurity/trivy#comparison-with-other-scanners">comparison</a> with other scanners on various factors like Usability, Accuracy, etc,. I will try to do a comparison analysis of other scanners and publish an article sometime later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MxcsiKOzbNZi_lnhYT8p3A.png" /><figcaption>Image Reference — <a href="https://github.com/aquasecurity/trivy#comparison-with-other-scanners">https://github.com/aquasecurity/trivy#comparison-with-other-scanners</a></figcaption></figure><p>The Symbols are Japanese representation and based on my reference below are their meanings:</p><ul><li>◯ (Good), ×(Fail), △(Partial), ◎(Best).</li></ul><blockquote>A recent blog post on comparison with open source tools can be checked <a href="https://boxboat.com/2020/04/24/image-scanning-tech-compared/">here</a>.</blockquote><p><strong>Summary:</strong></p><p>Trivy is easy to use and can be used to scan images for vulnerabilities before they are deployed in production. Try it out and post your comments.</p><h4><strong>References:</strong></h4><p>Videos on Trivy from <a href="https://medium.com/u/d9e5549e8e2c">Liz Rice</a> and @AquaSecTeam:</p><ul><li><a href="https://www.youtube.com/watch?v=wFIGUjcRLnU">Tweaking Trivy output to fit your workflow</a></li><li><a href="https://www.youtube.com/watch?v=AzOBGm7XxOA&amp;t=66s">Trivy — container image scanning</a></li></ul><h4>Blog Articles:</h4><ul><li><a href="https://medium.com/@knqyf263/a-simple-and-comprehensive-vulnerability-scanner-for-containers-compatible-with-ci-b3c0982d4fb6">https://medium.com/@knqyf263/a-simple-and-comprehensive-vulnerability-scanner-for-containers-compatible-with-ci-b3c0982d4fb6</a> by <a href="https://medium.com/u/c40f35b5881f">Teppei Fukuda</a></li><li><a href="https://sysdogs.com/en/on-docker-image-security/">https://sysdogs.com/en/on-docker-image-security/</a></li><li><a href="https://www.infoq.com/news/2020/04/trivy-docker-harbor/">Trivy is now included within Harbor as the default scanner</a>.</li></ul><p>That’s all for now! See you in the next article.</p><p>Check out PART-4<a href="https://medium.com/faun/container-security-101-scanning-images-for-vulnerabilities-ec414911d0e6"> here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and </strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷 <strong>and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook</strong></a><strong> and </strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin</strong></a><strong> Groups </strong>💬<strong>.</strong></p><p><strong>To join our community Slack team chat </strong>🗣️ <strong>read our weekly Faun topics </strong>🗞️,<strong> and connect with the community </strong>📣<strong> click here⬇</strong></p><figure><a href="https://www.faun.dev/join/?utm_source=medium.com%2Ffaun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_cT0_laE4iPcqW1qrbstAg.gif" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8030af2441ba" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/container-security-101-scanning-images-for-vulnerabilities-8030af2441ba">Container Security 101 — Scanning images for Vulnerabilities</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Container Security 101 — Scanning images for Vulnerabilities]]></title>
            <link>https://faun.pub/container-security-101-scanning-images-for-vulnerabilities-28391ee7170e?source=rss-75ab4a58ddb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/28391ee7170e</guid>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[docker-image]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Gowtham]]></dc:creator>
            <pubDate>Sat, 25 Apr 2020 16:54:58 GMT</pubDate>
            <atom:updated>2020-05-23T10:50:10.741Z</atom:updated>
            <content:encoded><![CDATA[<h3>Container Security 101 — Scanning images for Vulnerabilities</h3><p>Part 2 — Docker Trusted Registry Scanning</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*5Gx4jyAEbQBmRGk0" /><figcaption>Photo by <a href="https://unsplash.com/@mitoone">Miguel Castellanos</a> on U<a href="https://unsplash.com/">nsplash.com</a></figcaption></figure><p><em>NOTE: This is Part 2 of a multi-part series. For Part 1, please click </em><a href="https://medium.com/faun/container-security-101-scanning-images-for-vulnerabilities-d25c9a7d02f5"><em>here</em></a><em>.</em></p><h3>Quick Recap</h3><p>In Part-1, I explained about AWS Native image scanning and its features. Now, I will cover scanning images for vulnerabilities in Docker Trusted Registry (DTR).</p><p><strong>Overview:</strong></p><p>Docker Trusted Registry (DTR) is the image storage solution from Docker to securely store and manage the Docker images you use in your applications.</p><p>It can also be part of CI/CD processes to build, ship, and run your applications. DTR has a built-in security scanner that can be used to discover vulnerabilities in the images.</p><blockquote>Note: This feature is available only with Docker Enterprise[1].</blockquote><p><strong>Prerequisite:</strong></p><p>Docker image scanning is available only in the Docker Enterprise version and hence it is necessary to acquire a license to use this feature.</p><p><strong>Installing Docker Enterprise:</strong></p><p>Docker Enterprise involves the following items to be installed:</p><ul><li>Docker Enterprise Container Engine</li><li>Docker Universal Control Plane (UCP) — helps you manage your Docker cluster and applications through a single interface.</li><li>Docker Trusted Registry (DTR) — used to securely store and manage the Docker images.</li></ul><p>A detailed explanation on how these can be installed is mentioned <a href="https://docs.docker.com/ee/supported-platforms/">here.</a></p><p><strong>Set up Security Scanning in DTR:</strong></p><p>With Docker Enterprise installed and configured, it is possible to set up image scanning in DTR.</p><p>Docker Security Scanning is available as an add-on and an administrator configures it for your DTR instance.</p><blockquote>Note: It is necessary to purchase a DTR license with that includes Docker Security Scanning.</blockquote><p>To check the license, navigate to the DTR Settings page, and click Security. If an “Enable Scanning” toggle appears, the license includes scanning.</p><p><strong><em>Steps to enable DTR scanning:</em></strong></p><ol><li>Login to your Docker Enterprise account and download the license file(.lic) from the MyContent option.</li><li>Log in to your <strong>DTR Instance</strong> Install the license file using Settings &gt; General &gt; Apply new license.</li></ol><p>3. Enable DTR scanning under the Security tab from the Systems menu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hzDsysf_VtQNXf_MHQNmCQ.png" /><figcaption>Enabling the Image Scanning</figcaption></figure><p>4. Security scanning requires the Database to be configured and available. There are two modes for database configuration available. By Default, Online mode is enabled and DTR attempts to download a security database from Docker Server.</p><p>For the Offline mode, it is necessary to download and install the .tar file that contains database updates. More details can be found <a href="https://docs.docker.com/ee/dtr/admin/configure/set-up-vulnerability-scans/#update-cve-database---offline-mode">here</a>.</p><p>5. Setting up repository scanning mode — Scan on push and Scan Manually</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MChdYwTbcNwymz-Zhe3oBg.png" /><figcaption>Choosing the Image Scanning Method</figcaption></figure><p>Scan on push — Images are scanned / re-scanned on each docker push to the repository.</p><p>Scan Manually — Users with write access to repo or admin can trigger the scan using the Scan button.</p><blockquote>Note: The scanning mode can be changed from each repository Settings page.</blockquote><p>6. Viewing the Scan results — Once the images are scanned the results can be viewed from theTags tab of each repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WoyUDSGf2bz_HlJf_otCPQ.png" /><figcaption>Viewing the Scan Results</figcaption></figure><p>It is possible to view the vulnerabilities by specific Layers and Components by clicking the View details button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IgrVE0LIJAbJRzuy40Cf9A.png" /><figcaption>Vulnerabilities in each Layer</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fhTAls8b6GYCG2lKPGKalA.png" /><figcaption>Vulnerabilities in each Component</figcaption></figure><p>7. Ignoring / Overriding the reported Vulnerabilities — The reported vulnerabilities can be ignored using Hide button under the components tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qYE4iC5lm89rOrL-DBAwIw.png" /><figcaption>Overriding Vulnerabilities</figcaption></figure><blockquote>Note: Vulnerabilities that are marked hidden will not be reported again and to re-evaluate click the Promote button.</blockquote><p>8. Updating the CVE database — DTR scanning requires the database to updated to check for CVE’s. For automatic updates using online mode, the host system should be able to reach https://dss-cve-updates.docker.com/ on port 443, and updates are checked at 3:00 AM UTC every day. This can be Enabled/Disabled from the Settings menu.</p><p>For Offline mode latest.tar database file should be downloaded and uploaded as mentioned in step 4.</p><p>Once everything is configured, all the images pushed to DTR will be scanned and results can be analyzed.</p><p>I hope this article covers the overview of DTR scanning, for more details check the references section.</p><p>In the subsequent articles, I will cover how Container Images can be Scanned using Open-Source Tools.</p><p>Check out PART-3 <a href="https://medium.com/faun/container-security-101-scanning-images-for-vulnerabilities-8030af2441ba">here</a>.</p><h3><strong>References:</strong></h3><p>Image Credits: Docker Blog / Documentation.</p><ul><li><a href="https://docs.docker.com/ee/">Docker Enterprise</a></li><li><a href="https://docs.docker.com/ee/release-notes/">Install or upgrade Docker Enterprise components</a></li><li><a href="https://docs.docker.com/ee/dtr/user/manage-images/scan-images-for-vulnerabilities/">Scan images for vulnerabilities</a></li><li><a href="https://docs.docker.com/ee/dtr/admin/configure/set-up-vulnerability-scans/">Set up Security Scanning in DTR</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and </strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷 <strong>and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook</strong></a><strong> and </strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin</strong></a><strong> Groups </strong>💬<strong>.</strong></p><p><strong>To join our community Slack team chat </strong>🗣️ <strong>read our weekly Faun topics </strong>🗞️,<strong> and connect with the community </strong>📣<strong> click here⬇</strong></p><figure><a href="https://www.faun.dev/join/?utm_source=medium.com%2Ffaun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6P3WpLjGv5v1ucm5dgkucg.png" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28391ee7170e" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/container-security-101-scanning-images-for-vulnerabilities-28391ee7170e">Container Security 101 — Scanning images for Vulnerabilities</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Container Security 101 — Scanning images for Vulnerabilities]]></title>
            <link>https://faun.pub/container-security-101-scanning-images-for-vulnerabilities-d25c9a7d02f5?source=rss-75ab4a58ddb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/d25c9a7d02f5</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[container-security]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Gowtham]]></dc:creator>
            <pubDate>Tue, 24 Mar 2020 16:37:14 GMT</pubDate>
            <atom:updated>2020-05-23T10:53:06.962Z</atom:updated>
            <content:encoded><![CDATA[<h3>Container Security 101 — Scanning images for Vulnerabilities</h3><p>This article series will cover how to secure your container (docker) images using various image scanning solutions and how they can be integrated in CI CD.</p><p><strong>Part 1 — Introduction and AWS Native Image Scanning</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OZ_lIVi8LYdMenRx" /></figure><p><strong>Container/Docker Intro:</strong></p><p>Am sure that everyone will be familiar with the container technologies and Docker as they are widely adopted. In short, Containers are unit of software that packages up code and all its dependencies for the application to run. One such prominent container solution is <strong>Docker</strong>.</p><p><strong>Container Image Scanning:</strong></p><p>A container image is a self-contained piece of software that has everything in it needed to run — code, tools, and resources. These images are stored in different registries such as Docker Hub, Amazon ECR, Google Container Registry, etc,. Hence it is very essential to analyse the vulnerabilities in images to provide a secure operating environment for application to run.</p><p>Let’s understand various container scanning solutions available and open-source tools to scan images for vulnerabilities.</p><p><strong><em>Image scanning can be of two types:</em></strong></p><blockquote>Static scanning to detect vulnerabilities in images before a container is launched.</blockquote><blockquote>Dynamic scanning is carried out in a runtime environment, to identify vulnerabilities introduced by software installed post-build as well as zero-day vulnerabilities.</blockquote><h4>Container Image Scanning with Amazon ECR:</h4><p>Amazon last year launched container image scanning <a href="https://aws.amazon.com/blogs/containers/amazon-ecr-native-container-image-scanning/">solution</a> to secure images that are pushed into their registries i.e Elastic Container Registry(ECR).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J7hGYKO-2bv0g-Oh6kftEA.png" /><figcaption>Reference from AWS Blog</figcaption></figure><p>The image scanning is carried using open-source tool <a href="https://github.com/quay/clair">Clair</a>. The ECR image scanning feature supports two modes of operations: <em>scan-on-push</em> and <em>scan-on-demand</em>. Additionally, an CloudWatch / EventBridge event can be set when the image scan is completed as mentioned <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/ecr-eventbridge.html">here</a>.</p><p><strong><em>Steps to Configure Image Scanning in ECR.</em></strong></p><ol><li><em>Using AWS CLI to login to ECR ( Elastic Container Registry).</em></li><li><em>Installing Docker and authorize Docker Client to PUSH / PULL / DELETE created images to ECR.</em></li><li><em>Configuring ECR repo for image scanning.</em></li><li><em>Scanning and analysing the results.</em></li></ol><p>Let’s get in to details of each step.</p><ol><li><strong>Using AWS CLI to login to ECR ( Elastic Container Registry):</strong></li></ol><p>The AWS CLI is a unified tool to manage your AWS services. It is necessary to <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html">install</a> and <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html">configure</a> to interact with the registry.</p><blockquote>If you receive an error, install or upgrade to the latest version of the AWS CLI. For more information, see <em>AWS Command Line Interface User Guide[1]</em>.</blockquote><p><strong>2. Installing Docker and authorize Docker Client to PUSH/PULL/ DELETE created images to ECR.</strong></p><p>Assuming docker is installed on your system, lets see how to authorize docker client with Amazon ECR.</p><p>“get-login-password” — is the command to retrieve and display a password to authenticate Amazon ECR registry that your IAM principal has access and the generated password is valid for 12 hours.</p><pre>aws ecr get-login-password (--profile profilename) <br>#if aws cli is configured with multiple profiles</pre><pre>output:<br>1860 charcter length password will be generated</pre><p>The password can now passed to the login command of the container client such as the Docker CLI.</p><pre>aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin aws_account_id.dkr.ecr.us-east-1.amazonaws.com</pre><pre>#it is necessary to pass the corresponding region and account id of your AWS account. Include --profile whenever required.</pre><pre>Output:<br>Login Succeeded.</pre><p>Now we have successfully authenticated to an Amazon ECR registry and use the Docker CLI to push and pull images from that registry until the token expires.<strong><em> For other authentication methods refer the documentation </em></strong><a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/Registries.html"><strong><em>here</em></strong></a><strong><em>.</em></strong></p><p><strong>3. Configuring ECR repo for image scanning.</strong></p><p>We can create a sample Dockerfile or pull any existing docker image locally and use the same to PUSH into ECR for scanning.</p><p>Lets create a simple docker image using base image as Alpine 3.7 locally,</p><pre>#Create a Dockerfile with following content<br>FROM alpine:3.7<br>MAINTAINER Kali<br>CMD [&quot;date&quot;]</pre><pre>#Save and build the file with tag as &quot;latest&quot;</pre><pre>docket build -t myimage:latest .</pre><pre>#List the images locally<br>docker images</pre><pre>REPOSITORY          TAG                 IMAGE ID           CREATED             <br>myimage            latest               965ea09ff2eb      2 days ago</pre><p>Next step is creating a ECR repository to push the image created and available locally.</p><p>Creating a ECR repository:</p><p>Create a repository in ECR, can be done via command line and also from the AWS Management console.</p><pre>aws ecr create-repository \<br>    --repository-name sample-repo \<br>    --image-scanning-configuration scanOnPush=true \<br>    --region us-east-1</pre><pre>Output:<br>{<br>    &quot;repository&quot;: {<br>        &quot;registryId&quot;: &quot;123456789012&quot;,<br>        &quot;repositoryName&quot;: &quot;sample-repo&quot;,<br>        &quot;repositoryArn&quot;: &quot;<em>arn:aws:ecr:useast1:123456789012:repository/sample-repo</em>&quot;,<br>        &quot;imageScanningConfiguration&quot;: {<br>            &quot;scanOnPush&quot;: true<br>        }<br>    }<br>}</pre><p>Pushing the image to ECR:</p><p>In order to push the docker images available locally we need to tag the image with the respective repo created in ECR.</p><pre>$ docker tag myimage:latest aws_account_id.dkr.ecr.us-east-1.amazonaws.com/sample-repo:latest</pre><pre>Output:<br>The push refers to a repository [<em>aws_account_id</em>.dkr.ecr.us-east-1.amazonaws.com/myimage] (len: 1)<br>e9ae3c220b23: Pushed<br>a6785352b25c: Pushed<br>0998bf8fb9e9: Pushed<br>0a85502c06c9: Pushed<br>digest: sha256:215d7e4121b30157d8839e81c4e0912606fca105775bb0636b95aed25f52c89b size: 6774</pre><blockquote>For other operations like Pull , Delete and Deleting a repo refer documentation <a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/getting-started-cli.html">here</a>.</blockquote><p><strong>4. <em>Scanning and analysing the results.</em></strong></p><p><em>Scanning Existing Repository to Scan on Push:</em></p><p>If you notice in the previous step while creating the new repo there was option called “<strong><em> — image-scanning-configuration scanOnPush=true</em></strong>” was passed. This defines all new images pushed to the repository will be scanned. The same option called be toggled on while creating repo from the console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MciPF0LAU8f1eQ5y8hP4NQ.png" /><figcaption>Scan on push option Enabled from the AWS Management console</figcaption></figure><blockquote>To disable image <strong>scan on push</strong> for a repository, specify scanOnPush=false.</blockquote><p><em>Manually Scanning an Image:</em></p><p>It is also possible to scan the images in repositories that are not configured to scan on push. This can also be done via Console and using CLI.</p><p>From the CLI:</p><pre>aws ecr start-image-scan --repository-name name --image-id imageTag=tag_name --region us-east-1</pre><p>From the Console:</p><p>Choose the repository →Images Page → Scan option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Bs2cUkJ4ZgdxvAbZoXNKQ.png" /></figure><p>Retrieving Scan Findings:</p><p>Once the images pushed to the repo is scanned we can retrieve the findings via both Console and CLI.</p><pre>aws ecr describe-image-scan-findings --repository-name name --image-id imageTag=tag_name --region us-east-2</pre><p>It is more comfortable to view the findings from the console. Choose the repository → Images →under the <strong>Vulnerabilities</strong> column, select <strong>Details</strong> for the image to retrieve the scan finding.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bjK7IPda71aI487ZYyQeOA.png" /><figcaption>Retrieving scan results from Console</figcaption></figure><p><strong>Recommendations :</strong></p><p>Ensure using the latest patched version of base image.</p><p>Setup “Scanning on push” feature for all created repos in ECR since this service is provided at <em>“free of cost”</em> at present.</p><p>Ensure the images are continuously scanned with the updated CVE list.</p><p><strong>Limitations:</strong></p><p>An image can only be scanned once per day. Multiple attempts to scan images will cause an ThrottlingException.</p><p>ECR provides CVE scanning for Operating System (OS) packages for most common Linux distributions including Debian, Ubuntu, and Amazon Linux; Scanning of other types of packages that your containerized application depends on, such as language libraries (for example, Java, Python, NodeJS, etc.), is currently out of scope[2].</p><p>That’s all for the first part, In the next part will cover about other solutions and open-source tools for container image security.</p><p>Cheers!!! Thanks to <a href="https://medium.com/@cvignesh28">Vignesh</a> for proofreading.</p><p>PART 2 about Docker Trusted Registry Scanning <a href="https://medium.com/faun/container-security-101-scanning-images-for-vulnerabilities-28391ee7170e">here</a>.</p><p>References:</p><ul><li><a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html">Installing or updating to the latest version of the AWS CLI</a></li><li><a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-scanning.html#scanning-existing-repository">Image Scanning</a></li><li><a href="https://aws.amazon.com/blogs/containers/amazon-ecr-native-container-image-scanning/">Native Container Image Scanning in Amazon ECR | Amazon Web Services</a></li><li><a href="https://docs.aws.amazon.com/AmazonECR/latest/userguide/Registries.html">Amazon ECR private registry</a></li><li><a href="https://aws.amazon.com/blogs/compute/authenticating-amazon-ecr-repositories-for-docker-cli-with-credential-helper/">Authenticating Amazon ECR Repositories for Docker CLI with Credential Helper | Amazon Web Services</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and </strong><a href="https://instagram.com/fauncommunity/"><strong>Instagram</strong></a><strong> </strong>📷 <strong>and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook</strong></a><strong> and </strong><a href="https://www.linkedin.com/company/faundev"><strong>Linkedin</strong></a><strong> Groups </strong>💬<strong>.</strong></p><p><strong>To join our community Slack team chat </strong>🗣️ <strong>read our weekly Faun topics </strong>🗞️,<strong> and connect with the community </strong>📣<strong> click here⬇</strong></p><figure><a href="https://www.faun.dev/join/?utm_source=medium.com%2Ffaun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6P3WpLjGv5v1ucm5dgkucg.png" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d25c9a7d02f5" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/container-security-101-scanning-images-for-vulnerabilities-d25c9a7d02f5">Container Security 101 — Scanning images for Vulnerabilities</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Security Automation Series — Part 2 ZAP- Jenkins Post Integration Actions]]></title>
            <link>https://faun.pub/security-automation-series-part-2-zap-jenkins-post-integration-actions-c451a6639aae?source=rss-75ab4a58ddb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/c451a6639aae</guid>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[owaspzap]]></category>
            <category><![CDATA[infosec]]></category>
            <category><![CDATA[automation-testing]]></category>
            <dc:creator><![CDATA[Gowtham]]></dc:creator>
            <pubDate>Wed, 07 Aug 2019 06:23:12 GMT</pubDate>
            <atom:updated>2019-09-23T14:52:46.726Z</atom:updated>
            <content:encoded><![CDATA[<h3>Security Automation Series — Part 2 ZAP- Jenkins Post Integration Actions</h3><h4>Part-2 — Running Authenticated Scans</h4><p>In <a href="https://medium.com/@gowsundar/security-automation-series-part-1-owasp-zap-jenkins-integration-50b091f29a36"><strong>Part-1</strong></a>, we discussed about Integration of ZAP in Jenkins and running a simple scan.</p><p>Let’s go further and see how we can run authenticated scans using two different type supported by Jenkins ZAP plugin.</p><p>Before moving to configuration, will see the list of authentication methods supported by ZAP proxy in Jenkins.</p><ol><li>Form-based Authentication</li><li>Script-based Authentication</li></ol><p>There are other types like Manual authentication, JSON-based, etc,. which is available only through ZAP UI.</p><p>Form-based authentication is used for websites / webapps where authentication is done by submitting a form or performing a GET request to a ‘login url’ using a ‘username/password’ pair of authentication credentials.</p><p>Script-based authentication method is useful for websites / webapps where the authentication is a more complex and some custom scripts that handle the authentication process are beneficial.</p><p>Lets see how to configure form-based authentication,</p><p><strong>Step-1:</strong></p><p>Authentication Checkbox is available under “Session Properties” which provides configuration options.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*67CeEx46yfC1-EPbSCJSrQ.png" /><figcaption>Authentication Dialog</figcaption></figure><p>In ZAP, we have an option called “Users” which allows you to configure a set of Users that may be used for various other actions throughout the application. Otherwise, these are the application login credentials.</p><p><strong>Step-2:</strong></p><p>We can configure Username, Password and use Regex to enable ZAP for identifying login, logout patterns.</p><p>Example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WHSNZoGpjM-t_6Wo6-t-VA.png" /><figcaption>Setting up the User</figcaption></figure><p>We can also configure Target-URL, Username, Password Parameters and also pass any extra POST data from the same dialog.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LtMfmSl2RxvudSB7_IfNHw.png" /><figcaption>Form based authentication</figcaption></figure><p><em>Tip: To find out the parameters name, you can utilize browser developer tools or intercept the request using ZAP or any other proxy tools.</em></p><p><strong>Step-3:</strong></p><p>Once everything is set, configure the scan type and save the job. Now its time to build the job and check the console output to verify whether ZAP is able to perform authenticated scan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tK8kuuEPzysy6e0QnUXSkA.png" /><figcaption>Console output for form based authentication</figcaption></figure><p>YESSSS!!! It Works…</p><p>Now, lets take a look at Script based authentication where ZEST script can help us run authenticated scans.</p><p>So, what is ZEST — Zest is a specialised scripting language developed by the Mozilla security team and is intended to be used in web oriented security tools. More details <a href="https://github.com/mozilla/zest/wiki">here</a>.</p><p><strong>Step-4:</strong></p><p>Let’s record a new ZEST script for demo site using the ZAP UI to understand further.</p><p>Open the ZAP UI, and configure it as proxy to capture browser requests. There will be small recorder like symbol from the ZAP toolbar menu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/323/0*YWm3dL2r6Bx7M3YD.png" /><figcaption>ZEST recorder icon</figcaption></figure><p>Clicking the icon will we will record a new script dialog from which we can provide Title, Type(Authentication in this case), URL, Prefix if there is any, etc,.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1008/1*pUJIWuc-emvLjlpxV2XbUw.png" /><figcaption>Recording a ZEST script</figcaption></figure><p><strong>Step-5:</strong></p><p>Next, we can click and start recording our login flow. ZAP — ZEST will record all the requests that are proxied through it during the recording. When we complete the login flow we can click the same icon to stop recording. The recorded requests will appear under “Scripts” section from the left pane.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w9tWikRcc-T7TIQRooa2ww.png" /><figcaption>Scripts Panel in ZAP</figcaption></figure><p><strong>Step-6:</strong></p><p>Now that the login flow is recorded, we can make sure it works by replaying the script using the “Script Console” tab and check the responses in ZEST Results tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0ujh6NtHmAGfbl9U8KcPKQ.png" /><figcaption>Execution of ZEST script in ZAP UI</figcaption></figure><p>By checking the response code it’s obvious that the script is working perfectly. Save the script to use it as part of Jenkins job.</p><p><strong>Step-6:</strong></p><p>To include the ZEST script as part of the Jenkins job, it is necessary to carry out few steps.</p><ol><li>Copy / Move the recored script to Jenkins system under the ZAP home directory with read/write permission.</li></ol><p>i.e PATH — /{zaphomedir}/scripts/scripts/authentication/Demo.zst</p><p>2. Edit the ZAP config file(config.xml) from ZAP home directory and include following snippet at the end of file to avoid this <a href="https://groups.google.com/forum/#!searchin/zaproxy-jenkins/config.xml|sort:date/zaproxy-jenkins/9TMVyQwks6o/3ZxuZoWMBQAJ">error</a>.</p><p>&lt;script&gt;<br> &lt;scripts&gt;<br> &lt;name&gt;Demo.zst&lt;/name&gt;<br> &lt;engine&gt;Mozilla Zest&lt;/engine&gt;<br> &lt;type&gt;authentication&lt;/type&gt;<br> &lt;enabled&gt;false&lt;/enabled&gt;<br> &lt;file&gt;/var/lib/jenkins/.ZAP_D<em>(my ZAP home)</em>/scripts/scripts/authentication/Demo.zst&lt;/file&gt;<br> &lt;/scripts&gt;</p><blockquote>Tip: If these steps are not configured properly it may cause the “script not found” error while running the job.</blockquote><p><strong>Step-6:</strong></p><p>Now that we have script copied to Jenkins machine, lets see how it can used for authentication. Let us select Script-based authentication under session properties section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AgLt63d9IsRYYvlFpyC8vg.png" /><figcaption>Script based authentication</figcaption></figure><p>The script can be selected from the drop-down and it is also possible to pass additional parameters as a Name-Value pair from the same dialog. I will explain about ZEST features in another post.</p><blockquote>Tip: Some commonly caused error while configuring script is addressed <a href="https://groups.google.com/forum/#!searchin/zaproxy-jenkins/$20Does$20not$20follow$20Authentication$20script$20interface%7Csort:date">here</a>.</blockquote><p>Click save and build the job and you will able to the ZEST script is loaded for authenticated scan.</p><p>In the next post, will cover about automated builds and many more..</p><p>CHEERSSS!!!</p><p>Thanks to <a href="https://medium.com/@cvignesh28"><strong>Vignesh C</strong></a><strong> </strong>for proof reading.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>💬<strong>.</strong></p><p><strong>To join our community Slack </strong>🗣️ <strong>and read our weekly Faun topics </strong>🗞️,<strong> click here⬇</strong></p><figure><a href="https://www.faun.dev/join/?utm_source=medium.com%2Ffaun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oSdFkACJxs5iy1oR" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c451a6639aae" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/security-automation-series-part-2-zap-jenkins-post-integration-actions-c451a6639aae">Security Automation Series — Part 2 ZAP- Jenkins Post Integration Actions</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Security Automation Series — Part 1 OWASP ZAP — Jenkins Integration]]></title>
            <link>https://faun.pub/security-automation-series-part-1-owasp-zap-jenkins-integration-50b091f29a36?source=rss-75ab4a58ddb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/50b091f29a36</guid>
            <category><![CDATA[automation-testing]]></category>
            <category><![CDATA[owaspzap]]></category>
            <category><![CDATA[bug-bounty]]></category>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Gowtham]]></dc:creator>
            <pubDate>Wed, 19 Jun 2019 17:44:04 GMT</pubDate>
            <atom:updated>2021-02-20T04:25:23.949Z</atom:updated>
            <content:encoded><![CDATA[<h3>Security Automation Series — Part 1 OWASP ZAP — Jenkins Integration</h3><p>This series is about various automation’s that can be used to perform Automated Vulnerability Assessment of Web Applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*KcMUgKVn8ztNspLJOkwPHQ.png" /><figcaption>ZAP — Jenkins Integration</figcaption></figure><p>Lets get started…</p><h4><strong>Part 1 — How to integrate OWASP ZAP in Jenkins and run a simple web application scan.</strong></h4><p>About <strong>OWASP ZAP:</strong></p><p>ZAP (ZED Attack Proxy) — is an open-source proxy tools like Burp which is used in Security Assessments of web apps. It offers various features like Scanner, Fuzzer , REST Api and lot more. A new interesting feature is ZAP Heads Up Display (HUD) which is really interesting.</p><p>About <strong>Jenkins</strong>:</p><p>Jenkins is an open source automation server widely used for CI / CD purposes.</p><p>In this post I will walkthrough installation of ZAP and Jenkins in a Ubuntu / Linux Operating system so that I can explain about issues and its solutions occur during the process.</p><p><strong>Step-1:</strong></p><p>Installing Jenkins in ubuntu — <a href="https://www.digitalocean.com/community/tutorials/how-to-install-jenkins-on-ubuntu-18-04">https://www.digitalocean.com/community/tutorials/how-to-install-jenkins-on-ubuntu-18-04</a></p><p>Once installed, configure Jenkins with an username &amp; password and login using the credentials.</p><p><strong>Step-2:</strong></p><p>For installing ZAP using we need following 2 Jenkins plugin needs to be installed:</p><ol><li>Custom Tool Plugin — This is used to install ZAP in the respective Operating System using Jenkins. If you have installed or need to install ZAP manually this plugin can be ignored. However to avoid unnecessary problems it is better to use the plugin.</li><li>OWASP ZAP official Plugin</li></ol><p>Choose “Manage Jenkins” -&gt; “Manage Plugins” search for OWASP ZAP , “Custom Tools Plugin” and install both.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oZBucWdQAvrCmFJroWUH4g.png" /><figcaption>OWASP ZAP Plugin in Jenkins</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N5n0h25KVz7t_cMRcZaSsg.png" /><figcaption>Custom Tools Plugin in Jenkins</figcaption></figure><p><strong>Step-3:</strong></p><p>Next using Custom Tool Plugin we will install ZAP in the system.</p><p>Choose “Manage Jenkins” -&gt; “Global Tool Configuration” -&gt; Custom Tool Option.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oIJPYmf1bILT0zIBWKmrQw.png" /><figcaption>Installing ZAP using Custom Tool Plugin</figcaption></figure><blockquote>Tip: Make sure keep the Label field blank to avoid <a href="https://groups.google.com/d/topic/zaproxy-jenkins/w5m9stza7pU/discussion"><strong>this</strong></a> error.</blockquote><p>You can use stable or weekly build based on your need.</p><p><strong>Step-4:</strong></p><p>Building a Jenkins job.</p><p>Now we can create a new Jenkins job to configure ZAP to run in the system.</p><p>Choose “New Item”-&gt; “Freestyle Project” with desired name and click Ok.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6jCUOtz0pJmcZbaj8AovvQ.png" /><figcaption>Creating New Project Item</figcaption></figure><p>Build the job without any options configured to create Workspace for the project, this helps to store reports, logs, etc,.</p><p><strong>Step-5:</strong></p><p>Installing ZAP in the system using Custom Tools Plugin. This step can be ignored if ZAP is already installed manually or any other ways.</p><p>Choose the created ZAP project and select configure. Under Build Environment section select “Install Custom tool” options. Click “Add Tool” and from the drop-down select ZAP(name chosen in Step-3).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tw-rLN-tdoNLjcbux3mfJA.png" /><figcaption>Configuring Build Environment</figcaption></figure><p>Click Apply and Save the project. Let’s run the build and find out how ZAP is getting installed.</p><p>Click “Build Now” and once build is complete select the build id and choose “Console Output”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3tFPjxGBh7KSReMPDRx__g.png" /><figcaption>ZAP installation output</figcaption></figure><p>We can now notice that ZAP installation Path and its workspace. Biingo !! Our first step towards integration is success!! ZAP is successfully installed.</p><p><strong>Step-6:</strong></p><p>Next step is to “Execute ZAP” during Build process to scan application of our choice.</p><p>Choose the same project and select configure, now <strong>uncheck</strong> “Install Custom Tool” option and under Build -&gt; Add Build Step -&gt; Execute ZAP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tVQrSPTIL5ZgwlfddJ1p6A.png" /><figcaption>Options to Execute ZAP</figcaption></figure><p>Specify Host and Port on which ZAP needs to run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j309itp7d92w6zcGcz3e0g.png" /><figcaption>Choosing Installation Method</figcaption></figure><p>For Installation Method we will choose Custom Tool Installation option. If ZAP is installed Manually select “System Installed” and set necessary Environment Variable to ZAP installed Path.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gCvkoI7iiGh2KwPlcRWpBA.png" /></figure><p>To Set Environment Variable Go to Manage Jenkins -&gt; Configure System -&gt; Environment variable checkbox under Global Properties. Click Add.</p><p>Name — ZAPPROXY_HOME , Value — Path where ZAP is installed (The path should be noted during manual installation)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zaJvG_FxGtlalWaefFxXBA.png" /><figcaption>Setting Environment Variables</figcaption></figure><p>Next we need to set ZAP Home Directory. This can be <em>/var/lib/jenkins/.ZAP_D</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_ULF-qwwFud01ViyPt27Zw.png" /><figcaption>Setting ZAP Home Directory</figcaption></figure><blockquote>Tip : Remember , ZAP installation and Home directory are different.</blockquote><p><strong>Step-7:</strong></p><p>Configuring the application for scanning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HIDcABNEdDQJp_8Xs5dpNQ.png" /><figcaption>Scan Configuration</figcaption></figure><p>Under Session Management, to store the session file for each build we can choose persist session or can load the existing session after a build. If we choose Persist Session chances are high it may consume system memory and might result this <a href="https://groups.google.com/forum/#!searchin/zaproxy-jenkins/zap$20session|sort:date/zaproxy-jenkins/Lzo1ALbz5xk/aJIJRFcACQAJ"><strong><em>error</em></strong></a><em>.</em></p><p>You can also specify various <em>J</em><a href="https://wiki.jenkins.io/display/JENKINS/Building+a+software+project"><em>enkins variables</em></a><em> like “BUILD_ID” to avoid </em>overwriting the same session file or the Context Name.</p><p>Include in Context — Define the list of URL’s to be scanned / in-scope.</p><p>Exclude in Context — Define the list of URL’s to be considered out of scope. We can also specify using Regex for exact pattern matching.</p><blockquote>Tip: You will get “<em>The provided url is not in the required context” </em>error if URL’s are not specified in “Include in Context” Filed.</blockquote><p><strong>Step-8:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*10pfDSHPJjtFMbkkYKPkrA.png" /><figcaption>Setting up Scan Mode</figcaption></figure><p>We can select the Starting Point and the type of scan under the Attack Mode menu. If you don’t find any value in Policy dropdown leave it default and it will pop-up after the first run.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Q5h_tJmjLJGNfx5UG0Log.png" /><figcaption>Generation of reports</figcaption></figure><p>It is possible to Generate Reports with the FileName (include jenkins variable) to avoid overwriting. Also you can Create JIRA issues which will not be covered in this post.</p><p>If you want to save logs , html reports of ZAP scans it can be done using “Post-Build Actions”</p><p>That’s IT 👍. We have successfully configured ZAP in Jenkins to perform a basic scan of the application.</p><p>In the next <strong>post</strong>, I will cover about application authentication, perform automated Builds and ZAP ZEST Script and many more…</p><p>PART 2 is here — <a href="https://medium.com/faun/security-automation-series-part-2-zap-jenkins-post-integration-actions-c451a6639aae">https://medium.com/faun/security-automation-series-part-2-zap-jenkins-post-integration-actions-c451a6639aae</a></p><p>Cheers!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/0*Piks8Tu6xUYpF4DU" /></figure><p><strong>Follow us on </strong><a href="https://twitter.com/joinfaun"><strong>Twitter</strong></a><strong> </strong>🐦<strong> and </strong><a href="https://www.facebook.com/faun.dev/"><strong>Facebook</strong></a><strong> </strong>👥<strong> and join our </strong><a href="https://www.facebook.com/groups/364904580892967/"><strong>Facebook Group</strong></a><strong> </strong>💬<strong>.</strong></p><p><strong>To join our community Slack </strong>🗣️ <strong>and read our weekly Faun topics </strong>🗞️,<strong> click here⬇</strong></p><figure><a href="https://www.faun.dev/join/?utm_source=medium.com%2Ffaun&amp;utm_medium=medium&amp;utm_campaign=faunmediumbanner"><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oSdFkACJxs5iy1oR" /></a></figure><h4>If this post was helpful, please click the clap 👏 button below a few times to show your support for the author! ⬇</h4><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50b091f29a36" width="1" height="1" alt=""><hr><p><a href="https://faun.pub/security-automation-series-part-1-owasp-zap-jenkins-integration-50b091f29a36">Security Automation Series — Part 1 OWASP ZAP — Jenkins Integration</a> was originally published in <a href="https://faun.pub/">FAUN.dev() 🐾</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Book of Bug Bounty Tips]]></title>
            <link>https://medium.com/@gowsundar/book-of-bug-bounty-tips-c6e1acece39b?source=rss-75ab4a58ddb9------2</link>
            <guid isPermaLink="false">https://medium.com/p/c6e1acece39b</guid>
            <dc:creator><![CDATA[Gowtham]]></dc:creator>
            <pubDate>Wed, 27 Mar 2019 09:16:32 GMT</pubDate>
            <atom:updated>2019-06-19T17:46:04.626Z</atom:updated>
            <content:encoded><![CDATA[<p>List of My Bug Bounty Tips</p><p><a href="https://app.gitbook.com/@gowsundar/s/book-of-bugbounty-tips/">https://app.gitbook.com/@gowsundar/s/book-of-bugbounty-tips/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6e1acece39b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>