<?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: Ali Mahdiyanjoo</title>
    <description>The latest articles on DEV Community by Ali Mahdiyanjoo (@sudo_apt_install_coffee).</description>
    <link>https://dev.to/sudo_apt_install_coffee</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%2F1021175%2F6dca8b37-2b81-4cfa-a76d-4b48b567a8aa.jpeg</url>
      <title>DEV Community: Ali Mahdiyanjoo</title>
      <link>https://dev.to/sudo_apt_install_coffee</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sudo_apt_install_coffee"/>
    <language>en</language>
    <item>
      <title>Setting Up SonarQube for Code Analysis: Part 1 - Docker Compose Configuration</title>
      <dc:creator>Ali Mahdiyanjoo</dc:creator>
      <pubDate>Mon, 15 Apr 2024 09:34:29 +0000</pubDate>
      <link>https://dev.to/sudo_apt_install_coffee/setting-up-sonarqube-for-code-analysis-part-1-docker-compose-configuration-1ifj</link>
      <guid>https://dev.to/sudo_apt_install_coffee/setting-up-sonarqube-for-code-analysis-part-1-docker-compose-configuration-1ifj</guid>
      <description>&lt;p&gt;&lt;strong&gt;SonarQube Overview:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;SonarQube is an open-source platform for continuous inspection of code quality to perform automatic reviews with static analysis of code to detect bugs, code smells, and security vulnerabilities. It supports multiple programming languages like Java, C#, JavaScript, Python, and more. SonarQube provides detailed reports and metrics to help teams improve code quality and maintainability.&lt;br&gt;
Comparison with Other Tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Snyk: Snyk focuses primarily on open-source security, offering vulnerability scanning and dependency management. It's more specialized in managing third-party dependencies' security.&lt;/li&gt;
&lt;li&gt;    Checkmarx: Checkmarx is a robust tool for static application security testing (SAST), emphasizing identifying and fixing security vulnerabilities in the codebase.&lt;/li&gt;
&lt;li&gt;    Qualys: Qualys is a broader security platform that includes vulnerability management, compliance monitoring, and threat protection.&lt;/li&gt;
&lt;li&gt;    DeepSource: DeepSource is geared towards automated code reviews and provides actionable insights to improve code quality and maintainability.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Why SonarQube Might Be Better:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;    Comprehensive Code Analysis: SonarQube offers a comprehensive set of code quality checks, including security vulnerabilities, bugs, code smells, and code duplication.&lt;/li&gt;
&lt;li&gt;    Language Support: SonarQube supports a wide range of programming languages, making it suitable for diverse development environments.&lt;/li&gt;
&lt;li&gt;    Customizable Rules: It allows users to define and customize coding rules based on their specific requirements and standards.&lt;/li&gt;
&lt;li&gt;    Integration: SonarQube integrates well with popular CI/CD tools like Jenkins, GitLab CI/CD, and Azure DevOps, enabling seamless integration into the development pipeline.&lt;/li&gt;
&lt;li&gt;    Community Support: Being open-source, SonarQube has a vibrant community contributing to its development, plugins, and support.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Docker Compose Configuration for SonarQube:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
version: "3"

services:
  sonarqube:
    image: sonarqube:community
    depends_on:
      - db
    environment:
      SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar
      SONAR_JDBC_USERNAME: {Your_Username_Here}
      SONAR_JDBC_PASSWORD: {Your_Password_Here}
    volumes:
      - sonarqube_data:/opt/sonarqube/data
      - sonarqube_extensions:/opt/sonarqube/extensions
      - sonarqube_logs:/opt/sonarqube/logs
    ports:
      - "9000:9000"
  db:
    image: postgres:12
    environment:
      POSTGRES_USER: {Your_Username_Here}
      POSTGRES_PASSWORD: {Your_Password_Here}
    volumes:
      - postgresql:/var/lib/postgresql
      - postgresql_data:/var/lib/postgresql/data

volumes:
  sonarqube_data:
  sonarqube_extensions:
  sonarqube_logs:
  postgresql:
  postgresql_data:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After creating the docker-compose.yml file, run the following command to start SonarQube in the background:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker-compose up -d
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once SonarQube is up and running, you can access it using your browser at &lt;code&gt;http://{Your_IP}:9000&lt;/code&gt;. Make sure to replace &lt;code&gt;{Your_IP}&lt;/code&gt; with your actual server's IP address.&lt;/p&gt;

&lt;p&gt;This setup will launch SonarQube with PostgreSQL as the database backend, allowing you to perform code analysis and quality checks seamlessly.&lt;/p&gt;

&lt;p&gt;This is the first part of the setup. In the second part, we'll configure SonarQube for Java backend analysis, and in the third part, we'll set it up for frontend Node.js analysis. Let me know when you're ready to proceed with the next steps!&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>devops</category>
      <category>testing</category>
    </item>
    <item>
      <title>Updating Elasticsearch with P12 Certificate</title>
      <dc:creator>Ali Mahdiyanjoo</dc:creator>
      <pubDate>Mon, 25 Mar 2024 14:54:04 +0000</pubDate>
      <link>https://dev.to/sudo_apt_install_coffee/updating-elasticsearch-with-p12-certificate-ng1</link>
      <guid>https://dev.to/sudo_apt_install_coffee/updating-elasticsearch-with-p12-certificate-ng1</guid>
      <description>&lt;p&gt;🔍 &lt;strong&gt;Background:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For updating Elasticsearch to versions 17.10 and 17.5 with a P12 certificate, you can follow the steps outlined below.&lt;/p&gt;

&lt;h3&gt;
  
  
  Steps:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Access Docker Container:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker exec -it {container_name} bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Generate CA Certificate:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/usr/share/elasticsearch/bin/elasticsearch-certutil ca
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Enter a file name for the CA certificate in P12 format (e.g., New_Cer.p12)&lt;/li&gt;
&lt;li&gt;Specify the cipher for SSL encryption.&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Sign the new Certificate:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/usr/share/elasticsearch/bin/elasticsearch-certutil cert --ca {First_created_file}.p12 --ca-pass "" --days {Date_Of_Expiration} --out "{Output_name}.p12" --pass ""
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Replace SSL Certificate:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rm -rf /usr/share/elasticsearch/config/cert/elastic-stack-ca.p12
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mv {Location_Of_Created_File} /usr/share/elasticsearch/config/cert/elastic-stack-ca.p12
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Update File Permissions:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo chown {Username}:{Group} /usr/share/elasticsearch/config/cert/elastic-stack-ca.p12
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Check SSL Validation:&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Dev Tool in Kibana:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET /_ssl/certificates
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Check SSL Expiry Date:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -X GET http://{IP_Address}:9200/_ssl/certificates -u {Username}:{Password} | jq '.[-1].expiry' | cut -d '"' -f 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🚀 &lt;strong&gt;Completion:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;By following these steps, you would have successfully updated Elasticsearch to the specified versions and configured it with a P12 certificate for secure communication.&lt;/p&gt;

&lt;p&gt;Good luck with your Elasticsearch update! 🎉&lt;/p&gt;

</description>
      <category>devops</category>
      <category>tutorial</category>
      <category>docker</category>
      <category>elasticsearch</category>
    </item>
  </channel>
</rss>
