在 Docker 裡面跑 GUI 程式

由於想把一些東西隔離放到 Docker 裡跑,所以找了些資料看看怎麼做。

在「Running GUI apps with Docker」這邊講了怎麼在 Docker 裡面跑 Firefox,不過在我的電腦上有狀況 (跑起來沒問題,但開網頁後 Firefox 就會 crash),也許再找時間看看吧...

不過這邊學到了把 X11 的相關資源丟進去的方式:

docker run -ti --rm \
       -e DISPLAY=$DISPLAY \
       -v /tmp/.X11-unix:/tmp/.X11-unix \
       firefox

不過畢竟是把整個 X11 資源都暴露進去了,技術上並不安全,只能跑一些大公司的程式,這些公司至少不能明目張膽的把 screenshot 一直傳回去... (還是其實都有做?@_@)

另外是 Skype,之前在「用 Docker 跑 Skype 講電話」這邊就有提過了。而另外一個是「tomparys/docker-skype-pulseaudio」。但之前發現中文字型都還是有問題,也續要看看他們的 Dockerfile 怎麼寫,然後自己再改一下,把中文的部份包進去...

然後是 Dropbox,在經過「Dropbox Responds to Mac 'Security Risk' Accusations [Updated]」事件以後,還是把 Dropbox 放進 Docker 裡面比較好... 這邊用 Googledocker dropbox 東西就不少,主要還是看 Dockerfile 來自己改。

奇怪的 Wildcard SSL 取得方式...

在「VMBox.co – 2GB OVZ w/ 2 Free Wildcare SSL @ $5/m」這邊看到的,租 VPS 送兩個 wildcard SSL certificate:

Up to 2 free wildcard SSL available per VPS order in Phoenix or Amsterdam. SSL only to be used on Singlehop network.

點進去看之後可以看到說明:

WildCard AlphaSSL Certificate - $0.00 USD Free Account
Please note these SSL's are only to be used on our network. They won't be guaranteed if used elsewhere.

不過除了 revoke 以外,想不到其他方式... 所以只要有合約在應該都是生效的?

如果是這樣的話,USD$40/year 就可以買兩個 wildcard SSL certificate 了?比起現在的各家 wildcard SSL certificate 都還便宜...

下一個版本的 Chrome (56) 將會對要求卡號或是密碼的 HTTP 站台標示「Not Secure」

如同之前在「Google Chrome 56 將會對 HTTP 網站標示「Not secure」」提到的規劃,Google Chrome 56 (也就是下一個版本) 將會對要求卡號或是密碼的站台標示「Not Secure」:「Chrome 56 Beta: “Not Secure” warning, Web Bluetooth, and CSS position: sticky」。

比較九月的 screenshot 與最近的 screenshot,從「Not secure」變成「Not Secure」了... 這是九月的:

而這是最近的:

可能是這樣標示會讓使用者更有警覺?

信用卡的先天缺陷造成盜刷問題

在「Guessing Credit Card Security Details」這邊看到的攻擊手法,基本上無解,除非信用卡的網路交易也全面改成使用晶片...

手法其實很簡單,就是先算出一個合法的卡號,然後分兩階段攻擊取得資訊:

  • 先去找數家只需要「卡號 + 日期」的網站,用暴力法踹出日期 (假設五年就是 60 次)。
  • 再去找數十家需要「卡號 + 日期 + CVV2」的網站,用暴力法踹出 CVV2 (1000 次)。

所以 1060 次就擺平了... 就算所有網站都需要 CVV2,也是 60000 次的嘗試而已 (找數千個網站來踹),算是完全可行的方案。而目前只能靠 workaround 來防止,像是需要多輸入姓名與地址之類的資訊來擋...

微軟預定在 2017 年的西洋情人節淘汰 SHA-1 certificate

經過多次改動後,微軟這次宣佈 SHA-1 certificate 將在明年淘汰:「SHA-1 deprecation countdown」。

影響的範圍包括 Internet Explorer 11Microsoft Edge,在 2017 年 2 月 14 日之後不信任 SHA-1 certificate:

