<?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>Forem: Dan Rollo</title>
    <description>The latest articles on Forem by Dan Rollo (@bhamail).</description>
    <link>https://forem.com/bhamail</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%2F360367%2Fa22d5f89-9e2e-4dc0-b9ee-154fdd885b3e.jpeg</url>
      <title>Forem: Dan Rollo</title>
      <link>https://forem.com/bhamail</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/bhamail"/>
    <language>en</language>
    <item>
      <title>Secure Your Golang Projects Using Nancy</title>
      <dc:creator>Dan Rollo</dc:creator>
      <pubDate>Mon, 13 Apr 2020 20:36:43 +0000</pubDate>
      <link>https://forem.com/sonatype/secure-your-golang-projects-using-nancy-5fk5</link>
      <guid>https://forem.com/sonatype/secure-your-golang-projects-using-nancy-5fk5</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fppxh2t5fsaksga0u7a3j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fppxh2t5fsaksga0u7a3j.png" alt="nancy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Who is Nancy?
&lt;/h3&gt;

&lt;p&gt;Nancy is a command line application, written in Golang by the Golang community and sponsored by Sonatype. It uses Sonatype’s OSS Index to check your dependencies for publicly filed vulnerabilities.&lt;/p&gt;

&lt;p&gt;You can get more information about Nancy by going to the GitHub repository for it at: &lt;br&gt;
&lt;a href="https://github.com/sonatype-nexus-community/nancy" rel="noopener noreferrer"&gt;https://github.com/sonatype-nexus-community/nancy&lt;/a&gt; or on &lt;a href="https://pkg.go.dev/github.com/sonatype-nexus-community/nancy?tab=doc" rel="noopener noreferrer"&gt;https://pkg.go.dev/github.com/sonatype-nexus-community/nancy?tab=doc&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Why would I use Nancy?
&lt;/h3&gt;

&lt;p&gt;Nancy can take dependency results from your go mod powered or dep powered projects and scan them for vulnerabilities. This is quite handy, as you’ll see that vulnerabilities pop up in libraries, like golang/x/crypto:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ossindex.sonatype.org/component/pkg:golang/golang.org/x/crypto@v0.0.0-20190227175134-215aa809caaf" rel="noopener noreferrer"&gt;https://ossindex.sonatype.org/component/pkg:golang/golang.org/x/crypto@v0.0.0-20190227175134-215aa809caaf&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Vulnerabilities in these third party or even standard lib libraries (x/crypto is a part of Golang itself!) can sneak up on you, if, for example, you are using a framework that uses them, or using them directly yourself. It’s never a good feeling getting pwned because of someone else’s code, and Nancy is here to help you!&lt;/p&gt;
&lt;h3&gt;
  
  
  How do I use Nancy?
&lt;/h3&gt;

&lt;p&gt;Nancy is quite easy to use, and the Community/Sonatype have gone to great lengths to make it as easy as possible.&lt;/p&gt;
&lt;h4&gt;
  
  
  Installing Nancy
&lt;/h4&gt;

&lt;p&gt;Nancy is distributed as an executable built with Golang and each executable is available on it’s release from multiple repositories:&lt;br&gt;
GitHub&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/sonatype-nexus-community/nancy/releases" rel="noopener noreferrer"&gt;https://github.com/sonatype-nexus-community/nancy/releases&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;
  
  
  Docker
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzytp1kvdfprrbwu54eyd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fzytp1kvdfprrbwu54eyd.png" alt="nancy-docker"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For ease of use a Docker image has been created, as well as a homebrew tap for OS X users that love brew!&lt;/p&gt;

&lt;p&gt;To run it with Docker one need only follow the instructions available here: &lt;a href="https://github.com/sonatype-nexus-community/nancy#docker-usage" rel="noopener noreferrer"&gt;https://github.com/sonatype-nexus-community/nancy#docker-usage&lt;/a&gt; or for ease of use in this post:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go list -m all | docker run -i sonatypecommunity/nancy:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h4&gt;
  
  
  Homebrew
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqzs58llis5zah3p3frwq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fqzs58llis5zah3p3frwq.png" alt="homebrew"&gt;&lt;/a&gt;&lt;br&gt;
To install with homebrew, instructions are available here: &lt;a href="https://github.com/sonatype-nexus-community/nancy#homebrew-usage" rel="noopener noreferrer"&gt;https://github.com/sonatype-nexus-community/nancy#homebrew-usage&lt;/a&gt;, and for ease of use, here you go:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew tap sonatype-nexus-community/homebrew-nancy-tap
brew install nancy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h4&gt;
  
  
  Ok I installed it, now what!?
