train-k8s-container-mitre 2.1.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG.md CHANGED
@@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.2.0](https://github.com/mitre/train-k8s-container/compare/v2.1.1...v2.2.0) (2025-12-24)
9
+
10
+
11
+ ### Features
12
+
13
+ * Add BEADS-BOARD.md and v1/v2 comparison test data ([35bbf46](https://github.com/mitre/train-k8s-container/commit/35bbf46fc25d84ef88e9953a628cf3a4aa8d2da0))
14
+
15
+ ## [2.1.1](https://github.com/mitre/train-k8s-container/compare/v2.1.0...v2.1.1) (2025-12-12)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * Parse PR number from JSON in auto-merge step ([09a3667](https://github.com/mitre/train-k8s-container/commit/09a3667cb67010c58837d3ff1ddcf5b197dc3d0d))
21
+
22
+
23
+ ### Documentation
24
+
25
+ * Add ARCHITECTURE.md with technical overview ([acfe73a](https://github.com/mitre/train-k8s-container/commit/acfe73a5ad16faa9b481d0c7802d2a8f6f64efb9))
26
+ * Enhance ARCHITECTURE.md with comprehensive technical details ([519675d](https://github.com/mitre/train-k8s-container/commit/519675db04d3766ac3d00575989e748da738a7ea))
27
+ * Fix inaccurate claims in README acknowledgments ([fa2e53c](https://github.com/mitre/train-k8s-container/commit/fa2e53c0eee41638edfa04a583bdcea4fd7eb272))
28
+ * Update release process documentation for automated workflow ([23d1fcf](https://github.com/mitre/train-k8s-container/commit/23d1fcfb38b1415c12029564b92dbcb9df34715d))
29
+
8
30
  ## [2.1.0](https://github.com/mitre/train-k8s-container/compare/v2.0.3...v2.1.0) (2025-12-12)
9
31
 
10
32
 
data/CONTRIBUTING.md CHANGED
@@ -135,60 +135,149 @@ open coverage/index.html
135
135
  5. **CI Passing**: All GitHub Actions checks must pass
136
136
  6. **Merge**: Maintainers will merge approved PRs
137
137
 
138
- ## Release Process
138
+ ## Versioning and Commit Messages
139
+
140
+ This project uses [Conventional Commits](https://www.conventionalcommits.org/) and [Semantic Versioning](https://semver.org/). Your commit message prefix determines how the version number changes.
141
+
142
+ **Official References:**
143
+ - [Conventional Commits Specification](https://www.conventionalcommits.org/en/v1.0.0/)
144
+ - [Angular Commit Message Guidelines](https://github.com/angular/angular/blob/main/CONTRIBUTING.md#-commit-message-format) (original source)
145
+ - [Semantic Versioning](https://semver.org/)
146
+
147
+ ### Commit Prefix → Version Bump
148
+
149
+ | Commit Prefix | Version Change | When to Use |
150
+ |---------------|----------------|-------------|
151
+ | `feat:` | **Minor** (2.0.0 → 2.1.0) | New features, capabilities, or enhancements |
152
+ | `fix:` | **Patch** (2.0.0 → 2.0.1) | Bug fixes, corrections, error handling |
153
+ | `docs:` | **Patch** | Documentation changes only |
154
+ | `style:` | **Patch** | Code style, formatting (no logic change) |
155
+ | `refactor:` | **Patch** | Code restructuring (no behavior change) |
156
+ | `perf:` | **Patch** | Performance improvements |
157
+ | `test:` | **Patch** | Adding or updating tests |
158
+ | `chore:` | **Patch** | Maintenance, dependencies, tooling |
159
+ | `ci:` | **Patch** | CI/CD pipeline changes |
160
+ | `build:` | **Patch** | Build system changes |
161
+ | `revert:` | **Patch** | Reverting a previous commit |
162
+ | `feat!:` | **Major** (2.0.0 → 3.0.0) | Breaking changes (note the `!`) |
163
+ | `fix!:` | **Major** | Breaking bug fix |
164
+ | `BREAKING CHANGE:` | **Major** | In commit body, forces major bump |
165
+
166
+ ### Type Descriptions
167
+
168
+ - **feat**: A new feature for the user (not a build script feature)
169
+ - **fix**: A bug fix for the user (not a build script fix)
170
+ - **docs**: Documentation only changes (README, CONTRIBUTING, inline docs)
171
+ - **style**: Changes that don't affect code meaning (whitespace, formatting, semicolons)
172
+ - **refactor**: Code change that neither fixes a bug nor adds a feature
173
+ - **perf**: Code change that improves performance
174
+ - **test**: Adding missing tests or correcting existing tests
175
+ - **chore**: Changes to build process, auxiliary tools, libraries
176
+ - **ci**: Changes to CI configuration files and scripts
177
+ - **build**: Changes that affect the build system or external dependencies
178
+ - **revert**: Reverts a previous commit (include reverted commit SHA in body)
179
+
180
+ ### Examples
139
181
 
140
- Releases are automated using [release-please](https://github.com/googleapis/release-please) and managed by project maintainers.
182
+ ```bash
183
+ # Patch version bump (2.1.0 → 2.1.1)
184
+ git commit -m "fix: handle nil response in platform detection"
185
+ git commit -m "docs: update installation instructions"
186
+ git commit -m "chore: update rubocop dependency"
187
+ git commit -m "test: add integration tests for Alpine containers"
141
188
 
142
- ### How It Works
189
+ # Minor version bump (2.1.0 → 2.2.0)
190
+ git commit -m "feat: add support for Windows containers"
191
+ git commit -m "feat: add retry logic for transient kubectl failures"
143
192
 
144
- 1. **Commit with Conventional Commits**: Use prefixes like `feat:`, `fix:`, `docs:`, `chore:`
145
- - `feat:` triggers a minor version bump (e.g., 2.0.0 → 2.1.0)
146
- - `fix:` triggers a patch version bump (e.g., 2.0.0 → 2.0.1)
147
- - `feat!:` or `BREAKING CHANGE:` triggers a major version bump
193
+ # Major version bump (2.1.0 3.0.0)
194
+ git commit -m "feat!: change URI format to k8s://namespace/pod/container"
195
+ git commit -m "fix!: remove deprecated connection options"
196
+ ```
148
197
 
149
- 2. **Release PR Created Automatically**: When commits are pushed to `main`, release-please creates/updates a Release PR that:
150
- - Bumps the version in `VERSION` file
151
- - Updates `CHANGELOG.md` with commit messages
152
- - Shows the proposed version change
198
+ ### Commit Message Format
153
199
 
154
- 3. **Merge to Release**: When maintainers merge the Release PR:
155
- - A git tag is created (e.g., `v2.1.0`)
156
- - GitHub Actions builds and publishes the gem to RubyGems.org
157
- - A GitHub Release is created with auto-generated notes
200
+ ```
201
+ <type>(<optional scope>): <description>
158
202
 
159
- ### Example Workflow
203
+ [optional body]
160
204
 
205
+ [optional footer(s)]
206
+ ```
207
+
208
+ **Examples:**
161
209
  ```bash
162
- # Make changes with conventional commit messages
163
- git commit -m "feat: add support for Windows containers"
164
- git push origin main
210
+ # Simple
211
+ git commit -m "fix: handle empty shell response"
165
212
 
166
- # release-please automatically creates a PR like:
167
- # "chore(main): release 2.1.0"
213
+ # With scope
214
+ git commit -m "feat(platform): add FreeBSD detection"
168
215
 
169
- # After review, maintainer merges the PR
170
- # Tag v2.1.0 is created
171
- # → Gem is published to RubyGems.org
216
+ # With body
217
+ git commit -m "feat: add Windows container support
218
+
219
+ This adds support for Windows containers running in Kubernetes.
220
+ Tested with Windows Server 2022 and Windows Server Core images."
221
+
222
+ # Breaking change with body
223
+ git commit -m "feat!: require Ruby 3.1+
224
+
225
+ BREAKING CHANGE: Ruby 2.7 and 3.0 are no longer supported.
226
+ This allows us to use pattern matching and other Ruby 3.1 features."
172
227
  ```
173
228
 
174
- ### Manual Releases (Emergency Only)
229
+ ## Release Process
175
230
 
176
- For hotfixes that need immediate release without waiting for release-please:
231
+ Releases are **fully automated** using [release-please](https://github.com/googleapis/release-please) with auto-merge enabled.
177
232
 
178
- ```bash
179
- # Update VERSION manually
180
- echo "2.0.2" > VERSION
233
+ ### How It Works
234
+
235
+ 1. **Release PR Created Automatically**: When commits are pushed to `main`, release-please creates/updates a Release PR with auto-merge enabled that:
236
+ - Bumps the version in `lib/train-k8s-container/version.rb`
237
+ - Updates `CHANGELOG.md` with commit messages
238
+ - Shows the proposed version change
239
+
240
+ 2. **Auto-Merge When CI Passes**: The Release PR automatically merges once all CI checks pass:
241
+ - Unit tests (Ruby 3.1, 3.2, 3.3)
242
+ - Integration tests (Kubernetes 1.29, 1.30, 1.31)
243
+ - Security audit
244
+ - Branch protection enforces all checks must pass
245
+
246
+ 3. **Automatic Publishing**: After merge, release-please creates a GitHub Release which triggers:
247
+ - Gem build
248
+ - Publish to RubyGems.org (via OIDC trusted publishing)
249
+ - Gem artifact attached to GitHub Release
250
+
251
+ ### Complete Automated Flow
181
252
 
182
- # Update CHANGELOG.md manually
253
+ ```
254
+ Push commit → CI runs → Release PR created (auto-merge enabled)
255
+
256
+ CI passes on PR
257
+
258
+ PR auto-merges
259
+
260
+ GitHub Release created
261
+
262
+ Gem published to RubyGems
263
+ ```
264
+
265
+ ### Example
266
+
267
+ ```bash
268
+ # Make changes with conventional commit messages
269
+ git commit -m "feat: add support for Windows containers"
270
+ git push origin main
183
271
 
184
- # Commit, tag, and push
185
- git add VERSION CHANGELOG.md
186
- git commit -m "chore: release v2.0.2"
187
- git tag v2.0.2
188
- git push origin main --tags
272
+ # Everything else is automatic:
273
+ # 1. release-please creates PR: "chore(main): release 2.2.0"
274
+ # 2. CI runs on the PR
275
+ # 3. PR auto-merges when CI passes
276
+ # 4. Tag v2.2.0 is created
277
+ # 5. Gem is published to RubyGems.org
189
278
  ```
190
279
 
191
- **Note:** Manual releases should be rare. Prefer the automated release-please flow.
280
+ No manual intervention required for releases.
192
281
 
193
282
  ## Getting Help
194
283
 
data/DEVELOPMENT.md CHANGED
@@ -295,29 +295,24 @@ See `.github/workflows/ci.yml` for details.
295
295
 
296
296
  ## Releasing
297
297
 
298
- Releases are automated using [release-please](https://github.com/googleapis/release-please).
298
+ Releases are **fully automated** using [release-please](https://github.com/googleapis/release-please) with auto-merge enabled. No manual intervention required.
299
299
 
300
- ### Automated Release Process (Recommended)
300
+ ### How It Works
301
301
 
302
- 1. **Make commits using Conventional Commits format**:
302
+ 1. **Push commits with Conventional Commits format**:
303
303
  ```bash
304
304
  git commit -m "feat: add Windows container support"
305
305
  git commit -m "fix: handle empty shell response"
306
- git commit -m "docs: update installation instructions"
307
- ```
308
-
309
- 2. **Push to main** - release-please will automatically create a Release PR:
310
- ```bash
311
306
  git push origin main
312
- # release-please creates PR: "chore(main): release 2.1.0"
313
307
  ```
314
308
 
315
- 3. **Review and merge the Release PR** - this triggers:
316
- - Version bump in `VERSION` file
317
- - `CHANGELOG.md` update
318
- - Git tag creation (e.g., `v2.1.0`)
319
- - Gem build and publish to RubyGems.org
320
- - GitHub Release creation
309
+ 2. **Automatic flow**:
310
+ - Release-please creates/updates a Release PR with auto-merge enabled
311
+ - CI runs on the PR (unit tests, integration tests, security audit)
312
+ - Branch protection requires all checks to pass
313
+ - PR auto-merges when CI is green
314
+ - Release-please creates a GitHub Release
315
+ - `release-tag.yml` triggers and publishes gem to RubyGems.org
321
316
 
322
317
  ### Conventional Commits Cheat Sheet
323
318
 
@@ -329,25 +324,28 @@ Releases are automated using [release-please](https://github.com/googleapis/rele
329
324
  | `chore:` | Patch | `chore: update dependencies` |
330
325
  | `feat!:` | Major (2.0.0 → 3.0.0) | `feat!: change URI format` |
331
326
 
332
- ### Manual Release (Emergency Only)
333
-
334
- For hotfixes that can't wait for the release-please flow:
335
-
336
- ```bash
337
- # Update VERSION file
338
- echo "2.0.2" > VERSION
339
-
340
- # Update CHANGELOG.md manually
327
+ ### Complete Flow Diagram
341
328
 
342
- # Commit and tag
343
- git add VERSION CHANGELOG.md
344
- git commit -m "chore: release v2.0.2"
345
- git tag v2.0.2
346
- git push origin main --tags
347
329
  ```
330
+ Push commit → CI runs on main → Release-please creates PR (auto-merge on)
331
+
332
+ CI runs on PR
333
+
334
+ PR auto-merges when green
335
+
336
+ GitHub Release created (v2.x.x)
337
+
338
+ release-tag.yml triggers
339
+
340
+ Gem published to RubyGems.org
341
+ ```
342
+
343
+ ### Key Files
348
344
 
349
- The `release-tag.yml` workflow triggers on tag push and will:
350
- 1. Run tests
351
- 2. Build gem
352
- 3. Publish to RubyGems.org (via OIDC trusted publishing)
353
- 4. Create GitHub release
345
+ | File | Purpose |
346
+ |------|---------|
347
+ | `lib/train-k8s-container/version.rb` | VERSION constant (updated by release-please) |
348
+ | `release-please-config.json` | Release-please configuration |
349
+ | `.release-please-manifest.json` | Current version tracking |
350
+ | `.github/workflows/release-please.yml` | Creates PRs with auto-merge |
351
+ | `.github/workflows/release-tag.yml` | Publishes gem on release |
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  A Train transport plugin that enables Chef InSpec and Cinc Auditor to execute compliance checks against containers running in Kubernetes clusters via kubectl exec.
4
4
 
5
+ [![Gem Version](https://badge.fury.io/rb/train-k8s-container-mitre.svg)](https://badge.fury.io/rb/train-k8s-container-mitre)
5
6
  [![CI](https://github.com/mitre/train-k8s-container/actions/workflows/ci.yml/badge.svg)](https://github.com/mitre/train-k8s-container/actions/workflows/ci.yml)
6
7
  [![Security](https://github.com/mitre/train-k8s-container/actions/workflows/security.yml/badge.svg)](https://github.com/mitre/train-k8s-container/actions/workflows/security.yml)
7
8
 
@@ -29,7 +30,7 @@ This plugin allows InSpec/Cinc Auditor to scan containers running in Kubernetes
29
30
  **Important:** Always install Train plugins using `inspec plugin install` or `cinc-auditor plugin install`. Do NOT use `gem install` directly, as this can cause issues with plugin discovery and management.
30
31
 
31
32
  ```bash
32
- # Using Cinc Auditor (recommended - open source, license-free)
33
+ # Using Cinc Auditor (open source, license-free)
33
34
  cinc-auditor plugin install train-k8s-container-mitre
34
35
 
35
36
  # Or using Chef InSpec
@@ -204,6 +205,18 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
204
205
  4. Run `bundle exec rspec && bundle exec rake style`
205
206
  5. Submit a pull request
206
207
 
208
+ ### Versioning
209
+
210
+ This project uses [Conventional Commits](https://www.conventionalcommits.org/) for automated releases:
211
+
212
+ | Commit Prefix | Version Bump | Example |
213
+ |---------------|--------------|---------|
214
+ | `feat:` | Minor (2.1.0) | New features |
215
+ | `fix:` | Patch (2.0.1) | Bug fixes |
216
+ | `feat!:` | Major (3.0.0) | Breaking changes |
217
+
218
+ See [CONTRIBUTING.md](CONTRIBUTING.md#versioning-and-commit-messages) for full details.
219
+
207
220
  ## Security
208
221
 
209
222
  See [SECURITY.md](SECURITY.md) for security policy and reporting vulnerabilities.
@@ -224,13 +237,12 @@ This project is maintained by the MITRE SAF (Security Automation Framework) team
224
237
 
225
238
  ## Acknowledgments
226
239
 
227
- This project is a fork of [inspec/train-k8s-container](https://github.com/inspec/train-k8s-container), significantly enhanced with:
240
+ This project is a fork of [inspec/train-k8s-container](https://github.com/inspec/train-k8s-container), enhanced with:
228
241
 
229
242
  - Train v2 plugin architecture
230
243
  - Detect+Context platform detection pattern
231
244
  - Comprehensive CI/CD with pod-to-pod testing
232
- - Security hardening and SBOM generation
233
- - MITRE SAF ecosystem integration
245
+ - Automated releases via release-please
234
246
 
235
247
  ---
236
248