<?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: Jeff Thorne</title>
    <description>The latest articles on Forem by Jeff Thorne (@jeffthorne).</description>
    <link>https://forem.com/jeffthorne</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%2F222084%2F0404a4a3-63ab-427a-aef1-b6be01bc9a95.jpeg</url>
      <title>Forem: Jeff Thorne</title>
      <link>https://forem.com/jeffthorne</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/jeffthorne"/>
    <language>en</language>
    <item>
      <title>Lacework VS Code Extension</title>
      <dc:creator>Jeff Thorne</dc:creator>
      <pubDate>Tue, 09 Nov 2021 22:54:00 +0000</pubDate>
      <link>https://forem.com/lacework/lacework-vs-code-extension-18la</link>
      <guid>https://forem.com/lacework/lacework-vs-code-extension-18la</guid>
      <description>&lt;p&gt;The Lacework VS Code vulnerability scanner extension is a new plugin that will quickly identify vulnerabilities in your base images right from your IDE. This is a first step and alpha release with expanded and additional capabilities to be released soon.&lt;/p&gt;

&lt;p&gt;This blog covers how to install lw-scanner and leverage it to perform image assurance scans from within VS Code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install lw-scanner&lt;/strong&gt;&lt;br&gt;
The plugin assumes that lw-scanner is installed on your local system. Installation instructions can be found here: &lt;a href="https://support.lacework.com/hc/en-us/articles/1500001777821-Integrate-Inline-Scanner" rel="noopener noreferrer"&gt;support.lacework.com&lt;/a&gt; and the the latest release of the scanner binary can be found at &lt;a href="https://github.com/lacework/lacework-vulnerability-scanner/releases" rel="noopener noreferrer"&gt;github.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once lw-scanner is installed the next step is to download the Lacework plugin from the VS Code Marketplace.&lt;/p&gt;

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

&lt;p&gt;With an active Dockerfile in the editor you can initiate an image assurance scan by clicking Command+Shift+P on macOS (Control+Shift+P on Windows/Linux).&lt;/p&gt;

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

&lt;p&gt;Once the scan is complete you will see a summary next to the base image that will disappear along with a more detailed scan result available in the output window.&lt;/p&gt;

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

&lt;p&gt;Source code can be found here for now: &lt;a href="https://github.com/jeffthorne/lacework-vscode-extension" rel="noopener noreferrer"&gt;github&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This is just a quick preview update. For suggestions or feedback please open an issue on the repo. PRs welcomed. Stay tuned for more.&lt;/p&gt;

&lt;p&gt;Cheers,&lt;br&gt;
Jeff&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>javascript</category>
      <category>security</category>
      <category>devops</category>
    </item>
    <item>
      <title>OPA @Lacework</title>
      <dc:creator>Jeff Thorne</dc:creator>
      <pubDate>Tue, 17 Aug 2021 22:19:52 +0000</pubDate>
      <link>https://forem.com/lacework/opa-lacework-27e5</link>
      <guid>https://forem.com/lacework/opa-lacework-27e5</guid>
      <description>&lt;p&gt;There is always a ton of innovation and exciting things happening in the Kubernetes community. One of the CNCF projects we are super excited about over here at Lacework is &lt;a href="https://www.openpolicyagent.org/"&gt;Open Policy Agent&lt;/a&gt; which has seen tremendous interest and adoption over the last 18months. If you’re not familiar with OPA it is a unified toolset and framework that can be used for consistent policy decisions across your cloud native stack. In 2020 alone the OPA project had over 35 million downloads and officially became an CNCF graduated project on Feb 4th, 2021. &lt;/p&gt;

&lt;p&gt;What really makes this project special is it’s open governance and that organizations can leverage their existing investment and skillset around policy in many facets of their cloud native stack. Lacework is committed to embracing OPA so that our customers can drive policy decisions in many parts of our platform.&lt;/p&gt;

&lt;p&gt;Where are we starting with our OPA support? No place better than in build. This will allow us to offer an enriched developer experience, deeper insight, software supply chain governance, and flexible decision making prior to application delivery.&lt;/p&gt;

&lt;p&gt;Ok enough of the fancy terms. Let’s get to the nuts and bolts of our current integration efforts. Lacework is currently in the process of launching a k8s security toolkit called Helios named after the greek titan of the sun and guardian of oaths. So how does OPA fit into Helios? One of Helios’ components is a k8s admission webhook that allows for policy decisions to be made at time of deployment through pod interception with OPA and Lacework image assurance.&lt;/p&gt;

