<?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: Julian Cantillo</title>
    <description>The latest articles on Forem by Julian Cantillo (@juliancantillo).</description>
    <link>https://forem.com/juliancantillo</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%2F67225%2F9f0c1170-7f35-4446-9ec2-cd14f963bb83.png</url>
      <title>Forem: Julian Cantillo</title>
      <link>https://forem.com/juliancantillo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/juliancantillo"/>
    <language>en</language>
    <item>
      <title>W3c Activitypub Protocol</title>
      <dc:creator>Julian Cantillo</dc:creator>
      <pubDate>Thu, 10 Nov 2022 00:52:56 +0000</pubDate>
      <link>https://forem.com/juliancantillo/w3c-activitypub-protocol-1e9g</link>
      <guid>https://forem.com/juliancantillo/w3c-activitypub-protocol-1e9g</guid>
      <description>&lt;h2&gt;
  
  
  ActivityPub protocol
&lt;/h2&gt;

&lt;p&gt;The protocol describes a decentralized "social network"; it relies heavily on JSON+LD schemes to describe &lt;code&gt;activities&lt;/code&gt; performed by &lt;code&gt;actors.&lt;/code&gt; The protocol comprises a set of interfaces for &lt;code&gt;server-to-server&lt;/code&gt; and &lt;code&gt;client-to-server&lt;/code&gt; connections. You can find more information in the &lt;a href="https://www.w3.org/TR/activitypub/#Overview" rel="noopener noreferrer"&gt;W3C ActivityPub&lt;/a&gt; page&lt;/p&gt;

&lt;h2&gt;
  
  
  How does it works?
&lt;/h2&gt;

&lt;p&gt;In the following diagram, you can see Alice and Bob interacting with the AcitityPub protocol. Alice wants to post something that could be a Tweet-like message, a video, or a note; Bob should be able to read it.&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%2Fdiagrams.cantillo.dev%2Factivitypub%2Fhow-activitypub-works%2Fhow-activitypub-works.svg" 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%2Fdiagrams.cantillo.dev%2Factivitypub%2Fhow-activitypub-works%2Fhow-activitypub-works.svg" title="How activity pub works" alt="ActivityPub sequence diagram"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A service discovery protocol is the base of ActivityPub. The representation of all actors, Alice and Bob, and the messages have URLs in the attributes pointing to the counterpart server. The service discovery definition uses JSON+LD as the default format.&lt;/p&gt;

&lt;p&gt;Those URLs tell where a server or a client must fulfill an activity such as Publish or Like. In the previous example, Alice wants to publish a post. She already knows the Outbox URL to create a Post; in this case, the action is "Create." &lt;/p&gt;

&lt;h2&gt;
  
  
  My take on this proposal
&lt;/h2&gt;

&lt;p&gt;I used to be a PropTech entrepreneur. I implemented the Real Estate Transaction Standards (RETS) for the web application. The Multiple Listing Services (MLS) uses RETS to describe properties and actions performed over it. Those standards or, better, a new version may benefit from this kind of protocol.&lt;/p&gt;

</description>
      <category>todayilearned</category>
      <category>w3c</category>
      <category>activitypub</category>
    </item>
    <item>
      <title>Go Vuln the Golang Vulnerability Database</title>
      <dc:creator>Julian Cantillo</dc:creator>
      <pubDate>Wed, 09 Nov 2022 13:33:04 +0000</pubDate>
      <link>https://forem.com/juliancantillo/go-vuln-the-golang-vulnerability-database-399m</link>
      <guid>https://forem.com/juliancantillo/go-vuln-the-golang-vulnerability-database-399m</guid>
      <description>&lt;h2&gt;
  
  
  What is govuln?
&lt;/h2&gt;

&lt;p&gt;govuln is a new vulnerability database for looking your code for vulnerable packages and prevent supply chain attacks&lt;/p&gt;

&lt;h2&gt;
  
  
  How to install the &lt;code&gt;govulncheck&lt;/code&gt; cli
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;govulncheck&lt;/code&gt; is the command line inferface for interacting with the database and checking your code against it, install it with the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;go &lt;span class="nb"&gt;install &lt;/span&gt;golang.org/x/vuln/cmd/govulncheck@latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run it in your project as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;govulncheck &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will search in your dependencies for vulnerable packages. Here is an example of the output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;govulncheck is an experimental tool. Share feedback at https://go.dev/s/govulncheck-feedback.

Scanning &lt;span class="k"&gt;for &lt;/span&gt;dependencies with known vulnerabilities...
No vulnerabilities found.

&lt;span class="o"&gt;===&lt;/span&gt; Informational &lt;span class="o"&gt;===&lt;/span&gt;

The vulnerabilities below are &lt;span class="k"&gt;in &lt;/span&gt;packages that you import, but your code
doesn&lt;span class="s1"&gt;'t appear to call any vulnerable functions. You may not need to take any
action. See https://pkg.go.dev/golang.org/x/vuln/cmd/govulncheck
for details.

