Raspberry Pi OS 改掉預設的帳號 pi
與密碼 raspberry
這個 security hole 了:「An update to Raspberry Pi OS Bullseye」。
取而代之的是在安裝時要求使用者建立帳號密碼:

如果是 terminal-based 的會是這樣:

之前裝完都要自己用 vipw
改掉,然後接著修改 /etc/group
... (沒有習慣用 vigr
)
幹壞事是進步最大的原動力
Raspberry Pi OS 改掉預設的帳號 pi
與密碼 raspberry
這個 security hole 了:「An update to Raspberry Pi OS Bullseye」。
取而代之的是在安裝時要求使用者建立帳號密碼:
如果是 terminal-based 的會是這樣:
之前裝完都要自己用 vipw
改掉,然後接著修改 /etc/group
... (沒有習慣用 vigr
)
在 Hacker News 首頁上看到「Firefox UI/UX History (github.com/black7375)」這篇,整理了 Firefox 的 UI/UX 歷史,裡面也試著分析各個不同版本的優缺點。
話說看到這個最早的版本的 screenshot 讓人懷念 (還叫做 Phoenix 的版本):
裡面也提到了一些 fork,像是「Early (v1 ~ v3)」這個 UI 版本的 fork 還可以在 SeaMonkey 看到。
到了「Classic (v4, 2011.3)」這個版本,目前還有在維護的 fork 則是 Pale Moon,不過核心的部份沒有跟上,很多網站的新功能是沒辦法用的。
接著是「Australis (v29, 2014.04)」這個版本,目前已經沒有在維護的 fork 了,2021 年年底 Basilisk 宣佈停止維護。
然後是「Photon (v57, 2017.11)」這個版本,目前還有在維護的 fork 是 Waterfox 的 G3 系列。
目前最新的一個是「Proton (v89, 2021.06)」這個版本。
是一篇 2017 年的文章,前幾天在 Hacker News 上重新被提出來:「The Line of Death (2017) (textslashplain.com)」。
文章開頭在講瀏覽器 UI 的信任區,這條線以上是 native UI,以下是網站可以任意操控的內容:
所以 UI 上面有些小細節讓你區分,但這其實對不是專精 phishing 的人很不友善:
另外當然就會提到 browser-in-a-browser (以及 picture-in-picture) 類的 phishing 了:
另外提到了 Fullscreen API,這使得信任區間變成 0:
提到 Fullscreen API 所以就去翻資料,意外發現 IE11 居然支援這組 API,雖然是帶 ms
的 prefix,而且不支援一些輔助性的功能 (像是傳回 Promise object)。
這些 UI 與 security 類的問題,主要還是得考慮到使用者未必那麼熟悉,以及就算有經驗的人也很有可能不小心中獎...
昨天在「AWS User Group Taiwan Meetup 2022-03 線上 / 下小聚」這邊分享的主題,在講如何在 AWS 上弄出一個高可靠性的 Vault 服務。
投影片在 https://bit.ly/3igUbgh 這邊可以抓到,我另外傳到 Speaker Deck 上面了:(好久沒用這個網站了?)
其實這類架構的設計有點像是 AWS 的 Solution Architect 在做的事情,如果一般的客戶開出類似的需求,應該也是會設計出類似的東西...
另外畢竟是在 AWS 的會議室裡面講,有些東西還是會避免提到,但裡面有很多概念是可以互換的,像是 Microsoft Azure 或是 GCP 上面都有可以抽換的服務,Vault 也都有支援。
看到 AWS 的 CloudWatch 推出 RUM (Real-User Monitoring) 的功能:「New – Real-User Monitoring for Amazon CloudWatch」。
從畫面截圖可以看到目前支援 javascript 的版本:
一定都會有的全站分析:
另外給了 client 端的一些情況:
然後可以針對比較慢的頁面進行了解:
然後有觀看頁面的記錄:
價錢是每 1M events 是 US$10,感覺不算便宜?
CloudWatch RUM is available now and you can start using it today in ten AWS Regions: US East (N. Virginia), US East (Ohio), US West (Oregon), Europe (Ireland), Europe (London), Europe (Frankfurt), Europe (Stockholm), Asia Pacific (Sydney), Asia Pacific (Tokyo), and Asia Pacific (Singapore). You pay $1 for every 100K events that are collected.
功能上的競爭對手,可以想到 Datalog 有 RUM 產品,如果也是沒有 commit 的話是 US$0.65 (Per 1,000 sessions, per month)。
另外 New Relic 有 Browser Monitoring 的功能應該也是類似的東西,但價錢好像沒有單獨列出來。
Mixpanel 這邊 $25/month 的套餐可以吃 100K MTUs (monthly tracked users),每個 MTU 可以吃 1K events,好像也可以做到類似的功能,隔壁 Amplitude 的話沒列出來...
不過就帳單的立場來說是方便不少...
看到 Simon Willison 的「s3-credentials: a tool for creating credentials for S3 buckets」這篇,裡面講到了幾件事情。
在 AWS 上比較好的安全設計是,不同專案之間都有自己的 S3 bucket,然後建立對應的 IAM user,每個 IAM user 只能存取自己的 S3 bucket。
但這個建立過程很煩:
Creating those credentials is surprisingly difficult!
整個建立的過程包括了四個步驟:
讓人煩的主要是第三個,那個 JSON format 每次都要翻資料 XD
所以他寫了 s3-credentials 這個套件讓大家用,可以透過 pip 直接安裝起來用。
不過我是偏好用 awscli 的,直接把指令放在 wiki page 上面:「awscli」,需要的時候就 copy & paste 過來執行就可以了。在公司的 wiki 上還有直接把 EC2 instance 生到對應的 subnet 指令可以用...
這東西大概不會簡化,只能大家自己找出路 XD
在 Hacker News 首頁上看到 FreeBSD 把 root 的 shell 從 /bin/csh
換成 /bin/sh
了:「sh(1): make it the default shell for the root user」,Hacker News 上的討論也可以看一看:「FreeBSD switches the default root shell from csh to sh (freebsd.org)」。
依照說明是把 FreeBSD 的 /bin/sh
加上了不少東西,所以算是堪用了:
In the recent history sh(1) has gain the missing features for it to become a usable interractive shell: - command completion - persistent history support - improvements on the default bindings in emacs mode - improvements in the vi mode (repect $EDITOR) - print a newline when exiting via ^D - default prompt and improvements on how PS1 can be configured - and more. This changes also simplifies making tiny freebsd images with only sh(1) as a shell
Hacker News 上看到「Gmail password first character is case insensitive on mobile device (support.google.com)」這篇,在講密碼輸入上的 UX。
在 Hacker News 上的討論看到這則:
This is a well-understood feature. Facebook does the same thing[0].
Quote:
Facebook actually accepts three forms of your password:
* Your original password.
* Your original password with the first letter capitalized. This is only for mobile devices, which sometimes capitalize the first character of a word.
* Your original password with the case reversed, for those with a caps lock key on.
[0]: https://www.zdnet.com/article/facebook-passwords-are-not-case-sensitive-update/
接受三種密碼,第一種是完全正確的密碼,第二種是第一個字如果是大寫時的密碼 (在行動裝置上可能的行為),第三種是大小寫全部相反的密碼,這在沒注意到 caps lock 時會發生。
強度不會削弱太多,但對於 user experience 好很多的設計。
看到 PostgreSQL 官方站台上的介紹,可以直接用 Python 的 pip 指令安裝 PostgreSQL server:「Install a local, non-root PostgreSQL Server with Python "pip"」,專案在「postgresql-wheel」這邊。
照 GitHub 上面的說明跑了一下,還真的可以惡搞... 這樣如果真的要在 CI 裡面跑的話也簡單很多了?只要能 pip 裝軟體就能跟你拼 XDDD
也省掉需要設定一些權限跑 Docker-in-Docker...
GitHub 在月初的時候把所有人都 logout,然後前幾天發文解釋了當時的情況:「How we found and fixed a rare race condition in our session handling」。
起因於月初時有使用者回報他在登入後,變成其他人的身份:
On March 2, 2021, we received a report via our support team from a user who, while using GitHub.com logged in as their own user, was suddenly authenticated as another user. They immediately logged out, but reported the issue to us, as it rightfully worried them.
後面其實就是在講他們在改善 github.com 的效能時是在 Rails 架構上疊上許多 threading 的機制,但是沒有處理好 critical section 與 object reuse 而造成後續的問題。
知道是 thread safety 的問題發生點後,其實就大概知道怎麼解決,主要還是 GitHub 在這篇文章裡面透漏了不少有趣的技術。
首先是 github.com 有保留 HTTP header 與 HTTP body,而且有記錄是在哪台機器、哪個 process 處理的,這對於事後找問題時很有幫助:
From reviewing logs, we could gather that the HTTP body in the response to the client we sent was correct and only the cookies in the response to the user were wrong. The affected users from the support reports received a session cookie from a user who very recently had a request handled inside the same process. In one case, the two requests were handled sequentially, one after the other. In the second case, there were two other requests in between.
不確定是不是所有的 HTTP request 都有記錄,以 GitHub 的量來說應該是蠻可觀的,但感覺上現代的硬體好像又可以暴力解...
另外是 github.com 引入了 threading 技術改善效能,不過這邊不確定這邊是用 C/C++ 寫,還是單純用 Ruby 本身提供的 threading 撰寫:
Threads were already used in other places in this application, but the new background thread produced a novel and unforeseen interaction with our exception handling routines. When exceptions were reported from a background thread, such as a query timeout, the error log would contain information from both the background thread and the currently running request, showing that the data was being pulled across threads.
這種最佳化的方式只有在夠大的服務上做才有效益,只能說 GitHub 的人比較無奈,threading 掛上一個已經很複雜的應用程式的確是容易中獎...