Starting on February 14th, 2017, Microsoft Edge and Internet Explorer 11 will prevent sites that are protected with a SHA-1 certificate from loading and will display an invalid certificate warning.

與其他家類似,還是提供了管道讓企業內部建立的 SHA-1 certificate 可以用:

This will only impact SHA-1 certificates that chain to a Microsoft Trusted Root CA. Manually-installed enterprise or self-signed SHA-1 certificates will not be impacted, although we recommend for all customers to quickly migrate to SHA-256.

Google 測試 CECPQ1 的一些資料...

七月的時候提到「Google Chrome 引入 CECPQ1,開始測試 Post-Quantum Cryptography」,剛剛看到 Adam Langley 寫了一些數據出來:「CECPQ1 results」。

目前看起來對於網路速度不快的使用者會影響比較大,最慢的 5% 使用者大約慢了 20ms,最慢的 1% 使用者會慢 150ms:

Although the median connection latency only increased by a millisecond, the latency for the slowest 5% increased by 20ms and, for the slowest 1%, by 150ms. Since NewHope is computationally inexpensive, we're assuming that this is caused entirely by the increased message sizes. Since connection latencies compound on the web (because subresource discovery is delayed), the data requirement of NewHope is moderately expensive for people on slower connections.

由於實驗算是完成了,加上 TLS 已經有規劃了,所以 Google Chrome 打算拔掉這個功能等標準出來:

At this point the experiment is concluded. We do not want to promote CECPQ1 as a de-facto standard and so a future Chrome update will disable CECPQ1 support. It's likely that TLS will want a post-quantum key-agreement in the future but a more multilateral approach is preferable for something intended to be more than an experiment.

利用上傳的檔案跳過 CSP 限制

CSP 可以做到一些簡單的保護機制,但在設計不良的情況下還是有辦法繞過。

這次是上傳合法的 JPEG 檔案,但當作 javascript 檔案繞過去:「Bypassing CSP using polyglot JPEGs」。

開頭的「FF D8 FF E0」可以在「List of file signatures」這邊看到是「JPEG raw or in the JFIF or Exif file format」,而這四個字元在 javascript 不會出問題。接下來的「2F 2A」表示 JPEG header 長度,剛好就是「/*」,把後面的東西給包起來,後面再用類似的方式一直組合就打穿了...

這種攻擊要跳過的是「用 CSP 的 self 限制不能引用外部網站 javascript」的限制,但還是有些前提:

  • 允許使用者傳到同一個 domain 上面。
  • 網站上有 XSS 漏洞。

其中第一個問題常見的解法是另外開一個 domain 來放使用者上傳的檔案 (最好是連 top domain 都不一樣,完全隔開),才可以透過 CSP 降低風險...

保護 macOS 的方法

在「drduh/macOS-Security-and-Privacy-Guide」這邊列出了許多保護方式,如果考慮到 APT 的話應該是個不錯的指南...

不過考慮到相當硬,服用前請小心,有些步驟甚至需要拆機:

雖然整篇文章還頗硬的,但裡面講軟體的部份還是很不錯的指南,可以保護自己...

Mozilla 也在考慮對 Certificate Transparency 的掌握度

由於 Firefox 要支援 Certificate Transparency 的緣故,在「Mozilla CT Policy」這邊 Mozilla 在討論要建立自己的 CT policy 以及自己的架構:

CT is coming to Firefox. As part of that, Mozilla needs to have a set of CT policies surrounding how that will work. Like our root inclusion program, we intend to run our CT log inclusion program in an open and transparent fashion, such that the Internet community can see how it works and how decisions are made.

這樣就有個開頭了...

英國通過法案要求 ISP 記錄使用者觀看過的網站

英國前幾天通過了最激烈的隱私侵犯法案,要求 ISP 必須記錄使用者觀看過的網站:「Britain has passed the 'most extreme surveillance law ever passed in a democracy'」:

The law forces UK internet providers to store browsing histories -- including domains visited -- for one year, in case of police investigations.

不愧是 George Orwell 生前的國家,居然先實現了他的理想國... 接下來 Let's EncryptTor 的重要性就更高了。