目次
Password
Administrator Username
Endpoints
Removing endpoints
Choosing non-standard ports
Securing the endpoint to your location:

Securing MongoDB on Windows Azure

Jun 07, 2016 pm 04:31 PM
azure mongodb windows

By Sridhar Nanjesudwaran, Windows Azure lead at 10gen I have used the MongoDB Installer for Windows Azure to deploy my MongoDB instance on a Windows Virtual Machine on Windows Azure. It is not my production environment but I would still li

By Sridhar Nanjesudwaran, Windows Azure lead at 10gen

I have used the MongoDB Installer for Windows Azure to deploy my MongoDB instance on a Windows Virtual Machine on Windows Azure. It is not my production environment but I would still like to secure it. What do I need to do to secure this standalone instance?

Let us take a look at the possible issues and how you would resolve each of them.

  • Password
  • Administrator username
  • Endpoints

Password

We are assuming you have created a strong password for the Administrator user. If not make sure to set a strong password for the Administrator user.

Administrator Username

The user name cannot be specified using the installer. It is always “Administrator”. The background here is that when Azure Virtual Machines were preview, “Administrator” was the only username allowed when creating Windows Virtual Machines. This was recently fixed but the installer has not been modified to allow it. To secure the instance it would be a good idea to change the username. You can change the username by logging onto the instance.

Once you remote desktop to the instance, you can change the username from PowerShell. To change:

$user = Get-WMIObject Win32_UserAccount -Filter "Name='Administrator'"
$username = “”
$user.Rename($username)
ログイン後にコピー

You can verify the username changed by logging out of the instance and retrying with Administrator – this should fail. Now retry with the username you just created which should succeed.

Endpoints

By default the installer creates 3 endpoints on the instance. The endpoints are for

  • RDP (starting at 3389)
  • MongoDB (starting at 27017)
  • PowerShell remoting (starting at 5985)

We are going to secure the endpoints by

  1. Removing the ports when not required
  2. Choosing non-standard ports
  3. Securing them to your location

Removing endpoints

Remove the endpoints if they are not necessary. The PowerShell remoting endpoint is only required for the initial setup. It is not necessary unless you explicitly want to continue to use PowerShell remoting to manage the instance. Hence you should remove the endpoint. Also if you want to use PowerShell remoting to manage the instance, it is more secure to add it via an Azure interface such as (CLI, PowerShell or Management portal) when needed.?

To remove the PowerShell remoting endpoint, from a Windows Azure PowerShell console:

# Remove PowerShell remoting endpoints
Get-AzureVM -ServiceName  | Remove-AzureEndpoint -Name endpname-5985-5985 | Update-AzureVM
ログイン後にコピー

The default remoting endpoint name is “endpname-5985-5985”. The service name is the same as the dns prefix you specified in the installer to create the instance. Similarly remove the RDP endpoint. Add it when needed as opposed to keeping it open all the time.

Choosing non-standard ports

Only add the RDP endpoint when necessary. When adding ensure you do not use the default port of 3389 for the external load balancer. To create the endpoint for RDP, from a Windows Azure PowerShell console:

# Add RDP endpoints to the single VM
Get-AzureVM -ServiceName “myservice” | Add-AzureEndpoint -Name rdp -LocalPort 3389 -Protocol tcp | Update-AzureVM
ログイン後にコピー

The above sets the load balancer port to an arbitrary one from the ephemeral range.

If an RDPendpoint already exists (like the default one created by the installer), you can change the load balancer port to a non standard port from a?Windows Azure PowerShell console by:

# Update RDP endpoint external port
Get-AzureVM -ServiceName “myservice” | Set-AzureEndpoint -Name rdp -LocalPort 3389 -Protocol tcp | Update-AzureVM
ログイン後にコピー

To check the external port you can get it from the management portal or use Windows Azure PowerShell:

