<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[It&#x27;s been a while since I&#x27;ve done web stuff.]]></title><description><![CDATA[<p>It's been a while since I've done web stuff. Did I screw up anything too horribly here?</p><p></p><div class="card col-md-9 col-lg-6 position-relative link-preview p-0">



<a href="https://github.com/ngscopeclient/scopehal-ci-scripts/blob/main/api/github-hook.php" title="scopehal-ci-scripts/api/github-hook.php at main · ngscopeclient/scopehal-ci-scripts">
<img src="https://opengraph.githubassets.com/1597748762c9884fe93530fccd576dbf3dc270d0ba9dba9ef5d1a5aa56d562f1/ngscopeclient/scopehal-ci-scripts" class="card-img-top not-responsive" style="max-height:15rem" alt="Link Preview Image" />
</a>



<div class="card-body">
<h5 class="card-title">
<a href="https://github.com/ngscopeclient/scopehal-ci-scripts/blob/main/api/github-hook.php">
scopehal-ci-scripts/api/github-hook.php at main · ngscopeclient/scopehal-ci-scripts
</a>
</h5>
<p class="card-text line-clamp-3">Test scripts for continuous integration builds on our internal cluster - scopehal-ci-scripts/api/github-hook.php at main · ngscopeclient/scopehal-ci-scripts</p>
</div>
<a href="https://github.com/ngscopeclient/scopehal-ci-scripts/blob/main/api/github-hook.php" class="card-footer text-body-secondary small d-flex gap-2 align-items-center lh-2">



<img src="https://github.githubassets.com/favicons/favicon.svg" alt="favicon" class="not-responsive overflow-hiddden" style="max-width:21px;max-height:21px" />



<p class="d-inline-block text-truncate mb-0">GitHub <span class="text-secondary">(github.com)</span></p>
</a>
</div><p></p><p>This is a web hook that is only triggered by the 'push' event on ngscopeclient/scopehal-apps.</p><p>Goal is to ensure that</p><p>a) nobody but github can trigger builds (to prevent DoSing the CI platform with a ridiculous number of builds etc)</p><p>b) a compromise of GitHub's webhook infrastructure can trigger builds of real commits in the repo, but not run arbitrary shell commands on the CI runner or pull from an untrusted fork (i.e. no shell command injections etc in the branch/commit strings which will be fed to a zillion bash scripts downstream)</p>]]></description><link>https://board.circlewithadot.net/topic/b2b2afb6-99be-4493-8240-c374ec1955ab/it-s-been-a-while-since-i-ve-done-web-stuff.</link><generator>RSS for Node</generator><lastBuildDate>Fri, 15 May 2026 04:33:33 GMT</lastBuildDate><atom:link href="https://board.circlewithadot.net/topic/b2b2afb6-99be-4493-8240-c374ec1955ab.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 12 May 2026 22:46:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to It&#x27;s been a while since I&#x27;ve done web stuff. on Wed, 13 May 2026 14:34:00 GMT]]></title><description><![CDATA[<p><span><a href="/user/dch%40bsd.network">@<span>dch</span></a></span> The overall flow is that incoming traffic to my site hits the core router / firewall which blocks requests to unrecognized ports or from blocklisted IPs etc.</p><p>Then anything headed to port 443 or 80 goes to the VM server where a single nginx instance does HTTPS termination as well as serving some static web endpoints like my blog. Non-HTTPS traffic is 301 redirected to HTTPS.</p><p>A bunch of other endpoints like the CI dashboard and API are reverse-proxied (currently with no TLS but I will eventually be using internal enterprise-CA certificates here just to be extra safe) to other VMs on the same physical host, like the one the dashboard is hosted by as well as the one the webhook API endpoint lives on.</p><p>Since the main TLS termination host needs to accept connections from anywhere on the internet, I would need IP filtering in that nginx instance to drop stuff going to the API endpoint from non-GitHub IPs. While doable, the hash is fast enough I don't think it is going to really protect me from much. The whole point of the HMAC itself is that anyone without the preshared key can't spoof requests.</p>]]></description><link>https://board.circlewithadot.net/post/https://ioc.exchange/users/azonenberg/statuses/116567758655601525</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://ioc.exchange/users/azonenberg/statuses/116567758655601525</guid><dc:creator><![CDATA[azonenberg@ioc.exchange]]></dc:creator><pubDate>Wed, 13 May 2026 14:34:00 GMT</pubDate></item><item><title><![CDATA[Reply to It&#x27;s been a while since I&#x27;ve done web stuff. on Wed, 13 May 2026 14:00:02 GMT]]></title><description><![CDATA[<p><span><a href="/user/dch%40bsd.network">@<span>dch</span></a></span> the hmac is fast enough it's not a viable DoS vector. My inbound pipe will saturate before I'll run out of CPU doing hashes.</p><p>If somebody wants to DDoS my API endpoint there's not a whole lot I can do about it.</p>]]></description><link>https://board.circlewithadot.net/post/https://ioc.exchange/users/azonenberg/statuses/116567625043439708</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://ioc.exchange/users/azonenberg/statuses/116567625043439708</guid><dc:creator><![CDATA[azonenberg@ioc.exchange]]></dc:creator><pubDate>Wed, 13 May 2026 14:00:02 GMT</pubDate></item><item><title><![CDATA[Reply to It&#x27;s been a while since I&#x27;ve done web stuff. on Wed, 13 May 2026 13:58:01 GMT]]></title><description><![CDATA[<p><span><a href="/user/azonenberg%40ioc.exchange">@<span>azonenberg</span></a></span> I've built one of these, and one thing you may end up needing it is *before* doing the HMAC validation, is to limit by inbound IP, e.g. at firewall or (in my case) haproxy.</p><p><a href="https://docs.github.com/en/webhooks/using-webhooks/best-practices-for-using-webhooks#allow-githubs-ip-addresses" rel="nofollow noopener noreferrer"><span>https://</span><span>docs.github.com/en/webhooks/us</span><span>ing-webhooks/best-practices-for-using-webhooks#allow-githubs-ip-addresses</span></a> &amp; use <a href="https://api.github.com/meta" rel="nofollow noopener noreferrer"><span>https://</span><span>api.github.com/meta</span><span></span></a> to populate it.</p>]]></description><link>https://board.circlewithadot.net/post/https://bsd.network/users/dch/statuses/116567617110594045</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://bsd.network/users/dch/statuses/116567617110594045</guid><dc:creator><![CDATA[dch@bsd.network]]></dc:creator><pubDate>Wed, 13 May 2026 13:58:01 GMT</pubDate></item><item><title><![CDATA[Reply to It&#x27;s been a while since I&#x27;ve done web stuff. on Tue, 12 May 2026 22:57:08 GMT]]></title><description><![CDATA[<p><span><a href="/user/cr1901%40mastodon.social">@<span>cr1901</span></a></span> The downstream bash scripts will do no further sanitizing, as it's assumed the branch and ref are valid by the time you get to them.</p><p>Right now these arguments are ignored and I always build latest master, but that is about to change and I want to not get pwned when that happens <img src="https://board.circlewithadot.net/assets/plugins/nodebb-plugin-emoji/emoji/android/1f61b.png?v=28325c671da" class="not-responsive emoji emoji-android emoji--stuck_out_tongue" style="height:23px;width:auto;vertical-align:middle" title=":p" alt="😛" /></p>]]></description><link>https://board.circlewithadot.net/post/https://ioc.exchange/users/azonenberg/statuses/116564074736317687</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://ioc.exchange/users/azonenberg/statuses/116564074736317687</guid><dc:creator><![CDATA[azonenberg@ioc.exchange]]></dc:creator><pubDate>Tue, 12 May 2026 22:57:08 GMT</pubDate></item><item><title><![CDATA[Reply to It&#x27;s been a while since I&#x27;ve done web stuff. on Tue, 12 May 2026 22:55:46 GMT]]></title><description><![CDATA[<p><span><a href="/user/cr1901%40mastodon.social">@<span>cr1901</span></a></span> The checks on line 54 and 65 are intended to make sure that $branch is only alphanumeric characters and dashes, and $after is only lowercase hex characters.</p><p>After that, they should be safe to e.g. "git checkout $COMMIT"</p><p>The question is...<br />* Did I do that right? I'm not a regex expert<br />* Is there any way that this can lead to me checking out a branch/commit from a fork rather than the upstream repo via some github server side weirdness?</p>]]></description><link>https://board.circlewithadot.net/post/https://ioc.exchange/users/azonenberg/statuses/116564069320237984</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://ioc.exchange/users/azonenberg/statuses/116564069320237984</guid><dc:creator><![CDATA[azonenberg@ioc.exchange]]></dc:creator><pubDate>Tue, 12 May 2026 22:55:46 GMT</pubDate></item><item><title><![CDATA[Reply to It&#x27;s been a while since I&#x27;ve done web stuff. on Tue, 12 May 2026 22:52:40 GMT]]></title><description><![CDATA[<p><span><a href="/user/azonenberg%40ioc.exchange">@<span>azonenberg</span></a></span> &gt; i.e. no shell command injections etc in the branch/commit strings</p><p>Yea, that was my question... how are you sanitizing $branch and $after?</p>]]></description><link>https://board.circlewithadot.net/post/https://mastodon.social/users/cr1901/statuses/116564057139672167</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://mastodon.social/users/cr1901/statuses/116564057139672167</guid><dc:creator><![CDATA[cr1901@mastodon.social]]></dc:creator><pubDate>Tue, 12 May 2026 22:52:40 GMT</pubDate></item><item><title><![CDATA[Reply to It&#x27;s been a while since I&#x27;ve done web stuff. on Tue, 12 May 2026 22:51:07 GMT]]></title><description><![CDATA[<p>One trust boundary I'm trying to maintain here is that the orchestrator node (the box that runs this hook and launches the actual runner instances) is slightly more trusted than the runners.</p><p>While right now, we're only building from master on the upstream repo, I would like to eventually use the same platform to test pull requests after a cursory human review.</p><p>The runner VMs are ephemeral and blown away after a job completes and live in an isolated sandbox network, so the damage they can cause if compromised is limited (assuming nobody cares enough to burn a Xen hypervisor escape on me).</p><p>But I want to avoid any opportunity for pivoting to the orchestrator which e.g. will be able to publish build artifacts to other servers</p>]]></description><link>https://board.circlewithadot.net/post/https://ioc.exchange/users/azonenberg/statuses/116564051092570648</link><guid isPermaLink="true">https://board.circlewithadot.net/post/https://ioc.exchange/users/azonenberg/statuses/116564051092570648</guid><dc:creator><![CDATA[azonenberg@ioc.exchange]]></dc:creator><pubDate>Tue, 12 May 2026 22:51:07 GMT</pubDate></item></channel></rss>