<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mitali Bisht 🐥</title>
    <description>The latest articles on DEV Community by Mitali Bisht 🐥 (@engrmitalib).</description>
    <link>https://dev.to/engrmitalib</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%2F397545%2F1fd100eb-7cdc-4aaa-b3ea-acdacbc1f2a6.jpg</url>
      <title>DEV Community: Mitali Bisht 🐥</title>
      <link>https://dev.to/engrmitalib</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/engrmitalib"/>
    <language>en</language>
    <item>
      <title>Detecting, Reporting and Mitigating System Vulnerabilities for Go</title>
      <dc:creator>Mitali Bisht 🐥</dc:creator>
      <pubDate>Mon, 01 Jun 2020 21:57:05 +0000</pubDate>
      <link>https://dev.to/engrmitalib/detecting-reporting-and-mitigating-system-vulnerabilities-for-go-435l</link>
      <guid>https://dev.to/engrmitalib/detecting-reporting-and-mitigating-system-vulnerabilities-for-go-435l</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%2Fiqg9777n2wezwiwlqz9e.jpg" 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%2Fiqg9777n2wezwiwlqz9e.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go Module vulnerabilities frustrate the lives of many Go developers and can turn a simple project into a battle of endurance between the dev and their patience. With the process of CI/CD &lt;a href="https://jfrog.com/webinar/shift-left-with-artifactory-pro-x/" rel="noopener noreferrer"&gt;shifting left&lt;/a&gt; more and more, it’s becoming even more pertinent for developers to be able to track and report vulnerabilities as early as possible. &lt;a href="https://search.gocenter.io/" rel="noopener noreferrer"&gt;JFrog GoCenter&lt;/a&gt; can help &lt;a href="https://jfrog.com/blog/detecting-reporting-and-mitigating-vulnerabilities-for-go-modules/" rel="noopener noreferrer"&gt;track and mitigate these vulnerabilities&lt;/a&gt; and make the lives of Go developers easier.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Reporting Vulnerabilities&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Vulnerabilities are monitored consistently throughout the development lifecycle of any system/application and should be reported by anyone who finds the issue so that it’s remediation can be tracked and shared among common organizations. Known vulnerabilities are tracked and classified using the &lt;strong&gt;Common Vulnerability and Exposures (CVE)&lt;/strong&gt; - &lt;a href="https://www.jfrog.com/confluence/display/JFROG/Fixed+Security+Vulnerabilities" rel="noopener noreferrer"&gt;a list&lt;/a&gt; of publicly disclosed information security vulnerabilities and exposures. Each CVE contains a standard identifier number (CVE ID), a status indicator, a brief description of the vulnerability and references related to vulnerability reports and advisories. &lt;/p&gt;

&lt;p&gt;CVE isn't a vulnerability database - instead, CVE is designed to allow vulnerability databases and other tools to be linked together and facilitates comparisons between security tools and services. The &lt;a href="https://nvd.nist.gov/" rel="noopener noreferrer"&gt;&lt;strong&gt;National Vulnerability Database (NVD)&lt;/strong&gt;&lt;/a&gt; is a free, public database that uses the CVE list identifiers and includes fix information, scoring and other pertinent information for each vulnerability.&lt;/p&gt;

&lt;p&gt;Detected vulnerabilities must be reported to one of the &lt;strong&gt;CVE Numbering Authorities (CNA)&lt;/strong&gt; accompanied by detailed documentation explaining the impact of the vulnerability and at least one codebase that it affects before it can be recognized as a common vulnerability and assigned a CVE ID. For reference, the format for the &lt;strong&gt;CVE ID = CVE prefix + Year + Arbitrary Digits&lt;/strong&gt;. Below is an example of a CVE ID entry:&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%2Fi%2Fxnwkx3svewfs8wun085z.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%2Fxnwkx3svewfs8wun085z.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;The Data Complexity of Securing Go Modules&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Securing Go modules can be a tricky task, specifically because of the relationship between Go modules and Go packages. Once the security data for a Go module is received, it’s difficult to correlate that data to a specific module version. This is because security vulnerabilities exist on the package level but are reported on the module level. This can leave the impression that the entire module is vulnerable, but that’s often not the case. More than likely, your module will remain secure unless you consume the vulnerable package data. &lt;/p&gt;

&lt;p&gt;Let’s use &lt;strong&gt;CVE-2020-10660&lt;/strong&gt; as an example. Below is an excerpt from the version 1.3.4 changelog detailing the effects of this vulnerability: &lt;/p&gt;