&lt;p&gt;Admission webhooks intercept requests to the Kubernetes API server prior to persistence of the object, but after the request is authenticated and authorized. At a high level they offer admission control which governs and enforces how the cluster is used. Let’s take a look at how this works in action as seen in figure 1.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---TbuRGKE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/avrrxvbz1zqk2noutotu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---TbuRGKE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/avrrxvbz1zqk2noutotu.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Figure 1 - High level architecture of k8s admission webhook&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When the application or pod is deployed in step 1 and after the request has been authenticated and authorized it is passed the admission webhook which can be both mutating or validating for processing in step 2. From here the helios webhook will then lookup image assurance scan results with the Lacework platform for the image in step 3. This lookup is performed with the image SHA and if not found an on-demand scan can be initiated. From here in step 4 the scan results json object is sent to an OPA endpoint for a policy decision.&lt;/p&gt;

&lt;p&gt;Then based on the results received from the OPA endpoint the pod or deployment is either allowed to be provisioned or is blocked. This result along with any error message received from the OPA endpoint is passed to the kube API server for processing.&lt;/p&gt;

&lt;p&gt;We can see the results of this in action below in figure 2. The top terminal is an attempt to circumvent an approved organizational CI/CD pipeline and directly deploy application changes from kubectl. The bottom terminal is a tail on the Lacework Helios admission webhook. We can see that the pod deployment has been intercepted while image assurance results are validated against an OPA endpoint. Based on the vulnerability surface in this image the deployment was ultimately blocked from entering this cluster.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--91qX701d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/msooj0vimqtrf3nrr53y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--91qX701d--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/msooj0vimqtrf3nrr53y.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Figure 2 - Pod interception and OPA validation of scan results&lt;/strong&gt;  &lt;/p&gt;

&lt;p&gt;These types of checks and best practices can also be integrated at build time through a variety of plugins to well know CI/CD tools. In figure 3 we can see a Jenkins pipeline blocked through an arbitrary policy written in Rego and validated in build against Lacework’s image assurance scanning results. Figure 4 displays a portion of the resulting build artifact.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IQpkWjks--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mr1gich24koqs0b2i9be.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IQpkWjks--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mr1gich24koqs0b2i9be.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Figure 3 - Custom OPA policy in build driving pipeline decisions&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RuBolUVb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nnyuakw7r5psnuehc0b5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RuBolUVb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nnyuakw7r5psnuehc0b5.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Figure 4 - Resulting build artifact displaying scan decision and policy ID&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;These are just a couple of quick examples demonstrating the power and flexibility of using Open Policy Agent to enforce policy decisions at various stages in your build to deploy pipelines. In this article we covered how Lacework is integrating OPA into our k8s admission controller and CI/CD plugins. Stay tuned for more info on our OPA and other tech initiatives.&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>devops</category>
    </item>
    <item>
      <title>Integrating Accurics IaC Scanning into Jenkins</title>
      <dc:creator>Jeff Thorne</dc:creator>
      <pubDate>Wed, 09 Dec 2020 17:31:45 +0000</pubDate>
      <link>https://forem.com/jeffthorne/integrating-accurics-iac-scanning-into-jenkins-13ai</link>
      <guid>https://forem.com/jeffthorne/integrating-accurics-iac-scanning-into-jenkins-13ai</guid>
      <description>&lt;p&gt;Just a quick post on integrating IaC scanning into Jenkins with the Accurics CLI. This example will detect security violations in your Terraform provisioning along with any drift in config from running cloud resources in build. Super cool stuff!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Steps&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Download CLI:&lt;/strong&gt; 
From the Accurics dashboard for your chosen environment hit Download CLI. This will download the Accurics binary and config file. The config file is needed to associate the scan results with your Accurics account and specific environment.&lt;/li&gt;
&lt;/ol&gt;

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

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Add Step to your Jenkins pipeline file:&lt;/strong&gt; 
You can optionally set the -fail flag to stop the build if violations are detected. The CLI will produce reports in both html and json formats. For this example I have also optionally requested that Jenkins publish the HTML report as a build artifact.&lt;/li&gt;
&lt;/ol&gt;

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

&lt;p&gt;Here is what the results look like from within Jenkins for a failed pipeline.&lt;/p&gt;

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

&lt;p&gt;And the resulting html report:&lt;/p&gt;

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

&lt;p&gt;Looks like I have some violations to address for the new infrastructure definition for the jeffsbooks app but currently no drift from my running application and cloud environment 👍&lt;/p&gt;

&lt;p&gt;This was a super quick example on integrating IaC scanning for Terraform into a Jenkins pipeline. The Accurics CLI has many other options and support for other provisioning tools such as Helm, Kustomize, CFT, Ansible, ARM, CDM, etc.&lt;/p&gt;

&lt;p&gt;If any questions come up or help is needed feel free to drop me a line.&lt;/p&gt;

&lt;p&gt;Cheers,&lt;br&gt;
Jeff&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