# Get RDP endpoint external port
Get-AzureVM -ServiceName “myservice” | Get-AzureEndpoint
ログイン後にコピー

Securing the endpoint to your location:

Prior to the recent updates to Windows Azure and Windows Azure PowerShell, the only method of securing endpoints are using firewall rules on the actual instance. While this does help secure the instance, it still allows for malicious DoS attacks. With the recent updates, in addition to firewall rules you can secure your endpoints by specifying a set of addresses that can access it (white list). You want to secure the MongoDB endpoints to only allow your MongoDB client/app machines (maybe in addition to administrator machines) to access the machines.

Also if you are enabling the RDPendpoint, secure it by only allowing access by the specified administrator machines. Using a Windows Azure PowerShell:

# Setup the ACL
$acl = New-AzureAclConfig
Set-AzureAclConfig -AddRule Permit -RemoteSubnet “mysubnet” -Order 1 –ACL $acl -Description “Lockdown MongoDB port”
# Update the endpoint with the ACL
Get-AzureVM -ServiceName “myservice” | Set-AzureEndpoint -Name endpname-27017-27017 -PublicPort 27017 -LocalPort 27017 -Protocol tcp –ACL $acl | Update-AzureVM
ログイン後にコピー

Mysubnet – is your subnet that you want to allow access specified in the CIDR format.

このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。

ホットAIツール

Undresser.AI Undress

Undresser.AI Undress

リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover

AI Clothes Remover

写真から衣服を削除するオンライン AI ツール。

Undress AI Tool

Undress AI Tool

脱衣画像を無料で

Clothoff.io

Clothoff.io

AI衣類リムーバー

AI Hentai Generator

AI Hentai Generator

AIヘンタイを無料で生成します。

ホットツール

メモ帳++7.3.1

メモ帳++7.3.1

使いやすく無料のコードエディター

SublimeText3 中国語版

SublimeText3 中国語版

中国語版、とても使いやすい

ゼンドスタジオ 13.0.1

ゼンドスタジオ 13.0.1

強力な PHP 統合開発環境

ドリームウィーバー CS6

ドリームウィーバー CS6

ビジュアル Web 開発ツール

SublimeText3 Mac版

SublimeText3 Mac版

神レベルのコード編集ソフト(SublimeText3)

MongoDBインデックスを並べ替える方法 MongoDBインデックスを並べ替える方法 Apr 12, 2025 am 08:45 AM

ソートインデックスは、特定のフィールドによるコレクション内のドキュメントのソートを許可するMongoDBインデックスの一種です。ソートインデックスを作成すると、追加のソート操作なしでクエリ結果をすばやく並べ替えることができます。利点には、クイックソート、オーバーライドクエリ、およびオンデマンドソートが含まれます。構文はdb.collection.createIndex({field:< sort and gt;})、where< sort and> IS 1(昇順)または-1(降順注文)です。また、複数のフィールドをソートするマルチフィールドソートインデックスを作成することもできます。

Centos Mongodbバックアップ戦略とは何ですか? Centos Mongodbバックアップ戦略とは何ですか? Apr 14, 2025 pm 04:51 PM

MongoDB効率的なバックアップ戦略の詳細な説明CENTOSシステムでは、この記事では、データセキュリティとビジネスの継続性を確保するために、CENTOSシステムにMongoDBバックアップを実装するためのさまざまな戦略を詳細に紹介します。 Dockerコンテナ環境でのマニュアルバックアップ、タイミング付きバックアップ、自動スクリプトバックアップ、バックアップメソッドをカバーし、バックアップファイル管理のベストプラクティスを提供します。マニュアルバックアップ:MongoDumpコマンドを使用して、マニュアルフルバックアップを実行します。たとえば、Mongodump-Hlocalhost:27017-U Username-P Password-Dデータベース名-O/バックアップディレクトリこのコマンドは、指定されたデータベースのデータとメタデータを指定されたバックアップディレクトリにエクスポートします。