&lt;p&gt;&lt;a href="http://gopkg.in/hashicorp/vault.v0" rel="noopener noreferrer"&gt;gopkg.in/hashicorp/vault.v0&lt;/a&gt; and &lt;a href="http://github.com/hashicorp/vault" rel="noopener noreferrer"&gt;github.com/hashicorp/vault&lt;/a&gt;, have both been affected by &lt;strong&gt;CVE-2020-10660&lt;/strong&gt; in HashiCorp Vault and Vault Enterprise versions 0.9.0 through 1.3.3. While using these packages they may, under certain circumstances, have an entity's group membership inadvertently include groups that the entity no longer has permissions to. &lt;/p&gt;

&lt;p&gt;Another vulnerability was identified in Vault Enterprise such that, under certain circumstances, existing nested-path policies may give access to namespaces created after-the-fact. Luckily, there was a change made to fix these vulnerabilities in version 1.3.4.&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%2Fi%2Fea763ujf9p5o06n6ngnz.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%2Fea763ujf9p5o06n6ngnz.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Looking above, the fix was made within &lt;a href="https://search.gocenter.io/github.com/hashicorp/vault?version=v0.10.0" rel="noopener noreferrer"&gt;&lt;strong&gt;“github.com/hashicorp/vault/vault”&lt;/strong&gt;&lt;/a&gt;. The module &lt;a href="https://search.gocenter.io/github.com/istio/istio?version=v0.0.0-20191015182630-149c2fc74f0a&amp;amp;tab=overview" rel="noopener noreferrer"&gt;istio.io/istio&lt;/a&gt; has a dependency on “github.com/hashicorp/vault/vault” in its go.mod file. Normally, you would assume that the security of istio.io/istio would be compromised, but it’s only using &lt;a href="https://github.com/hashicorp/vault/tree/master/api" rel="noopener noreferrer"&gt;&lt;strong&gt;“github.com/hashicorp/vault/api”&lt;/strong&gt;&lt;/a&gt; package, so its code is not affected by the vulnerability. See the source code below.&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%2Fi%2Ff33oywyis916uitf14sh.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%2Ff33oywyis916uitf14sh.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Mitigating your Software Vulnerabilities&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Now that you understand the process of how Go Module vulnerabilities are reported and some details around the security complexities, let’s see how to mitigate these threats in future development.&lt;/p&gt;

&lt;p&gt;To start, let’s look at the &lt;a href="https://search.gocenter.io/github.com/hashicorp/vault?version=v0.10.1&amp;amp;tab=readme" rel="noopener noreferrer"&gt;github/hashicorp/vault&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using CVE data, &lt;a href="https://jfrog.com/xray/" rel="noopener noreferrer"&gt;JFrog Xray&lt;/a&gt; is able to scan all the dependencies in a go.mod file held by GoCenter and identify every vulnerability. GoCenter exposes this Xray data on the &lt;a href="https://search.gocenter.io/github.com/hashicorp/vault?version=v0.10.1&amp;amp;tab=dependencies" rel="noopener noreferrer"&gt;&lt;strong&gt;Dependencies tab&lt;/strong&gt;&lt;/a&gt; to provide you detailed information about vulnerable components at every level of your dependency tree. You’ll see a warning triangle next to each vulnerable module. You can then click on the vulnerable module and be routed to that page. From there, click on the &lt;a href="https://search.gocenter.io/github.com/hashicorp/vault?version=v0.10.1&amp;amp;tab=versions" rel="noopener noreferrer"&gt;&lt;strong&gt;Version tab&lt;/strong&gt;&lt;/a&gt; to look for a secure version of that module so that you can upgrade that in your go.mod file.&lt;/p&gt;

&lt;p&gt;Once all components and dependencies have been identified, their information is cross-referenced with other vulnerability feeds and databases to alert you of any potential threats. Basic &lt;a href="https://jfrog.com/blog/gocenter-reveals-go-module-vulnerabilities-with-xray/" rel="noopener noreferrer"&gt;Xray vulnerability scanning for Go modules is available for free on  GoCenter&lt;/a&gt;, shown in the &lt;a href="https://search.gocenter.io/github.com/hashicorp/vault?version=v0.10.1&amp;amp;tab=security" rel="noopener noreferrer"&gt;&lt;strong&gt;Security tab&lt;/strong&gt;&lt;/a&gt;:&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%2Fi%2Fro5fzqx3h8p8jop9s7kk.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%2Fro5fzqx3h8p8jop9s7kk.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Keeping your Software Secure with GoCenter&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;GoCenter is a public GOPROXY and central repository with over 700,000 Go module versions. When using GoCenter as your GOPROXY, you can be sure that the version of code downloaded is the correct version from the correct source code. GoCenter as your GOPROXY works seamlessly with Go commands and has the advantage of being secure, fast, available and storage efficient. &lt;/p&gt;

