<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>squid &#8211; luke arms</title>
	<atom:link href="https://tech.lkrms.org/tag/squid/feed/" rel="self" type="application/rss+xml" />
	<link>https://tech.lkrms.org</link>
	<description>just a nerd with &#34;mild OCD tendencies&#34;</description>
	<lastBuildDate>Mon, 22 May 2017 00:20:28 +0000</lastBuildDate>
	<language>en-AU</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.6.12</generator>

<image>
	<url>https://tech.lkrms.org/wp-content/uploads/2016/06/cropped-Logo-Letters-WB-Circle-2-32x32.png</url>
	<title>squid &#8211; luke arms</title>
	<link>https://tech.lkrms.org</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">152348619</site>	<item>
		<title>Caching iOS updates on a Squid proxy server</title>
		<link>https://tech.lkrms.org/caching-ios-updates-on-a-squid-proxy-server/</link>
					<comments>https://tech.lkrms.org/caching-ios-updates-on-a-squid-proxy-server/#comments</comments>
		
		<dc:creator><![CDATA[Luke]]></dc:creator>
		<pubDate>Fri, 20 Sep 2013 04:39:47 +0000</pubDate>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[squid]]></category>
		<guid isPermaLink="false">http://lkrms.org/?p=987</guid>

					<description><![CDATA[<p>Update (22 December 2014): The following instructions have been updated and tested with iOS 8. Right now, my challenge is upgrading almost 200 iPads to iOS 7 with minimal pain (read: zero device handling). Factor in less-than-ideal Internet bandwidth and Apple&#8217;s disinterest in allowing proxies to cache iOS updates, and it&#8217;s been a bit of &#8230; <a href="https://tech.lkrms.org/caching-ios-updates-on-a-squid-proxy-server/" class="more-link">Continue reading <span class="screen-reader-text">Caching iOS updates on a Squid proxy server</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://tech.lkrms.org/caching-ios-updates-on-a-squid-proxy-server/">Caching iOS updates on a Squid proxy server</a> appeared first on <a rel="nofollow" href="https://tech.lkrms.org">luke arms</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><em><strong>Update (22 December 2014):</strong> The following instructions have been updated and tested with iOS 8.</em></p>
<p>Right now, my challenge is upgrading almost 200 iPads to iOS 7 with minimal pain (read: zero device handling). Factor in less-than-ideal Internet bandwidth and Apple&#8217;s disinterest in allowing proxies to cache iOS updates, and it&#8217;s been a bit of a headache.</p>
<p>First, a word of advice: <em>ask your users not to upgrade when prompted.</em> Do this before Apple release a major update, to buy yourself some time to test it on your network and to check that the update is being cached properly.</p>
<p>Hopefully your iPad fleet is already using your Squid proxy. Ours is configured (via Apple&#8217;s Profile Manager) to use a PAC file when it&#8217;s on our WiFi network. The PAC file directs all but onsite requests to Squid.</p>
<p>Unfortunately, iOS doesn&#8217;t use the proxy for everything; system update authorizations, in particular, don&#8217;t get out unless permitted on your firewall. Here&#8217;s the relevant rule on our iptables firewall (no_proxy_ok is one of our custom chains, as is tcp_allowed):</p>
<pre>-A no_proxy_ok -p tcp -m comment -m tcp -m multiport -d 17.0.0.0/8 -j tcp_allowed --dports 80,443,5223,2195,2196 --comment "allow Apple services (e.g. APNs, updates)"</pre>
<p>Mercifully, the update itself is requested via the proxy, but getting it to cache is non-trivial. Obviously max_object_size needs to be big enough to accommodate a 1GB+ file. I went with 2GB:</p>
<pre>maximum_object_size 2048000000 bytes</pre>
<p>But this wasn&#8217;t enough to get the update to cache. A bit of sleuthing led to the first problem: Apple adds HTTP headers like these to its updates, so Squid discards them:</p>
<pre>Cache-Control: max-age=0, no-cache, no-store
Pragma: no-cache</pre>
<p>The workaround is to break HTTP a little by adding this line above any other refresh_pattern entries in your squid.conf:</p>
<pre>refresh_pattern -i appldnld\.apple\.com 129600 100% 129600 ignore-reload ignore-no-store override-expire override-lastmod ignore-must-revalidate

refresh_pattern -i phobos\.apple\.com 129600 100% 129600 ignore-reload ignore-no-store override-expire override-lastmod ignore-must-revalidate</pre>
<p>This forces Squid to treat objects from *.appldnld.apple.com and *.phobos.apple.com as &#8220;fresh&#8221; (i.e. cacheable) for 90 days (129600 minutes), no matter what appldnld.apple.com and phobos.apple.com say.</p>
<p>Finally, I made sure appldnld.apple.com requests were excluded from Squid&#8217;s delay pools and filtering ACLs; you may need to make similar tweaks. I also found that maximum_object_size wasn&#8217;t being applied correctly to cache_dir, so I defined it explicitly, i.e.:</p>
<pre>cache_dir aufs /var/spool/squid3 256000 128 256 max-size=2048000000</pre>
<p>iOS 7 is rolling out smoothly as I type.</p>
<p>The post <a rel="nofollow" href="https://tech.lkrms.org/caching-ios-updates-on-a-squid-proxy-server/">Caching iOS updates on a Squid proxy server</a> appeared first on <a rel="nofollow" href="https://tech.lkrms.org">luke arms</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://tech.lkrms.org/caching-ios-updates-on-a-squid-proxy-server/feed/</wfw:commentRss>
			<slash:comments>24</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">987</post-id>	</item>
		<item>
		<title>Squid authentication via OS X Profile Manager and Active Directory</title>
		<link>https://tech.lkrms.org/squid-authentication-via-os-x-profile-manager-and-active-directory/</link>
		
		<dc:creator><![CDATA[Luke]]></dc:creator>
		<pubDate>Mon, 26 Aug 2013 05:17:19 +0000</pubDate>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[macOS]]></category>
		<category><![CDATA[macOS server]]></category>
		<category><![CDATA[squid]]></category>
		<guid isPermaLink="false">http://lkrms.org/?p=975</guid>

					<description><![CDATA[<p>Updated on 6-Nov-13 for OS X Server 3.0 on Mavericks My last post was about getting access to OS X Server&#8217;s Profile Manager database; this post is about doing something useful with it. Hypothesis: given live access to data from Profile Manager and Active Directory, it should be easy to write a Squid external_acl_type helper &#8230; <a href="https://tech.lkrms.org/squid-authentication-via-os-x-profile-manager-and-active-directory/" class="more-link">Continue reading <span class="screen-reader-text">Squid authentication via OS X Profile Manager and Active Directory</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://tech.lkrms.org/squid-authentication-via-os-x-profile-manager-and-active-directory/">Squid authentication via OS X Profile Manager and Active Directory</a> appeared first on <a rel="nofollow" href="https://tech.lkrms.org">luke arms</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><em><strong>Updated on 6-Nov-13 for OS X Server 3.0 on Mavericks</strong></em></p>
<p>My <a href="https://lkrms.org/under-the-hood-os-x-servers-profile-manager/">last post</a> was about getting access to OS X Server&#8217;s Profile Manager database; this post is about doing something useful with it.</p>
<p>Hypothesis: given live access to data from Profile Manager and Active Directory, it should be easy to write a Squid <a href="http://www.squid-cache.org/Doc/config/external_acl_type/">external_acl_type</a> helper that maps incoming IP addresses to usernames. An optional check for group membership? Trivial. Amirite?!</p>
<p>I was half-right. The lookups weren&#8217;t hard, but getting the helper to terminate when Squid wanted it to, and to NOT terminate prematurely, required a little trial-and-error. Turns out Squid keeps its helpers alive by sending them empty lines, so terminating on empty input isn&#8217;t such a good idea.</p>
<p>Anyway, here&#8217;s the code that has our iPad fleet &#8220;authenticating&#8221; with our Squid proxy server transparently. It&#8217;s been tested on Linux (Ubuntu 12.04 LTS) and OS X. Yes, Python would have been better than PHP, but I&#8217;m more fluent in PHP, and the PHP CLI interpreter is efficient enough for this purpose.</p>
<p><em><strong>Update 23-Dec-2014:</strong> this script is now <a href="https://github.com/lkrms/extensions/blob/master/squid/external_auth.php">hosted on GitHub.</a></em></p>
<p>To use it in squid.conf (assuming you&#8217;ve pulled it down to /opt/git/extensions/squid/external_auth.php):</p>
<pre>
external_acl_type external_auth ttl=300 negative_ttl=5 children-startup=10 children-max=40 children-idle=10 ipv4 %SRC %MYPORT /opt/git/extensions/squid/external_auth.php

acl Apple_Devices external external_auth
acl Staff_Apple_Devices external external_auth staff
acl No_Filter_Devices external external_auth no_filter
acl No_Access_Devices external external_auth no_access
</pre>
<p>The &#8220;staff&#8221;, &#8220;no_filter&#8221; and &#8220;no_access&#8221; values map to $SQUID_LDAP_GROUP_DN in the configuration file &#8211; customise as needed (many groups may be defined).</p>
<p>Finally, use your new acls in some access rules, e.g.:</p>
<pre>http_access allow localnet Staff_Only_Websites Staff_Apple_Devices
http_access deny localnet Staff_Only_Websites Apple_Devices</pre>
<p>Questions? Errata? Do comment.</p>
<p>The post <a rel="nofollow" href="https://tech.lkrms.org/squid-authentication-via-os-x-profile-manager-and-active-directory/">Squid authentication via OS X Profile Manager and Active Directory</a> appeared first on <a rel="nofollow" href="https://tech.lkrms.org">luke arms</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">975</post-id>	</item>
	</channel>
</rss>
