MING
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    1
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Linux的資訊安全 ## 前情提要 截至 2017 年為止,90% 的公有雲都是在 Linux 上運作,Linux 讓企業建置了絕大多數的雲端環境,支援數位轉型策略。今日許多最先進尖端的 IoT 裝置與雲端應用程式和技術,都建立在某種版本的 Linux 之上,而這也使得 Linux 成了當代技術當中迫切需要防護的一個重要領域。 > 許多人認為 Linux 是一種獨特的操作系統,因為它具有穩定性、靈活性和開源特性。其卓越的聲譽得益於其近年來的許多顯著成就。例如,根據W3Techs 的一項調查(圖一),世界500 強超級計算機中有100%運行在 Linux 上,世界前 100,000 名網站中有 49.8% 使用它。 ![](https://i.imgur.com/a5wEMYi.png) ## 遭到攻擊的Linux 大眾普遍覺得Linux伺服器與Window伺服器相比安全又可靠,然而上網查詢美國國家漏洞資料庫(National Vulnerability Database)便能發現Linux作業系統的漏洞數量不容小覷。雖然不比Microsoft Windows,但針對Linux所開發的惡意程式高達數萬個,尤其絕大多導致資料外洩的攻擊都潛藏於程式安裝過程內。 全球知名跨國軟體公司——[趨勢科技(TREND MICRO)通過百萬次檢查數據](https://www.trendmicro.com/vinfo/us/security/news/cybercrime-and-digital-threats/linux-threat-report-2021-1h-linux-threats-in-the-cloud-and-security-recommendations),剖析了Trend Micro Cloud One - Workload Security中的 IPS(入侵防禦系統)命中並篩選了超過5000萬個事件,向大眾展示SPN數據佐證LINUX作為普遍性以及平台各種威脅和漏洞普遍性。趨勢科技(TREND MICRO)查覺到大約20,000個漏洞,令人匪夷所思的是,只有200個漏洞具有公開已知的漏洞利用並被觀察到,而表1為已知漏洞利用或概念證明的前15個漏洞。 ## 攻擊的方法 Linux 伺服器影響最嚴重的惡意程式,其中前三名的惡意程式類型是: - 挖礦程式 (25%) – 虛擬加密貨幣挖礦程式的普遍程度之高,不令人意外,因為雲端上幾乎取之不盡、用之不竭的運算效能,對這類惡意程式來說,是最完美的天堂。 - 網頁後門 (20%) – 例如最近一次針對 Microsoft Exchange 的攻擊即使用網頁後門 (web shell),突顯出系統修補對於防範這類惡意程式的重要性。 - 勒索病毒 (12%) – 目前最常偵測到的是新型態勒索病毒 DoppelPaymer,但仍有一些其他專門攻擊 Linux 系統的勒索病毒值得注意,如:RansomExx、DarkRadiation 及 DarkSide。 ## [攻擊背後的意圖](https://www.informationsecurity.com.tw/article/article_detail.aspx?aid=9804&fbclid=IwAR088FXuHqL97C0857ezHt8epfM4z_L9ZNdyEzSsYmb7bL0bWFPSXg_k9yY) ## [提升安全性的方法](https://blog.xuite.net/jin117/blog/19133517) 由上述所知,使用Linux時的資訊安全是一個不可忽略的問題,而要如何提升Linux的安全性,更是一大學問。以下提供一些簡易提升Linux安全性的方式。 1. 執行更新 開發者們不斷地尋找方法,通過修補已知的漏洞,使伺服器更加穩定、快速、安全。定期執行更新是一個好習慣,可以最大限度地提高安全性。 > Linux系統管理員應該消息靈通,經常光顧安全新聞組,查閱新的修補程序 2. 啟用防火牆保護 啟用防火牆可以更容易地控制伺服器上的進站和出站流量。在 Linux 上有許多防火牆應用程式可以使用,包括firewall-cmd和Uncomplicated Firewall。 >[Linux上最簡單(也是最有效)的防火牆之一就是FirewallD](https://computingforgeeks.com/install-and-use-firewalld-on-ubuntu/) 3. 加強密碼保護 實施強有力的密碼政策是保持伺服器安全、防止網路攻擊和資料洩露的一個重要方面。密碼策略的一些具體方法包括強制要求最小長度和定時更換密碼。 > 密碼破解程序是黑客工具箱中的一種工具,它將常用的密碼或者是英文字典中所有可能用來作密碼的字都用程序加密成密碼字,然後將其與 Linux系統的/etc/passwd密碼文件或/etc/shadow影子文件相比較,如果發現有吻合的密碼,就可以求得明碼了 4. 停用容易被利用的非必要服務 停用不必要的服務是一種最好的做法。這樣可以減少開放的埠,以便被利用。 > 除了http、smtp、telnet和ftp之外,其他服務都應該取消,取消不必要服務的第一步就是輸入systemctl list-unit-files > 一般來說, 5. 檢查監聽埠 開放的埠可能會帶來安全風險,攻擊者可以使用每個開放埠來利用漏洞或執行任何其他型別的攻擊,所以檢查伺服器上的監聽埠很重要。 >[安裝Nmap](https://phoenixnap.com/kb/how-to-install-nmap-ubuntu-18-04) > [3 個 Linux 中快速檢測埠的小技巧](https://www.firbug.com/a/202110/1161462.html) 6. 掃描惡意軟體 防毒掃描軟體可以有用的防止病毒進入你的系統。使用它們是一種簡單的方法,可以讓你的伺服器免受惡意軟體的侵害。 > [[十種 Linux 安全掃描工具推薦]](https://kknews.cc/zh-tw/code/94vobxb.html) 7. 設定用戶賬號的安全等級 在Linux上每個賬號可以被賦予不同的權限,因此在建立一個新用戶ID時,系統管理員應該根據需要賦予該賬號不同的權限,並且歸並到不同的用戶組中。 8. 限制超級用戶的權力 root是Linux保護的重點,由於它權力無限,因此最好不要輕易將超級用戶授權出去。但是,有些程序的安裝和維護工作必須要求有超級用戶的權限,在這種情況下,可以利用Sudo等工具讓這類用戶有部分超級用戶的權限。 > 使用sudo工具讓這類用戶有部分超級用戶的權限,在不使用root身分的情況下也能安裝和維護程序,Sudo不但限制了用戶的權限,而且還將每次使用sudo所執行的指令記錄下來,不管該指令的執行是成功還是失敗。在大型公司中還可以從sudo的日誌中,可以追蹤到誰做案。*但sudo並不能限制所有的用戶行為,尤其是當某些簡單的指令沒有設置限定時,就有可能被黑客濫用。* > https://xyz.cinc.biz/2021/09/linux-sudo-log-command.html ## 補充:修補資安漏洞平均速度 Google 旗下的資安研究團隊 Project Zero,日前發表一分針對市場主流作業系統、軟硬體業者修補該單位提報資安漏洞所需時間的統計報告;報告中指出 Linux 開發者推出資安修補所需日數是最短的,平均為15 日。從漏洞修復的速度來看,這三年來各大廠商修復漏洞的速度多半都有加快,從 2019 年到 2021 年所需日數如下所示: Apple:71 天→ 63 天→ 64 天; Microsoft:85 天 →87 天 →76 天; Google:49 天 →22 天 →53 天; Linux:32 天 →22 天 →15 天; 其他:63 天 →54 天→29 天。 ## 遇到的小問題 ![](https://i.imgur.com/JoRezqQ.png) [解法](https://ubuntuqa.com/zh-tw/article/9069.html) 參考資料來源: https://www.gushiciku.cn/pl/gihN/zh-tw https://blog.xuite.net/jin117/blog/19133517 https://www.trendmicro.com/vinfo/us/security/news/cybercrime-and-digital-threats/linux-threat-report-2021-1h-linux-threats-in-the-cloud-and-security-recommendations https://blog.trendmicro.com.tw/?p=49537 https://www.redhat.com/zh-tw/topics/linux https://w3techs.com/technologies/comparison/os-linux,os-windows https://www.trendmicro.com/vinfo/us/security/news/cybercrime-and-digital-threats/linux-threat-report-2021-1h-linux-threats-in-the-cloud-and-security-recommendations https://www.informationsecurity.com.tw/article/article_detail.aspx?aid=9473 https://codertw.com/%E4%BC%BA%E6%9C%8D%E5%99%A8/382311/ ###### tags: `分享`

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully