Skip to content

Commit b868273

Browse files
committed
feat(enterprise): add enterprise policy file support
Add support for organization-wide Claude Code configuration deployment at the Enterprise Policy tier, which has the highest priority in the memory hierarchy. Changes: - Add enterprise/ directory with CLAUDE.md and rules/ templates - Update install.sh with options 4 (Enterprise only) and 5 (All) - Update backup.sh with Enterprise backup capability - Update sync.sh with Enterprise sync capability - Add OS-specific path detection (macOS, Linux, Windows) - Handle sudo permissions for system directories - Update README.md and README.ko.md with Enterprise documentation Closes #64
1 parent 7973579 commit b868273

8 files changed

Lines changed: 540 additions & 9 deletions

File tree

README.ko.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ claude --plugin-dir ./plugin
107107

108108
```
109109
claude_config_backup/
110+
├── enterprise/ # Enterprise 설정 (시스템 전체)
111+
│ ├── CLAUDE.md # 조직 전체 정책
112+
│ └── rules/ # Enterprise 규칙
113+
│ ├── security.md # 보안 규칙 템플릿
114+
│ └── compliance.md # 컴플라이언스 규칙 템플릿
115+
110116
├── global/ # 글로벌 설정 백업 (~/.claude/)
111117
│ ├── CLAUDE.md # 메인 설정 파일
112118
│ ├── settings.json # Hook 설정 (보안, 세션, UserPromptSubmit, Stop)
@@ -223,6 +229,52 @@ claude_config_backup/
223229

224230
---
225231

232+
## Enterprise 설정
233+
234+
Enterprise 설정은 조직의 모든 개발자에게 적용되는 조직 전체 정책을 제공합니다. Claude Code의 메모리 계층에서 **가장 높은 우선순위**를 가집니다.
235+
236+
### 메모리 계층
237+
238+
| 레벨 | 위치 | 범위 | 우선순위 |
239+
|------|------|------|----------|
240+
| **Enterprise Policy** | 시스템 전체 | 조직 | **최고** |
241+
| Project Memory | `./CLAUDE.md` || 높음 |
242+
| Project Rules | `./.claude/rules/*.md` || 높음 |
243+
| User Memory | `~/.claude/CLAUDE.md` | 개인 | 중간 |
244+
| Project Local | `./CLAUDE.local.md` | 개인 | 낮음 |
245+
246+
### OS별 Enterprise 경로
247+
248+
| OS | 경로 |
249+
|----|------|
250+
| **macOS** | `/Library/Application Support/ClaudeCode/CLAUDE.md` |
251+
| **Linux** | `/etc/claude-code/CLAUDE.md` |
252+
| **Windows** | `C:\Program Files\ClaudeCode\CLAUDE.md` |
253+
254+
### Enterprise 설정 설치
255+
256+
```bash
257+
./scripts/install.sh
258+
259+
# 옵션 선택:
260+
# 4) Enterprise 설정만 설치 (관리자 권한 필요)
261+
# 5) 전체 설치 (Enterprise + Global + Project)
262+
```
263+
264+
**참고**: Enterprise 설치는 관리자 권한이 필요합니다 (macOS/Linux에서 `sudo`).
265+
266+
### Enterprise 템플릿 내용
267+
268+
기본 enterprise 템플릿에는 다음이 포함됩니다:
269+
- **보안 요구사항**: 커밋 서명, 비밀 정보 보호, 접근 제어
270+
- **컴플라이언스**: 데이터 처리, 감사 요구사항, 규정 준수
271+
- **승인된 도구**: 패키지 레지스트리, 컨테이너 이미지, 의존성
272+
- **코드 표준**: 품질 게이트, 리뷰 요구사항, 브랜치 보호
273+
274+
배포 전에 조직의 정책에 맞게 `enterprise/CLAUDE.md`를 커스터마이즈하세요.
275+
276+
---
277+
226278
## 글로벌 명령어
227279

228280
글로벌 명령어는 `~/.claude/commands/`에 설치되어 모든 프로젝트에서 사용 가능합니다.

README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ See [plugin/README.md](plugin/README.md) for more details.
107107

108108
```
109109
claude_config_backup/
110+
├── enterprise/ # Enterprise settings (system-wide)
111+
│ ├── CLAUDE.md # Organization-wide policies
112+
│ └── rules/ # Enterprise rules
113+
│ ├── security.md # Security rules template
114+
│ └── compliance.md # Compliance rules template
115+
110116
├── global/ # Global settings backup (~/.claude/)
111117
│ ├── CLAUDE.md # Main configuration file
112118
│ ├── settings.json # Hook settings (security, session, UserPromptSubmit, Stop)
@@ -262,6 +268,52 @@ For detailed configuration, see [HOOKS.md](HOOKS.md).
262268

263269
---
264270

271+
## Enterprise Settings
272+
273+
Enterprise settings provide organization-wide policies that apply to all developers in your organization. These have the **highest priority** in Claude Code's memory hierarchy.
274+
275+
### Memory Hierarchy
276+
277+
| Level | Location | Scope | Priority |
278+
|-------|----------|-------|----------|
279+
| **Enterprise Policy** | System-wide | Organization | **Highest** |
280+
| Project Memory | `./CLAUDE.md` | Team | High |
281+
| Project Rules | `./.claude/rules/*.md` | Team | High |
282+
| User Memory | `~/.claude/CLAUDE.md` | Personal | Medium |
283+
| Project Local | `./CLAUDE.local.md` | Personal | Low |
284+
285+
### Enterprise Paths by OS
286+
287+
| OS | Path |
288+
|----|------|
289+
| **macOS** | `/Library/Application Support/ClaudeCode/CLAUDE.md` |
290+
| **Linux** | `/etc/claude-code/CLAUDE.md` |
291+
| **Windows** | `C:\Program Files\ClaudeCode\CLAUDE.md` |
292+
293+
### Installing Enterprise Settings
294+
295+
```bash
296+
./scripts/install.sh
297+
298+
# Select option:
299+
# 4) Enterprise settings only (admin required)
300+
# 5) All (Enterprise + Global + Project)
301+
```
302+
303+
**Note**: Enterprise installation requires administrator privileges (`sudo` on macOS/Linux).
304+
305+
### Enterprise Template Contents
306+
307+
The default enterprise template includes:
308+
- **Security Requirements**: Commit signing, secret protection, access control
309+
- **Compliance**: Data handling, audit requirements, regulatory compliance
310+
- **Approved Tools**: Package registries, container images, dependencies
311+
- **Code Standards**: Quality gates, review requirements, branch protection
312+
313+
Customize `enterprise/CLAUDE.md` according to your organization's policies before deployment.
314+
315+
---
316+
265317
## Rules
266318

267319
Rules are modular configuration files in `.claude/rules/` that are conditionally loaded based on file paths.

enterprise/CLAUDE.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Organization Policy
2+
3+
This is the enterprise-level Claude Code configuration that applies to all users
4+
in the organization. Settings here have the highest priority in the memory hierarchy.
5+
6+
> **Note**: This file should be placed in the system-wide location:
7+
> - **macOS**: `/Library/Application Support/ClaudeCode/CLAUDE.md`
8+
> - **Linux**: `/etc/claude-code/CLAUDE.md`
9+
> - **Windows**: `C:\Program Files\ClaudeCode\CLAUDE.md`
10+
11+
## Security Requirements
12+
13+
### Code Security
14+
- All commits must be signed with GPG keys
15+
- No secrets, API keys, or credentials in source code
16+
- Use environment variables or secret management tools for sensitive data
17+
- Required: security review for authentication-related changes
18+
19+
### Access Control
20+
- Follow principle of least privilege
21+
- Document all permission requirements
22+
- Regular access audits required
23+
24+
## Compliance
25+
26+
### Data Handling
27+
- Follow organization's data classification policy
28+
- GDPR compliance for personal data
29+
- Audit logging for sensitive operations
30+
- Data retention policies must be followed
31+
32+
### Documentation
33+
- All public APIs must be documented
34+
- Security-relevant decisions require ADR (Architecture Decision Records)
35+
- Change logs must be maintained
36+
37+
## Approved Tools and Libraries
38+
39+
### Package Management
40+
- Use only approved package registries
41+
- All dependencies must pass security scanning
42+
- Version pinning required for production dependencies
43+
44+
### Container Images
45+
- Docker images must be from approved registry
46+
- Base images must be scanned and approved
47+
- No `latest` tags in production
48+
49+
## Code Standards
50+
51+
### Quality Gates
52+
- All code must pass linting before merge
53+
- Test coverage minimum: 80%
54+
- No high/critical security vulnerabilities
55+
56+
### Review Requirements
57+
- All changes require code review
58+
- Security-sensitive changes require security team approval
59+
- Breaking changes require architecture review
60+
61+
## Communication
62+
63+
### Language Policy
64+
- Code comments: English
65+
- Documentation: English
66+
- Commit messages: English
67+
68+
## Version Control
69+
70+
### Branch Protection
71+
- Main branch is protected
72+
- Force push is prohibited
73+
- Squash merge preferred
74+
75+
### Commit Standards
76+
- Conventional commits format required
77+
- Reference issue/ticket in commits
78+
- Sign-off required
79+
80+
---
81+
82+
*This is a template. Customize according to your organization's policies.*
83+
*Last updated: 2026-01-22*

enterprise/rules/compliance.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Compliance Rules
2+
3+
Organization-wide compliance rules that apply to all projects.
4+
5+
## Data Protection
6+
7+
### Personal Data (GDPR/Privacy)
8+
- **MUST** obtain consent before collecting personal data
9+
- **MUST** provide data deletion capability
10+
- **MUST** encrypt personal data at rest and in transit
11+
- **MUST** document data processing activities
12+
13+
### Data Classification
14+
- **MUST** classify data according to organization policy
15+
- **MUST** apply appropriate controls per classification
16+
- **MUST NOT** mix data of different classification levels
17+
18+
## Audit Requirements
19+
20+
### Logging
21+
- **MUST** log all data access events
22+
- **MUST** retain logs according to retention policy
23+
- **MUST** protect logs from tampering
24+
25+
### Traceability
26+
- **MUST** maintain audit trail for sensitive operations
27+
- **MUST** link changes to authorized requests
28+
- **MUST** document security decisions
29+
30+
## Regulatory Compliance
31+
32+
### Industry Standards
33+
- **MUST** follow applicable industry standards (SOC2, ISO27001, etc.)
34+
- **MUST** document compliance status
35+
- **MUST** address compliance gaps timely
36+
37+
### Legal Requirements
38+
- **MUST** comply with applicable laws and regulations
39+
- **MUST** consult legal team for uncertain cases
40+
- **MUST** document legal decisions
41+
42+
## Third-Party Risk
43+
44+
### Vendor Assessment
45+
- **MUST** assess third-party security before integration
46+
- **MUST** document third-party data flows
47+
- **MUST** review third-party agreements for compliance
48+
49+
---
50+
51+
*Customize these rules according to your organization's compliance requirements.*

enterprise/rules/security.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Security Rules
2+
3+
Organization-wide security rules that apply to all projects.
4+
5+
## Input Validation
6+
7+
- **MUST** validate all external input
8+
- **MUST** sanitize data before database queries
9+
- **MUST** encode output to prevent XSS
10+
11+
## Authentication
12+
13+
- **MUST** use organization-approved authentication methods
14+
- **MUST NOT** store passwords in plain text
15+
- **MUST** implement rate limiting on auth endpoints
16+
17+
## Secrets Management
18+
19+
- **MUST NOT** commit secrets to version control
20+
- **MUST** use approved secret management tools
21+
- **MUST** rotate secrets according to policy
22+
23+
## Dependencies
24+
25+
- **MUST** scan dependencies for vulnerabilities
26+
- **MUST** keep dependencies updated
27+
- **MUST NOT** use deprecated packages with known vulnerabilities
28+
29+
## Logging
30+
31+
- **MUST** log security-relevant events
32+
- **MUST NOT** log sensitive data (passwords, tokens, PII)
33+
- **MUST** use structured logging format
34+
35+
---
36+
37+
*Customize these rules according to your organization's security policy.*

0 commit comments

Comments
 (0)