<?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: Juan Brendon Luna Juarez</title>
    <description>The latest articles on DEV Community by Juan Brendon Luna Juarez (@juan_brendonlunajuarez_).</description>
    <link>https://dev.to/juan_brendonlunajuarez_</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%2F2041514%2F3ec87478-9049-45bf-a42a-dee80be26741.jpg</url>
      <title>DEV Community: Juan Brendon Luna Juarez</title>
      <link>https://dev.to/juan_brendonlunajuarez_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/juan_brendonlunajuarez_"/>
    <language>en</language>
    <item>
      <title>Applying API Testing Frameworks: Real-World Example with REST Assured for a Product Service</title>
      <dc:creator>Juan Brendon Luna Juarez</dc:creator>
      <pubDate>Sun, 06 Jul 2025 00:53:10 +0000</pubDate>
      <link>https://dev.to/juan_brendonlunajuarez_/applying-api-testing-frameworks-real-world-example-with-rest-assured-for-a-product-service-2fb9</link>
      <guid>https://dev.to/juan_brendonlunajuarez_/applying-api-testing-frameworks-real-world-example-with-rest-assured-for-a-product-service-2fb9</guid>
      <description>&lt;h1&gt;
  
  
  Applying API Testing Frameworks: Real-World Example with REST Assured for a Product Service
&lt;/h1&gt;

&lt;p&gt;APIs are the backbone of many modern applications, enabling communication between different systems and services. Therefore, ensuring that an API works correctly is crucial for software quality. In this article, we will explore how to apply the &lt;strong&gt;REST Assured&lt;/strong&gt; framework to automate tests on a RESTful service that manages products.&lt;/p&gt;




&lt;h2&gt;
  
  
  What is REST Assured?
&lt;/h2&gt;

&lt;p&gt;REST Assured is a Java-based testing framework designed to simplify testing of RESTful APIs. Its fluent syntax allows writing readable and expressive tests that validate HTTP responses, JSON or XML bodies, headers, and more. It integrates easily with testing frameworks like JUnit or TestNG, making it ideal for continuous integration pipelines.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Advantages of REST Assured
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Intuitive and expressive syntax.&lt;/li&gt;
&lt;li&gt;Easy validation of status codes, headers, and response bodies.&lt;/li&gt;
&lt;li&gt;Support for authentication, parameters, and various HTTP methods.&lt;/li&gt;
&lt;li&gt;Integration with common Java tools.&lt;/li&gt;
&lt;li&gt;Active community and good documentation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Limitations
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Requires basic knowledge of Java.&lt;/li&gt;
&lt;li&gt;No graphical user interface; tests are written in code.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Case Study: Product Management API
&lt;/h2&gt;

&lt;p&gt;Imagine we work with an API that manages a product catalog for an online store. The API includes several endpoints, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;GET /products/{id}&lt;/code&gt;: Retrieves information about a specific product.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;POST /products&lt;/code&gt;: Creates a new product.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;PUT /products/{id}&lt;/code&gt;: Updates an existing product.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;DELETE /products/{id}&lt;/code&gt;: Deletes a product.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this article, we will focus on testing the &lt;code&gt;GET /products/{id}&lt;/code&gt; endpoint to ensure it returns correct information and meets expected standards.&lt;/p&gt;




&lt;h2&gt;
  
  
  Testing Objectives
&lt;/h2&gt;

&lt;p&gt;We want to validate that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The HTTP response status code is 200 when the product exists.&lt;/li&gt;
&lt;li&gt;The JSON body contains the fields &lt;code&gt;id&lt;/code&gt;, &lt;code&gt;name&lt;/code&gt;, &lt;code&gt;price&lt;/code&gt;, &lt;code&gt;category&lt;/code&gt;, and &lt;code&gt;inStock&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;name&lt;/code&gt; field is a non-empty string.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;price&lt;/code&gt; field is a positive number.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;category&lt;/code&gt; field belongs to a predefined list of valid categories.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;inStock&lt;/code&gt; field is a boolean.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;Content-Type&lt;/code&gt; header is &lt;code&gt;application/json&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  REST Assured Test Code Example
&lt;/h2&gt;

&lt;p&gt;Below is a complete Java example using REST Assured and JUnit to validate the endpoint:&lt;/p&gt;

&lt;p&gt;import static io.restassured.RestAssured.;&lt;br&gt;
import static org.hamcrest.Matchers.;&lt;br&gt;
import org.junit.BeforeClass;&lt;br&gt;
import org.junit.Test;&lt;/p&gt;

&lt;p&gt;public class ProductApiTest {&lt;/p&gt;

&lt;p&gt;@BeforeClass&lt;br&gt;
public static void setup() {&lt;br&gt;
    baseURI = "&lt;a href="https://api.example-store.com" rel="noopener noreferrer"&gt;https://api.example-store.com&lt;/a&gt;";&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;&lt;a class="mentioned-user" href="https://dev.to/test"&gt;@test&lt;/a&gt;&lt;br&gt;
public void testGetProductById_ValidProduct() {&lt;br&gt;
    int productId = 101;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;given()
    .pathParam("id", productId)
.when()
    .get("/products/{id}")
.then()
    .statusCode(200)
    .contentType("application/json")
    .body("id", equalTo(productId))
    .body("name", allOf(notNullValue(), not(isEmptyString())))
    .body("price", greaterThan(0.0f))
    .body("category", isOneOf("Electronics", "Books", "Clothing", "Home", "Sports"))
    .body("inStock", anyOf(equalTo(true), equalTo(false)));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;/p&gt;

&lt;p&gt;&lt;a class="mentioned-user" href="https://dev.to/test"&gt;@test&lt;/a&gt;&lt;br&gt;
public void testGetProductById_ProductNotFound() {&lt;br&gt;
    int invalidProductId = 99999;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;given()
    .pathParam("id", invalidProductId)
.when()
    .get("/products/{id}")
.then()
    .statusCode(404)
    .body("error", equalTo("Product not found"));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;}&lt;br&gt;
}&lt;/p&gt;




&lt;h2&gt;
  
  
  Detailed Explanation
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;@BeforeClass&lt;/code&gt; and &lt;code&gt;baseURI&lt;/code&gt;&lt;/strong&gt;: Sets up the base URI for all requests.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;testGetProductById_ValidProduct()&lt;/code&gt;&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Uses &lt;code&gt;pathParam&lt;/code&gt; to inject the product ID into the URL.&lt;/li&gt;
&lt;li&gt;Validates the status code is 200.&lt;/li&gt;
&lt;li&gt;Confirms the &lt;code&gt;Content-Type&lt;/code&gt; header is &lt;code&gt;application/json&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Checks that the &lt;code&gt;id&lt;/code&gt; field in the response matches the requested ID.&lt;/li&gt;
&lt;li&gt;Ensures the &lt;code&gt;name&lt;/code&gt; field is neither null nor empty.&lt;/li&gt;
&lt;li&gt;Validates that the &lt;code&gt;price&lt;/code&gt; is a positive number.&lt;/li&gt;
&lt;li&gt;Verifies the &lt;code&gt;category&lt;/code&gt; is one of the allowed values.&lt;/li&gt;
&lt;li&gt;Confirms &lt;code&gt;inStock&lt;/code&gt; is a boolean value (true or false).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;strong&gt;&lt;code&gt;testGetProductById_ProductNotFound()&lt;/code&gt;&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;Tests with an invalid product ID to ensure the API returns a 404 status and an appropriate error message.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  Why Use REST Assured?
&lt;/h2&gt;

&lt;p&gt;REST Assured allows you to automate API tests easily and robustly, with a clear syntax that promotes maintainable code. By integrating with JUnit, you can run these tests within CI/CD pipelines to ensure continuous software quality.&lt;/p&gt;




&lt;h2&gt;
  
  
  Recommended Next Steps
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Extend tests to other endpoints (&lt;code&gt;POST&lt;/code&gt;, &lt;code&gt;PUT&lt;/code&gt;, &lt;code&gt;DELETE&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Add validations for authentication and authorization.&lt;/li&gt;
&lt;li&gt;Integrate with automated reporting tools to visualize results.&lt;/li&gt;
&lt;li&gt;Combine with mocking tools for isolated testing environments.&lt;/li&gt;
&lt;/ul&gt;




</description>
    </item>
    <item>
      <title>Comparative Study: GitHub Actions vs GitLab Pipelines for Automated Testing</title>
      <dc:creator>Juan Brendon Luna Juarez</dc:creator>
      <pubDate>Fri, 04 Jul 2025 14:32:06 +0000</pubDate>
      <link>https://dev.to/juan_brendonlunajuarez_/comparative-study-github-actions-vs-gitlab-pipelines-for-automated-testing-2p1f</link>
      <guid>https://dev.to/juan_brendonlunajuarez_/comparative-study-github-actions-vs-gitlab-pipelines-for-automated-testing-2p1f</guid>
      <description>&lt;h2&gt;
  
  
  🧪 Introducción
&lt;/h2&gt;

&lt;p&gt;La &lt;strong&gt;automatización de pruebas&lt;/strong&gt; es un pilar fundamental en el desarrollo de software moderno. Las pipelines de &lt;strong&gt;Integración Continua y Entrega Continua (CI/CD)&lt;/strong&gt; permiten a los equipos entregar código de calidad de forma más rápida, automatizando la ejecución de pruebas y despliegues.&lt;/p&gt;

&lt;p&gt;En este artículo, compararemos dos herramientas populares de CI/CD: &lt;strong&gt;GitHub Actions&lt;/strong&gt; y &lt;strong&gt;GitLab Pipelines&lt;/strong&gt;, centrándonos en cómo gestionan los flujos de trabajo de pruebas. Analizaremos su sintaxis, estructura, fortalezas y presentaremos ejemplos prácticos con repositorios públicos.&lt;/p&gt;




&lt;h2&gt;
  
  
  ⚙️ Visión General de Cada Herramienta
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🔵 GitHub Actions
&lt;/h3&gt;

&lt;p&gt;GitHub Actions es una herramienta de CI/CD integrada nativamente en GitHub, que permite automatizar flujos de trabajo directamente desde los repositorios mediante archivos de configuración en YAML.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ventajas:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Integración nativa con GitHub&lt;/li&gt;
&lt;li&gt;Gran comunidad y marketplace de acciones predefinidas&lt;/li&gt;
&lt;li&gt;Fácil activación mediante eventos en GitHub (push, pull request, etc.)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Desventajas:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Paralelismo limitado en el plan gratuito&lt;/li&gt;
&lt;li&gt;Interfaz menos flexible para pipelines complejas&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🟣 GitLab Pipelines
&lt;/h3&gt;

&lt;p&gt;GitLab CI/CD está profundamente integrado en GitLab y ofrece funcionalidades avanzadas como entornos, runners personalizados y flujos de trabajo complejos.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ventajas:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Interfaz potente y altamente flexible&lt;/li&gt;
&lt;li&gt;Registro Docker integrado&lt;/li&gt;
&lt;li&gt;Repositorios privados con CI/CD gratuitos&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Desventajas:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Curva de aprendizaje más pronunciada&lt;/li&gt;
&lt;li&gt;Minutos de CI limitados en el plan gratuito&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧰 Ejemplos Prácticos de Código
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🧪 Ejemplo con GitHub Actions
&lt;/h3&gt;

&lt;p&gt;.github/workflows/test.yml&lt;br&gt;
name: Run Tests&lt;/p&gt;

&lt;p&gt;on: [push, pull_request]&lt;/p&gt;

&lt;p&gt;jobs:&lt;br&gt;
test:&lt;br&gt;
runs-on: ubuntu-latest&lt;br&gt;
steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;uses: actions/checkout@v3&lt;/li&gt;
&lt;li&gt;name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'&lt;/li&gt;
&lt;li&gt;run: npm install&lt;/li&gt;
&lt;li&gt;run: npm test&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;text&lt;/p&gt;

&lt;h3&gt;
  
  
  🧪 Ejemplo con GitLab Pipelines
&lt;/h3&gt;

&lt;p&gt;.gitlab-ci.yml&lt;br&gt;
stages:&lt;/p&gt;

&lt;p&gt;test&lt;/p&gt;

&lt;p&gt;test_job:&lt;br&gt;
image: node:18&lt;br&gt;
stage: test&lt;br&gt;
script:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;npm install&lt;/li&gt;
&lt;li&gt;npm test&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;text&lt;/p&gt;




&lt;h2&gt;
  
  
  🔍 Comparativa Detallada
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Aspecto&lt;/th&gt;
&lt;th&gt;GitHub Actions&lt;/th&gt;
&lt;th&gt;GitLab Pipelines&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Configuración&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Múltiples archivos YAML en &lt;code&gt;.github/workflows&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Archivo único &lt;code&gt;.gitlab-ci.yml&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Integración&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Nativa con GitHub y su ecosistema&lt;/td&gt;
&lt;td&gt;Integración completa en GitLab (issues, merge, etc.)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Flexibilidad de flujo&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Modelo basado en eventos, fácil para flujos dinámicos&lt;/td&gt;
&lt;td&gt;Soporta pipelines complejos con múltiples etapas y dependencias&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Marketplace / Runners&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Amplio marketplace de acciones predefinidas&lt;/td&gt;
&lt;td&gt;Runners personalizables, registro Docker integrado&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Curva de aprendizaje&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Más sencillo para empezar&lt;/td&gt;
&lt;td&gt;Requiere mayor conocimiento para configuraciones avanzadas&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Paralelismo&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Soporta matrix builds y trabajos paralelos&lt;/td&gt;
&lt;td&gt;Soporta ejecución paralela y condicional&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🧪 Conclusión
&lt;/h2&gt;

&lt;p&gt;Ambas herramientas son poderosas para implementar CI/CD y automatizar pruebas, pero su elección dependerá del contexto y necesidades del equipo:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub Actions&lt;/strong&gt; destaca por su integración nativa con GitHub, su modelo flexible basado en eventos y la facilidad para comenzar rápidamente con flujos simples o medianamente complejos.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitLab Pipelines&lt;/strong&gt; ofrece una solución más robusta para pipelines complejos, con mayor control sobre etapas, dependencias y despliegues, ideal para equipos que buscan una plataforma DevOps integral.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;En cualquier caso, la automatización de pruebas dentro de CI/CD acelera la entrega de software de calidad, reduce errores manuales y mejora la colaboración, siendo una práctica esencial en el desarrollo moderno.&lt;/p&gt;




&lt;p&gt;Si quieres profundizar en algún aspecto o necesitas más ejemplos, no dudes en dejar un comentario.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Detecting Infrastructure Misconfigurations Using CoGuard: SAST for Terraform and IaC</title>
      <dc:creator>Juan Brendon Luna Juarez</dc:creator>
      <pubDate>Wed, 30 Apr 2025 05:17:55 +0000</pubDate>
      <link>https://dev.to/juan_brendonlunajuarez_/detecting-infrastructure-misconfigurations-using-coguard-sast-for-terraform-and-iac-48ko</link>
      <guid>https://dev.to/juan_brendonlunajuarez_/detecting-infrastructure-misconfigurations-using-coguard-sast-for-terraform-and-iac-48ko</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Infrastructure as Code (IaC) is a modern approach to provisioning cloud infrastructure using tools like Terraform, Pulumi, or OpenTofu. These technologies improve scalability, repeatability, and automation—but they can also introduce security risks if the code is misconfigured. For example, exposing an S3 bucket to the public or disabling encryption can lead to serious data breaches.&lt;/p&gt;

&lt;p&gt;This article introduces &lt;strong&gt;CoGuard&lt;/strong&gt;, a Static Application Security Testing (SAST) tool designed specifically to analyze configuration files used in infrastructure code. We’ll demonstrate how to scan Terraform code, interpret results, and automate the scanning process in a CI/CD workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is CoGuard?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;CoGuard&lt;/strong&gt; is a command-line static analysis tool for infrastructure configuration security. It detects insecure defaults and misconfigurations before deployment, aligning its findings with security frameworks like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CIS Benchmarks
&lt;/li&gt;
&lt;li&gt;OWASP Cloud-Native Top 10
&lt;/li&gt;
&lt;li&gt;Internal security policies&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It supports a variety of IaC and system configuration formats, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Terraform
&lt;/li&gt;
&lt;li&gt;Kubernetes YAML
&lt;/li&gt;
&lt;li&gt;Dockerfiles
&lt;/li&gt;
&lt;li&gt;CloudFormation
&lt;/li&gt;
&lt;li&gt;Apache/Nginx configs
&lt;/li&gt;
&lt;li&gt;PostgreSQL, MySQL
&lt;/li&gt;
&lt;li&gt;SSH, Linux services&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Unlike general-purpose SAST tools that analyze source code for logic flaws, CoGuard focuses on infrastructure and system-level misconfigurations, such as weak ACLs, missing encryption, and open network ports.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Scans entire directories for misconfigured infrastructure files
&lt;/li&gt;
&lt;li&gt;Highlights issues with severity levels and remediation advice
&lt;/li&gt;
&lt;li&gt;Maps findings to recognized security standards (e.g., CIS, OWASP)
&lt;/li&gt;
&lt;li&gt;Produces detailed reports in terminal or SARIF format
&lt;/li&gt;
&lt;li&gt;Integrates with CI/CD tools like GitHub Actions or GitLab CI&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Installation and First Scan
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: Pull the Docker image
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker pull coguard/coguard-cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Run the scan on your Terraform project
&lt;/h3&gt;

&lt;p&gt;Make sure you're inside your Terraform project directory and run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;--rm&lt;/span&gt; &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;:/mnt coguard/coguard-cli scan /mnt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command mounts your local project and scans all infrastructure configuration files inside it. CoGuard will return a report showing any misconfigurations, their severity, and remediation advice.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you prefer a graphical user interface, you can also use &lt;a href="https://www.coguard.io/" rel="noopener noreferrer"&gt;CoGuard’s web platform&lt;/a&gt; to upload and analyze configuration files.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Example: Vulnerable Terraform Code
&lt;/h2&gt;

&lt;p&gt;Here is a deliberately insecure &lt;code&gt;main.tf&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight hcl"&gt;&lt;code&gt;&lt;span class="nx"&gt;resource&lt;/span&gt; &lt;span class="s2"&gt;"aws_s3_bucket"&lt;/span&gt; &lt;span class="s2"&gt;"example"&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;bucket&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"open-bucket"&lt;/span&gt;
  &lt;span class="nx"&gt;acl&lt;/span&gt;    &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"public-read"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  What CoGuard detects:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Public access&lt;/strong&gt;: The ACL &lt;code&gt;public-read&lt;/code&gt; makes the bucket accessible to anyone.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No encryption&lt;/strong&gt;: There's no encryption configuration for data at rest.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Missing versioning&lt;/strong&gt;: There’s no versioning policy enabled.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These issues are reported with their severity and are mapped to standards like the &lt;strong&gt;CIS AWS Foundations Benchmark v1.4&lt;/strong&gt; and &lt;strong&gt;OWASP Cloud-Native Application Security Top 10&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  CI/CD Integration
&lt;/h2&gt;

&lt;p&gt;You can integrate CoGuard into your deployment workflow using GitHub Actions:&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;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;CoGuard Terraform Scan&lt;/span&gt;

&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;main"&lt;/span&gt; &lt;span class="pi"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;coguard-scan&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&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;Checkout repository&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v3&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;Run CoGuard&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;docker pull coguard/coguard-cli&lt;/span&gt;
          &lt;span class="s"&gt;docker run --rm -v ${{ github.workspace }}:/mnt coguard/coguard-cli scan /mnt&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Exporting SARIF Reports
&lt;/h3&gt;

&lt;p&gt;You can export results in SARIF format for integration with GitHub Security Dashboard:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker run &lt;span class="nt"&gt;--rm&lt;/span&gt; &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;:/mnt coguard/coguard-cli scan /mnt &lt;span class="nt"&gt;--output-format&lt;/span&gt; sarif &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; report.sarif
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Results and Interpretation
&lt;/h2&gt;

&lt;p&gt;In a sample scan, CoGuard detected:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;3 high-severity issues (e.g., public S3 bucket, unencrypted storage)
&lt;/li&gt;
&lt;li&gt;2 medium-severity issues (e.g., missing logging)
&lt;/li&gt;
&lt;li&gt;1 low-severity issue (e.g., missing metadata tags)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each result includes filename, line number, and clear remediation guidance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusions
&lt;/h2&gt;

&lt;p&gt;CoGuard is a reliable SAST tool tailored for Infrastructure as Code. Its strengths include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Early detection of cloud misconfigurations
&lt;/li&gt;
&lt;li&gt;Alignment with security benchmarks like CIS and OWASP
&lt;/li&gt;
&lt;li&gt;Easy setup using Docker
&lt;/li&gt;
&lt;li&gt;Seamless CI/CD integration
&lt;/li&gt;
&lt;li&gt;Report generation for audits and dashboards
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By integrating CoGuard, teams can ensure secure and compliant infrastructure even before deployment.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/coguardio/coguard-cli" rel="noopener noreferrer"&gt;CoGuard CLI GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.coguard.io/" rel="noopener noreferrer"&gt;CoGuard Web Platform&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.cisecurity.org/benchmark/amazon_web_services/" rel="noopener noreferrer"&gt;CIS AWS Foundations Benchmark&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://owasp.org/www-project-cloud-native-application-security-top-10/" rel="noopener noreferrer"&gt;OWASP Cloud-Native Top 10&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Securing Code at the Source: Applying HCL AppScan CodeSweep in Real-Time Development</title>
      <dc:creator>Juan Brendon Luna Juarez</dc:creator>
      <pubDate>Wed, 30 Apr 2025 04:55:11 +0000</pubDate>
      <link>https://dev.to/juan_brendonlunajuarez_/securing-code-at-the-source-applying-hcl-appscan-codesweep-in-real-time-development-4oe6</link>
      <guid>https://dev.to/juan_brendonlunajuarez_/securing-code-at-the-source-applying-hcl-appscan-codesweep-in-real-time-development-4oe6</guid>
      <description>&lt;h1&gt;
  
  
  Securing Code at the Source: Applying HCL AppScan CodeSweep in Real-Time Development
&lt;/h1&gt;

&lt;p&gt;In modern software engineering, ensuring security from the beginning of the development cycle is fundamental. Static Application Security Testing (SAST) tools provide a way to detect potential vulnerabilities directly in the source code, often before the application is even compiled. This article discusses the use of &lt;strong&gt;HCL AppScan CodeSweep&lt;/strong&gt;, a lightweight, IDE-integrated SAST tool, applied in a real Node.js development context.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is HCL AppScan CodeSweep?
&lt;/h2&gt;

&lt;p&gt;AppScan CodeSweep is a free and open-source plugin available for IDEs such as Visual Studio Code and JetBrains IDEs (e.g., IntelliJ, PyCharm, WebStorm). It enables static code analysis by scanning the developer's source files upon saving and reporting common security issues in real time.&lt;/p&gt;

&lt;p&gt;Supported languages include JavaScript, Python, PHP, Java, Go, Ruby, .NET Core, Apex, and others.&lt;/p&gt;

&lt;h2&gt;
  
  
  Installation and Setup
&lt;/h2&gt;

&lt;p&gt;The setup process is straightforward:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Visual Studio Code.&lt;/li&gt;
&lt;li&gt;Access the Extensions Marketplace.&lt;/li&gt;
&lt;li&gt;Search for "AppScan CodeSweep" and install the plugin.&lt;/li&gt;
&lt;li&gt;Open any source file.&lt;/li&gt;
&lt;li&gt;Save the file to trigger automatic analysis.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;No manual configuration or terminal usage is required to begin scanning.&lt;/p&gt;

&lt;h2&gt;
  
  
  Practical Example: Node.js API Project
&lt;/h2&gt;

&lt;p&gt;The tool was tested in a Node.js REST API built with Express, including user authentication and token-based access control.&lt;/p&gt;

&lt;p&gt;Findings included:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use of &lt;code&gt;eval()&lt;/code&gt; on user-controlled input&lt;/li&gt;
&lt;li&gt;Absence of input validation in a POST route, potentially enabling XSS&lt;/li&gt;
&lt;li&gt;Insecure client-side storage of JSON Web Tokens (JWTs)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each issue was presented with file name, line number, vulnerability type, and a concise remediation suggestion.&lt;/p&gt;

&lt;h2&gt;
  
  
  Observed Benefits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Real-time vulnerability detection during development&lt;/li&gt;
&lt;li&gt;Seamless integration into existing IDE workflows&lt;/li&gt;
&lt;li&gt;No additional infrastructure or complex configurations&lt;/li&gt;
&lt;li&gt;Zero-cost licensing, ideal for personal or educational use&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Limitations
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The tool focuses on file-level static analysis and may miss context-specific issues&lt;/li&gt;
&lt;li&gt;False positives may occur, though generally manageable&lt;/li&gt;
&lt;li&gt;Not a substitute for dynamic analysis (DAST) or manual code reviews&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;HCL AppScan CodeSweep proves to be an effective solution for integrating security into the software development lifecycle without disrupting productivity. It empowers developers to identify and resolve vulnerabilities early, contributing to safer and more reliable codebases.&lt;/p&gt;

&lt;p&gt;This tool is particularly useful for developers who want to adopt security practices without the overhead of enterprise-grade platforms. Its ease of use and compatibility with popular languages make it a practical choice for secure software development.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Creating a Generative AI Chatbot with Python</title>
      <dc:creator>Juan Brendon Luna Juarez</dc:creator>
      <pubDate>Wed, 11 Dec 2024 07:44:04 +0000</pubDate>
      <link>https://dev.to/juan_brendonlunajuarez_/creating-a-generative-ai-chatbot-with-python-153p</link>
      <guid>https://dev.to/juan_brendonlunajuarez_/creating-a-generative-ai-chatbot-with-python-153p</guid>
      <description>&lt;p&gt;AI models have become incredibly popular in the development of chatbots. With Python, it's easy to create such a chatbot using deep learning techniques and libraries like transformers, TensorFlow, and PyTorch. In this article, we’ll guide you step by step to build a simple generative AI chatbot using Python.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why we use a AI Chatbot with Python?&lt;/strong&gt;&lt;br&gt;
Using an AI chatbot with Python offers several advantages, particularly in the areas of simplicity, flexibility, and access to powerful machine learning frameworks.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;First step to start with ai chatbot development
Install the necessary dependencies
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install transformers torch

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Install virtualenv in console if you don’t have it already:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install virtualenv

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Create a virtual environment
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;virtualenv chatbot-env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;We need Activate the environment. 
I use Windows
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chatbot-env\Scripts\activate

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Importing Required Libraries
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from transformers import GPT2LMHeadModel, GPT2Tokenizer
import torch

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Loading Pre-trained GPT model
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;model_name = "gpt2"
model = GPT2LMHeadModel.from_pretrained(model_name)
tokenizer = GPT2Tokenizer.from_pretrained(model_name)

model.eval()

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Creating the Chatbot’s Response Generator
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def generate_response(user_input):

    inputs = tokenizer.encode(user_input + tokenizer.eos_token, return_tensors="pt")

    outputs = model.generate(inputs, max_length=150, num_return_sequences=1, no_repeat_ngram_size=2, temperature=0.7)

    response = tokenizer.decode(outputs[0], skip_special_tokens=True)

    return response

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Building the Chatbot Interface.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally, we’ll create a simple loop where the user can input text, and the chatbot will generate a response.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print("Hello! I am your chatbot. Type 'quit' to exit.")

while True:
    user_input = input("You: ")

    if user_input.lower() == "quit":
        break

    response = generate_response(user_input)
    print("Chatbot: ", response)

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Finally Testing the Chatbot!!
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python chatbot.py

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Conclusions&lt;/strong&gt;&lt;br&gt;
We've shown you how to create a simple generative AI chatbot using Python. The chatbot uses a pre-trained model to generate responses based on user input. With some fine-tuning and improvements, you can create a more sophisticated and context-aware chatbot. Chatbots like this one can be used in a variety of applications, such as customer service, education, and entertainment.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Bokeh an interesting data tool in python for data visualization</title>
      <dc:creator>Juan Brendon Luna Juarez</dc:creator>
      <pubDate>Sun, 08 Sep 2024 07:19:39 +0000</pubDate>
      <link>https://dev.to/juan_brendonlunajuarez_/bokeh-an-interesting-data-tool-in-python-for-data-visualization-2bd6</link>
      <guid>https://dev.to/juan_brendonlunajuarez_/bokeh-an-interesting-data-tool-in-python-for-data-visualization-2bd6</guid>
      <description>&lt;p&gt;Data visualization plays a critical role in interpreting large volumes of information. Tools like Bokeh have emerged as popular solutions for building interactive dashboards and reports. Each tool brings unique advantages depending on the complexity of your project and your preferred programming language. In this article, we will delve into each tool and then focus on Bokeh, including a hands-on example and deployment in the cloud.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;So that...&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is bokeh?&lt;/strong&gt;&lt;br&gt;
Bokeh is an interactive visualization library that targets modern web browsers for presentation. It offers elegant and concise graphics, enabling developers to build dashboards with advanced interactivity. Bokeh is particularly suitable for data scientists and developers using Python, offering both high-level interfaces and granular control over your plots.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How can you use this tool?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install dependencies:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;pip install bokeh &lt;br&gt;
 pip install gunicorn&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create the plot:
In this case i developed two plots in the main page then i called "app.py"&lt;/li&gt;
&lt;/ul&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from bokeh.layouts import column
from bokeh.models import ColumnDataSource, Select
from bokeh.plotting import figure, curdoc
import numpy as np

# Sample data for line plot
line_data = {
    'x': [1, 2, 3, 4, 5],
    'y1': [6, 7, 2, 4, 7],
    'y2': [1, 4, 8, 6, 9]
}

# Data for scatter plot
N = 4000
x_scatter = np.random.random(size=N) * 100
y_scatter = np.random.random(size=N) * 100
radii = np.random.random(size=N) * 1.5
colors = np.array([(r, g, 150) for r, g in zip(50 + 2 * x_scatter, 30 + 2 * y_scatter)], dtype="uint8")

# Create ColumnDataSource for line plot
source = ColumnDataSource(data={'x': line_data['x'], 'y': line_data['y1']})

# Create a figure for line plot
plot_line = figure(title="Interactive Line Plot", x_axis_label='X', y_axis_label='Y')
line1 = plot_line.line('x', 'y', source=source, line_width=3, color='blue', legend_label='y1')
line2 = plot_line.line('x', 'y2', source=source, line_width=3, color='red', legend_label='y2', line_alpha=0.5)

# Create a figure for scatter plot
plot_scatter = figure(title="Scatter Plot", tools="hover,crosshair,pan,wheel_zoom,zoom_in,zoom_out,box_zoom,undo,redo,reset,tap,save,box_select,poly_select,lasso_select,examine,help")
plot_scatter.circle(x_scatter, y_scatter, radius=radii,
                    fill_color=colors, fill_alpha=0.6,
                    line_color=None)

# Dropdown widget to select data for line plot
select = Select(title="Y-axis data", value='y1', options=['y1', 'y2'])

# Update function to change data based on selection
def update(attr, old, new):
    selected_y = select.value
    source.data = {'x': line_data['x'], 'y': line_data[selected_y]}
    # Update line colors based on selection
    line1.visible = (selected_y == 'y1')
    line2.visible = (selected_y == 'y2')
    plot_line.title.text = f"Interactive Line Plot - Showing {selected_y}"

select.on_change('value', update)

# Arrange plots and widgets in a layout
layout = column(select, plot_line, plot_scatter)

# Add layout to current document
curdoc().add_root(layout)
`
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create your page in heroku and make the next to steps.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a Procfile:&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;In this file declare for example in my case.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;web: bokeh serve --port=$PORT --address=0.0.0.0 --allow-websocket-origin=juancitoelpapi-325d94c2c6c7.herokuapp.com app.py&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create requeriments:
In the project create requirements.txt and write and save&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;&lt;code&gt;bokeh&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Push your project:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's similar when you push a project in git but in this case the final master push is in heroku&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git init&lt;br&gt;
git add .&lt;br&gt;
git commit -m "Deploy Bokeh app with Gunicorn"&lt;br&gt;
git push heroku master&lt;br&gt;
&lt;/code&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;And Finally ...&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can see your page with the plots bokeh.&lt;/p&gt;

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

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

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The real power of Bokeh lies in its ability to deliver interactive dashboards in web environments, making it ideal for real-time data monitoring and large datasets. By using Gunicorn to deploy Bokeh applications on cloud services like Heroku, you can build scalable, production-ready dashboards that are easy to maintain and update.&lt;/p&gt;

</description>
      <category>python</category>
      <category>bokuh</category>
      <category>heroku</category>
      <category>datascience</category>
    </item>
  </channel>
</rss>
