微軟 | 捕夢網 Blog https://blog.pumo.com.tw 網路安全、資安服務、雲端主機、主機租賃、主機代管、虛擬主機、網站代管專家 Thu, 10 Mar 2016 03:37:13 +0000 zh-TW hourly 1 https://wordpress.org/?v=6.5.5 Announcing SQL Server on Linux https://blog.pumo.com.tw/archives/383 https://blog.pumo.com.tw/archives/383#respond Thu, 10 Mar 2016 03:31:49 +0000 http://blog.pumo.com.tw/?p=383 簡單來說~未來可以在Linux系統執行MSSQL了 從封閉心態的Mi...

The post Announcing SQL Server on Linux first appeared on 捕夢網 Blog.

]]>
簡單來說~未來可以在Linux系統執行MSSQL了

從封閉心態的Microsoft走向擁抱世界的開放態度

從改變產品的布局即可一窺端倪

Azure一推出就支援Linux系統

一些產品像是Office365可安裝在iOS及Andriod等行動平台

微軟正在逐漸改變:)

SQL-Loves-Linux_2_Twitter-002-640x358

It’s been an incredible year for the data business at Microsoft and an incredible year for data across the industry. This Thursday at our Data Driven event in New York, we will kick off a wave of launch activities for SQL Server 2016 with general availability later this year. This is the most significant release of SQL Server that we have ever done, and brings with it some fantastic new capabilities. SQL Server 2016 delivers:

  • Groundbreaking security encryption capabilities that enable data to always be encrypted at rest, in motion and in-memory to deliver maximum security protection
  • In-memory database support for every workload with performance increases up to 30-100x
  • Incredible Data Warehousing performance with the #1, #2 and #3 TPC-H 10 Terabyte benchmarks for non-clustered performance, and as of March 7, the #1 SAP SD Two-Tier performance benchmark on Windows1
  • Business Intelligence for every employee on every device – including new mobile BI support for iOS, Android and Windows Phone devices
  • Advanced analytics using our new R support that enables customers to do real-time predictive analytics on both operational and analytic data
  • Unique cloud capabilities that enable customers to deploy hybrid architectures that partition data workloads across on-premises and cloud based systems to save costs and increase agility

These improvements, and many more, are all built into SQL Server and bring you not just a new database but a complete platform for data management, business analytics and intelligent apps – one that can be used in a consistent way across both on-premises and the cloud. In fact, over the last year we’ve been using the SQL Server 2016 code-base to run in production more than 1.4 million SQL Databases in the cloud using our Azure SQL Database as a Service offering, and this real-world experience has made SQL Server 2016 an incredibly robust and battle-hardened data platform.

Gartner recently named Microsoft as leading the industry in their Magic Quadrant for Operational Database Management Systems in both execution and vision. We’re also a leader in Gartner’s Magic Quadrant for Data Warehouse and Data Management Solutions for Analytics, and Magic Quadrant for Business Intelligence and Analytics Platforms, as well as leading in vision in the Magic Quadrant for Advanced Analytics Platforms.

Gartner-MQs

Extending SQL Server to Also Now Run on Linux

Today I’m excited to announce our plans to bring SQL Server to Linux as well. This will enable SQL Server to deliver a consistent data platform across Windows Server and Linux, as well as on-premises and cloud. We are bringing the core relational database capabilities to preview today, and are targeting availability in mid-2017.

SQL Server on Linux will provide customers with even more flexibility in their data solution. One with mission-critical performance, industry-leading TCO, best-in-class security, and hybrid cloud innovations – like Stretch Database which lets customers access their data on-premises and in the cloud whenever they want at low cost – all built in.

“This is an enormously important decision for Microsoft, allowing it to offer its well-known and trusted database to an expanded set of customers”, said Al Gillen, group vice president, enterprise infrastructure, at IDC. “By taking this key product to Linux Microsoft is proving its commitment to being a cross platform solution provider. This gives customers choice and reduces the concerns for lock-in. We would expect this will also accelerate the overall adoption of SQL Server.”

“SQL Server’s proven enterprise experience and capabilities offer a valuable asset to enterprise Linux customers around the world,” said Paul Cormier, President, Products and Technologies, Red Hat. “We believe our customers will welcome this news and are happy to see Microsoft further increasing its investment in Linux. As we build upon our deep hybrid cloud partnership, spanning not only Linux, but also middleware, and PaaS, we’re excited to now extend that collaboration to SQL Server on Red Hat Enterprise Linux, bringing enterprise customers increased database choice.”

