Skip to content

Commit 302cb0b

Browse files
authored
Merge branch 'master' into master
2 parents 49759ba + 9ff4175 commit 302cb0b

File tree

5 files changed

+242
-104
lines changed

5 files changed

+242
-104
lines changed

CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
macos.duh.to

InstallESD_Hashes.csv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ Version,Build,SHA-256,SHA-1
1515
10.12.2,16C67,6c2b16f248407a3853a9c4a63efadc94813321708f5eed5c09b73f33e5edd855,1432e3be6222c434b536721076ed8b16b1c6050e
1616
10.12.2,16C68,6e8ccda1849bb49b1acf75f455019fe327adb47c676dbff018ea811c2456dcce,94f9e8f7ae2540dee6fe3465f60fc037e2547d16
1717
10.12.3,16D32,75a288fe6efc0591f757baf08305270f1b843b54cfb66fe6b257049400a0d6e9,77d354ec06df0d0acc37c105ae524ba96948142b
18+
10.12.4,16E195,30319aeae18c3277919c59fe678201553f5a11022d6966b67a43422996391181,30b9245f7c7608c40bbdf4d4a74f3ab84dbac716
19+
10.12.5,16F73,dae2d71921a737d41df8f00379b7c04653bd35ed8db0f38313f8d86eb7f39f88,51df126965433187403987c9d74d95c26cba9266
20+
10.12.6,16G29,d93efaaaa9d029b52ac1985043fabf0e6c8d5015841e7338f96ed9e162538b2c,b53c36706eef6e0e15c1f76ef51d1b552705fc75

README-cn.md

Lines changed: 43 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# MacOS 的安全和隐私指南
22

