<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:h="http://www.w3.org/TR/html4/"><channel><title>EINDEX&apos;s Blog</title><description>A blog about technology, life and more.</description><link>https://eindex.me/en</link><language>en</language><follow_challenge><feedId>64579551534239744</feedId><userId>42385791769513984</userId></follow_challenge><item><title>2</title><link>https://eindex.me/en/posts/newsletters/2</link><guid isPermaLink="true">https://eindex.me/en/posts/newsletters/2</guid><description>Blog migration to Astro, DeepWiki tool review, and security insights about MCP and embeddings</description><pubDate>Sat, 18 Oct 2025 05:01:59 GMT</pubDate><content:encoded>&lt;p&gt;I recently migrated my blog from Ghost to a new Astro-based system using the &lt;a href=&quot;https://astro-pure.js.org/&quot;&gt;Pure&lt;/a&gt; Theme. A key benefit of this move was consolidating my separate &lt;a href=&quot;https://eindex.me/en&quot;&gt;English site&lt;/a&gt; and &lt;a href=&quot;https://eindex.me/zh&quot;&gt;Chinese site&lt;/a&gt; into a single platform.&lt;/p&gt;
&lt;p&gt;This transition was primarily motivated by the looming expiration of my Digital Ocean VPS. Coupled with Astro&apos;s significant maturation over the past two years and some available time while job seeking, it felt like the perfect opportunity to rebuild.&lt;/p&gt;
&lt;p&gt;Familiar features like webmentions, security.txt, and comments will be making a comeback. I&apos;m also excited to integrate new functionalities such as llm.txt support and ActivityPub in the future.&lt;/p&gt;
&lt;h2&gt;Recent Finding&lt;/h2&gt;
&lt;h3&gt;&lt;a href=&quot;https://deepwiki.com&quot;&gt;Deepwiki&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;DeepWiki is an intelligent tool designed to help developers quickly understand open-source code repositories. It can generate documentation-like wiki pages for your GitHub repository with a single click and allows you to ask questions directly about the codebase.&lt;/p&gt;
&lt;p&gt;I tested DeepWiki with my &lt;a href=&quot;https://deepwiki.com/EINDEX/logseq-copilot&quot;&gt;Logseq Copilot&lt;/a&gt; Chrome extension repository, and it impressively generated diagrams for architecture, logic, and flow, along with highlighting key features. This tool shows great promise for security reviews, including threat modeling, security code reviews, and system audits. Its output could even provide valuable context for tools like &lt;a href=&quot;https://stridegpt.streamlit.app/&quot;&gt;STRIDE-GPT&lt;/a&gt; to conduct more in-depth analysis.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://medium.com/data-science-collective/mcp-is-a-security-nightmare-heres-how-the-agent-security-framework-fixes-it-fd419fdfaf4e&quot;&gt;MCP Security Risks&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;The linked article highlights that MCP servers often have excessive permissions and capabilities, introducing significant potential security risks.&lt;/p&gt;
&lt;h3&gt;&lt;a href=&quot;https://huggingface.co/blog/getting-started-with-embeddings&quot;&gt;Getting Started With Embeddings&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;This article explains the working principles of embedding models.&lt;/p&gt;</content:encoded><h:img src="/_astro/2.BGY4zoSK.jpeg"/><enclosure url="/_astro/2.BGY4zoSK.jpeg"/></item><item><title>2024-ending</title><link>https://eindex.me/en/posts/reviews/2024-ending</link><guid isPermaLink="true">https://eindex.me/en/posts/reviews/2024-ending</guid><description>A review of 2024, focusing on the transition to technical management (Function Owner for IAM), immigration plans to Melbourne, project updates (Kobo Hoarder, Logseq Copilot), financial status, and lessons learned.</description><pubDate>Thu, 13 Feb 2025 04:34:04 GMT</pubDate><content:encoded>&lt;p&gt;My 2024 was primarily focused on exploring &lt;strong&gt;technical management&lt;/strong&gt; and &lt;strong&gt;starting immigration&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;2024 was a year full of changes and rich experiences for me. During this year, I led a functional team for the first time, spent most of my time in Shanghai, left ThoughtWorks after 5.5 years, sold my apartment in Wuhan, and arrived in Melbourne on Christmas Eve, feeling optimistic about my new life.&lt;/p&gt;
&lt;p&gt;As usual, I learned and used new tools almost every week, tinkering with various things on my self-hosted cluster. However, due to being extremely busy with work in 2024, I had little time to write articles and summarize my experiences. Combined with the numerous changes throughout the year and being in a constant state of motion, it&apos;s now a month and a half into 2025 before I started writing my 2024 review.&lt;/p&gt;
&lt;h2&gt;Career&lt;/h2&gt;
&lt;h3&gt;Role and Transition&lt;/h3&gt;
&lt;p&gt;First, let&apos;s talk about my career. The main change in 2024 was transitioning from security consulting to becoming a Function Owner, leading the IAM team in China to plan roadmaps, improve maturity, implement various improvements, and support other teams in better and faster integration with IAM infrastructure. Through Standard Operation Process (SOP), we supported the integration of dozens of applications while introducing SCIM for efficient cross-site data synchronization. We also implemented some automation work in Jira to make the entire integration process visible and ensure smooth communication between team members for timely problem-solving and strategy adjustment.&lt;/p&gt;
&lt;p&gt;Compared to my previous work experiences, this role required creating various SOPs and dealing with different vendors, making comparisons, and proposing technical selection solutions. Unlike before, I couldn&apos;t personally handle every task and had to focus on high-priority and important deliverables, leaving little time for other matters. While some things didn&apos;t go as expected, each module still worked very well. I plan to write an article later sharing the solutions and experiences in Enterprise Identity Management System (EIAM).&lt;/p&gt;
&lt;h3&gt;Communication and Collaboration&lt;/h3&gt;
&lt;p&gt;The biggest challenge in my new role was communication. As an internal IAM provider, since most B2B products in China have low integration with IAM or none at all, many business or technical stakeholders don&apos;t understand the significance and value of integrating IAM.&lt;/p&gt;
&lt;p&gt;The role transition brought new responsibilities where I needed to constantly approach from the perspective of other departments&apos; existing or new products, providing suitable, easy, and stable integration methods to help various applications quickly and steadily integrate with the IAM platform.&lt;/p&gt;
&lt;p&gt;The most valuable points in cross-team communication were:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Thinking from the application&apos;s perspective, saving integration costs for application teams while providing consistent experiences to reduce learning and usage costs for non-technical staff&lt;/li&gt;
&lt;li&gt;Providing successful cases from other teams/similar applications and explaining their benefits&lt;/li&gt;
&lt;li&gt;Active communication, timely feedback on issues, and providing sufficient solutions with pros and cons for application teams to choose from&lt;/li&gt;
&lt;li&gt;For applications that truly cannot integrate, finding ways to provide grace periods, such as developing/preparing features that will make future integration into the project easier&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;Professional Skills&lt;/h3&gt;
&lt;p&gt;Although most of my energy in 2024 was focused on IAM-related work, I didn&apos;t neglect AppSec and DevOps. I provided many valuable suggestions to vendors regarding IAM-related application security and DevOps, while also participating in numerous open source projects with the help of AI.&lt;/p&gt;
&lt;p&gt;My architectural capabilities improved; in communications with different vendors, I could easily understand the underlying mechanisms of their applications and help them fix issues.&lt;/p&gt;
&lt;p&gt;I learned how to make trade-offs and choose the most beneficial paths, avoiding the engineering mindset of automating first before considering value. Simply put, if something has value, do it manually first, then automate it once it stabilizes.&lt;/p&gt;
&lt;p&gt;The technology I experimented with most in 2024 was AI-related, though mostly limited to configuration and usage without delving into AI fundamentals - essentially using AI as infrastructure. I created an automated flow using AI to analyze articles in my read-later list and tag them after searching my knowledge base.&lt;/p&gt;
&lt;h2&gt;Projects&lt;/h2&gt;
&lt;h3&gt;Open Source Projects&lt;/h3&gt;
&lt;p&gt;The only new project in 2024 was &lt;a href=&quot;https://github.com/EINDEX/Kobo-Hoarder-ReadItlater&quot;&gt;Kobo Hoarder Read-it-later&lt;/a&gt;, a tool that modifies the read-later feature on Kobo e-readers to work with &lt;a href=&quot;https://wallabag.org/&quot;&gt;Wallabag&lt;/a&gt;. Recently, I migrated from &lt;a href=&quot;https://wallabag.org/&quot;&gt;Wallabag&lt;/a&gt; to &lt;a href=&quot;https://github.com/hoarder-app/hoarder&quot;&gt;Hoarder&lt;/a&gt;, so I also modified this project into a Kobo Hoarder tool. The Hook part is directly inherited from &lt;a href=&quot;https://github.com/Podginator/KoboOmnivoreConverter&quot;&gt;KoboOmnivoreConverter&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;Blog and Website&lt;/h3&gt;
&lt;p&gt;I updated the &lt;a href=&quot;https://logseq-copilot.eindex.me/&quot;&gt;Logseq-Copilot&lt;/a&gt; official website using vuepress, and traffic increased dramatically - almost 10 times that of my blog site. I might optimize it further when I have time.&lt;/p&gt;
&lt;p&gt;For my personal blog, I simply migrated to Ghost. There were frequent downtimes throughout the past year, and I didn&apos;t have much time to fix them. The most encouraging thing is that I received some sponsors, which is my main motivation for continuing to maintain Logseq Copilot.&lt;/p&gt;
&lt;h2&gt;Finance&lt;/h2&gt;
&lt;p&gt;Due to moving to Melbourne and spending half a year in Shanghai for work, I barely traveled. Considering future expenses, I first predicted my spending patterns in Beancount, calculating that my savings would last for over two happy years at my current consumption level.&lt;/p&gt;
&lt;p&gt;Meanwhile, Australia&apos;s basic interest rate of 5% is higher than China&apos;s 2%, so my after-tax income in Australia is slightly higher than in China. However, the cost of living is also higher than in China, so my current funds are still quite far from FIRE (Financial Independence, Retire Early).&lt;/p&gt;
&lt;h2&gt;Lessons Learned&lt;/h2&gt;
&lt;p&gt;The biggest failure of 2024 was letting my girlfriend come to Australia mid-year, resulting in us living apart. Against the backdrop of a poor economy, I trusted the company&apos;s relocation plan too much, and we only managed to reunite after six months. If you need to relocate internationally, it&apos;s best to move together - when one person is in a foreign country, the other can only offer limited help.&lt;/p&gt;
&lt;h2&gt;Looking Forward to 2025&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;The primary goal this year is to find a job&lt;/strong&gt; that can support myself and my family in Australia; I also want to get an Australian driver&apos;s license and own a car.&lt;/p&gt;
&lt;p&gt;Technically, I will explore both information security and development fields while maximizing the use of AI to improve efficiency. I&apos;ll continue to explore new areas and knowledge.&lt;/p&gt;
&lt;p&gt;I hope to maintain a healthy body and mind, go skiing in Australia, and travel to Japan with my girlfriend.&lt;/p&gt;
&lt;p&gt;I will try to maintain regular article updates and publish more newsletters.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;2024 was a very fulfilling year. With the support of friends and colleagues, 2024 was full of achievements and experiences.&lt;/p&gt;
&lt;p&gt;I hope to find a job soon and settle down in Australia in 2025.&lt;/p&gt;</content:encoded><h:img src="undefined"/><enclosure url="undefined"/></item><item><title>#1 Mid-Autumn Festival</title><link>https://eindex.me/en/posts/newsletters/1</link><guid isPermaLink="true">https://eindex.me/en/posts/newsletters/1</guid><description>Although it&apos;s the Mid-Autumn Festival, I&apos;m still on a business trip in Shanghai, continuing to be a homebody who doesn&apos;t go out. I&apos;ve made some major decisions recently, I hope everything goes smoothly.</description><pubDate>Tue, 17 Sep 2024 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;import { LinkPreview } from &apos;astro-pure/advanced&apos;&lt;/p&gt;
&lt;p&gt;Although it&apos;s the Mid-Autumn Festival, I&apos;m still on a business trip in Shanghai, continuing to be a homebody who doesn&apos;t go out. I&apos;ve made some major decisions recently, I hope everything goes smoothly.&lt;/p&gt;
&lt;h2&gt;Projects&lt;/h2&gt;
&lt;p&gt;One week before the holiday, I updated Logseq Copilot with support for the Logseq DB version.&lt;/p&gt;
&lt;h2&gt;Articles&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;Generalists (juniors) are usually better at innovation than experts&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I actually think there are mid and senior level generalists too. Generalists excel at solving problems across different domains/knowledge areas, often arriving at simpler solutions.&lt;/p&gt;
&lt;h2&gt;Tools&lt;/h2&gt;</content:encoded><h:img src="undefined"/><enclosure url="undefined"/></item><item><title>improving-your-code-review-process-with-semgrep</title><link>https://eindex.me/en/posts/cybersecurity/improving-your-code-review-process-with-semgrep</link><guid isPermaLink="true">https://eindex.me/en/posts/cybersecurity/improving-your-code-review-process-with-semgrep</guid><description>A tool to automate code analysis and enforce security best practices. Helps developers write better code faster.</description><pubDate>Tue, 13 Dec 2022 12:55:03 GMT</pubDate><content:encoded>&lt;p&gt;In this post, I will show you how to set up Semgrep for your project, give examples of common code issues that it can detect, and provide best practices for using Semgrep in code review. By the end, you will have a better understanding of how Semgrep can improve your code review process and make your code more secure, reliable and maintainable.&lt;/p&gt;
&lt;h2&gt;Introduction to Semgrep and why it is Useful for Code Review&lt;/h2&gt;
&lt;p&gt;Code review is an essential part of the SDLC(software development live cycle). It helps ensure that the code is correct, maintainable, secure, and follows the agreed-upon standards and conventions. However, manual code review can be time-consuming and error-prone, especially for large codebases with many contributors or long time history.&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;https://img.eindex.me/img/e23bd0bbaf9d2513d3d26042b1aa702b.png&quot; alt=&quot;Semgrep compare with AST and regex&quot;&gt;&lt;/p&gt;
&lt;p&gt;Enter Semgrep, a tool for statically analyzing code and detecting common issues. Semgrep runs mostly language-agnostic analysis on analysis-friendly IR(intermediate language) which translate by AST(abstract syntax tree) tree. This process will not generate AST tree via your compile project with dependencies like CodeQL. So semgrep can run it quick and easy to create rules to find and fix common problems in your code, such as security vulnerabilities, logical errors, and style violations.&lt;/p&gt;
&lt;h2&gt;Setting up Semgrep for Your Project&lt;/h2&gt;
&lt;p&gt;To use Semgrep, you need to install the semgrep command-line tool on your system. The installation process varies depending on your operating system and package manager, but in general, you can use the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;pip install semgrep
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once you have installed Semgrep, you can use it to scan your codebase for specific patterns. For example, the following command will search for instances of the strcpy function, which is considered insecure and should not be used:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;semgrep --config p/python --pattern &apos;strcpy(x, y)&apos; path/to/code
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;--config&lt;/code&gt; option specifies the configuration to use for the scan, and the &lt;code&gt;--pattern&lt;/code&gt; option specifies the rule to match. In this case, I are using the &lt;code&gt;p/python&lt;/code&gt; configuration, which includes rules for detecting common issues in Python code, and I are looking for occurrences of the strcpy function.&lt;/p&gt;
&lt;p&gt;You can also finding more rules on the semgrep registry on your project, there are a lot of open source rules provide from semgrep community, &lt;a href=&quot;https://semgrep.dev/explore&quot;&gt;link to registry&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Once you have set up Semgrep and run a scan, you can use the results to identify and fix potential problems in your code. This can save time and effort during code review, as it allows you to automatically detect and address common issues before they are reviewed by your team.&lt;/p&gt;
&lt;h2&gt;Examples of Common Code Issues that Semgrep Can Detect&lt;/h2&gt;
&lt;p&gt;Semgrep can detect a wide range of code issues, depending on the configuration and rules that you use. Here are some examples of common code issues that Semgrep can help you find and fix:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Security vulnerabilities, such as &lt;a href=&quot;https://semgrep.dev/p/sql-injection&quot;&gt;SQL injection&lt;/a&gt; and &lt;a href=&quot;https://semgrep.dev/p/xss&quot;&gt;Cross-Site Scripting (XSS)&lt;/a&gt; vulnerabilities, or you can use &lt;a href=&quot;https://semgrep.dev/p/owasp-top-ten&quot;&gt;OWASP Top 10&lt;/a&gt; ruleset for common web security vulnerabilities.&lt;/li&gt;
&lt;li&gt;Deprecated or unsafe API usage, such as the use of strcpy in C or eval in JavaScript&lt;/li&gt;
&lt;li&gt;Misconfgration, such as &lt;a href=&quot;https://semgrep.dev/p/dockerfile&quot;&gt;dockerfile&lt;/a&gt;, &lt;a href=&quot;https://semgrep.dev/p/docker-compose&quot;&gt;docker-compose&lt;/a&gt; settings.&lt;/li&gt;
&lt;li&gt;Hard-coded secret, such as the &lt;a href=&quot;https://semgrep.dev/p/secrets&quot;&gt;secret&lt;/a&gt; ruleset.&lt;/li&gt;
&lt;li&gt;Style violations, such as inconsistent indentation, unused variables, catch default issues and overly complex expressions&lt;/li&gt;
&lt;li&gt;Permission issue, such as forgot add permission check. Need to write custom rules.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By using Semgrep to detect these issues, you can prevent bugs and security risks in your code and improve its overall quality. This can save time and effort during code review, as it allows you to focus on higher-level design and architecture issues instead of catching low-level mistakes.&lt;/p&gt;
&lt;p&gt;In the next section, I will share some best practices when I using Semgrep in code review.&lt;/p&gt;
&lt;p&gt;or create your own configuration and rules to customize Semgrep for your project. For more information, see the Semgrep documentation, &lt;a href=&quot;https://semgrep.dev/docs/writing-rules/overview/&quot;&gt;link to docs&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Best Practices for Using Semgrep in Code Review&lt;/h2&gt;
&lt;p&gt;To get the most out of Semgrep in code review, you should follow these best practices:&lt;/p&gt;
&lt;h3&gt;How to Integrate Semgrep into Your Code Review Workflow&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Set up Semgrep as part of your continuous integration (CI) pipeline, so that it automatically runs on every code change. This can help you catch potential issues early and prevent them from being merged into the main codebase.&lt;/li&gt;
&lt;li&gt;Use the output of Semgrep as input for your code review tool, such as GitHub Pull Requests or Gerrit. This can help you quickly identify and address the issues that Semgrep has detected.&lt;/li&gt;
&lt;li&gt;Use Semgrep as part of your team&apos;s code review standards and guidelines. This can help your team members understand the expectations for code quality and avoid common pitfalls.&lt;/li&gt;
&lt;li&gt;Starting to write costom rules for your project. This will building you team knowledge base for your codebases, new team member can easily and fast know the reason, and avoid issues.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;How to Write effective Semgrep Rules&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;Keep your rules simple and focused: avoid using complex regular expressions or matching patterns that are too broad.&lt;/li&gt;
&lt;li&gt;Use concrete examples to illustrate the code that the rule should match and the code that it should not match. This can help you and others understand the rule and avoid false positives or false negatives.&lt;/li&gt;
&lt;li&gt;Test your rules on a representative sample of your codebase before using them in code review. This can help you fine-tune the rules and make sure they work as expected.&lt;/li&gt;
&lt;li&gt;If possible provide fix suggestion or direct using fix field in the rule for time saving.&lt;/li&gt;
&lt;li&gt;Document your rules and share them with your team. This can help others understand the rationale behind the rules and improve the consistency of your codebase.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By following these best practices, you can make Semgrep an integral part of your code review process and improve the overall quality of your code. In the next section, I will discuss some tips and tricks for getting the most out of Semgrep.&lt;/p&gt;
&lt;h2&gt;Tips and Tricks for Getting the Most out of Semgrep&lt;/h2&gt;
&lt;p&gt;To get the most out of Semgrep, here are some tips and tricks that you can use:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use the &lt;code&gt;--severity&lt;/code&gt; option to filter the output of Semgrep based on the severity of the issues that it detects. This can help you focus on the most important or critical issues first.&lt;/li&gt;
&lt;li&gt;Use the &lt;code&gt;--metrics off&lt;/code&gt; or set environment variables &lt;code&gt;SEMGREP_SEND_METRICS=off&lt;/code&gt; if you not want to send anything to Semgrep server, avoiding the information exposure.&lt;/li&gt;
&lt;li&gt;Use the &lt;code&gt;--json&lt;/code&gt;, &lt;code&gt;--junit-xml&lt;/code&gt; or &lt;code&gt;--sarif&lt;/code&gt; as output, can easily to integrate your workflow.&lt;/li&gt;
&lt;li&gt;Use the &lt;code&gt;--autofix&lt;/code&gt; with simple code style ruleset as lint, run it in your team member&apos;s pre-commit hook.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;By using these tips and tricks, you can customize Semgrep to fit your specific needs and workflows, and get even more value from it. In the next and final section, I will discuss the conclusion and next steps for improving your code review process with Semgrep.&lt;/p&gt;
&lt;h2&gt;Conclusion and next Steps for Improving Your Code Review Process with Semgrep&lt;/h2&gt;
&lt;p&gt;In this post, I have shown you how to use Semgrep to improve your code review process. I have discussed the benefits of using Semgrep, the steps for setting it up, the types of code issues that it can detect, and the best practices for using it in code review. I have also provided some tips and tricks for getting the most out of Semgrep.&lt;/p&gt;
&lt;p&gt;By using Semgrep in your code review process, you can save time and effort, improve the quality of your code, and prevent bugs and security risks. If you want to learn more about Semgrep and how it can help you, here are some next steps that you can take:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Read the Semgrep documentation to learn more about the features and capabilities of Semgrep, &lt;a href=&quot;https://semgrep.dev/docs/&quot;&gt;link to docs&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Try Semgrep on your own codebase to see how it works and what it can find.&lt;/li&gt;
&lt;li&gt;Learning how to write semgrep rules on official tutorial, &lt;a href=&quot;https://semgrep.dev/learn&quot;&gt;link to learning center&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Join the Semgrep community to ask questions, share experiences, and contribute to the development of Semgrep, &lt;a href=&quot;https://r2c.dev/slack&quot;&gt;Slack&lt;/a&gt;, &lt;a href=&quot;https://twitter.com/r2cdev&quot;&gt;Twitter&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I hope that this post has been helpful and that you will consider using Semgrep in your code review process. Happy coding!&lt;/p&gt;</content:encoded><h:img src="/_astro/improving-your-code-review-process-with-semgrep.CUlCrSnf.png"/><enclosure url="/_astro/improving-your-code-review-process-with-semgrep.CUlCrSnf.png"/></item><item><title>webmentions</title><link>https://eindex.me/en/posts/webmentions</link><guid isPermaLink="true">https://eindex.me/en/posts/webmentions</guid><description>A beginner&apos;s guide to Webmentions, explaining what they are, how to join the community (using webmention.io, microformats2), benefits, and automation using GitHub Actions.</description><pubDate>Sun, 06 Nov 2022 09:44:50 GMT</pubDate><content:encoded>&lt;p&gt;Recently I came across &lt;a href=&quot;https://www.owenyoung.com/en/blog/indieweb/&quot;&gt;Now, I&apos;m in IndieWeb?&lt;/a&gt; and learned about webmentions. I found the concept very interesting and decided to join the webmentions community for my blog.&lt;/p&gt;
&lt;h2&gt;What Are Webmentions&lt;/h2&gt;
&lt;p&gt;Webmentions are a way for websites to communicate with each other and notify each other when they link to each other&apos;s content. This allows for a more interactive and connected online community, where websites can engage with each other and their users in real-time.&lt;/p&gt;
&lt;h2&gt;How Do I Join the Webmentions Community?&lt;/h2&gt;
&lt;p&gt;To join the webmentions community and start receiving notifications when other websites link to your content, you need to take the following steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Register your website with a webmention service, such as webmention.io. This will allow your website to receive webmentions from other sites and also enable you to send webmentions to other sites when you link to them. To do this, you can add the following HTML code to your website:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-html&quot;&gt;&amp;#x3C;link rel=&quot;webmention&quot; href=&quot;https://webmention.io/eindex.me/webmention&quot; /&gt;
&amp;#x3C;link rel=&quot;pingback&quot; href=&quot;https://webmention.io/eindex.me/xmlrpc&quot; /&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Make sure your website follows the &lt;a href=&quot;https://microformats.org/&quot;&gt;microformats2&lt;/a&gt; standard. This may require some effort, but it is important for ensuring that your website can properly send and receive webmentions. You can use a tool like &lt;a href=&quot;https://indiewebify.me/&quot;&gt;IndieWebify.Me&lt;/a&gt; to check if your website is using microformats2 correctly. You may also want to use a tool like &lt;code&gt;ngrok&lt;/code&gt; or &lt;code&gt;cloudflare tunnel&lt;/code&gt; to debug your website locally, which can save you time.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Start sending and receiving webmentions on your website. Once your website is registered with a webmention service and you have tested your implementation, you can start using webmentions on your site. Whenever you link to another website, you can send a webmention to notify them of your link. And whenever someone else links to your website, you can receive a webmention notification and display that link on your site.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Consider using tools like Github actions and JavaScript scripts to automate the process of sending and receiving webmentions. This is particularly useful for static websites. For example, you can store your webmentions in a &lt;code&gt;webmentions&lt;/code&gt; branch on Github, and use a workflow file like this to fetch webmentions and send your webmentions, you also can check my &lt;a href=&quot;https://github.com/EINDEX/blog/blob/main/.github/workflows/fetch-webmentions.yaml&quot;&gt;implement&lt;/a&gt; for this blog:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;name: Fetch Webmentions
on:
schedule:
    - cron: &quot;0 0 * * *&quot;