&lt;p&gt;Many Golang developers can also bring GoCenter’s vulnerability information directly into their IDE, using the free &lt;a href="https://jfrog.com/blog/free-go-module-vulnerability-scanning-in-visual-studio-code/" rel="noopener noreferrer"&gt;JFrog extension for VS Code&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;With the CI/CD cycle shifted to the left more and more, GoCenter’s security features can help you identify whether or not there are vulnerable dependencies in the public Go module versions you are importing. &lt;/p&gt;

</description>
      <category>go</category>
      <category>security</category>
    </item>
    <item>
      <title>#Managing Go Module Pseudo-Versions in Go 1.13</title>
      <dc:creator>Mitali Bisht 🐥</dc:creator>
      <pubDate>Sun, 31 May 2020 06:20:15 +0000</pubDate>
      <link>https://dev.to/engrmitalib/managing-go-module-pseudo-versions-in-go-1-13-678</link>
      <guid>https://dev.to/engrmitalib/managing-go-module-pseudo-versions-in-go-1-13-678</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%2F1ee3k5b8o8aojpyollcd.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%2F1ee3k5b8o8aojpyollcd.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Go modules have helped bring order to Go development, but there’s been some disorder lurking. Managing module pseudo-versions can be difficult, especially with some of the latest changes to Go.&lt;/p&gt;

&lt;p&gt;Let’s take a look at how pseudo-versions work, and what you can expect from those changes. We also offer some guidance on keeping your Go builds working as you upgrade to Go 1.13 and later.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Go Module Versioning&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The ability to version &lt;a href="https://search.gocenter.io/" rel="noopener noreferrer"&gt;Go modules&lt;/a&gt; is a key feature, providing developers a way to make sure their applications use the dependencies they intend. When modules are versioned, an app can specify the use of a module version they know will be compatible with the rest of their runtime. &lt;/p&gt;

&lt;p&gt;A Go module version is assigned by tagging its revision in the underlying source repository. The go command uses &lt;a href="https://semver.org/" rel="noopener noreferrer"&gt;semantic versioning&lt;/a&gt; of the standard form &lt;strong&gt;vX.Y.Z&lt;/strong&gt; to describe the module version. The version number changes based on the changes made in the API :&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%2Fi%2F2ihnglc234r7hf6gp0r3.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%2F2ihnglc234r7hf6gp0r3.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From this standard format, module versions can be compared to identify which should be considered most or least current.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Using Pseudo-Versions&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;A versioned Go module is one that has been released for general use and should be preferred by most developers. However, there are some cases where you cannot release the most current version of a module.&lt;/p&gt;

&lt;p&gt;For example, a team may need to share an interim version during development. This is especially the case when a dependent project has no released versions yet, so it hasn’t been tagged with a version. Similarly, you may need to develop against a commit that hasn’t yet been tagged.&lt;/p&gt;

&lt;p&gt;To use an untagged version of a module as a dependency, it must be referenced by its &lt;strong&gt;pseudo-version&lt;/strong&gt; identifier. A pseudo-version has the following format:&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%2Fi%2Fbhwmx57tuepl7rh5h4rd.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%2Fbhwmx57tuepl7rh5h4rd.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are &lt;strong&gt;3 acceptable forms of pseudo-version&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;vX.0.0-yyyymmddhhmmss-abcdefxyz when no earlier versioned commit 
with an appropriate major version before target commit&lt;/li&gt;
&lt;li&gt;vX.Y.Z-pre.0.yyyymmddhhmmss-abcdefxyz when most recent versioned 
commit before the target commit is vX.Y.Z-pre&lt;/li&gt;
&lt;li&gt;vX.Y.(Z+1)-0.yyyymmddhhmmss-abcdefxyz when most recent versioned 
commit before the target commit is vX.Y.Z&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;As a best practice, a pseudo-version string should never be typed by hand&lt;/strong&gt;. The go command will accept the plain commit hash and translate it into a pseudo-version automatically. This method helps to compare revisions based on the generated timestamp. &lt;/p&gt;

&lt;p&gt;For example, a go get command might use just the commit hash for the module query:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-&amp;gt; go get github.com/x/sys@c856192   # records v0.0.0-20180517173623-c85619274f5d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There are problems with not letting the go command automatically generate the pseudo-version:&lt;/p&gt;

