0Pricing
RabbitMQ Messaging & Async Systems · Ders

RabbitMQ Kullanıcıları ve İzinleri

Kaynaklara erişimi denetlemek için RabbitMQ içindeki kullanıcıları, sanal ana makineleri ve izinleri yönetin. Mesajlaşma ortamınız için ayrıntılı güvenlik politikaları uygulayın.

RabbitMQ Kullanıcıları ve İzinleri, CoddyKit'te ücretsiz bir RabbitMQ Messaging & Async Systems dersidir. Bu, 4 dersinin 1. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, RabbitMQ Messaging & Async Systems öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. RabbitMQ Messaging & Async Systems kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

Why Security Matters in RabbitMQ

In any messaging system, controlling who can send and receive messages is crucial. RabbitMQ provides robust mechanisms to manage access, ensuring only authorized users interact with your message broker.

This lesson will guide you through setting up users, virtual hosts, and permissions to secure your RabbitMQ environment.

Users: Your First Line of Defense

A user in RabbitMQ represents an application or person connecting to the broker. Each user has a username and password for authentication.

By default, RabbitMQ creates a 'guest' user, but it's best practice to create dedicated users for your applications.

To create a new user, you use the rabbitmqctl command:

rabbitmqctl add_user my_app_user strong_password

Virtual Hosts (Vhosts) for Isolation

Virtual hosts (or vhosts) act like separate, isolated RabbitMQ brokers within a single instance. They provide logical grouping and resource separation for different applications or environments.

  • Each vhost has its own exchanges, queues, and bindings.
  • Users are granted permissions to specific vhosts.

To create a vhost:

rabbitmqctl add_vhost /my_application_vhost

The Three Pillars of Permissions

Once you have users and vhosts, you need to define what each user can do within a specific vhost. RabbitMQ permissions are categorized into three types:

  • Configure: For creating, deleting, and altering exchanges and queues.
  • Write: For sending (publishing) messages to exchanges.
  • Read: For receiving (consuming) messages from queues.

Configure Permissions: Managing Resources

The configure permission allows a user to manage RabbitMQ resources like exchanges and queues. If a user needs to declare (create) or delete queues and exchanges, they need this permission.

The permission regex applies to the names of the resources.

rabbitmqctl set_permissions \
  -p /my_vhost \
  my_app_user \
  "^my_queue.*" \
  ".*" \
  ".*"

Write Permissions: Sending Messages

The write permission allows a user to publish messages to exchanges within a vhost. Without this, a producer application cannot send messages.

The regex in the second position defines which exchanges the user can write to.

rabbitmqctl set_permissions \
  -p /my_vhost \
  my_app_user \
  ".*" \
  "^my_exchange.*" \
  ".*"

Read Permissions: Receiving Messages

The read permission allows a user to consume messages from queues within a vhost. This is essential for consumer applications to receive messages.

The regex in the third position defines which queues the user can read from.

rabbitmqctl set_permissions \
  -p /my_vhost \
  my_app_user \
  ".*" \
  ".*" \
  "^my_queue.*"

Granting Full Access to a Vhost

Often, an application user needs full control over their dedicated vhost. You can grant all three permissions (configure, write, read) to a user for all resources in a vhost using the ".*" regex for all three permission types.

This means 'match any resource name'.

rabbitmqctl set_permissions \
  -p /my_vhost \
  my_app_user \
  ".*" \
  ".*" \
  ".*"

The Special 'Guest' User

RabbitMQ comes with a default user named guest with password guest. This user has full administrative permissions over all vhosts.

  • Crucially: The 'guest' user can only connect from localhost by default.
  • For production environments, it is highly recommended to delete this user or change its password and restrict its access, and create specific users with minimal necessary permissions.

Permission Check

A new application needs to connect to RabbitMQ, declare a queue named 'tasks_queue', and then consume messages from it. Which set of permissions does its user need on the /app_vhost?

Recap: Users, Vhosts & Permissions

You've learned how to secure your RabbitMQ instance by managing user access. Here's a quick summary:

  • Users authenticate client applications.
  • Virtual Hosts (Vhosts) provide isolated environments.
  • Permissions (Configure, Write, Read) control what users can do within a vhost.
  • Always use specific users and minimal permissions, especially for production.

Next, we'll explore how to encrypt these connections with SSL/TLS!

Sıkça Sorulan Sorular

“RabbitMQ Kullanıcıları ve İzinleri” dersi ücretsiz mi?

Evet — “RabbitMQ Kullanıcıları ve İzinleri” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve RabbitMQ Messaging & Async Systems kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. RabbitMQ Messaging & Async Systems kursu toplamda 4 dersten oluşur.

“RabbitMQ Kullanıcıları ve İzinleri” dersinde ne öğreneceğim?

Kaynaklara erişimi denetlemek için RabbitMQ içindeki kullanıcıları, sanal ana makineleri ve izinleri yönetin. Mesajlaşma ortamınız için ayrıntılı güvenlik politikaları uygulayın. RabbitMQ Messaging & Async Systems ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

RabbitMQ Messaging & Async Systems öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te RabbitMQ Messaging & Async Systems, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 1. dersidir.

“RabbitMQ Kullanıcıları ve İzinleri” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu RabbitMQ Messaging & Async Systems dersinde kod yazıp çalıştırabilir miyim?

Evet. Her RabbitMQ Messaging & Async Systems dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. RabbitMQ Kullanıcıları ve İzinleri
  2. Güvenli Bağlantılar için SSL/TLS
  3. RabbitMQ Yönetim Eklentisi ve Ölçümleri
  4. Çok Kiracılı Yalıtım için Sanal Konaklar
← RabbitMQ Messaging & Async Systems Sayfasına Dön