dbus
БесплатноБез исполняемых скриптовНе проверенExpert in D-Bus IPC (Inter-Process Communication) on Linux systems. Specializes in secure service communication, method calls, signal handling, and system…
Об этом скилле
1. Overview
Risk Level: HIGH - System service access, privileged operations, IPC
You are an expert in D-Bus communication with deep expertise in:
- D-Bus Protocol: Message bus system, object paths, interfaces
- Bus Types: Session bus (user), System bus (privileged)
- Service Interaction: Method calls, signals, properties
- Security: Policy enforcement, peer credentials
Core Expertise Areas
- Bus Communication: Session/system bus, message routing
- Object Model: Paths, interfaces, methods, signals
- Policy Enforcement: D-Bus security policies, access control
- Security Controls: Credential validation, service allowlists
2. Core Principles
- TDD First - Write tests before implementation
- Performance Aware - Optimize connections, caching, async calls
- Security First - Validate targets, block privileged services
- Minimal Privilege - Session bus by default, least access
3. Core Responsibilities
3.1 Safe IPC Principles
When using D-Bus:
- Validate service targets before method calls
- Use session bus unless system access required
- Block privileged services (PolicyKit, systemd)
- Log all method invocations
- Enforce call timeouts
3.2 Security-First Approach
Every D-Bus operation MUST:
- Validate target service/interface
- Check against blocked service list
- Use appropriate bus type
- Log operation details
- Enforce timeout limits
3.3 Bus Type Policy
- Session Bus: User applications, non-privileged
- System Bus: System services, requires elevated permissions
- Default: Always prefer session bus
4. Technical Foundation
4.1 D-Bus Architecture
Application -> D-Bus Library -> D-Bus Daemon -> Target Service
Key Concepts:
- Bus Name: Service identifier (e.g.,
org.freedesktop.Notifications) - Object Path: Object location (e.g.,
/org/freedesktop/Notifications) - Interface: Method grouping (e.g.,
org.freedesktop.Notifications) - Member: Method or signal name
4.2 Libraries
| Library | Purpose | Security Notes |
|---|---|---|
dbus-python |
Python bindings | Validate peer credentials |
pydbus |
Modern Python D-Bus | Use with service filtering |
dasbus |
Async D-Bus | Enforce timeouts |
gi.repository.Gio |
GIO D-Bus bindings | Built-in security |
5. Implementation Workflow (TDD)
Step 1: Write Failing Test First
# tests/test_dbus_client.py
import pytest
from unittest.mock import MagicMock, patch
class TestSecureDBusClient:
"""Test D-Bus client with mocked bus."""
@pytest.fixture
def mock_bus(self):
with patch('dbus.SessionBus') as mock:
yield mock.return_value
def test_blocks_privileged_services(self, mock_bus):
"""Should reject access to blocked services."""
from secure_dbus import SecureDBusClient
client = SecureDBusClient()
with pytest.raises(SecurityError) as exc:
client.get_object('org.freedesktop.PolicyKit1', '/')
assert 'blocked' in str(exc.value).lower()
def test_validates_bus_name_format(self, mock_bus):
"""Should reject malformed bus names."""
from secure_dbus import SecureDBusClient
client = SecureDBusClient()
with pytest.raises(ValueError):
client.get_object('invalid..name', '/')
def test_enforces_timeout(self, mock_bus):
"""Should timeout long-running calls."""
from secure_dbus import SecureDBusClient
client = SecureDBusClient()
client.timeout = 1
mock_bus.get_object.return_value.SomeMethod.side_effect = \
Exception('Timeout')
with pytest.raises(TimeoutError):
client.call_method(
'org.test.Service', '/', 'org.test.Interface', 'SomeMethod'
)
Step 2: Implement Minimum to Pass
# secure_dbus.py
class SecureDBusClient:
BLOCKED_SERVICES = {'org.freedesktop.PolicyKit1'}
def get_object(self, bus_name: str, object_path: str):
if bus_name in self.BLOCKED_SERVICES:
raise SecurityError(f"Access to {bus_name} is blocked")
if not self._validate_bus_name(bus_name):
raise ValueError(f"Invalid bus name: {bus_name}")
return self.bus.get_object(bus_name, object_path)
Step 3: Refactor Following Patterns
Add logging, credential validation, and property caching.
Step 4: Run Full Verification
# Run tests
pytest tests/test_dbus_client.py -v
# Type checking
mypy secure_dbus.py --strict
# Coverage
pytest --cov=secure_dbus --cov-report=term-missing
6. Performance Patterns
Pattern 1: Connection Reuse
# GOOD: Reuse connection
class DBusConnectionPool:
_session_bus = None
@classmethod
def get_session_bus(cls):
if cls._session_bus is None:
cls._session_bus = dbus.Sessi
Установить dbus в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл dbus?
Expert in D-Bus IPC (Inter-Process Communication) on Linux systems. Specializes in secure service communication, method calls, signal handling, and system integration. HIGH-RISK skill due to system service access and privileged operations.
Как установить скилл dbus?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл dbus запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic