零信任不是對你沒有信任的意思 Zero Trust(ZT)

美國國家標準暨技術研究院(NIST), 於2020年8月發表零信任 (SP 800-207) 指導書 , 火速被各大軟體服務商奉為聖旨,
並不是對你沒有信任的意思, 而是任何人做任何事都必須一視同仁, 詳加盤查, 才能信任.

以防火牆來說, 牆內安全, 牆外不安全, 這是以前的思維;
未來上雲端後, 將打破防火牆概念, 任何動作都必須再次檢驗才能過關.

https://csrc.nist.gov/publications/detail/sp/800-207/final

8/13起 github 專案commit要改用token

github 公告 2021/8/13起, 強制改用token的方式, 之前使用密碼的方式不能再用

"Beginning August 13, 2021, we will no longer accept account passwords when authenticating Git operations on GitHub.com."

所以要到個人github上, 生成token, 然後當作密碼使用

https://github.com/settings/tokens

  1. 先產生 token , 將token copy 起來

2. 用戶端輸入帳號,與密碼(此時不要輸入真的密碼, 請輸入token)

nextcloud 綁定ldap, 突然無法登入

nextcloud 綁定公司兩台AD , 一台台北, 一台蘇州 , 兩台不同網域

但是今天發生蘇州網域伺服器停機(停電超過4小時), 居然造成nextcloud所有人員無法登入的情況

查了一下解法, 可以先暫時停用蘇州的ldap連線,

sudo -u www-data php occ ldap:set-config s02 ldapConfigurationActive 0

以下是ldap相關指令, 可以先查詢設定檔案名稱之後, 如s01 , s02 , 再停用連線

ldap
 ldap:check-user               checks whether a user exists on LDAP.
 ldap:create-empty-config      creates an empty LDAP configuration
 ldap:delete-config            deletes an existing LDAP configuration
 ldap:search                   executes a user or group search
 ldap:set-config               modifies an LDAP configuration
 ldap:show-config              shows the LDAP configuration
 ldap:show-remnants            shows which users are not available on
                               LDAP anymore, but have remnants in
                               Nextcloud.
 ldap:test-config              tests an LDAP configuration

推薦一款免費開源PDF編輯軟體-xournal++

公司一般同仁需要用到PDF編輯功能(不會太複雜, 很簡單):

  1. 刪除PDF頁面
  2. 合併PDF檔案
  3. 簡易修改一下文字(不需要大幅修改格式,表格)

除了付費版adobe acrobat 之外, 就libreoffice draw 可以勝任, 但是libreoffice 開啟pdf格式常常會跑掉, 修改pdf不是非常理想,

我試了多套免費軟體, 也都失敗了, 後來發現這個開源軟體 xournal++ , 開pdf不會變形, 使用一種另類的layer方式達到編輯pdf的功能, 我認為非常有潛力當擔重任.

xournal++ 還在積極開發中, 目前少了幾個重要功能,也有bug 未來這些功能應該會補上.

  1. 無法合併pdf , 暫時方案就是用 PDFSAM 做合併的任務
  2. 無法輸入中文, 但可以copy過去, Linux可正常輸入中文, 但windows不行, 是bug
  3. 無法選擇 pdf 裡面原有的文字複製 , 這功能也在積極實現中

docker安裝multiOTP, 讓windows登入更安全(MFA)

我們不屎用微軟的MFA(Multi Factor Authentication), 原因如下:

Azure AD MFA 免費使用, 但是很貴, 哈哈, 於是就pass

multiOTP(https://github.com/multiOTP/multiotp/wiki) 是個開源免費的 MFA server & client 專案,
其實我們也只是要讓登入更安全, 目標就是手上多個驗證器, 可以輸入動態密碼, 多個保障.
不囉嗦, 直接寫下我的安裝方法

安裝開源的 MFA Server

  1. 準備docker環境
  2. 下載最新檔案
    https://download.multiotp.net/multiotp_5.8.1.0.zip
    解開檔案
  3. 修改Dockerfile
    加上 RUN echo “deb http://ftp.de.debian.org/debian buster-backports main” | tee /etc/apt/sources.list.d/docker.list
    **這是5.8.1.0的bug

修改Dockerfile這步驟以後不需要做, 下個版本會解決


4. 編譯images
docker build . -t mymultiotp:latest

5. 啟動server

docker run --mount source=multiotp-data,target=/etc/multiotp -p 8080:80 -p 8443:443 -p 1812:1812/udp -p 1813:1813/udp -d mymultiotp:latest

8080 與 8443 請依實際情況修改

6. 網頁輸入 http://<docker serverr ip>:8080

登入後, 新增測試帳號 administrator (請注意, 這個帳號是windows 10本機可登入帳號 , 不限定administrator)

手機安裝google authenticator


安裝google驗證器, 刷入帳號的QR code , 請選擇帳號後點選 Print


在windows安裝Credential Provider

https://download.multiotp.net/credential-provider/
https://download.multiotp.net/credential-provider/multiOTPCredentialProvider-5.8.1.0.exe

輸入windows的帳號與密碼, 還有google驗證器的密碼

遠端登入

此時遠端登入第一次登入不用otp密碼, 但是會出現第二是要求輸入otp密碼,

這是原本遠端桌面連線並無法一開始就支援otp的緣故,目前無法解結

MFA server 與 網域主控連線

docker 登入已安裝好的 mfa server 然後輸入以下指令

 multiotp -config default-request-prefix-pin=0
 multiotp -config default-request-ldap-pwd=1
 multiotp -config ldap-server-type=1
 multiotp -config ldap-cn-identifier="sAMAccountName"
 multiotp -config ldap-cn-identifier="sAMAccountName"
 multiotp -config ldap-group-attribute="memberOf"
 multiotp -config ldap-ssl=1
 multiotp -config ldap-port=636
 multiotp -config ldap-domain-controllers=ldaps://網域主控伺服器:636
 multiotp -config ldap-base-dn="OU=xxxx,DC=test,DC=com"
 multiotp -config ldap-bind-dn="cn=ldap,cn=Users,dc=test,dc=com"
 multiotp -config ldap-server-password="password"
 multiotp -config ldap-network-timeout=10
 multiotp -config ldap-time-limit=30
 multiotp -config ldap-activated=1
 multiotp -config ldap_default_algorithm=totp
 multiotp -debug -display-log -ldap-users-sync
  1. 若成功, 網頁登入MFA server就能看到網域使用者, 也可以派送QR code給該使用者使用
  2. 定期執行同步指令
multiotp -debug -display-log -ldap-users-sync
1 2 3 4 5