“We are delighted to be working with Microsoft as it brings SQL Server to Linux,” said Mark Shuttleworth, founder of Canonical. “Customers are already taking advantage of Azure Data Lake services on Ubuntu, and now developers will be able to build modern applications that utilize SQL Server’s enterprise capabilities.”

Bringing SQL Server to Linux is another way we are making our products and new innovations more accessible to a broader set of users and meeting them where they are. Just last week, we announced our agreement to acquire Xamarin. Recently, we alsoannounced Microsoft R Server , our technologies based on our acquisition of Revolution Analytics, with support for Hadoop and Teradata.

The private preview of SQL Server on Linux is available starting today and we look forward to working with the community, our customers and our partners to bring it to market.

Please join me Satya Nadella, Joseph Sirosh and Judson Althoff at our Data Driven event on Thursday to hear more about this news and how Microsoft is helping customers transform their business using data.

Thanks,
Scott

To find out more about SQL Server on Linux, you can sign up to get regular updates and provide input to the team.

1 Benchmark Certification #2016002: Two-tier configured SAP SD Standard Application Benchmark. Using SAP ERP 6.0 Enhancement Package 5, achieving the results of 100000 SD benchmark users using HPE Integrity Superdome X, 16 processors/288 cores/576 threads Intel E7-8890 v3 with 4096GB of main memory. Operating System: Windows Server 2012R2 with SQL Server 2014 Enterprise Edition as DBMS. For more details see: http://www.sap.com/benchmark.

[1] Gartner “Magic Quadrant for Operational Database Management Systems,” by Donald Feinberg , Merv Adrian , Nick Heudecker, October 2015
[2] Gartner “Magic Quadrant for Data Warehouse and Data Management Solutions for Analytics,” by Roxane Edjlali and Mark Beyer, Feb 2016
[3] Gartner “Magic Quadrant for Business Intelligence and Analytics Platforms,” by Josh Parenteau, Rita L. Sallam,  Cindi Howson  Joao Tapadinhas, Kurt Schlegel, Thomas W. Oestreich February 2016
[4] Gartner “Magic Quadrant for Advanced Analytics Platforms,” by Lisa Kart, Gareth Herschel, Alexander Linden, Jim Hare, February 2016

The above graphic was published by Gartner, Inc. as part of a larger research document and should be evaluated in the context of the entire document. The Gartner document is available upon request from Microsoft. Gartner does not endorse any vendor, product or service depicted in its research publications, and does not advise technology users to select only those vendors with the highest ratings or other designation. Gartner research publications consist of the opinions of Gartner’s research organization and should not be construed as statements of fact. Gartner disclaims all warranties, expressed or implied, with respect to this research, including any warranties of merchantability or fitness for a particular purpose.

文章來源:https://blogs.microsoft.com/blog/2016/03/07/announcing-sql-server-on-linux/

圖片來源:https://pixabay.com/

The post Announcing SQL Server on Linux first appeared on 捕夢網 Blog.

]]>
https://blog.pumo.com.tw/archives/383/feed 0
微軟系統日誌集中控管 自建資料庫式Log伺服器 https://blog.pumo.com.tw/archives/265 https://blog.pumo.com.tw/archives/265#respond Wed, 24 Feb 2016 05:43:24 +0000 http://blog.pumo.com.tw/?p=265 為了快速找出系統紀錄內的重要資訊,本文將透過Syslog方式把Win...

The post 微軟系統日誌集中控管 自建資料庫式Log伺服器 first appeared on 捕夢網 Blog.

]]>
為了快速找出系統紀錄內的重要資訊,本文將透過Syslog方式把Windows系統上的事件紀錄統一儲存到遠端的rsyslog伺服器,並藉由rsyslog伺服器將相關資訊儲存至MySQL資料庫,以達成中央控管紀錄的目標。

遇到系統問題時,有經驗的系統管理者第一時間都會想到查詢系統上的紀錄(Log)來釐清問題。更希望能有一個機制將主機上的紀錄統一儲存至單一的伺服器,以達到中央控管紀錄的功能,便於在發生系統問題時能更有效地查詢相關資訊。

對此,本文將介紹能夠將Windows系統上的事件紀錄(Event Log)透過Syslog的方式,統一儲存在遠端的Syslog伺服器,並利用Syslog伺服器將相關資訊儲存至MySQL資料庫。

相關的實作架構如圖1所示,所使用的套件則參考表1。

NP160203000516020314033901

▲圖1 實作相關架構。

表1 實作所採用的套件

NP160203000516020313591801

什麼是Syslog