&lt;/h4&gt;

&lt;p&gt;For a go mod powered project, one need only do:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go list -m all | nancy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;For a dep powered project:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nancy /path/to/your/Gopkg.lock
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;The beauty of Nancy is Nancy tries to meet you where you are. It cares about securing all projects. If you use a package manager that it doesn’t support, it is Open Source and the community is more than willing to help you change that!&lt;/p&gt;
&lt;h4&gt;
  
  
  What do results look like?
&lt;/h4&gt;

&lt;p&gt;If you run Nancy and find nothing wrong with your dependencies you’ll see something akin to the following:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fro22b9v3hb35ib6l9ipb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fro22b9v3hb35ib6l9ipb.png" alt="results-novuln"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Nancy will exit with a zero code in this case, and all is good in the world!&lt;/p&gt;

&lt;p&gt;If Nancy finds a vulnerability in one of your dependencies it will exit with a non zero code, allowing you to use Nancy as a tool in your CI/CD process, and fail builds, if you’d like.&lt;/p&gt;

&lt;p&gt;Output when it finds a vulnerability looks like:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Frtmeod463gus8lz6c4yg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Frtmeod463gus8lz6c4yg.png" alt="results-vuln"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You are given the information on what the vulnerability is, and how to get more info on the OSS Index site about it!&lt;/p&gt;
&lt;h4&gt;
  
  
  What do I do if the vulnerability doesn’t apply to me?
&lt;/h4&gt;

&lt;p&gt;Since Nancy is checking the dependencies for vulnerabilities, sometimes you’ll run into one where you are not using the affected code path. The community has built functionality to let you exclude the vulnerability from being reported.&lt;/p&gt;

&lt;p&gt;The information on how to do this is available here: &lt;a href="https://github.com/sonatype-nexus-community/nancy#exclude-vulnerabilities" rel="noopener noreferrer"&gt;https://github.com/sonatype-nexus-community/nancy#exclude-vulnerabilities&lt;/a&gt; and for ease of use:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nancy -exclude-vulnerability CVE-789,bcb0c38d-0d35-44ee-b7a7-8f77183d1ae2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;You can also use an exclusion file to keep better track of them and avoid passing in long lists via the command line. The default file name, if you check this in to your repo, would be: &lt;code&gt;.nancy-ignore&lt;/code&gt; and an example looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# This vulnerability is coming from package xyz, we are ok with this for now
CVN-111 
CVN-123 # Mitigated the risk of this since we only use one method in this package and the affected code doesn't matter
CVN-543
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to temporarily exclude a vulnerability, the community has provided functionality for that as well:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CVN-111 until=2021-01-01
CVN-543 until=2018-02-12 #Waiting on release from third party. Should be out before this date but gives us a little time to fix it.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This can be handy if you are waiting for the upstream library to get fixed, and want to just exclude the vulnerability until a new version has been released, or just a specific time frame to remind yourself.&lt;/p&gt;

&lt;h4&gt;
  
  
  I love this! How do I use Nancy in CI/CD so that it runs for everything on my repo?
&lt;/h4&gt;

&lt;p&gt;We got you, fam!&lt;/p&gt;

&lt;p&gt;You can take a look at how we have used Nancy in CI/CD at the following repo: &lt;a href="https://github.com/sonatype-nexus-community/intentionally-vulnerable-golang-project" rel="noopener noreferrer"&gt;https://github.com/sonatype-nexus-community/intentionally-vulnerable-golang-project&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are examples for TravisCI and CircleCI.&lt;/p&gt;

&lt;p&gt;There are also &lt;a href="https://bitbucket.org/product/features/pipelines/integrations?p=sonatype-community/nancy-scan" rel="noopener noreferrer"&gt;BitBucket pipes for Nancy&lt;/a&gt;, and community willing &lt;a href="https://github.com/marketplace/actions/nancy-for-github-actions" rel="noopener noreferrer"&gt;GitHub actions&lt;/a&gt; :)&lt;/p&gt;

&lt;h4&gt;
  
  
  What else?
&lt;/h4&gt;

&lt;p&gt;Nancy works with Sonatype’s OSS Index by default, but also will work with Nexus Lifecycle, for improved policy driven auditing. You can get information on that here: &lt;a href="https://github.com/sonatype-nexus-community/nancy#nexus-iq-server-options" rel="noopener noreferrer"&gt;https://github.com/sonatype-nexus-community/nancy#nexus-iq-server-options&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A couple notes:&lt;/p&gt;

&lt;p&gt;OSS Index usage is prone to rate limiting, the community goes out of their way to make sure you won’t run into this however, Nancy caches results from OSS Index for a period of 12 hours, ensuring that you only run checks against dependencies you change the version for, or results that have expired from it’s cache.&lt;/p&gt;

&lt;h5&gt;
  
  
  OSS Index account registration
&lt;/h5&gt;

&lt;p&gt;If you register for Sonatype’s OSS Index, your rate limiting gets substantially upgraded which can be very nice if you are using Nancy in a CI/CD pipeline.&lt;/p&gt;

&lt;p&gt;You can register for a free OSS Index account here: &lt;a href="https://ossindex.sonatype.org/user/register" rel="noopener noreferrer"&gt;https://ossindex.sonatype.org/user/register&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To see how to use your new registered user with Nancy, check out &lt;a href="https://github.com/sonatype-nexus-community/nancy#rate-limiting--setting-oss-index-config" rel="noopener noreferrer"&gt;this portion of Nancy’s documentation&lt;/a&gt;. If you are reading along in this post, it’s pretty easy:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nancy config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;From there decide on if you are setting OSS Index or Nexus IQ Server config, and Nancy will save it for you.&lt;/p&gt;

&lt;p&gt;NOTE: A good portion of the OSS Index tools (jake, AuditJS, chelsea, etc…) will pick up this config if you set it once, allowing all of the tools you use to benefit from this!&lt;/p&gt;

&lt;h4&gt;
  
  
  Feedback
&lt;/h4&gt;

&lt;p&gt;If you end up using Nancy, the community and Sonatype would love to hear your feedback, we actively work on this project, and we love to help the Golang community shift security further left!&lt;/p&gt;

&lt;p&gt;If you run into an issue with Nancy, go ahead and file an issue on the GitHub repo, here: &lt;a href="https://github.com/sonatype-nexus-community/nancy/issues" rel="noopener noreferrer"&gt;https://github.com/sonatype-nexus-community/nancy/issues&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you’d like to give us just general feedback, reach out to me! You can leave a comment on this article or reach out otherwise.&lt;/p&gt;

&lt;h4&gt;
  
  
  I want to work on this too!
&lt;/h4&gt;

&lt;p&gt;Nancy is open source, and we love getting new contributors. Interested in working on Nancy with the community? Pop in to their gitter: &lt;a href="https://gitter.im/sonatype-nexus-community/nancy" rel="noopener noreferrer"&gt;https://gitter.im/sonatype-nexus-community/nancy&lt;/a&gt; or just send us a PR. Nancy is powered by community contributors, and we are all very proud of their contributions that make this tool even better!&lt;/p&gt;

&lt;p&gt;Thanks for reading this article, and we hope you get a ton of value out of using Nancy!&lt;/p&gt;

</description>
      <category>security</category>
      <category>go</category>
      <category>mod</category>
      <category>dep</category>
    </item>
    <item>
      <title>3D Printed Face Shields</title>
      <dc:creator>Dan Rollo</dc:creator>
      <pubDate>Fri, 03 Apr 2020 20:20:20 +0000</pubDate>
      <link>https://forem.com/bhamail/3d-printed-face-shields-4j5n</link>
      <guid>https://forem.com/bhamail/3d-printed-face-shields-4j5n</guid>
      <description>&lt;p&gt;Hi All,&lt;/p&gt;

&lt;p&gt;I really wish my first post wasn't about this sort of thing, but here goes.&lt;/p&gt;

&lt;p&gt;I sincerely hope you DO NOT need this information, but just case, I am sharing our experience with crowd sourcing COVID-19 Face Shields. The link below has the .stl files and parts we used. Tidbits like using the 3D printers from local schools to scale up production can help a lot.&lt;/p&gt;

&lt;p&gt;Be well!&lt;br&gt;
Dan&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/bha-github-organization/trip-d-print#3d-printed-face-shields"&gt;https://github.com/bha-github-organization/trip-d-print#3d-printed-face-shields&lt;/a&gt;&lt;/p&gt;

</description>
      <category>3dprinting</category>
    </item>
  </channel>
</rss>