jobs:
fetch_webmentions:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
        with:
        ref: webmentions
    - name: Fetch Webmentions
        run: node pipeline/webmentions.js
    - name: Send Webmetnions
        run: node pipeline/send-webmentions.js
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;By following these steps, you can join the webmentions community and start enjoying the benefits of more interactive and engaging communication with other websites and their users.&lt;/p&gt;
&lt;p&gt;e&lt;/p&gt;
&lt;h2&gt;Why Join the Webmentions Community?&lt;/h2&gt;
&lt;p&gt;There are many potential benefits to joining the webmentions community and implementing webmentions on your website. Some of the potential benefits include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Increased engagement and connectivity with other websites and theirusers. By receiving notifications when other websites link to your content and being able to notify other websites when you link to them, you can foster a more interactive and connected online community. This can lead to increased traffic and potentially even more opportunities for collaboration and engagement.&lt;/li&gt;
&lt;li&gt;Improved communication and collaboration with other websites. Webmentions allow for real-time communication between websites, which can be helpful for coordinating efforts and staying up-to-date with the latest developments in the webmentions community.&lt;/li&gt;
&lt;li&gt;The ability to participate in the evolving web ecosystem. Webmentions are a form of &quot;web 3.0&quot; where websites are more interconnected and interactive than in the past. By joining the webmention community, you can be part of this evolving web ecosystem and potentially benefit from new opportunities and connections that arise.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Of course, joining the webmention community does require some effort and resources, so it may not be the right decision for everyone. But for many website owners, the potential benefits of joining the webmention community may outweigh the challenges, making it a worthwhile investment.&lt;/p&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;In this beginner&apos;s guide, we&apos;ve covered the steps involved in joining the webmentions community and implementing webmentions on your website. By following these steps, you can join the webmentions community and start enjoying the benefits of more interactive and engaging communication with other websites and their users. While there are some challenges and resources required to join the webmention community, the potential benefits may outweigh the challenges for many website owners.&lt;/p&gt;</content:encoded><h:img src="/_astro/webmentions.B4Xcvid0.png"/><enclosure url="/_astro/webmentions.B4Xcvid0.png"/></item><item><title>semgrep-with-custom-rules</title><link>https://eindex.me/en/posts/cybersecurity/semgrep-with-custom-rules</link><guid isPermaLink="true">https://eindex.me/en/posts/cybersecurity/semgrep-with-custom-rules</guid><description>Improve code reviews with Semgrep: enforce standards, detect vulnerabilities, and enhance code quality. Integrate Semgrep for better code before release.</description><pubDate>Wed, 14 Dec 2022 06:14:56 GMT</pubDate><content:encoded>&lt;p&gt;In this post, we will discuss how Semgrep can be integrated into your code review process. If you are unfamiliar with Semgrep, we recommend checking out our previous article on the topic, titled &quot;&lt;a href=&quot;/en/posts/cybersecurity/improving-your-code-review-process-with-semgrep&quot;&gt;Improving Your Code Review Process With Semgrep&lt;/a&gt;&quot;.&lt;/p&gt;
&lt;h2&gt;Codereview and Semgrep&lt;/h2&gt;
&lt;p&gt;Code review is a crucial step in the software development workflow, as it allows team members to review and critique each other&apos;s code.&lt;/p&gt;
&lt;p&gt;However, code review can sometimes be a source of contention, with debates over code style or disagreements over team coding standards.&lt;/p&gt;
&lt;p&gt;Additionally, there may be cases where the team lacks domain expertise, leading to the inclusion of vulnerabilities in the code. Semgrep can help address these issues by promoting consistent coding practices and identifying potential vulnerabilities.&lt;/p&gt;
&lt;p&gt;Let&apos;s take a closer look at how Semgrep can be utilized in the code review process.&lt;/p&gt;
&lt;h2&gt;Cases&lt;/h2&gt;
&lt;p&gt;In this section, we will examine three cases where Semgrep custom rules can be utilized to improve code quality.&lt;/p&gt;
&lt;p&gt;Case 1: Preventing the use of &lt;code&gt;System.out&lt;/code&gt; in Java. It is not uncommon for team members to use &lt;code&gt;System.out&lt;/code&gt; for logging or debugging purposes. However, this practice can be problematic. The following custom rule can help address this issue:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;rules:
  - id: logging-via-system-out
    pattern: System.out.$PRINT($ARG);
    message: Using system out as logging method.
    languages: [java]
    severity: WARNING
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If your team has established logging standards, the &lt;code&gt;fix&lt;/code&gt; function can be used to automatically replace instances of &lt;code&gt;System.out&lt;/code&gt; with a preferred logging method. For example:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;rules:
  - id: logging-via-system-out
    pattern: System.out.$PRINT($ARG);
    message: Using system out as logging method.
    fix: log.info($ALG)
    languages: [java]
    severity: WARNING
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Case 2: Disallowing system calls. In some situations, it may be desirable to prohibit system commands in order to protect the user&apos;s device or cloud machine. The following custom rule can be used to detect and prevent the execution of system commands:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;rules:
  - id: java-rec-checker
    patterns:
      - pattern-inside: $FUN(...,$ARG,...){...}
      - pattern-either:
          - pattern: Runtime.getRuntime().exec(..., $ARG, ...);
          - patterns:
              - pattern: Process $PROCESS = Runtime.getRuntime();
              - pattern: $PROCESS.exec(..., $ARG, ...);
    message: RCE risk from user input.
    languages: [java]
    severity: ERROR
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Case 3: Ensuring that all request mappings have authentication checks. It is important to ensure that all request mappings have proper permission checks in place. The following custom rule can be used to identify instances where these checks are missing:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-yaml&quot;&gt;rules:
  - id: vaild-permission-check-on-all-request-mapping
    patterns:
      - pattern-inside: |
          @$CONTROLLER_ANNOTATION
          public class $CONTROLLER {
            ...
          }
      - pattern: |
          @$MAPPING_ANNOTATION(...)
          public $RET $METHOD(...){...}
      - pattern-not: |
          @$MAPPING_ANNOTATION(...)
          @$PERMISSION_ANNOTATION(...)
          public $RET $METHOD(...){...}
      - metavariable-regex:
          metavariable: $CONTROLLER_ANNOTATION
          regex: (.*Controller$)
      - metavariable-regex:
          metavariable: $MAPPING_ANNOTATION
          regex: (.*Mapping$)
      - metavariable-regex:
          metavariable: $PERMISSION_ANNOTATION
          regex: (.*Permission$)
    message: Should check user permission on all request mapping
    languages: [java]
    severity: WARNING
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Summarize&lt;/h2&gt;
&lt;p&gt;This article has discussed how Semgrep can be integrated into the code review process to improve code quality and consistency.&lt;/p&gt;
&lt;p&gt;By using custom rules, Semgrep can enforce team coding standards and detect potential vulnerabilities in the code.&lt;/p&gt;
&lt;p&gt;By incorporating Semgrep into the code review workflow, teams can more effectively identify and address issues before code is released to production.&lt;/p&gt;</content:encoded><h:img src="/_astro/semgrep-with-custom-rules.DfqOxfg4.png"/><enclosure url="/_astro/semgrep-with-custom-rules.DfqOxfg4.png"/></item></channel></rss>