<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Laravel Git Blog - Security</title><description>Blog posts tagged Security: notes on Git, code review and shipping Laravel projects.</description><link>https://laravelgit.com/</link><language>en-gb</language><atom:link href="https://laravelgit.com/blog/tag/security.xml" rel="self" type="application/rss+xml"/><item><title>Signed Commits: When Your Team Should Bother</title><link>https://laravelgit.com/blog/signed-commits-when-to-bother/</link><guid isPermaLink="true">https://laravelgit.com/blog/signed-commits-when-to-bother/</guid><description>Signing proves a commit came from the key holder. Worth it for some repos, overhead for others. SSH keys make it cheap.</description><pubDate>Wed, 21 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;A commit&amp;#39;s author line is a text field anyone can set. Signing replaces &amp;quot;trust the name&amp;quot; with &amp;quot;trust the key&amp;quot;. Whether your team needs that depends on what the repo protects.&lt;/p&gt;
&lt;h2&gt;The cheap version: sign with your SSH key&lt;/h2&gt;
&lt;p&gt;No GPG setup anymore — git signs with the SSH key you already push with:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;git config --global gpg.format ssh
git config --global user.signingkey ~/.ssh/id_ed25519.pub
git config --global commit.gpgsign true
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Add the same public key to your git host as a signing key and your commits show as verified.&lt;/p&gt;
&lt;h2&gt;When it earns the setup&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Repos whose history feeds audits or compliance, where &amp;quot;who actually wrote this&amp;quot; needs an answer.&lt;/li&gt;
&lt;li&gt;Open source or vendor code others build on, where a forged author line is a real supply-chain risk.&lt;/li&gt;
&lt;li&gt;Teams with contractors coming and going, where key rotation is easier to reason about than usernames.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;When to skip it&lt;/h2&gt;
&lt;p&gt;A private repo for a two-person team that reviews everything anyway gains little. Signing proves authorship of the commit, not quality of the code — review is still the control that matters.&lt;/p&gt;
&lt;h2&gt;If you adopt it&lt;/h2&gt;
&lt;p&gt;Turn on the host&amp;#39;s &amp;quot;require signed commits&amp;quot; only after everyone signs comfortably. Flipping it early just teaches people to bypass the rule.&lt;/p&gt;
</content:encoded><category>Security</category><category>Tooling</category></item><item><title>A Secret Got Committed. Now What?</title><link>https://laravelgit.com/blog/a-secret-got-committed-now-what/</link><guid isPermaLink="true">https://laravelgit.com/blog/a-secret-got-committed-now-what/</guid><description>Rotate first, scrub second, prevent third. The order matters more than the tooling.</description><pubDate>Sun, 18 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;It happens: &lt;code&gt;.env&lt;/code&gt;, an API key, a database password ends up in a commit. The fix is the same every time, and the order matters.&lt;/p&gt;
&lt;h2&gt;1. Rotate the secret first&lt;/h2&gt;
&lt;p&gt;Deleting the file from git does nothing while the key still works. Assume anything committed is public, even in a private repo: clones, forks and CI caches all copy it. Revoke or rotate the credential at the provider before touching the repository.&lt;/p&gt;
&lt;h2&gt;2. Scrub the history&lt;/h2&gt;
&lt;p&gt;Once the old key is dead, remove it from history so the repo stops carrying it. &lt;code&gt;git filter-repo&lt;/code&gt; is the tool that works:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;pip install git-filter-repo
git filter-repo --path .env --invert-paths
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This rewrites every commit, so force-push and have the team re-clone. A commit hash they still hold can resurrect the file.&lt;/p&gt;
&lt;h2&gt;3. Stop it happening again&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;.gitignore&lt;/code&gt; the file and commit a &lt;code&gt;.env.example&lt;/code&gt; with the keys but no values.&lt;/li&gt;
&lt;li&gt;Laravel reads real values from the environment, so nothing secret needs to be in the repo at all.&lt;/li&gt;
&lt;li&gt;Turn on your host&amp;#39;s push protection or run a pre-commit scan so a key gets caught before it lands.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;The short version&lt;/h2&gt;
&lt;p&gt;A scrubbed repo with a live key is still a breach. A rotated key with an ugly history is just housekeeping. Rotate first.&lt;/p&gt;
</content:encoded><category>Security</category><category>Workflows</category></item></channel></rss>