<?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"><channel><title><![CDATA[Untitled Publication]]></title><description><![CDATA[Untitled Publication]]></description><link>https://viksmals.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Sep 2026 12:08:12 GMT</lastBuildDate><atom:link href="https://viksmals.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Running Vulnerability Scans for Spark Third Party Packages]]></title><description><![CDATA[If you use Spark in your codebase, chances are you also use some popular third-party packages to work with Spark. What does this mean from a security perspective? Your application may have some security vulnerabilities introduced due to these third-p...]]></description><link>https://viksmals.hashnode.dev/running-vulnerability-scans-for-spark-third-party-packages</link><guid isPermaLink="true">https://viksmals.hashnode.dev/running-vulnerability-scans-for-spark-third-party-packages</guid><category><![CDATA[Spark For Data Science]]></category><category><![CDATA[Security]]></category><category><![CDATA[trivy]]></category><category><![CDATA[PySpark]]></category><category><![CDATA[security testing ]]></category><category><![CDATA[#apache-spark]]></category><dc:creator><![CDATA[Malavika]]></dc:creator><pubDate>Sun, 11 Feb 2024 17:37:23 GMT</pubDate><content:encoded><![CDATA[<p>If you use Spark in your codebase, chances are you also use some popular third-party packages to work with Spark. What does this mean from a security perspective? Your application may have some security vulnerabilities introduced due to these third-party packages too. If you are looking to find vulnerabilities in these packages, sharing what I tried in the hope that it helps you out as I couldn’t find too many resources when researching for my specific use case.</p>
<p>1. Get the source repository of the third-party package that you want to assess. This can be found at <a target="_blank" href="https://spark-packages.org/">https://spark-packages.org/</a>.</p>
<p>As an example, let’s consider kafka-spark-consumer. The corresponding page of <a target="_blank" href="https://spark-packages.org/package/dibbhatt/kafka-spark-consumer">kafka-spark-consumer</a> points you to the source <a target="_blank" href="https://github.com/dibbhatt/kafka-spark-consumer">repo</a>. </p>
<p><img src="https://cdn-images-1.medium.com/max/800/1*hyNR0C1coaYKNOk4ye3Lgw.png" alt /></p>
<p>The commit hash of the versions would take you to the source code of the package. </p>
<p>2. I used <a target="_blank" href="https://aquasecurity.github.io/trivy/v0.48/">Trivy</a> for scanning security vulnerabilities. If Trivy isn’t installed already, install the same using </p>
<pre><code class="lang-plaintext">sudo snap install trivy
</code></pre>
<p>3. Once Trivy is installed, then use the Trivy command for scanning Git repositories and provide the URL we obtained from Step 1. </p>
<pre><code class="lang-plaintext">trivy repo https://github.com/dibbhatt/kafka-spark-consumer.git
</code></pre>
<p>Trivy traverses through relevant files and prints the list of potential vulnerabilities and their severity. It also shows the current version of the dependency packages and the version in which the security vulnerability may be potentially fixed, in case you are interested in upgrading the packages to fix the issues. </p>
<p><img src="https://cdn-images-1.medium.com/max/800/1*FsKMfmjjQa0Vw-jb87qNug.png" alt /></p>
<p>Please note that Trivy does the <a target="_blank" href="https://aquasecurity.github.io/trivy/v0.20.2/vulnerability/detection/language/">check</a> by detecting a few language-specific files in the directory, for example, <code>Pipfile.lock</code> for Python, and then uses these files to scan the vulnerabilities in the dependencies. If these files are not present in the package, or the package is written in a language unsupported by Trivy, the result of the scan may not be accurate. In such cases, using alternative tools to Trivy would be the way to go.</p>
]]></content:encoded></item></channel></rss>