|
| 1 | +# Security Controls & Protections |
| 2 | + |
| 3 | +This document outlines the security controls, validations, and protections configured for the `intune-baseline` repository to ensure policy integrity, quality, and compliance. |
| 4 | + |
| 5 | +## Table of Contents |
| 6 | + |
| 7 | +- [Repository Overview](#repository-overview) |
| 8 | +- [Automated Workflows](#automated-workflows) |
| 9 | +- [Validation Controls](#validation-controls) |
| 10 | +- [Documentation Standards](#documentation-standards) |
| 11 | +- [File Security](#file-security) |
| 12 | +- [Release Management](#release-management) |
| 13 | +- [Permissions Model](#permissions-model) |
| 14 | + |
| 15 | +--- |
| 16 | + |
| 17 | +## Repository Overview |
| 18 | + |
| 19 | +The `intune-baseline` repository contains Nerdio's recommended Microsoft Intune configurations for both Windows and macOS devices. All configurations are version-controlled and subject to automated validation before integration. |
| 20 | + |
| 21 | +**Repository Structure:** |
| 22 | + |
| 23 | +- `windows/` - Windows-specific Intune policies |
| 24 | +- `macos/` - macOS-specific Intune policies |
| 25 | +- `.github/workflows/` - Automated CI/CD workflows |
| 26 | + |
| 27 | +--- |
| 28 | + |
| 29 | +## Automated Workflows |
| 30 | + |
| 31 | +The repository implements three automated GitHub Actions workflows to maintain security, quality, and consistency. |
| 32 | + |
| 33 | +### 1. JSON Validation Workflow |
| 34 | + |
| 35 | +**File:** [.github/workflows/validate-json.yml](.github/workflows/validate-json.yml) |
| 36 | + |
| 37 | +**Trigger Conditions:** |
| 38 | +- Pull requests modifying `windows/**/*.json` |
| 39 | +- Pull requests modifying `macos/**/*.json` |
| 40 | +- Manual workflow dispatch |
| 41 | + |
| 42 | +**Permissions:** |
| 43 | +- `contents: read` - Read-only access to repository code |
| 44 | +- `pull-requests: read` - Read access to pull request metadata |
| 45 | + |
| 46 | +**Validation Checks:** |
| 47 | + |
| 48 | +1. **File Encoding Verification** |
| 49 | + - Tests JSON files with multiple encoding attempts (UTF-8, UTF-8 with BOM, UTF-16 LE) |
| 50 | + - Ensures cross-platform compatibility |
| 51 | + - Prevents encoding-related parsing failures |
| 52 | + |
| 53 | +2. **JSON Structure Validation** |
| 54 | + - Verifies all JSON files are well-formed |
| 55 | + - Catches syntax errors before merge |
| 56 | + |
| 57 | +3. **Description Property Enforcement** |
| 58 | + - Ensures all policy files contain a `description` property |
| 59 | + - Validates description is not null |
| 60 | + - Prevents carriage return (CR) and line feed (LF) characters in descriptions |
| 61 | + - Maintains documentation consistency |
| 62 | + |
| 63 | +**Failure Handling:** |
| 64 | +- Blocks pull request merge if validation fails |
| 65 | +- Provides detailed error reporting in GitHub job summary |
| 66 | +- Lists all failed files with specific failure reasons |
| 67 | + |
| 68 | +**Security Benefits:** |
| 69 | + |
| 70 | +- ✅ Prevents malformed configurations from entering the main branch |
| 71 | +- ✅ Ensures all policies are properly documented |
| 72 | +- ✅ Maintains consistent metadata standards |
| 73 | +- ✅ Catches encoding issues that could cause deployment failures |
| 74 | + |
| 75 | +### 2. Documentation Update Workflow |
| 76 | + |
| 77 | +**File:** [.github/workflows/update-md.yml](.github/workflows/update-md.yml) |
| 78 | + |
| 79 | +**Trigger Conditions:** |
| 80 | + |
| 81 | +- Push to `main` branch |
| 82 | +- Changes to `windows/**` or `macos/**` directories |
| 83 | +- Manual workflow dispatch |
| 84 | + |
| 85 | +**Permissions:** |
| 86 | + |
| 87 | +- `contents: write` - Allows automated documentation commits |
| 88 | + |
| 89 | +**Functionality:** |
| 90 | + |
| 91 | +- Automatically generates `README.md` files in each policy subdirectory |
| 92 | +- Extracts policy names and descriptions from JSON files |
| 93 | +- Creates formatted markdown tables using MarkdownPS PowerShell module |
| 94 | +- Commits changes automatically with proper attribution |
| 95 | + |
| 96 | +**Commit Attribution:** |
| 97 | + |
| 98 | +``` |
| 99 | +Commit User: github-actions |
| 100 | +Email: github-actions@users.noreply.github.com |
| 101 | +Message: "Update POLICIES.md" |
| 102 | +``` |
| 103 | + |
| 104 | +**Security Benefits:** |
| 105 | + |
| 106 | +- ✅ Ensures documentation stays synchronized with actual policies |
| 107 | +- ✅ Eliminates manual documentation drift |
| 108 | +- ✅ Provides audit trail of documentation updates |
| 109 | +- ✅ Uses dedicated service account for automated commits |
| 110 | + |
| 111 | +### 3. Release Management Workflow |
| 112 | + |
| 113 | +**File:** [.github/workflows/new-release.yml](.github/workflows/new-release.yml) |
| 114 | + |
| 115 | +**Trigger Conditions:** |
| 116 | + |
| 117 | +- Manual workflow dispatch only (controlled release process) |
| 118 | + |
| 119 | +**Permissions:** |
| 120 | + |
| 121 | +- `contents: write` - Create tags and releases |
| 122 | + |
| 123 | +**Release Process:** |
| 124 | + |
| 125 | +1. Generates version tag based on date format: `v{YY.MM.DD}.{RUN_NUMBER}` |
| 126 | +2. Creates compressed archive of policy directories |
| 127 | +3. Creates and pushes Git tag |
| 128 | +4. Creates GitHub release with attached policy archive |
| 129 | + |
| 130 | +**Security Benefits:** |
| 131 | + |
| 132 | +- ✅ Manual trigger prevents accidental releases |
| 133 | +- ✅ Semantic versioning based on date |
| 134 | +- ✅ Immutable release artifacts |
| 135 | +- ✅ Audit trail of all releases |
| 136 | +- ✅ Uses GitHub's secure token authentication |
| 137 | + |
| 138 | +--- |
| 139 | + |
| 140 | +## Validation Controls |
| 141 | + |
| 142 | +### JSON File Validation |
| 143 | + |
| 144 | +The repository enforces strict JSON validation on all policy files: |
| 145 | + |
| 146 | +| Validation Check | Purpose | Failure Impact | |
| 147 | +|-----------------|---------|----------------| |
| 148 | +| **Encoding Detection** | Ensures files use UTF-8, UTF-8-BOM, or UTF-16 LE | ⛔ Blocks PR merge | |
| 149 | +| **JSON Syntax** | Validates well-formed JSON structure | ⛔ Blocks PR merge | |
| 150 | +| **Description Property** | Ensures `description` field exists | ⛔ Blocks PR merge | |
| 151 | +| **Description Not Null** | Validates description has content | ⛔ Blocks PR merge | |
| 152 | +| **No CR/LF in Description** | Prevents line breaks in descriptions | ⛔ Blocks PR merge | |
| 153 | + |
| 154 | +### Validation Scope |
| 155 | + |
| 156 | +- **Applies to:** All `.json` files in `windows/` and `macos/` directories |
| 157 | +- **Execution:** Automated on every pull request |
| 158 | +- **Enforcement:** Required check before merge |
| 159 | +- **Reporting:** Detailed failure summary in GitHub Actions interface |
| 160 | + |
| 161 | +### Example Validation Output |
| 162 | + |
| 163 | +``` |
| 164 | +❌ JSON Validation Failed |
| 165 | +
|
| 166 | +The following files failed validation: |
| 167 | +
|
| 168 | + • ./windows/security/policy-example.json |
| 169 | + Reason: description property is missing |
| 170 | +
|
| 171 | + • ./macos/compliance/config.json |
| 172 | + Reason: description contains CR/LF characters |
| 173 | +``` |
| 174 | + |
| 175 | +--- |
| 176 | + |
| 177 | +## Documentation Standards |
| 178 | + |
| 179 | +### Automated Documentation Generation |
| 180 | + |
| 181 | +**Enforcement Mechanism:** GitHub Actions workflow automatically updates documentation on merge to main branch. |
| 182 | + |
| 183 | +**Documentation Structure:** |
| 184 | + |
| 185 | +Each policy subdirectory contains an auto-generated `README.md` with: |
| 186 | + |
| 187 | +1. **Header:** Directory name as H1 heading |
| 188 | +2. **Policy Table:** Markdown table with columns: |
| 189 | + - Name (from `name` or `displayName` property) |
| 190 | + - Description (from `description` property) |
| 191 | + |
| 192 | +**Example:** |
| 193 | + |
| 194 | +```markdown |
| 195 | +# windows-compliance |
| 196 | + |
| 197 | +| Name | Description | |
| 198 | +| ---- | ----------- | |
| 199 | +| Windows Compliance Baseline | Baseline compliance policy for all Windows devices | |
| 200 | +``` |
| 201 | + |
| 202 | +**Benefits:** |
| 203 | + |
| 204 | +- ✅ Self-documenting repository |
| 205 | +- ✅ Always accurate policy descriptions |
| 206 | +- ✅ Consistent formatting |
| 207 | +- ✅ Reduces manual maintenance burden |
| 208 | + |
| 209 | +--- |
| 210 | + |
| 211 | +## File Security |
| 212 | + |
| 213 | +### .gitignore Protection |
| 214 | + |
| 215 | +**File:** [.gitignore](.gitignore) |
| 216 | + |
| 217 | +The repository excludes sensitive and binary files from version control: |
| 218 | + |
| 219 | +**Protected File Types:** |
| 220 | + |
| 221 | +| Category | Extensions | Security Rationale | |
| 222 | +|----------|-----------|-------------------| |
| 223 | +| **Installers** | `.exe`, `.msi`, `.msix`, `.msp`, `.msu` | Prevents binary malware injection | |
| 224 | +| **Packages** | `.intunewin`, `.zip`, `.7z`, `.tar`, `.gz` | Avoids large binaries, potential payload hiding | |
| 225 | +| **Archives** | `.dmg`, `.iso`, `.jar`, `.rar` | Prevents repository bloat and binary storage | |
| 226 | +| **OS Files** | `.DS_Store`, `Thumbs.db`, `ehthumbs.db` | Prevents OS metadata leakage | |
| 227 | +| **Temporary** | `.tmp`, `.cache`, `._*` | Avoids temporary file pollution | |
| 228 | +| **Spotlight** | `.Spotlight-V100`, `.Trashes` | macOS system file exclusion | |
| 229 | + |
| 230 | +**Security Benefits:** |
| 231 | + |
| 232 | +- ✅ Prevents accidental commit of binary executables |
| 233 | +- ✅ Reduces attack surface for malicious file injection |
| 234 | +- ✅ Keeps repository focused on configuration files |
| 235 | +- ✅ Prevents OS-specific metadata exposure |
| 236 | + |
| 237 | +--- |
| 238 | + |
| 239 | +## Release Management |
| 240 | + |
| 241 | +### Controlled Release Process |
| 242 | + |
| 243 | +**Release Workflow:** Manual trigger only (no automated releases) |
| 244 | + |
| 245 | +**Version Format:** `v{YY.MM.DD}.{RUN_NUMBER}` |
| 246 | + |
| 247 | +- Year: 2-digit year |
| 248 | +- Month: 2-digit month |
| 249 | +- Day: 2-digit day |
| 250 | +- Run Number: GitHub Actions run number (auto-increment) |
| 251 | + |
| 252 | +**Example:** `v26.02.07.15` (February 7, 2026, 15th workflow run) |
| 253 | + |
| 254 | +**Release Artifacts:** |
| 255 | + |
| 256 | +- Compressed ZIP archive containing policy directories |
| 257 | +- Automatically attached to GitHub Release |
| 258 | +- Immutable once created |
| 259 | + |
| 260 | +**Release Security:** |
| 261 | + |
| 262 | +- ✅ Manual approval required (no auto-deployment) |
| 263 | +- ✅ Semantic versioning tracks release date |
| 264 | +- ✅ Git tags provide immutable reference points |
| 265 | +- ✅ GitHub releases provide audit trail |
| 266 | +- ✅ Credentials managed via GitHub Secrets |
| 267 | + |
| 268 | +--- |
| 269 | + |
| 270 | +## Permissions Model |
| 271 | + |
| 272 | +### Workflow Permissions (Principle of Least Privilege) |
| 273 | + |
| 274 | +| Workflow | Contents | Pull Requests | Rationale | |
| 275 | +|----------|----------|---------------|-----------| |
| 276 | +| **validate-json.yml** | `read` | `read` | Read-only validation, no modifications needed | |
| 277 | +| **update-md.yml** | `write` | - | Needs to commit documentation updates | |
| 278 | +| **new-release.yml** | `write` | - | Needs to create tags and releases | |
| 279 | + |
| 280 | +**Security Principles:** |
| 281 | + |
| 282 | +- ✅ Minimal permissions granted per workflow |
| 283 | +- ✅ No workflows have admin access |
| 284 | +- ✅ Write access limited to specific workflows |
| 285 | +- ✅ Pull request checks run with read-only access |
| 286 | + |
| 287 | +### Authentication |
| 288 | + |
| 289 | +- All workflows use `GITHUB_TOKEN` for authentication |
| 290 | +- Tokens are automatically generated and scoped per workflow run |
| 291 | +- No long-lived credentials stored in repository |
| 292 | +- Token permissions explicitly defined per workflow |
| 293 | + |
| 294 | +--- |
| 295 | + |
| 296 | +## Security Best Practices Implemented |
| 297 | + |
| 298 | +### 1. Defense in Depth |
| 299 | + |
| 300 | +- Multiple validation layers (encoding, syntax, metadata) |
| 301 | +- Automated checks plus code owner review |
| 302 | +- Prevention at pull request stage |
| 303 | + |
| 304 | +### 2. Separation of Duties |
| 305 | + |
| 306 | +- Code owners for approval |
| 307 | +- Automated workflows for validation |
| 308 | +- Manual release process |
| 309 | + |
| 310 | +### 3. Audit Trail |
| 311 | + |
| 312 | +- All changes tracked in Git history |
| 313 | +- Workflow runs logged in GitHub Actions |
| 314 | +- Release artifacts preserved |
| 315 | + |
| 316 | +### 4. Automated Enforcement |
| 317 | + |
| 318 | +- Validation runs automatically on PR |
| 319 | +- Documentation updates automatically |
| 320 | +- No manual steps to bypass controls |
| 321 | + |
| 322 | +### 5. Fail Secure |
| 323 | + |
| 324 | +- Validation failures block merges |
| 325 | +- Missing descriptions block integration |
| 326 | +- Encoding errors prevent corruption |
| 327 | + |
| 328 | +--- |
| 329 | + |
| 330 | +## Maintenance Notes |
| 331 | + |
| 332 | +### Adding New Policies |
| 333 | + |
| 334 | +When adding new policy files: |
| 335 | + |
| 336 | +1. ✅ Ensure JSON file includes `description` property |
| 337 | +2. ✅ Use single-line description (no CR/LF) |
| 338 | +3. ✅ Save file as UTF-8 encoding |
| 339 | +4. ✅ Create pull request (triggers validation) |
| 340 | +5. ✅ Wait for code owner review |
| 341 | +6. ✅ Documentation updates automatically on merge |
| 342 | + |
| 343 | +### Modifying Workflows |
| 344 | + |
| 345 | +Changes to workflow files require: |
| 346 | + |
| 347 | +1. ✅ Review of permission changes |
| 348 | +2. ✅ Testing in fork or development branch |
| 349 | +3. ✅ Code owner approval |
| 350 | +4. ✅ Documentation update if behavior changes |
| 351 | + |
| 352 | +### Security Issue Reporting |
| 353 | + |
| 354 | +For security concerns related to this repository's controls or configurations, contact the code owners directly or open a private security advisory through GitHub. |
| 355 | + |
| 356 | +--- |
| 357 | + |
| 358 | +## Compliance Summary |
| 359 | + |
| 360 | +| Control Type | Implementation | Status | |
| 361 | +|--------------|----------------|--------| |
| 362 | +| **Input Validation** | JSON validation workflow | ✅ Active | |
| 363 | +| **Access Control** | CODEOWNERS + branch protection | ✅ Active | |
| 364 | +| **Documentation** | Auto-generated README files | ✅ Active | |
| 365 | +| **Version Control** | Git + semantic versioning | ✅ Active | |
| 366 | +| **Release Management** | Manual approval workflow | ✅ Active | |
| 367 | +| **File Type Restrictions** | .gitignore enforcement | ✅ Active | |
| 368 | +| **Audit Logging** | GitHub Actions + Git history | ✅ Active | |
| 369 | +| **Least Privilege** | Scoped workflow permissions | ✅ Active | |
| 370 | + |
| 371 | +--- |
| 372 | + |
| 373 | +**Document Version:** 1.0 |
| 374 | +**Last Updated:** February 7, 2026 |
| 375 | +**Repository:** Get-Nerdio/intune-baseline |
0 commit comments