Syslog又被稱為系統日誌,是一個可在網際網路協定(TCP/IP)中傳遞紀錄檔訊息的標準,它是一種主從式的架構(Client-Server)。

在實際運用上,客戶端可將系統主機上的紀錄轉換成對應的Syslog資訊,以TCP或UDP通訊協定傳遞(在預設的情況下,Syslog會以明碼的型式傳送)到遠端伺服器端,以完成集中保管紀錄資訊的目的。

基本上,Syslog會將紀錄資訊劃分為Facility(事件種類,主要在區分此紀錄為那一種事件所產生)和Level(嚴重程度,在於說明此事件的嚴重性),如圖2所示。其中常見的事件類型(Facility)如表2所示,而常見的嚴重程度(Level)說明,可參考表3。

NP160203000516020313591802

▲圖2 Syslog會將紀錄資訊劃分為事件種類和嚴重程度。

表2 Syslog常見的事件類型

NP160203000516020313591803

表3 Syslog常見的嚴重程度

NP160203000516020313591804

在簡單說明Syslog事件的種類區分及嚴重性後,接下來講解Syslog所使用的格式,Syslog會將紀錄分成四個部分,如圖3所示,各欄位意義相關說明如下:

 

(1) 此欄位記錄事件發生的日期與時間

(2) 此欄位記錄產生Log紀錄的主機名稱

(3) 此欄位記錄產生Log紀錄的程式名稱及PID(Process ID)資訊

(4) 此欄位記錄詳細的Log資訊內容

NP160203000516020313591805

▲圖3 Syslog將紀錄分成四個部分。

在簡單說明Syslog後,接著介紹Windo ws系統上的事件紀錄(Event Log)。

微軟事件紀錄介紹

一般而言,各項的主機設備的Log紀錄,大都會遵循Syslog的標準,微軟當然也不例外。基本上,微軟系統所記錄的Log紀錄(又稱為事件紀錄,如下簡稱為事件紀錄)大致遵循Syslog的標準,但有稍許的擴充。

其中,最大的特色在於微軟針對每種事件紀錄均有定義一個Event ID,亦即何種編號代表什麼樣的事件,例如Event ID為4624則表示使用者登入,但依據作業系統的種類,可能會有不同的代碼。

基本上,微軟將事件紀錄大致分為應用程式(程式)事件、安全性相關事件、設定事件以及系統事件等類型。

1. 應用程式(程式)事件

主要記錄使用應用程式時所發生的事件。以嚴重性來做區分,可區分為「錯誤」、「警告」、「資訊」等級。

「錯誤」代表嚴重等級最高,例如資料遺失、程式發生無預期的錯誤等事件。「警告」的嚴重等級次高,主要在描述後續可能會發生問題的事件。而「資訊」僅是在描述相關程式的操作情形,例如成功地啟動程式或載入驅動程式等相關資訊。

2. 安全性相關事件

主要用來記錄稽核所需要的事件,例如使用者嘗試登入系統成功或失敗的相關資訊。

3. 設定事件

如果系統被設定為網域控制站的電腦,就會額外記錄此類型的事件紀錄。

4. 系統事件

用來記錄由Windows系統服務(Service)所發生的事件,以嚴重性來區分,同樣可區分為錯誤、警告、資訊等級。

一般而言,可經由系統上的事件檢視器來查看相關的事件資訊,如圖4所示。

NP160203000516020313594601

▲圖4 在事件檢視器中查看事件資訊。

安裝rsyslog與MySQL

這裡將利用rsyslog結合MySQL,接收來自Windows系統的事件紀錄,並將相關的事件紀錄儲存在MySQL資料庫內。

首先,安裝rsyslog來當作Syslog伺服器,由於已編譯完成的套件通常都不會支援MySQL資料庫的功能,因此將利用原始碼編譯的方式編譯出一個支援MySQL資料庫的rsyslog伺服器,且由於相容性的原因考量,在此選用6.6.0版本。

在編譯rsyslog伺服器之前,必須先安裝libestr和libee程式庫。在安裝好所需的程式庫後,接下來至rsyslog官方網站下載6.6.0的原始碼。

