PHPackages                             tourze/wechat-work-security-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tourze/wechat-work-security-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

tourze/wechat-work-security-bundle
==================================

企业微信安全管理功能包，包含文件防泄漏、成员操作记录、截屏录屏管理、设备信息管理等功能

0.0.1(11mo ago)00MITPHPPHP ^8.1CI failing

Since Jun 3Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/tourze/wechat-work-security-bundle)[ Packagist](https://packagist.org/packages/tourze/wechat-work-security-bundle)[ RSS](/packages/tourze-wechat-work-security-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (20)Versions (2)Used By (0)

WeChat Work Security Bundle
===========================

[](#wechat-work-security-bundle)

[English](README.md) | [中文](README.zh-CN.md)

[![Latest Version](https://camo.githubusercontent.com/139c2eee68c4e95336f9d1cd678436c703e1fc283f6240cee5cc9d079384aaa8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746f75727a652f7765636861742d776f726b2d73656375726974792d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/wechat-work-security-bundle)[![PHP Version](https://camo.githubusercontent.com/9acd1be849c075470078101ba81ce895d65b940b8325f74e2adc9a5af1d817a6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f746f75727a652f7765636861742d776f726b2d73656375726974792d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/wechat-work-security-bundle)[![License](https://camo.githubusercontent.com/6697039aae5c52aa6104352f773120fe4c31b282aa33efba03654281382e6c55/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f746f75727a652f7765636861742d776f726b2d73656375726974792d62756e646c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/tourze/wechat-work-security-bundle)[![Build Status](https://camo.githubusercontent.com/835838d57e8050aec0b037cecfbbfa6b24bfddeed6d6421f3f242292421b733d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f746f75727a652f6d6f6e6f7265706f2f63692e796d6c3f6272616e63683d6d61696e267374796c653d666c61742d737175617265)](https://github.com/tourze/monorepo/actions)[![Coverage Status](https://camo.githubusercontent.com/ac8c8ca24a23c6a1e2dd761d3344a076bc41eb5f40877e97238f4ee77d209037/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f746f75727a652f6d6f6e6f7265706f3f7374796c653d666c61742d737175617265)](https://codecov.io/gh/tourze/monorepo)

A Symfony bundle for WeChat Work (Enterprise WeChat) security management, providing comprehensive security monitoring and control features.

Table of Contents
-----------------

[](#table-of-contents)

- [Features](#features)
- [Installation](#installation)
- [Quick Start](#quick-start)
    - [Configuration](#configuration)
    - [Available Commands](#available-commands)
    - [Scheduled Execution](#scheduled-execution)
- [Advanced Usage](#advanced-usage)
    - [Custom Command Configuration](#custom-command-configuration)
    - [Entity Customization](#entity-customization)
    - [Event Listeners](#event-listeners)
    - [API Integration](#api-integration)
- [Configuration Options](#configuration-options)
    - [Database Configuration](#database-configuration)
    - [Cron Configuration](#cron-configuration)
- [Entities](#entities)
- [Requirements](#requirements)
- [Dependencies](#dependencies)
- [Contributing](#contributing)
- [License](#license)

Features
--------

[](#features)

- **File Operation Monitoring**: Track file operations to prevent data leakage
- **Member Operation Recording**: Monitor member activities within WeChat Work
- **Screen Capture Management**: Track screen capture and recording operations
- **Device Trust Management**: Manage and monitor trusted devices

Installation
------------

[](#installation)

```
composer require tourze/wechat-work-security-bundle
```

Quick Start
-----------

[](#quick-start)

### Configuration

[](#configuration)

Configure the bundle in your Symfony application:

```
# config/packages/wechat_work_security.yaml
services:
    _defaults:
        autowire: true
        autoconfigure: true

    WechatWorkSecurityBundle\:
        resource: '../vendor/tourze/wechat-work-security-bundle/src/'
        exclude:
            - '../vendor/tourze/wechat-work-security-bundle/src/Entity/'
```

Available Commands
------------------

[](#available-commands)

### 1. File Operation Record Command

[](#1-file-operation-record-command)

Track file operations to prevent data leakage:

```
php bin/console wechat-work:file-operate-record [--startTime=] [--endTime=]
```

**Options:**

- `--startTime`: Start time for records (default: beginning of yesterday)
- `--endTime`: End time for records (default: end of yesterday)

**Limitations:**

- Time range cannot exceed 14 days
- End time must be greater than start time

### 2. Member Operation Record Command

[](#2-member-operation-record-command)

Get member operation records:

```
php bin/console wechat-work:member-operate-record [--startTime=] [--endTime=]
```

**Options:**

- `--startTime`: Start time for records (default: beginning of yesterday)
- `--endTime`: End time for records (default: end of yesterday)

**Limitations:**

- Start time cannot be earlier than 180 days ago
- End time must be greater than start time and less than current time
- Time range cannot exceed 7 days

### 3. Screen Operation Record Command

[](#3-screen-operation-record-command)

Monitor screen capture and recording operations:

```
php bin/console wechat-work:screen-operate-record [--startTime=] [--endTime=]
```

**Options:**

- `--startTime`: Start time for records (default: beginning of yesterday)
- `--endTime`: End time for records (default: end of yesterday)

**Limitations:**

- Time range cannot exceed 14 days
- End time must be greater than start time

### 4. Trust Device Command

[](#4-trust-device-command)

Get information about trusted devices:

```
php bin/console wechat-work:trust-device
```

This command fetches information about all types of trusted devices (type 1, 2, and 3), including:

- MAC addresses
- Motherboard UUID
- Hard disk UUID
- Last login information
- Approval and confirmation status

### Scheduled Execution

[](#scheduled-execution)

All commands can be configured as scheduled tasks using cron expressions. Each command has a commented `AsCronTask` attribute that can be enabled for automatic execution.

Example crontab entry for daily execution:

```
0 1 * * * cd /path/to/app && php bin/console wechat-work:file-operate-record
0 2 * * * cd /path/to/app && php bin/console wechat-work:member-operate-record
0 3 * * * cd /path/to/app && php bin/console wechat-work:screen-operate-record
0 4 * * * cd /path/to/app && php bin/console wechat-work:trust-device
```

Advanced Usage
--------------

[](#advanced-usage)

### Custom Command Configuration

[](#custom-command-configuration)

You can customize command behavior by extending the provided commands:

```
use WechatWorkSecurityBundle\Command\FileOperateRecordCommand;

class CustomFileOperateRecordCommand extends FileOperateRecordCommand
{
    protected function configure(): void
    {
        parent::configure();
        $this->setName('custom:file-operate-record');
    }
}
```

### Entity Customization

[](#entity-customization)

Extend entities to add custom fields:

```
use WechatWorkSecurityBundle\Entity\FileOperateRecord;

class CustomFileOperateRecord extends FileOperateRecord
{
    private string $customField;

    public function getCustomField(): string
    {
        return $this->customField;
    }
}
```

### Event Listeners

[](#event-listeners)

Listen to security events:

```
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

class SecurityEventSubscriber implements EventSubscriberInterface
{
    public static function getSubscribedEvents(): array
    {
        return [
            'wechat_work.file_operation' => 'onFileOperation',
        ];
    }
}
```

### API Integration

[](#api-integration)

Integrate with WeChat Work API directly:

```
use WechatWorkBundle\Service\WorkService;

class CustomSecurityService
{
    public function __construct(private WorkService $workService)
    {
    }

    public function getCustomSecurityData(): array
    {
        return $this->workService->request(/* custom request */);
    }
}
```

Configuration Options
---------------------

[](#configuration-options)

### Database Configuration

[](#database-configuration)

Ensure your database supports UTF-8 encoding:

```
doctrine:
    dbal:
        charset: utf8mb4
        default_table_options:
            charset: utf8mb4
            collate: utf8mb4_unicode_ci
```

### Cron Configuration

[](#cron-configuration)

For production environments, configure cron jobs:

```
# Edit crontab
crontab -e

# Add these lines
0 1 * * * cd /path/to/app && php bin/console wechat-work:file-operate-record
0 2 * * * cd /path/to/app && php bin/console wechat-work:member-operate-record
0 3 * * * cd /path/to/app && php bin/console wechat-work:screen-operate-record
0 4 * * * cd /path/to/app && php bin/console wechat-work:trust-device
```

Entities
--------

[](#entities)

The bundle provides the following entities to store security-related data:

- `FileOperateRecord`: Stores file operation records
- `MemberOperateRecord`: Stores member operation records
- `ScreenOperateRecord`: Stores screen capture/recording records
- `TrustDevice`: Stores trusted device information

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Symfony 6.4 or higher
- WeChat Work Bundle (`tourze/wechat-work-bundle`)
- Doctrine ORM 3.0 or higher

Dependencies
------------

[](#dependencies)

This bundle depends on:

- `tourze/wechat-work-bundle`: For WeChat Work API integration
- `tourze/bundle-dependency`: For managing bundle dependencies
- `tourze/doctrine-timestamp-bundle`: For automatic timestamp management
- `tourze/enum-extra`: For enhanced enum support
- `tourze/http-client-bundle`: For HTTP client functionality

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance68

Regular maintenance activity

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

339d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e354fdb316da535dfa8ba2e9193a473c403b6bc6fb9170778d1dc50e304c6e9d?d=identicon)[tourze](/maintainers/tourze)

---

Top Contributors

[![tourze](https://avatars.githubusercontent.com/u/13899502?v=4)](https://github.com/tourze "tourze (3 commits)")

---

Tags

wechat

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tourze-wechat-work-security-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/tourze-wechat-work-security-bundle/health.svg)](https://phpackages.com/packages/tourze-wechat-work-security-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M647](/packages/sylius-sylius)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.3k](/packages/contao-core-bundle)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
