<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sophos Central APIs &#8211; Thegioifirewall</title>
	<atom:link href="https://thegioifirewall.com/tag/sophos-central-apis/feed/" rel="self" type="application/rss+xml" />
	<link>https://thegioifirewall.com</link>
	<description>Tường lửa bảo vệ doanh nghiệp, trung tâm thông tin và giá cả</description>
	<lastBuildDate>Sun, 11 Sep 2022 14:06:18 +0000</lastBuildDate>
	<language>vi</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://thegioifirewall.com/wp-content/uploads/vacif_icon-150x150.png</url>
	<title>Sophos Central APIs &#8211; Thegioifirewall</title>
	<link>https://thegioifirewall.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Sophos Central APIs: Hướng dẫn cấu hình API Credentials Mangement trên Sophos Central.</title>
		<link>https://thegioifirewall.com/sophos-central-apis-huong-dan-cau-hinh-api-credentials-mangement-tren-sophos-central/</link>
					<comments>https://thegioifirewall.com/sophos-central-apis-huong-dan-cau-hinh-api-credentials-mangement-tren-sophos-central/#respond</comments>
		
		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Sun, 11 Sep 2022 14:06:18 +0000</pubDate>
				<category><![CDATA[Sophos Central APIs]]></category>
		<category><![CDATA[API Credentials Mangement]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[Hướng dẫn cấu hình API Credentials Mangement trên Sophos Central]]></category>
		<category><![CDATA[tenant id]]></category>
		<guid isPermaLink="false">https://www.thegioifirewall.com/?p=16895</guid>

					<description><![CDATA[1.Overview Chương trình Sophos Central&#8217;s Public API giúp bạn dễ dàng tự động hóa các hoạt động giám sát, bảo mật và quản trị mạng của mình trong Sophos Central. Bạn có thể làm nhiều việc mà bạn thường làm trong Sophos Central Admin hoặc Sophos Central Partner. Bài viết hôm nay sẽ hướng dẫn [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><strong>1.Overview</strong></p>



<p class="wp-block-paragraph">Chương trình Sophos Central&#8217;s Public API giúp bạn dễ dàng tự động hóa các hoạt động giám sát, bảo mật và quản trị mạng của mình trong Sophos Central. Bạn có thể làm nhiều việc mà bạn thường làm trong Sophos Central Admin hoặc Sophos Central Partner.</p>



<p class="wp-block-paragraph">Bài viết hôm nay sẽ hướng dẫn bạn một vài bước đơn giản để được xác thực và bắt đầu gọi các Sophos Central APIs.</p>



<p class="wp-block-paragraph"><strong>2.Hướng dẫn cấu hình.</strong></p>



<p class="wp-block-paragraph"><strong>Bước 1: Tạo API Credentials Mangement trên Sophos Central.</strong></p>



<p class="wp-block-paragraph">Login vào <strong>Sophos Central Admin &gt; Gloabal Settings &gt; Administration &gt; API Credentials Mangement.</strong></p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img fetchpriority="high" decoding="async" width="624" height="330" src="https://thegioifirewall.com/wp-content/uploads/image-4937.png" alt="" class="wp-image-16896" srcset="https://thegioifirewall.com/wp-content/uploads/image-4937.png 624w, https://thegioifirewall.com/wp-content/uploads/image-4937-300x159.png 300w" sizes="(max-width: 624px) 100vw, 624px" /></figure>
</div>


<p class="wp-block-paragraph">Tại <strong>Credentials tab</strong>, click chọn <strong>Add Credentials.</strong></p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="795" height="165" src="https://thegioifirewall.com/wp-content/uploads/image-4938.png" alt="" class="wp-image-16897" srcset="https://thegioifirewall.com/wp-content/uploads/image-4938.png 795w, https://thegioifirewall.com/wp-content/uploads/image-4938-300x62.png 300w, https://thegioifirewall.com/wp-content/uploads/image-4938-768x159.png 768w" sizes="(max-width: 795px) 100vw, 795px" /></figure>
</div>


<p class="wp-block-paragraph">Trong <strong>Add Credentials:</strong></p>



<p class="wp-block-paragraph"><strong>Credentials Name: </strong>Điền tên bạn muốn</p>



<p class="wp-block-paragraph"><strong>Roles:</strong> chọn <strong>Service Principal Super Admin</strong> (Với vai trò <strong>Super Admin</strong> bạn sẽ có toàn quyền truy cập vào tất cả các API công khai trong Sophos Central).</p>



<p class="wp-block-paragraph">Click <strong>Add.</strong></p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="532" height="375" src="https://thegioifirewall.com/wp-content/uploads/image-4939.png" alt="" class="wp-image-16898" srcset="https://thegioifirewall.com/wp-content/uploads/image-4939.png 532w, https://thegioifirewall.com/wp-content/uploads/image-4939-300x211.png 300w" sizes="(max-width: 532px) 100vw, 532px" /></figure>
</div>


<p class="wp-block-paragraph"><strong>Note:</strong> Bạn cần copy lấy phần <strong>Client ID</strong> và <strong>Client Secret</strong> và paste vào note. Bạn sẽ cần các thông tin này cho các lệnh API sau. Phần <strong>Client Secret</strong> sẽ bị dấu đi sau một thời gian. Nếu bạn không nhớ phần <strong>Client Secret</strong> này bạn sẽ cần tạo lại <strong>API Credentials Mangement</strong>.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="799" height="231" src="https://thegioifirewall.com/wp-content/uploads/image-4940.png" alt="" class="wp-image-16899" srcset="https://thegioifirewall.com/wp-content/uploads/image-4940.png 799w, https://thegioifirewall.com/wp-content/uploads/image-4940-300x87.png 300w, https://thegioifirewall.com/wp-content/uploads/image-4940-768x222.png 768w" sizes="auto, (max-width: 799px) 100vw, 799px" /></figure>
</div>


<p class="wp-block-paragraph"><strong>Bước 2: Yêu cầu trên máy Endpoint</strong></p>



<p class="wp-block-paragraph">Trên máy endpoint dùng để chạy các lệnh API cần có tool tên là &#8220;<strong>curl</strong>&#8220;, bạn cần cài đặt tool này. Truy cập link: <a href="https://curl.se/">https://curl.se/</a> .Kéo xuống mục “<strong>What the latest curl</strong>”, click chọn <strong>download</strong>.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="624" height="82" src="https://thegioifirewall.com/wp-content/uploads/image-4941.png" alt="" class="wp-image-16900" srcset="https://thegioifirewall.com/wp-content/uploads/image-4941.png 624w, https://thegioifirewall.com/wp-content/uploads/image-4941-300x39.png 300w" sizes="auto, (max-width: 624px) 100vw, 624px" /></figure>
</div>


<p class="wp-block-paragraph">Tiếp tục kéo xuống mục <strong>Windows 64 bit</strong>, click chọn mục &#8220;<strong>7.84.0 binary the curl project</strong>&#8220;.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="624" height="146" src="https://thegioifirewall.com/wp-content/uploads/image-4942.png" alt="" class="wp-image-16901" srcset="https://thegioifirewall.com/wp-content/uploads/image-4942.png 624w, https://thegioifirewall.com/wp-content/uploads/image-4942-300x70.png 300w" sizes="auto, (max-width: 624px) 100vw, 624px" /></figure>
</div>


<p class="wp-block-paragraph">Chọn tải xuống file “<strong>curl for 64-bit</strong>”.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="624" height="366" src="https://thegioifirewall.com/wp-content/uploads/image-4943.png" alt="" class="wp-image-16902" srcset="https://thegioifirewall.com/wp-content/uploads/image-4943.png 624w, https://thegioifirewall.com/wp-content/uploads/image-4943-300x176.png 300w" sizes="auto, (max-width: 624px) 100vw, 624px" /></figure>
</div>


<p class="wp-block-paragraph">Mở file vừa tải, chọn mở mục <strong>Bin</strong>.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="624" height="175" src="https://thegioifirewall.com/wp-content/uploads/image-4944.png" alt="" class="wp-image-16903" srcset="https://thegioifirewall.com/wp-content/uploads/image-4944.png 624w, https://thegioifirewall.com/wp-content/uploads/image-4944-300x84.png 300w" sizes="auto, (max-width: 624px) 100vw, 624px" /></figure>
</div>


<p class="wp-block-paragraph">Click chạy mục <strong>curl.exe</strong>. Tool sẽ cài đặt tự động, không hiện ra bất cứ tab cài đặt nào.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="624" height="178" src="https://thegioifirewall.com/wp-content/uploads/image-4945.png" alt="" class="wp-image-16904" srcset="https://thegioifirewall.com/wp-content/uploads/image-4945.png 624w, https://thegioifirewall.com/wp-content/uploads/image-4945-300x86.png 300w" sizes="auto, (max-width: 624px) 100vw, 624px" /></figure>
</div>


<p class="wp-block-paragraph">Kiểm tra, bạn mở CMD trên endpoint gõ lệnh <strong>&#8220;curl -V&#8221;</strong>. Nếu hiển thị version là bạn đã cài đặt xong.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="979" height="227" src="https://thegioifirewall.com/wp-content/uploads/image-4946.png" alt="" class="wp-image-16905" srcset="https://thegioifirewall.com/wp-content/uploads/image-4946.png 979w, https://thegioifirewall.com/wp-content/uploads/image-4946-300x70.png 300w, https://thegioifirewall.com/wp-content/uploads/image-4946-768x178.png 768w" sizes="auto, (max-width: 979px) 100vw, 979px" /></figure>
</div>


<p class="wp-block-paragraph">Ngoài ra vì API là các code dòng lệnh, bạn nên cài đặt 1 ứng dụng có thể chỉnh sửa các code này 1 cách dễ dàng hơn như “<strong>Visual Studio Code</strong>”.</p>



<p class="wp-block-paragraph"><strong>Bước 3: Xác thực</strong> <strong>sử dụng</strong> <strong>API Credentials Mangement</strong>.</p>



<p class="wp-block-paragraph">Bên dưới là dòng lệnh để xác thực sử dụng API Credentials Mangement bạn mới có được ở bước 1.</p>



<p class="wp-block-paragraph">curl.exe -XPOST -H &#8220;Content-Type:application/x-www-form-urlencoded&#8221;</p>



<p class="wp-block-paragraph">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;-d &#8220;grant_type=client_credentials&amp;client_id=&lt;client-id&gt;&amp;client_secret=&lt;client-secret&gt;&amp;scope=token&#8221;</p>



<p class="wp-block-paragraph">Bạn tiến hành chỉnh sửa dòng lệnh như sau:</p>



<p class="wp-block-paragraph">Paste <strong>Client ID</strong> và <strong>Client Secret</strong> vào mục <strong>&lt;client-id&gt; và &lt;client-secret&gt;</strong>.</p>



<p class="wp-block-paragraph"><strong>Note: </strong>Sau khi chỉnh sửa xong bạn cần sửa để các dòng lệnh trên cùng 1 hàng (xóa các khoảng trắng giữa các dòng lệnh) nếu không bạn sẽ không thể chạy dòng lệnh này.</p>



<p class="wp-block-paragraph">Tiếp theo bạn mở CMD trên máy. Copy và paste dòng lệnh vào CMD, nhấn enter.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="790" height="182" src="https://thegioifirewall.com/wp-content/uploads/image-4947.png" alt="" class="wp-image-16907" srcset="https://thegioifirewall.com/wp-content/uploads/image-4947.png 790w, https://thegioifirewall.com/wp-content/uploads/image-4947-300x69.png 300w, https://thegioifirewall.com/wp-content/uploads/image-4947-768x177.png 768w" sizes="auto, (max-width: 790px) 100vw, 790px" /></figure>
</div>


<p class="wp-block-paragraph">Kết quả đúng sẽ xuất ra dưới dạng:</p>



<p class="wp-block-paragraph">{</p>



<p class="wp-block-paragraph">&nbsp; &#8220;access_token&#8221;: &#8220;&lt;jwt&gt;&#8221;,</p>



<p class="wp-block-paragraph">&nbsp; &#8220;errorCode&#8221;: &#8220;success&#8221;,</p>



<p class="wp-block-paragraph">&nbsp; &#8220;expires_in&#8221;: 3600,</p>



<p class="wp-block-paragraph">&nbsp; &#8220;message&#8221;: &#8220;OK&#8221;,</p>



<p class="wp-block-paragraph">&nbsp; &#8220;refresh_token&#8221;: &#8220;&lt;token&gt;&#8221;,</p>



<p class="wp-block-paragraph">&nbsp; &#8220;token_type&#8221;: &#8220;bearer&#8221;,</p>



<p class="wp-block-paragraph">&nbsp; &#8220;trackingId&#8221;: &#8220;&lt;uuid&gt;&#8221;</p>



<p class="wp-block-paragraph">}</p>



<p class="wp-block-paragraph">Sau khi chạy dòng lệnh sẽ xuất kết quả như hình dưới, từ mục “<strong>Access_token</strong>” cho đến “<strong>trackingId</strong>”.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="797" height="308" src="https://thegioifirewall.com/wp-content/uploads/image-4976.png" alt="" class="wp-image-16943" srcset="https://thegioifirewall.com/wp-content/uploads/image-4976.png 797w, https://thegioifirewall.com/wp-content/uploads/image-4976-300x116.png 300w, https://thegioifirewall.com/wp-content/uploads/image-4976-768x297.png 768w" sizes="auto, (max-width: 797px) 100vw, 797px" /></figure>
</div>


<p class="wp-block-paragraph">Để dễ nhìn hơn, bạn copy dòng kết quả này paste vào <strong>Visual Studio Code</strong>.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="792" height="154" src="https://thegioifirewall.com/wp-content/uploads/image-4949.png" alt="" class="wp-image-16909" srcset="https://thegioifirewall.com/wp-content/uploads/image-4949.png 792w, https://thegioifirewall.com/wp-content/uploads/image-4949-300x58.png 300w, https://thegioifirewall.com/wp-content/uploads/image-4949-768x149.png 768w" sizes="auto, (max-width: 792px) 100vw, 792px" /></figure>
</div>


<p class="wp-block-paragraph">Bạn chuột phải chọn <strong>Fomat Document.</strong></p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="790" height="228" src="https://thegioifirewall.com/wp-content/uploads/image-4950.png" alt="" class="wp-image-16910" srcset="https://thegioifirewall.com/wp-content/uploads/image-4950.png 790w, https://thegioifirewall.com/wp-content/uploads/image-4950-300x87.png 300w, https://thegioifirewall.com/wp-content/uploads/image-4950-768x222.png 768w" sizes="auto, (max-width: 790px) 100vw, 790px" /></figure>
</div>


<p class="wp-block-paragraph">Kết quả chạy dòng lệnh đã thành công, bạn sẽ có thông tin về “<strong>access_token</strong>”, bạn sẽ dùng thông tin này cho các lệnh API tiếp theo.</p>



<p class="wp-block-paragraph"><strong>Note:</strong> “<strong>access_token</strong>” sẽ có thời gian hết hạn là 1 giờ. Nếu bạn dùng access_token này sau 1 giờ sẽ không còn hiệu lực và bạn phải lấy lại access_token mới như bước trên.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="786" height="236" src="https://thegioifirewall.com/wp-content/uploads/image-4951.png" alt="" class="wp-image-16911" srcset="https://thegioifirewall.com/wp-content/uploads/image-4951.png 786w, https://thegioifirewall.com/wp-content/uploads/image-4951-300x90.png 300w, https://thegioifirewall.com/wp-content/uploads/image-4951-768x231.png 768w" sizes="auto, (max-width: 786px) 100vw, 786px" /></figure>
</div>


<p class="wp-block-paragraph"><strong>Bước 4: Tìm Tenant-ID của Sophos Central.</strong></p>



<p class="wp-block-paragraph">Bên dưới là dòng lệnh API để tìm <strong>Tenant-ID</strong>:</p>



<p class="wp-block-paragraph">curl.exe -XGET -H &#8220;Authorization: Bearer &lt;jwt&gt;&#8221; https://api.central.sophos.com/whoami/v1</p>



<p class="wp-block-paragraph">Bạn chỉnh sửa thông số sau:</p>



<p class="wp-block-paragraph"><strong>&lt;jwt&gt;:</strong> bạn copy và paste &#8220;<strong>access_token</strong>&#8221; đã lấy được ở bước 3.</p>



<p class="wp-block-paragraph">Sau khi chỉnh sửa xong bạn paste dòng lệnh vào CMD, nhấn Enter. </p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="782" height="259" src="https://thegioifirewall.com/wp-content/uploads/image-4977.png" alt="" class="wp-image-16944" srcset="https://thegioifirewall.com/wp-content/uploads/image-4977.png 782w, https://thegioifirewall.com/wp-content/uploads/image-4977-300x99.png 300w, https://thegioifirewall.com/wp-content/uploads/image-4977-768x254.png 768w" sizes="auto, (max-width: 782px) 100vw, 782px" /></figure>
</div>


<p class="wp-block-paragraph">Kết quả:</p>



<p class="wp-block-paragraph">{</p>



<p class="wp-block-paragraph">&#8220;id&#8221;:&#8221;tenant-id&#8221;,</p>



<p class="wp-block-paragraph">&#8220;idType&#8221;:&#8221;tenant&#8221;,</p>



<p class="wp-block-paragraph">&#8220;apiHosts&#8221;:{</p>



<p class="wp-block-paragraph">&#8220;global&#8221;:&#8221;https://api.central.sophos.com&#8221;,</p>



<p class="wp-block-paragraph">&#8220;dataRegion&#8221;:&#8221;https://api-us03.central.sophos.com&#8221;}</p>



<p class="wp-block-paragraph">}</p>



<p class="wp-block-paragraph"><strong>Note:</strong> Bạn cần lưu lại các thông tin về “<strong>tenant-id</strong>” và “<strong>dataRegion</strong>”, các thông tin này sẽ được sử dụng trong các lệnh API tiếp theo.</p>



<p class="wp-block-paragraph"></p>
]]></content:encoded>
					
					<wfw:commentRss>https://thegioifirewall.com/sophos-central-apis-huong-dan-cau-hinh-api-credentials-mangement-tren-sophos-central/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