下載並解壓縮後,執行以下的指令編譯rsyslog伺服器(#之後為註解):

NP160203000516020313594602

在安裝成功之後,緊接著建立相關的資料庫。

可以依照「rsyslog<原始碼目錄>/plugins/ommysql」之下createDB.sql檔案內的資訊,來建立相關的資料庫表格。至此,rsyslog的安裝工作即告完成。

接下來,簡單說明rsyslog相關的架構及組態檔的設定,圖5所示為rsyslog的架構。

NP160203000516020313594603

▲圖5 rsyslog架構示意圖。

rsyslog架構說明

基本上,rsyslog整個架構劃分為Input(輸入模組)、Parser(過濾模組)及Output(輸出模組),以下分別加以介紹。

Input(輸入模組)

設定接收Syslog的來源,例如可從系統上的紀錄檔案內或從網路連線(Socket)中取得。在本文中會使用到的輸入模組說明,如表4所示。

表4 輸入模組說明

NP160203000516020313594604

Parser(過濾模組)

可由使用者自行定義相關的過濾條件,從繁雜的紀錄檔中取得符合的資訊。在此並不使用過濾模組的功能。

Output(輸出模組)

可將Syslog資訊輸出到其他媒介上。在此將設定輸出到MySQL資料庫,所使用的如表5所示。

表5 輸出模組說明

NP160203000516020313594605

最後,設定rsyslog的組態檔,檔名為rsyslog.conf,如圖6示。

NP160203000516020314000901

▲圖6 設定rsyslog的組態檔。

有關於rsyslog.conf的相關設定,分別說明如下:

(1) 為設定要載入的模組,其中包括imuxsock(設定 資料來源為本機的Log資訊)、imklog(設定資料來源為本機的核心資訊)以及ommysql(支援MySQL資料庫存取功能)。

(2) 設定rsyslog伺服器的功能,包括:

NP160203000516020314000902

(3) 設定rsyslog伺服器輸出Syslog到MySQL資料庫的 相關資訊,其格式為:

NP160203000516020314000903

在圖6中的設定,即表示將所有產生的Syslog資料儲存到所指定的MySQL資料庫內。

完成設定後,即可利用「rsyslogd –f rsyslog.conf」指令來啟動rsyslog伺服器。

完成rsyslog伺服器端的設定後,接下來設定Windows系統的Syslog功能,將所產生的事件紀錄透過Syslog傳遞至遠端的rsyslog,再由rsyslog儲存到MySQL資料庫內,以達到集中式保存Log紀錄的目的。

安裝EventLog to Syslog

利用EventLog to Syslog免費軟體,即可將Windows系統的事件紀錄輸出到遠端的rsyslog伺服器上。先連結至「https://code.google.com/p/eventlog-to-syslog/」,然後依據作業系統的需求(32位元或64位元)取得相關的程式,這裡取得的版本為Evtsys_4.5.1_64-Bit(64位元版)。

EventLog to Syslog的安裝方式非常簡單,解壓縮後會產生一個「evtsys.exe」檔案,接著以「系統管理者的身分」開啟命令列介面,並執行如圖7所示的指令進行安裝即可,其中-h需指定遠方的rsyslog伺服器主機IP位址,-p 514則是指定以通訊埠514來傳遞。

NP160203000516020314000904

▲圖7 安裝EventLog to Syslog。

執行指令成功完成安裝作業後,就會如圖8所示在Windows系統上新增一個「Eventlog to Syslog」服務(Service),請將此服務加以啟動。啟動服務後,就會將系統內的所有事件(Event)輸出到所設定的rsyslog伺服器,再由rsyslog伺服器將相關的資料儲存至MySQL資料庫。

NP160203000516020314000905

▲圖8 新增「Eventlog to Syslog」服務。

如果一切正常,就可以查閱資料庫內是否有相關的資訊,如圖9所示。

NP160203000516020314003101

▲圖9 在資料庫內查閱是否有相關資訊。

或者,可以查詢rsyslog伺服器下的「/var/log/messages」檔案是否有接收到來自其他主機的Syslog資訊,如圖10所示。

NP160203000516020314003102

▲圖10 查看「/var/log/messages」檔案以確認是否有接收到來自其他主機的Syslog資訊。

如果設定正常,應該就能查詢到從Windows系統傳來的事件紀錄。就本次測試的結果,在rsyslog伺服器內所接收的Syslog資訊,對於中文資訊並不會有影響,可正常地顯示事件紀錄內的中文資訊。

但是,如果經由rsyslog儲存到MySQL資料庫,中文字就會呈現亂碼,這在解析事件上或許會造成一些困擾。幸好,微軟針對每個事件均會定義一個事件代號(Event ID)來表示,即使無法取得完整的中文說明,使用者還是可以從事件代號判別事件的種類。

到目前為止,已經成功地將Windows系統上所有的事件,輸出到rsyslog伺服器上,但美中不足的是,這種方式並無法利用過濾的方式來取得所需的資料,例如可能只要監控「登入」的事件,並不想理會其他的事件。

因此,接下來介紹一套微軟提供的免費紀錄解析軟體Log Parser,讓管理者能夠方便地以資料庫解析(使用SQL語法)擷取所需的資料,並且以輸出Syslog的方式將資料輸出至rsyslog伺服器。

什麼是Log Parser

Log Parser是一套微軟公司所提供解析多種紀錄(基本上Windows系統上的紀錄都可解析)的免費命令列工具程式,由於一般的系統紀錄大多儲存在文字檔案中,在解析相關資訊會有一定的難度,因此Log Parser提供使用者能以資料庫解析的方式(利用SQL指令)從文字型態的檔案中解析出所需的資訊。

Log Parser的安裝很簡單,到微軟官方網站直接下載(本文採用的版本為2.2),解壓縮後,直接安裝即可。在安裝完成後,Log Parser提供一個主要執行檔以供使用者使用,其檔案名稱為「LogParser」。

另外,Log Parser也貼心提供了許多有用的查詢SQL範例供使用者參考,例如找尋曾登入到系統的使用者名稱等等。而SQL範例放置於Log Parser安裝目錄下的「Samples」目錄內。

簡單介紹Log Parser後,接著說明Log Parser整體架構,相關架構如圖11所示。

NP160203000516020314003103

▲圖11 Log Parse架構示意圖。

圖11中的輸入源指的是欲被解析的紀錄來源,例如IIS Log、系統事件(Event Log)等等。輸出方面,除了可輸出至檔案(Text file)外,還能夠輸出到資料庫或Syslog伺服器上,本文將使用輸出到Syslog的功能。

Log Parser的使用並不難,主要是指定欲解析的輸入源,例如系統事件,而後利用SQL查詢指令(SELECT)來解析紀錄輸入源,最後將執行結果的資訊輸出到其他地方,例如檔案或資料庫。

在本文中,將利用Log Parser把所解析的系統事件傳遞到遠方的Syslog伺服器,再由該Syslog伺服器將相關資料儲存到MySQL資料庫,以達到中央控管的功能。表6簡單說明了所提供的輸入源格式。

表6 輸入源格式說明

NP160203000516020314003104

本文將只探討記錄輸入源為EVT(Windows事件)的分析運用。其他的類型請自行研究。而Log Parser在解析完相關的紀錄後,也提供了多種類型的輸出格式,相關的輸出格式如表7所述。

緊接著,說明如何利用Log Parser來取得Windows系統上的紀錄。

表7 相關輸出格式說明

NP160203000516020314003105

系統事件(System)

系統事件(System)的相關指令,如圖12所示。其中較為重要的欄位說明,可參考表8。

NP160203000516020314005101

▲圖12 系統事件相關指令。

表8 系統事件(System)重要欄位說明

NP160203000516020314005102

安全事件(Security)

有關於安全事件(Security),其使用的指令如圖13所示。

NP160203000516020314005103

▲圖13 安全事件(Security)相關指令。

Application應用程式事件

Application應用程式事件的相關指令,則如圖14所示。

NP160203000516020314005104

▲圖14 Application應用程式事件相關指令。

在了解相關事件的欄位之後,就可以資料庫的方式取得所需的資料,並且輸出至Syslog伺服器。在此以取得Windows系統中登入成功的資訊為例,使用如圖15所示的指令輸出至Syslog資料庫,然後找出所有曾經登入的相關資訊,其中事件編號(eventid)4624為表示登入事件,並輸出到遠端的Syslog伺服器。

NP160203000516020314005105

▲ 圖15 輸出至Syslog資料庫,然後找出所有曾經登入的相關資訊。

指令執行成功以後,就會將SQL指令執行的結果傳入到遠端的rsyslog伺服器。至此,已經利用Log Parser程式搭配輸出Syslog的方式,將有意義的資訊儲存到遠端的rsyslog伺服器上,並且透過rsyslog伺服器將資料儲存至MySQL資料庫,達成以中央控管紀錄的目的。

<本文作者:吳惠麟,多年資安經驗,喜好利用開源碼建構相關解決方案,著有「資訊安全原理與實驗」等書。>

文章來源:http://www.netadmin.com.tw/article_content.aspx?sn=1602030005&jump=1

圖片來源:https://pixabay.com/

The post 微軟系統日誌集中控管 自建資料庫式Log伺服器 first appeared on 捕夢網 Blog.

]]>
https://blog.pumo.com.tw/archives/265/feed 0