33
> * 原文地址:[macOS Security and Privacy Guide](https://github.com/drduh/macOS-Security-and-Privacy-Guide)
4-
* 原文作者:[drduh](https://github.com/drduh)
5-
* 译文出自:[掘金翻译计划](https://github.com/xitu/gold-miner)
6-
* 译者:[Nicolas(Yifei) Li](https://github.com/yifili09), [MAYDAY1993](https://github.com/MAYDAY1993), [DeadLion](https://github.com/DeadLion)
7-
* 校对者:[lovelyCiTY](https://github.com/lovelyCiTY), [sqrthree](https://github.com/sqrthree)
4+
> * 原文作者:[drduh](https://github.com/drduh)
5+
> * 译文出自:[掘金翻译计划](https://github.com/xitu/gold-miner)
6+
> * 译者:[Nicolas(Yifei) Li](https://github.com/yifili09), [MAYDAY1993](https://github.com/MAYDAY1993), [DeadLion](https://github.com/DeadLion)
7+
> * 校对者:[lovelyCiTY](https://github.com/lovelyCiTY), [sqrthree](https://github.com/sqrthree)
8+
> * 这个 [链接](https://github.com/xitu/macOS-Security-and-Privacy-Guide/compare/master...drduh:master) 用来查看本翻译与英文版是否有差别(如果你没有看到 README.md 发生变化,那就意味着这份翻译文档是最新的)。
89
910
这里汇集了一些想法,它们是有关如何保护运行了 macOS 10.12 "Sierra" 操作系统(以前是 **OS X**)的现代化苹果 Mac 电脑,也包含了一些提高个人网络隐私的小贴士。
1011

@@ -95,7 +96,7 @@
9596

9697
为固件设定一个密码,它能阻止除了你的启动盘之外的任何其它设备启动你的 Mac 电脑。它也能设定成每次启动时为必选项。
9798

98-
[当你的计算机被盗的时候,这个功能是非常有用的](https://www.ftc.gov/news-events/blogs/techftc/2015/08/virtues-strong-enduser-device-controls),因为唯一能重置固件密码的方式是通过 `Apple Store`,或者使用一个 [SPI 程序](https://reverse.put.as/2016/06/25/apple-efi-firmware-passwords-and-the-scbo-myth/),例如 [Bus Pirate](http://ho.ax/posts/2012/06/unbricking-a-macbook/) 或者其它刷新电路的程序。
99+
[当你的计算机被盗或者丢失的时候,这个功能是非常有用的](https://www.ftc.gov/news-events/blogs/techftc/2015/08/virtues-strong-enduser-device-controls),该功能可以防止直接内存访问从而可以读取您的 FileVault 密码并注入诸如 [pcileech](https://github.com/ufrisk/pcileech) 之类的内核模块这种攻击方式,因为唯一能重置固件密码的方式是通过 `Apple Store`,或者使用一个 [SPI 程序](https://reverse.put.as/2016/06/25/apple-efi-firmware-passwords-and-the-scbo-myth/),例如 [Bus Pirate](http://ho.ax/posts/2012/06/unbricking-a-macbook/) 或者其它刷新电路的程序。
99100

100101
1. 开始时,按下 `Command``R` 键来启动[恢复模式 / Recovery Mode](https://support.apple.com/en-au/HT201314)
101102

@@ -113,7 +114,11 @@
113114

114115
这个固件密码会在下一次启动后激活。为了验证这个密码,在启动过程中按住 `Alt` 键 - 按照提示输入密码。
115116

116-
当启动进操作系统以后。固件密码也能通过 `firmwarepasswd` 工具管理。
117+
当启动进操作系统以后。固件密码也能通过 `firmwarepasswd` 工具管理。例如,从另一个模式启动的时候可以这样:
118+
119+
$ sudo firmwarepasswd -setpasswd -setmode command
120+
121+
输入一个密码然后重启。
117122

118123
<img width="750" alt="Using a Dediprog SF600 to dump and flash a 2013 MacBook SPI Flash chip to remove a firmware password, sans Apple" src="https://cloud.githubusercontent.com/assets/12475110/17075918/0f851c0c-50e7-11e6-904d-0b56cf0080c1.png">
119124

@@ -286,10 +291,10 @@ $ /tmp/recovery/RecoveryHDUpdate.pkg/Scripts/Tools/dmtest ensureRecoveryPartitio
286291
在虚拟机内安装 macOS,可以使用 [VMware Fusion](https://www.vmware.com/products/fusion.html) 工具,按照上文中的说明来创建一个镜像。你**不需要**再下载,也不需要手动创建还原分区。
287292

288293
```
289-
VMware-Fusion-8.5.2-4635224.dmg
290-
SHA-256: f6c54b98c9788d1df94d470661eedff3e5d24ca4fb8962fac5eb5dc56de63b77
291-
SHA-1: 37ec465673ab802a3f62388d119399cb94b05408
292-
```
294+
VMware-Fusion-8.5.6-5234762.dmg
295+
SHA-256: 57a879095c9fcce0066bea0d3c203571689fb53205915fda156c0d742f7c7ad2
296+
SHA-1: b7315d00a7c92dbad280d0f01f42dd8b56d96040
297+
```
293298

294299
选择 **Install OS X from the recovery parition** 这个安装方法。可自定义配置任意的内存和 CPU,之后完成设置。默认情况下,这个虚拟机应该进入 [Recovery Mode / 还原模式](https://support.apple.com/en-us/HT201314)
295300

@@ -385,7 +390,7 @@ $ dscl . -read /Users/<username> GeneratedUID
385390

386391
[FileVault](https://en.wikipedia.org/wiki/FileVault) 提供了在 macOS 上对整个磁盘加密的能力(技术上来说,是**整个卷宗**。)
387392

388-
FileVault 加密将在休眠的时候保护数据,并且阻止其它人通过物理访问形式偷取数据或者使用你的 Mac 修改数据
393+
FileVault 加密在休眠的时候保护数据,并且使通过物理访问形式偷取数据或者使用你的 Mac 修改数据的某人更为艰难(但[不总是阻止](http://blog.frizk.net/2016/12/filevault-password-retrieval.html))
389394

390395
因为大部分的加密操作都[高效地运作在硬件上](https://software.intel.com/en-us/articles/intel-advanced-encryption-standard-aes-instructions-set/),性能上的损失对 FireVault 来说并不凸显。
391396

@@ -480,10 +485,10 @@ FileVault 的安全性依赖于伪随机数生成器 (PRNG)。
480485
**以下是一段 Little Snitch 监控会话的例子**
481486

482487
```
483-
LittleSnitch-3.7.1.dmg
484-
SHA-256: e6332ee70385f459d9803b0a582d5344bb9dab28bcd56e247ae69866cc321802
485-
SHA-1: d5d602c0f76cd73051792dff0ac334bbdc66ae32
486-
```
488+
LittleSnitch-3.7.4.dmg
489+
SHA-256: b0ce3519d72affbc7910c24c264efa94aa91c9ad9b1a905c52baa9769156ea22
490+
SHA-1: 868ad75623c60cb9ad428c7c1d3e5ae449a9033e
491+
```
487492

488493
这些程序都具备有监控和阻拦**对内****对外**网络连接的能力。然而,它们可能会需要使用一个闭源的[内核扩展](https://developer.apple.com/library/mac/documentation/Darwin/Conceptual/KernelProgramming/Extend/Extend.html)
489494

@@ -593,7 +598,7 @@ $ curl -O https://fix-macosx.com/fix-macosx.py
593598
594599
$ less fix-macosx.py
595600
596-
$ python fix-macosx.py
601+
$ /usr/bin/python fix-macosx.py
597602
All done. Make sure to log out (and back in) for the changes to take effect.
598603
```
599604

@@ -665,12 +670,12 @@ fe80::1%lo0 localhost
665670

666671
$ brew install dnsmasq --with-dnssec
667672

668-
$ cp ~/homebrew/opt/dnsmasq/dnsmasq.conf.example ~/homebrew/etc/dnsmasq.conf
673+
$ cp /usr/local/opt/dnsmasq/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf
669674

670675

671676
编辑配置项:
672677

673-
$ vim ~/homebrew/etc/dnsmasq.conf
678+
$ vim /usr/local/etc/dnsmasq.conf
674679

675680
检查所有的选项。这有一些推荐启用的设置:
676681

@@ -796,13 +801,17 @@ $ find ~/homebrew -name homebrew.mxcl.dnscrypt-proxy.plist
796801

797802
$ sudo gsed -i "/sbin\\/dnscrypt-proxy<\\/string>/a<string>--local-address=127.0.0.1:5355<\\/string>\n" $(find ~/homebrew -name homebrew.mxcl.dnscrypt-proxy.plist)
798803

799-
默认情况下,`resolvers-list` 将会指向 dnscrypt 版本特定的 resolvers 文件。当更新了 dnscrypt,这一版本将不再存在,若它存在,可能指向一个过期的文件。在 `/Library/LaunchDaemons/homebrew.mxcl.dnscrypt-proxy.plist` 中把 resolvers 文件改为 `/usr/local/share` 中的符号链接的版本,能解决上述问题:
804+
默认情况下,`resolvers-list` 将会指向 dnscrypt 版本特定的 resolvers 文件。当更新了 dnscrypt,这一版本将不再存在,若它存在,可能指向一个过期的文件。在 `homebrew.mxcl.dnscrypt-proxy.plist` 中把 resolvers 文件改为 `/usr/local/share` 中的符号链接的版本,能解决上述问题:
800805

801806
<string>--resolvers-list=/usr/local/share/dnscrypt-proxy/dnscrypt-resolvers.csv</string>
802807

808+
还有下面这一行:
809+
810+
<string>/usr/local/opt/dnscrypt-proxy/sbin/dnscrypt-proxy</string>
811+
803812
启用 DNSCrypt:
804813

805-
$ brew services start dnscrypt-proxy
814+
$ sudo brew services start dnscrypt-proxy
806815

807816
确保 DNSCrypt 在运行:
808817

@@ -865,12 +874,12 @@ macOS 上有从像 Apple、Verisign、Thawte、Digicert 这样的营利性公司
865874

866875
Apple 在他们的 [Cryptographic Services 指南](https://developer.apple.com/library/mac/documentation/Security/Conceptual/cryptoservices/GeneralPurposeCrypto/GeneralPurposeCrypto.html)文档中宣布**弃用** OpenSSL。他们的版本也有补丁,可能会[带来惊喜喔](https://hynek.me/articles/apple-openssl-verification-surprises/)
867876

868-
如果你要在你的 Mac 上用 OpenSSL,用 `brew install openssl` 下载并安装一个 OpenSSL 最近的版本。注意,brew 已经链接了 `/usr/bin/openssl`可能和构建软件冲突。查看 [issue #39](https://github.com/drduh/OS-X-Security-and-Privacy-Guide/issues/39)
877+
如果你要在你的 Mac 上用 OpenSSL,用 `brew install openssl` 下载并安装一个 OpenSSL 最近的版本。注意,brew 已经链接了 `/usr/bin/openssl`可能和内置软件冲突。查看 [issue #39](https://github.com/drduh/OS-X-Security-and-Privacy-Guide/issues/39)
869878

870879
在 homebrew 版本和 OpenSSL 系统版本之间比较 TLS 协议和密码:
871880

872881
```
873-
$ ~/homebrew/bin/openssl version; echo | ~/homebrew/bin openssl s_client -connect github.com:443 2>&1 | grep -A2 SSL-Session
882+
$ ~/homebrew/bin/openssl version; echo | ~/homebrew/bin/openssl s_client -connect github.com:443 2>&1 | grep -A2 SSL-Session
874883
OpenSSL 1.0.2j 26 Sep 2016
875884
SSL-Session:
876885
Protocol : TLSv1.2
@@ -1151,9 +1160,9 @@ gpg: assuming signed data in `TorBrowser-6.0.5-osx64_en-US.dmg'
11511160
gpg: Signature made Fri Sep 16 07:51:52 2016 EDT using RSA key ID D40814E0
11521161
gpg: Can't check signature: public key not found
11531162
1154-
$ gpg --recv 0xD40814E0
1155-
gpg: requesting key D40814E0 from hkp server keys.gnupg.net
1156-
gpg: key 93298290: public key "Tor Browser Developers (signing key) <torbrowser@torproject.org>" imported
1163+
$ gpg --recv 0x4E2C6E8793298290
1164+
gpg: requesting key 0x4E2C6E8793298290 from hkp server keys.gnupg.net
1165+
gpg: key 0x4E2C6E8793298290: public key "Tor Browser Developers (signing key) <torbrowser@torproject.org>" imported
11571166
gpg: no ultimately trusted keys found
11581167
gpg: Total number processed: 1
11591168
gpg: imported: 1 (RSA: 1)
@@ -1426,6 +1435,8 @@ $ xattr -l ~/Downloads/TorBrowser-6.0.5-osx64_en-US.dmg
14261435

14271436
看看 [Yubikey](https://www.yubico.com/products/yubikey-hardware/yubikey-neo/) 的两因素和私钥(如:ssh、gpg)硬件令牌。 阅读 [drduh/YubiKey-Guide](https://github.com/drduh/YubiKey-Guide)[trmm.net/Yubikey](https://trmm.net/Yubikey)。两个 Yubikey 的插槽之一可以通过编程来生成一个长的静态密码(例如可以与短的,记住的密码结合使用)。
14281437

1438+
除了登录和其他 PAM 模块,也能用 Yubikey 来使你的登录和 sudo 更安全,这里有份来自[Yubico](https://www.yubico.com/wp-content/uploads/2016/02/Yubico_YubiKeyMacOSXLogin_en.pdf)的 pdf 文档。Yubikey 有点贵,这有个更便宜的替代品,但是没有它好,[U2F Zero](https://www.u2fzero.com/)。这有份文档来[启动它](https://microamps.gibsjose.com/u2f-authentication-on-os-x/)
1439+
14291440
## 备份
14301441

14311442
备份到外部介质或在线服务之前,总是先对本地文件进行加密。
@@ -1826,6 +1837,10 @@ Google Chrome 现在应该可以启动了,以后的更新也不会被阻止,
18261837

18271838
`/var/log/santa.log` 可以查看监控器**允许****拒绝**执行的决策记录。
18281839

1840+
[Zentral](https://github.com/zentralopensource/zentral)里有针对 Santa 的一个日志和配置框架,Zentral 是一个开源的事件监控框架和针对osquery 和 Santa 的 TLS 服务器。
1841+
1842+
Zentral 会在监控和锁定模式支持 Santa。客户端需要建立一个 TLS 连接来同步 Santa 规则。所有来自终端的 Santa 事件会汇总并记录在 Zentral 里。Santa 事件能从 Zentral 框架内部触发行为和通知。
1843+
18291844
**注意** Python、Bash 和其它解释性语言是在白名单中的(因为它们是由苹果开发者证书签名的),所以 Santa 不会阻止这些脚本的运行。因此,要注意到 Santa 可能无法有效的拦截非二进制程序运行(这不算漏洞,因为它本身就这么设计的)。
18301845

18311846
## 其它
@@ -1912,6 +1927,9 @@ $ duti -s com.apple.Safari smb
19121927

19131928
[CISOfy/lynis](https://github.com/CISOfy/lynis) - 跨平台安全审计工具,并协助合规性测试和系统强化。
19141929

1930+
[Zentral](https://github.com/zentralopensource/zentral)- 一个针对 santa 和 osquery 的日志和配置框架。在盘点、事件
1931+
日志文件,结合时点的提醒上运行排查和探测。一个完整的框架和 Django web 服务器搭建在 elastic stack(通常叫 ELK stack)基础上。
1932+
19151933
## 其它资源
19161934

19171935
**排名不分先后**

0 commit comments

Comments
 (0)