MongoDBコマンドを設定する方法 MongoDBコマンドを設定する方法 Apr 12, 2025 am 09:24 AM

MongoDBデータベースをセットアップするには、コマンドライン(使用およびdb.createcollection())またはMongoシェル(Mongo、Use、DB.CreateCollection())を使用できます。その他の設定オプションには、データベースの表示(DBSの表示)、コレクションの表示(コレクションの表示)、データベースの削除(db.dropdatabase())、db。& collection_name& gt; drop())、挿入文書(db; lt; lt; lt; collection

Debian Mongodbでデータを暗号化する方法 Debian Mongodbでデータを暗号化する方法 Apr 12, 2025 pm 08:03 PM

DebianシステムでMongoDBデータベースを暗号化するには、次の手順に従う必要があります。ステップ1:MongoDBのインストール最初に、DebianシステムがMongoDBをインストールしていることを確認してください。そうでない場合は、インストールについては公式のMongoDBドキュメントを参照してください:https://docs.mongodb.com/manual/tutorial/install-mongodb-onedbian/-step 2:暗号化キーファイルを作成し、暗号化キーを含むファイルを作成し、正しい許可を設定します。

Mongodbの力:現代のデータ管理 Mongodbの力:現代のデータ管理 Apr 13, 2025 am 12:04 AM

MongoDBは、柔軟性とスケーラビリティが最新のデータ管理において非常に重要であるため、NOSQLデータベースです。ドキュメントストレージを使用し、大規模で可変デー​​タの処理に適しており、強力なクエリとインデックスの機能を提供します。

Mongodbにトランザクションがない場合はどうすればよいですか Mongodbにトランザクションがない場合はどうすればよいですか Apr 12, 2025 am 08:57 AM

MongoDBにはトランザクションメカニズムがないため、データベース操作の原子性、一貫性、分離、耐久性を保証できません。代替ソリューションには、検証およびロックメカニズム、分散トランザクションコーディネーター、およびトランザクションエンジンが含まれます。代替ソリューションを選択するときは、その複雑さ、パフォーマンス、およびデータの一貫性要件を考慮する必要があります。

Centosでgitlabデータベースを選択する方法 Centosでgitlabデータベースを選択する方法 Apr 14, 2025 pm 05:39 PM

CENTOSシステムにGitLabをインストールして構成する場合、データベースの選択が重要です。 gitlabは複数のデータベースと互換性がありますが、PostgreSQLとMySQL(またはMariaDB)が最も一般的に使用されています。この記事では、データベースの選択要因を分析し、詳細なインストールと構成の手順を提供します。データベース選択ガイドデータベースを選択する際には、次の要因を考慮する必要があります。PostGreSQL:GitLabのデフォルトデータベースは強力で、スケーラビリティが高く、複雑なクエリとトランザクション処理をサポートし、大規模なアプリケーションシナリオに適しています。 MySQL/MariadB:Webアプリケーションで広く使用されている人気のあるリレーショナルデータベース、安定した信頼性の高いパフォーマンスを備えています。 MongoDB:NOSQLデータベース、専門

Windows 8でコードを実行できます Windows 8でコードを実行できます Apr 15, 2025 pm 07:24 PM

VSコードはWindows 8で実行できますが、エクスペリエンスは大きくない場合があります。まず、システムが最新のパッチに更新されていることを確認してから、システムアーキテクチャに一致するVSコードインストールパッケージをダウンロードして、プロンプトとしてインストールします。インストール後、一部の拡張機能はWindows 8と互換性があり、代替拡張機能を探すか、仮想マシンで新しいWindowsシステムを使用する必要があることに注意してください。必要な拡張機能をインストールして、適切に動作するかどうかを確認します。 Windows 8ではVSコードは実行可能ですが、開発エクスペリエンスとセキュリティを向上させるために、新しいWindowsシステムにアップグレードすることをお勧めします。

See all articles