Vulnerability #1: GO-2022-1095
  Due to unsanitized NUL values, attackers may be able to maliciously set environment variables on Windows.

  In syscall.StartProcess and os/exec.Cmd, invalid environment variable values containing NUL values are not properly checked for. A malicious environment variable value can exploit this behavior to set a value for a different environment variable. For example, the environment variable string "A=B\x00C=D" sets the variables "A=B" and "C=D".
  Found in: syscall@go1.19.1
  Fixed in: syscall@go1.19.3
  More info: https://pkg.go.dev/vuln/GO-2022-1095
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For more details check the official doc: &lt;a href="https://go.dev/security/vuln/"&gt;https://go.dev/security/vuln/&lt;/a&gt; and the talk given during the 2022 go day titled &lt;a href="https://www.youtube.com/watch?v=aw7lFSFGKZs"&gt;&lt;br&gt;
Writing your Applications Faster and More Securely with Go&lt;br&gt;
&lt;/a&gt; which also covers Fuzzy Testing but that is for another TIL&lt;/p&gt;

</description>
      <category>todayilearned</category>
      <category>go</category>
      <category>security</category>
    </item>
    <item>
      <title>Kubernetes setup Dockerhub secret</title>
      <dc:creator>Julian Cantillo</dc:creator>
      <pubDate>Sun, 13 Mar 2022 23:23:40 +0000</pubDate>
      <link>https://forem.com/juliancantillo/kubernetes-setup-dockerhub-secret-363i</link>
      <guid>https://forem.com/juliancantillo/kubernetes-setup-dockerhub-secret-363i</guid>
      <description>&lt;p&gt;When a Kubernete's pod or deployment pull the container image, the easiest way is to host the image in Dockerhub. However, sometimes you need to host the image in a private registry, therefore, you need to create a secret in Kubernetes to store the credentials and enable the pod to pull the image from the private registry.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Create a secret
&lt;/h3&gt;

&lt;p&gt;Using the &lt;a href="https://kubernetes.io/docs/reference/kubectl/overview/"&gt;kubectl command&lt;/a&gt;, create a secret as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl create secret generic dockerhub &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--from-file&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;.dockerconfigjson&lt;span class="o"&gt;=&lt;/span&gt;~/.docker/config.json &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;kubernetes.io/dockerconfigjson
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;create secret&lt;/code&gt; command creates a secret with the name &lt;code&gt;dockerhub&lt;/code&gt; and the type &lt;code&gt;kubernetes.io/dockerconfigjson&lt;/code&gt;. The &lt;code&gt;--from-file&lt;/code&gt; flag specifies that the secret should be created from the file &lt;code&gt;.dockerconfigjson&lt;/code&gt; in the home directory of the user, and, the &lt;code&gt;kubernetes.io/dockerconfigjson&lt;/code&gt; type is used to specify that the secret is in the format of a Docker configuration file.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Specify the secret in the Pod definition
&lt;/h3&gt;

&lt;p&gt;In the spec section of the Pod definition, add the following lines:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;imagePullSecrets&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dockerhub&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;imagePullSecrets&lt;/code&gt; field specifies that the pod should use the secret to pull the image from the private registry. The &lt;code&gt;name&lt;/code&gt; field specifies the name of the secret. A complete example of the Pod definition is shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;apiVersion&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;v1&lt;/span&gt;
&lt;span class="na"&gt;kind&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Pod&lt;/span&gt;
&lt;span class="na"&gt;metadata&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-app&lt;/span&gt;
&lt;span class="na"&gt;spec&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;containers&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-app-container&lt;/span&gt;
    &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;my-docker-hub-user/my-app-image&lt;/span&gt;
  &lt;span class="na"&gt;imagePullSecrets&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dockerhub&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Deploy the Pod
&lt;/h3&gt;

&lt;p&gt;The Pod is now ready to be deployed in the Kubernetes cluster using the private image.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;kubectl apply &lt;span class="nt"&gt;-f&lt;/span&gt; my-app.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>My 2021 Reading List</title>
      <dc:creator>Julian Cantillo</dc:creator>
      <pubDate>Sat, 29 May 2021 22:05:41 +0000</pubDate>
      <link>https://forem.com/juliancantillo/my-2021-reading-list-gab</link>
      <guid>https://forem.com/juliancantillo/my-2021-reading-list-gab</guid>
      <description>&lt;p&gt;Last year I did read several books, mostly because the COVID-19 pandemic, tired of watching netflix I decided to read a book instead. &lt;br&gt;
Started with some from the backlog. And this year the tradition continues -the pandemic haven't finished yet- but also I learnt a lot last year. &lt;br&gt;
However this year I want to make more public my reading list, and also write more. For that reason I want to start writing little essays from the &lt;br&gt;
latest books.&lt;/p&gt;

&lt;p&gt;This is my reading list:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Ask Your Developer: How to Harness the Power of Software Developers and Win in the 21st Century by Jeff Lawson | &lt;a href="https://www.amazon.com/dp/B083XL677V"&gt;Amazon&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Working Backwards: Insights, Stories, and Secrets from Inside Amazon by Colin Bryar and Bill Carr | &lt;a href="https://www.amazon.com/Working-Backwards-Insights-Stories-Secrets/dp/1250267595"&gt;Amazon&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;An Ugly Truth: Inside Facebook's Battle for Domination by Sheera Frenkel and Cecilia Kang | &lt;a href="https://www.amazon.com/Sheera-Frenkel-ebook/dp/B07YSHD2C5/"&gt;Amazon&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Staff Engineer, Leadership beyond the management track by Will Larson &lt;a href="https://www.amazon.com/dp/B097CNXP89"&gt;Amazon&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

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