&lt;p&gt;The pseudo-version participates in minimal version selection. If its version prefix is inaccurate, the pseudo-version may appear to have higher precedence than the releases that follow it, effectively pinning the module to that commit&lt;br&gt;
The commit date within pseudo-version provides a total order among pseudo-versions, so if it gets edited it will mess up the ordering&lt;/p&gt;

&lt;p&gt;Despite this recommendation, sometimes a pseudo-version may exist in a go module that has been edited by hand. In other instances, the full pseudo-version string may be generated by a third-party tool. &lt;/p&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;Stricter Rules&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Through release 1.12, Go was forgiving for pseudo-version references. Most operations involving pseudo-versions accepted any arbitrary combination of version string and date, and would resolve to the underlying revision (typically a Git commit hash) as long as that revision existed.&lt;/p&gt;

&lt;p&gt;The release of Go 1.13 brought stricter enforcement, in order to address the problems noted above. Go 1.13 restricts the pseudo-versions that ‘go’ command accepts, rendering some previously accepted but not canonical versions invalid. &lt;/p&gt;

&lt;p&gt;The go client now performs some validation on different elements of the pseudo-version against the version control metadata:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;tag&lt;/strong&gt; from which the pseudo-version derives points to the 
named revision or one of its ancestors as reported by the underlying 
VCS tool, or the pseudo-version is not derived from any tag (i.e. 
has a “vX.0.0-” prefix before the date string) and uses the lowest 
major version appropriate to the module path&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;date string&lt;/strong&gt; within the pseudo-version matches the UTC 
timestamp of the revision as reported by the underlying VCS tool&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;short name of the revision&lt;/strong&gt; within the pseudo-version is the 
same as the short name generated by the go command.&lt;/li&gt;
&lt;li&gt;The pseudo-version includes a &lt;strong&gt;‘+incompatible’ suffix&lt;/strong&gt; only if it 
is needed for the corresponding major version, and only if the 
underlying module does not have a go.mod file&lt;/li&gt;
&lt;li&gt;Even after resolving the module from proxy, the go client will try 
to fetch the checksum content from the &lt;strong&gt;checksum server&lt;/strong&gt;, which 
enforces the same pseudo-version validation rules and will refuse to 
serve the checksum content.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  &lt;strong&gt;How to Fix Improper Pseudo-versions&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In order to move to Go 1.13, a developer must correct all pseudo-version references that don’t align with the above requirements. Otherwise the go client will flag an exception:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go get golang.org/x/sys@v0.0.0-20190726090000-fde4db37ae7a: invalid pseudo-version: does not match version-control timestamp (2019-08-13T06:44:41Z)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Fortunately, this is pretty easy to do through your &lt;a href="https://golang.org/cmd/go/#hdr-The_go_mod_file" rel="noopener noreferrer"&gt;go.mod file&lt;/a&gt; where your pseudo-version references are made.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If the go.mod file’s require directive has an incorrect pseudo-version, this can be corrected by replace the full pseudo-version reference with just the commit hash string
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;require {
   golang.org/x/sys fde4db37ae7a
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;If one of the transitive dependencies references an invalid pseudo-version, you can use the replace directive in your go.mod file to force the correction:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;replace golang.org/x/sys v0.0.0-20190726091711-fde4db37ae7a =&amp;gt;
   golang.org/x/sys fde4db37ae7a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;GoCenter Can Help&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;An important principle of GoCenter, the &lt;a href="https://search.gocenter.io" rel="noopener noreferrer"&gt;free repository of versioned Go Modules&lt;/a&gt; is being version agnostic. JFrog’s Community Engineering team has made important updates to GoCenter to support all versions of Go through 1.13, and we are in the process of further updates to accommodate Go 1.14 requirements. GoCenter can help you comply with the &lt;a href="https://www.youtube.com/watch?v=2xw6Qe3zZyU&amp;amp;amp=&amp;amp;feature=youtu.behttps%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D2xw6Qe3zZyU&amp;amp;amp=&amp;amp;feature=youtu.be" rel="noopener noreferrer"&gt;pseudo-version validation&lt;/a&gt; by redirecting to the correct pseudo-version. GoCenter changes the metadata in the .info with the correct version when the module download was requested for incorrect pseudo-version.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-&amp;gt; curl https://gocenter.io/golang.org/x/sys/@v/fde4db37ae7a.info

{ “name” : “v0.0.0-20190813064441-fde4db37ae7a”,
  “shortName” : “v0.0.0-20190813064441-fde4db37ae7a”,
  “version” : “v0.0.0-20190813064441-fde4db37ae7az”,
  “time” : “2019-08-13T08:03:52Z”
 }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To make use of GoCenter, set your GOPROXY&lt;/p&gt;

&lt;p&gt;GOPROXY=&lt;a href="https://gocenter.io/" rel="noopener noreferrer"&gt;https://gocenter.io/&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Go 1.12 and before&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;For Go 1.12 and before users, GoCenter will update the go.mod file held in its repository with the correct pseudo-version. GoCenter will still serve the incorrect pseudo-version that was processed in GoCenter before this change.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-&amp;gt; go version
go version go1.12.14 darwin/amd64
-&amp;gt; go get golang.org/x/sys@v0.0.0-20190726090000-fde4db37ae7a
go: finding golang.org/x/sys v0.0.0-20190726090000-fde4db37ae7a
-&amp;gt; cat go.mod
module example

go 1.12

require golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // indirect
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  &lt;strong&gt;For Go 1.13 and later&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Go 1.13 and later users will receive an error message that points to the correct pseudo-version.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-&amp;gt; go version
go version go1.13.5 darwin/amd64

-&amp;gt; go get golang.org/x/sys@v0.0.0-20190726090000-fde4db37ae7a
go: finding golang.org v0.0.0-20190726090000-fde4db37ae7a
go: finding golang.org/x/sys v0.0.0-20190726090000-fde4db37ae7a
go: finding golang.org/x v0.0.0-20190726090000-fde4db37ae7a
go get golang.org/x/sys@v0.0.0-20190726090000-fde4db37ae7a: golang.org/x/sys@v0.0.0-20190726090000-fde4db37ae7a: proxy returned info for version v0.0.0-20190813064441-fde4db37ae7a instead of requested version

-&amp;gt; cat go.mod 
module example.com/mitali

go 1.13
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In order to update the correct pseudo-version in the go.mod file, Go 1.13 users need to change the go get to include only the commit hash part of pseudo-version.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-&amp;gt; go get golang.org/x/sys@fde4db37ae7a
go: finding golang.org fde4db37ae7a
go: finding golang.org/x/sys fde4db37ae7a
go: finding golang.org/x fde4db37ae7a

-&amp;gt; cat go.mod 
module example.com/mitali

go 1.13

require golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // indirect
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to override this behavior and have GoCenter serve the incorrect pseudo-version that was processed earlier, then you can set GOSUMDB= off.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Changes in Go 1.14 for Modules&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;As we noted, JFrog is working on changes to GoCenter to support Go 1.14. Here are some of the changes to Go in that release that affect the operation of modules that you may want to be aware of:&lt;/p&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;go command flags&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;go get command no longer accepts the -mod flag &lt;/li&gt;
&lt;li&gt;-mod=readonly is set by default if there is no top level vendor directory and go.mod file is read only&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;-modfile=file&lt;/strong&gt; new flag introduced which instructs go command to read/write an alternate go.mod file and an alternate go.sum file will also be used. Although a file named go.mod must still be present in order to determine the module root directory&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;go.mod file changes&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;go get will not upgrade to an +incompatible major version unless it is requested explicitly or already required&lt;/li&gt;
&lt;li&gt;go commands (except go mod tidy) will not remove a require directive that specifies a version of an indirect dependency that is already implied by other dependencies of the main module&lt;/li&gt;
&lt;li&gt;When -mod=readonly flag is set then the go command will not fail due to a missing go directive or any error&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  &lt;strong&gt;Module download&lt;/strong&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;go command now supports &lt;strong&gt;Subversion repositories&lt;/strong&gt; in module mode&lt;/li&gt;
&lt;li&gt;go command now includes snippets of &lt;strong&gt;plain-text error messages&lt;/strong&gt; from module proxies and other HTTP servers. An error message will only be shown if it is valid UTF-8 and consists of monopoly graphic characters and spaces.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Using Pseudo Versions with Confidence&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;We hope that the steps outlined help you manage your pseudo versions more easily and effectively. As more versions are released, more will change and &lt;a href="https://jfrog.com/" rel="noopener noreferrer"&gt;JFrog&lt;/a&gt; will do all that it can to ensure that we are ahead of the curve! Look forward to more helpful blogs from us in the very near future and If you haven’t explored GoCenter’s free repository of Go modules yet, we invite you to do so! With a rich UI that helps you examine data about all 600,000+ Go modules, it can help you gain powerful command over the GoLang dependencies you use&lt;/p&gt;

</description>
      <category>go</category>
    </item>
  </channel>
</rss>
