cyber_trackr_live 1.0.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.
- checksums.yaml +7 -0
- data/CHANGELOG-GEM.md +47 -0
- data/CODE_OF_CONDUCT.md +20 -0
- data/CONTRIBUTING.md +422 -0
- data/LICENSE.md +16 -0
- data/NOTICE.md +16 -0
- data/README-GEM.md +75 -0
- data/SECURITY.md +86 -0
- data/cyber_trackr_live.gemspec +56 -0
- data/examples/cyber_trackr_client.rb +208 -0
- data/examples/fetch-complete-stig +174 -0
- data/examples/fetch-stig-complete +67 -0
- data/examples/fetch-stig-direct +99 -0
- data/examples/use_helper.rb +50 -0
- data/lib/cyber_trackr_client/api/api_documentation_api.rb +79 -0
- data/lib/cyber_trackr_client/api/cci_api.rb +147 -0
- data/lib/cyber_trackr_client/api/documents_api.rb +276 -0
- data/lib/cyber_trackr_client/api/rmf_controls_api.rb +272 -0
- data/lib/cyber_trackr_client/api/scap_api.rb +276 -0
- data/lib/cyber_trackr_client/api_client.rb +437 -0
- data/lib/cyber_trackr_client/api_error.rb +58 -0
- data/lib/cyber_trackr_client/configuration.rb +400 -0
- data/lib/cyber_trackr_client/models/api_documentation.rb +238 -0
- data/lib/cyber_trackr_client/models/assessment_procedure.rb +321 -0
- data/lib/cyber_trackr_client/models/cci_detail.rb +391 -0
- data/lib/cyber_trackr_client/models/document_detail.rb +434 -0
- data/lib/cyber_trackr_client/models/document_version.rb +385 -0
- data/lib/cyber_trackr_client/models/error.rb +313 -0
- data/lib/cyber_trackr_client/models/requirement_detail.rb +580 -0
- data/lib/cyber_trackr_client/models/requirement_summary.rb +360 -0
- data/lib/cyber_trackr_client/models/rmf_control_detail.rb +436 -0
- data/lib/cyber_trackr_client/models/rmf_control_list.rb +241 -0
- data/lib/cyber_trackr_client/version.rb +15 -0
- data/lib/cyber_trackr_client.rb +54 -0
- data/lib/cyber_trackr_helper.rb +269 -0
- data/lib/rubocop/cop/cyber_trackr_api/README.md +81 -0
- data/openapi/openapi.yaml +798 -0
- metadata +271 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7321b70b1c8459812539c33ded0a07b849631cc0c1f459c233c25c410eb132d1
|
4
|
+
data.tar.gz: f4c886d74885ad041cc30b598f9af0bc1fcafda0e5adaae06b8bc22b9e8e7b7f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d71f019d1a621a07963f0440b01f4af31f08e5242145fd1757028f43b2d0766b1c3dc48cce9becae2f233a7b77a36a0e99a2acb16016d2ddf60179fcd7ceb7d5
|
7
|
+
data.tar.gz: cfc1efe90c525825a15ec5705af86b9ddb6be0f02bf54cdae4999ee5f2be593c88cf63c0ef0f2094c84d66296bb9debe892978449c63a12bea60b73618d791f2
|
data/CHANGELOG-GEM.md
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
All notable changes to this project will be documented in this file.
|
4
|
+
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
|
+
|
8
|
+
## [Unreleased]
|
9
|
+
|
10
|
+
### Added
|
11
|
+
|
12
|
+
- Add project foundation and build infrastructure
|
13
|
+
- Add OpenAPI 3.1.1 specification and generated Ruby client
|
14
|
+
- Add helper library and development utilities
|
15
|
+
- Add comprehensive cross-platform support and documentation
|
16
|
+
- Integrate git-cliff with VitePress deployment
|
17
|
+
|
18
|
+
### Fixed
|
19
|
+
|
20
|
+
- Engineer release process to automatically use correct versions
|
21
|
+
- Stabilize release process and exclude node_modules from linting
|
22
|
+
- Use correct VitePress paths for changelog links in release notes
|
23
|
+
|
24
|
+
### MAJOR
|
25
|
+
|
26
|
+
- Remove duplicate OpenAPI validation, fix Windows CI/CD permanently
|
27
|
+
- Migrate from typhoeus to Faraday HTTP client
|
28
|
+
|
29
|
+
### Miscellaneous Tasks
|
30
|
+
|
31
|
+
- Update generated client files to match OpenAPI v1.0.0
|
32
|
+
- Update versions to 1.0.1 baseline for testing
|
33
|
+
|
34
|
+
### Testing
|
35
|
+
|
36
|
+
- Add comprehensive two-stage testing pattern
|
37
|
+
|
38
|
+
### Build
|
39
|
+
|
40
|
+
- Add development tools and automation scripts
|
41
|
+
|
42
|
+
### Prepare
|
43
|
+
|
44
|
+
- Reset to v0.9.9 and add RuboCop auto-correction for v1.0.0 release
|
45
|
+
- Reset versions to 0.9.9 for first formal v1.0.0 release
|
46
|
+
|
47
|
+
<!-- generated by git-cliff -->
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
title: Code of Conduct
|
3
|
+
description: Community standards and guidelines for the cyber-trackr-live project
|
4
|
+
layout: doc
|
5
|
+
sidebar: true
|
6
|
+
---
|
7
|
+
|
8
|
+
# Code of Conduct
|
9
|
+
|
10
|
+
This project adopts the [Contributor Covenant](https://www.contributor-covenant.org/version/2/1/code_of_conduct/) as our code of conduct.
|
11
|
+
|
12
|
+
## Our Pledge
|
13
|
+
|
14
|
+
We are committed to making participation in this project a welcoming experience for everyone.
|
15
|
+
|
16
|
+
## Enforcement
|
17
|
+
|
18
|
+
Instances of unacceptable behavior may be reported to the project team at [saf@mitre.org](mailto:saf@mitre.org).
|
19
|
+
|
20
|
+
For the full text of our code of conduct, please see: https://www.contributor-covenant.org/version/2/1/code_of_conduct/
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,422 @@
|
|
1
|
+
---
|
2
|
+
title: Contributing
|
3
|
+
description: How to contribute to the cyber-trackr-live project
|
4
|
+
layout: doc
|
5
|
+
sidebar: true
|
6
|
+
---
|
7
|
+
|
8
|
+
# Contributing to cyber-trackr-live
|
9
|
+
|
10
|
+
Thank you for your interest in contributing to cyber-trackr-live! This project provides an OpenAPI specification and Ruby client for the cyber.trackr.live API.
|
11
|
+
|
12
|
+
## 🚀 Quick Start
|
13
|
+
|
14
|
+
```bash
|
15
|
+
# Fork and clone
|
16
|
+
git clone https://github.com/YOUR_USERNAME/cyber-trackr-live.git
|
17
|
+
cd cyber-trackr-live
|
18
|
+
|
19
|
+
# Install dependencies
|
20
|
+
bundle install # Ruby dependencies
|
21
|
+
npm install # Node dependencies (optional - for docs)
|
22
|
+
|
23
|
+
# Run tests
|
24
|
+
bundle exec rake test # Unit tests
|
25
|
+
bundle exec rake test:all # All tests including integration
|
26
|
+
```
|
27
|
+
|
28
|
+
## 🛠️ Development Setup
|
29
|
+
|
30
|
+
### Prerequisites
|
31
|
+
|
32
|
+
- Ruby 3.2+ (check `.ruby-version`)
|
33
|
+
- Node.js 22+ (check `.nvmrc`) - optional, only for OpenAPI docs
|
34
|
+
- Docker (for client generation)
|
35
|
+
|
36
|
+
### Environment Setup
|
37
|
+
|
38
|
+
```bash
|
39
|
+
# Using rbenv
|
40
|
+
rbenv install 3.3.0
|
41
|
+
rbenv local 3.3.0
|
42
|
+
|
43
|
+
# Using nvm (for docs development)
|
44
|
+
nvm install
|
45
|
+
nvm use
|
46
|
+
|
47
|
+
# Or using asdf
|
48
|
+
asdf install
|
49
|
+
```
|
50
|
+
|
51
|
+
## 📝 Development Workflows
|
52
|
+
|
53
|
+
### Working on the OpenAPI Specification
|
54
|
+
|
55
|
+
The OpenAPI spec is the source of truth for the API documentation and client generation.
|
56
|
+
|
57
|
+
```bash
|
58
|
+
# 1. Edit the spec
|
59
|
+
vi openapi/openapi.yaml
|
60
|
+
|
61
|
+
# 2. Validate your changes
|
62
|
+
npm run docs:validate
|
63
|
+
|
64
|
+
# 3. Preview the docs
|
65
|
+
npm run docs:dev
|
66
|
+
# Opens at http://localhost:4000
|
67
|
+
|
68
|
+
# 4. Regenerate the Ruby client (if needed)
|
69
|
+
./scripts/generate_client.sh
|
70
|
+
|
71
|
+
# 5. Run tests to ensure compatibility
|
72
|
+
bundle exec rake test
|
73
|
+
```
|
74
|
+
|
75
|
+
#### OpenAPI Best Practices
|
76
|
+
|
77
|
+
- Use OpenAPI 3.1.1 features (proper null handling with `anyOf`)
|
78
|
+
- Include examples for all schemas
|
79
|
+
- Add operation IDs for clean client generation
|
80
|
+
- Document all error responses
|
81
|
+
- Keep descriptions clear and concise
|
82
|
+
|
83
|
+
### Ruby Client Development
|
84
|
+
|
85
|
+
#### Generated Code
|
86
|
+
|
87
|
+
The Ruby client in `lib/cyber_trackr_client/` is generated from the OpenAPI spec. **Do not edit these files directly**.
|
88
|
+
|
89
|
+
To fix issues in generated code:
|
90
|
+
1. Update the OpenAPI spec if the issue is in the API definition
|
91
|
+
2. Use RuboCop cops in `lib/rubocop/cop/` for post-generation fixes
|
92
|
+
3. Add helper methods in `lib/cyber_trackr_helper/`
|
93
|
+
|
94
|
+
#### Helper Development
|
95
|
+
|
96
|
+
```bash
|
97
|
+
# Work on helper methods
|
98
|
+
vi lib/cyber_trackr_helper.rb
|
99
|
+
|
100
|
+
# Run tests
|
101
|
+
bundle exec ruby test/cyber_trackr_helper_test.rb
|
102
|
+
|
103
|
+
# Test interactively
|
104
|
+
bundle exec irb -I lib -r cyber_trackr_helper
|
105
|
+
client = CyberTrackrHelper::Client.new
|
106
|
+
client.list_stigs
|
107
|
+
```
|
108
|
+
|
109
|
+
#### Testing
|
110
|
+
|
111
|
+
```bash
|
112
|
+
# OpenAPI validation (Node.js/Spectral)
|
113
|
+
npm run docs:validate
|
114
|
+
|
115
|
+
# Ruby testing
|
116
|
+
bundle exec rake test # Core gem tests (fast - default)
|
117
|
+
bundle exec rake test:all # All tests including live API
|
118
|
+
bundle exec rake test:stage2b # Live API integration only
|
119
|
+
|
120
|
+
# Run specific test file
|
121
|
+
bundle exec ruby test/cyber_trackr_helper_test.rb
|
122
|
+
```
|
123
|
+
|
124
|
+
### Documentation Development
|
125
|
+
|
126
|
+
#### API Documentation (Scalar)
|
127
|
+
|
128
|
+
```bash
|
129
|
+
# Start local docs server
|
130
|
+
npm run docs:dev
|
131
|
+
|
132
|
+
# Build static docs
|
133
|
+
npm run docs:build
|
134
|
+
|
135
|
+
# Update Scalar configuration
|
136
|
+
vi scalar.config.json
|
137
|
+
```
|
138
|
+
|
139
|
+
#### Ruby Documentation (YARD)
|
140
|
+
|
141
|
+
```bash
|
142
|
+
# Generate YARD docs
|
143
|
+
bundle exec yard doc
|
144
|
+
|
145
|
+
# Preview at http://localhost:8808
|
146
|
+
bundle exec yard server
|
147
|
+
|
148
|
+
# Update documentation
|
149
|
+
vi lib/cyber_trackr_helper.rb # Add YARD comments
|
150
|
+
```
|
151
|
+
|
152
|
+
## 🧪 Testing Guidelines
|
153
|
+
|
154
|
+
### Test Architecture
|
155
|
+
|
156
|
+
We use a **two-tier testing approach** with clear separation of concerns:
|
157
|
+
|
158
|
+
```mermaid
|
159
|
+
graph TD
|
160
|
+
subgraph tier1 ["🔧 Tier 1: Static Validation (Spectral)"]
|
161
|
+
A["📋 OpenAPI Specification"]
|
162
|
+
A --> A1["✅ OpenAPI 3.1.1 compliance"]
|
163
|
+
A --> A2["✅ Syntax validation"]
|
164
|
+
A --> A3["✅ Best practices"]
|
165
|
+
A --> A4["✅ Custom DISA rules"]
|
166
|
+
A --> A5["✅ Professional patterns"]
|
167
|
+
A1 --> B["📊 Static Analysis Results"]
|
168
|
+
A2 --> B
|
169
|
+
A3 --> B
|
170
|
+
A4 --> B
|
171
|
+
A5 --> B
|
172
|
+
end
|
173
|
+
|
174
|
+
subgraph tier2 ["💎 Tier 2: Dynamic Testing (Ruby)"]
|
175
|
+
C["🌐 Live API Testing"]
|
176
|
+
C --> C1["📦 Core gem functionality"]
|
177
|
+
C --> C2["🛠️ Helper methods"]
|
178
|
+
C --> C3["🔗 Integration tests"]
|
179
|
+
C --> C4["📋 Business logic"]
|
180
|
+
C --> C5["🧪 Cross-platform"]
|
181
|
+
C1 --> D["🧪 Dynamic Test Results"]
|
182
|
+
C2 --> D
|
183
|
+
C3 --> D
|
184
|
+
C4 --> D
|
185
|
+
C5 --> D
|
186
|
+
end
|
187
|
+
|
188
|
+
B --> E["✅ Complete Validation"]
|
189
|
+
D --> E
|
190
|
+
|
191
|
+
style tier1 fill:#fff5e6,stroke:#fd7e14,stroke-width:2px
|
192
|
+
style tier2 fill:#e8f5e8,stroke:#28a745,stroke-width:2px
|
193
|
+
style A fill:#fd7e14,stroke:#e55100,stroke-width:2px,color:#000000
|
194
|
+
style C fill:#28a745,stroke:#1e7e34,stroke-width:2px,color:#ffffff
|
195
|
+
style E fill:#007bff,stroke:#0056b3,stroke-width:2px,color:#ffffff
|
196
|
+
```
|
197
|
+
|
198
|
+
### Test Structure
|
199
|
+
|
200
|
+
```
|
201
|
+
test/
|
202
|
+
├── cyber_trackr_helper_test.rb # Core gem functionality
|
203
|
+
└── live_api_validation_test.rb # Live API integration
|
204
|
+
```
|
205
|
+
|
206
|
+
### Writing Tests
|
207
|
+
|
208
|
+
```ruby
|
209
|
+
# Unit test example
|
210
|
+
class HelperTest < Minitest::Test
|
211
|
+
def test_list_stigs_filters_srgs
|
212
|
+
mock_documents_list # Use test helpers
|
213
|
+
|
214
|
+
stigs = @client.list_stigs
|
215
|
+
|
216
|
+
assert_equal 2, stigs.size
|
217
|
+
refute stigs.key?(:Application_Security_Requirements_Guide)
|
218
|
+
end
|
219
|
+
end
|
220
|
+
```
|
221
|
+
|
222
|
+
### Mocking API Responses
|
223
|
+
|
224
|
+
Always use the test helpers from `test/test_helper.rb`:
|
225
|
+
|
226
|
+
```ruby
|
227
|
+
# Good - uses proper mock structure
|
228
|
+
mock_documents_list(sample_document_list)
|
229
|
+
|
230
|
+
# Bad - incomplete mock missing required fields
|
231
|
+
stub_request(:get, url).to_return(body: {}.to_json)
|
232
|
+
```
|
233
|
+
|
234
|
+
## 📋 Contribution Types
|
235
|
+
|
236
|
+
### Bug Reports 🐛
|
237
|
+
|
238
|
+
Use GitHub Issues with:
|
239
|
+
- Clear reproduction steps
|
240
|
+
- Version information (Ruby, gem version)
|
241
|
+
- Error messages and stack traces
|
242
|
+
- Minimal code example
|
243
|
+
|
244
|
+
### Feature Requests 💡
|
245
|
+
|
246
|
+
- Open an issue first to discuss
|
247
|
+
- Explain the use case
|
248
|
+
- Consider API compatibility
|
249
|
+
- Propose implementation approach
|
250
|
+
|
251
|
+
### Pull Requests 🔄
|
252
|
+
|
253
|
+
1. **Fork and branch** from `main`
|
254
|
+
2. **Make focused changes** - one feature/fix per PR
|
255
|
+
3. **Add tests** for new functionality
|
256
|
+
4. **Update docs** as needed
|
257
|
+
5. **Run all checks**:
|
258
|
+
```bash
|
259
|
+
npm run docs:validate # OpenAPI validation
|
260
|
+
bundle exec rake test # Ruby tests
|
261
|
+
bundle exec rubocop # Code style
|
262
|
+
```
|
263
|
+
6. **Update changelogs**:
|
264
|
+
- `CHANGELOG-GEM.md` for Ruby changes
|
265
|
+
- `CHANGELOG-OPENAPI.md` for spec changes
|
266
|
+
7. **Version updates** (maintainers only):
|
267
|
+
- Do NOT bump version in PRs
|
268
|
+
- Versions are bumped during release process
|
269
|
+
- If you modified `openapi/openapi.yaml`, regenerate client
|
270
|
+
|
271
|
+
## 🌍 Cross-Platform Development
|
272
|
+
|
273
|
+
This gem supports multiple platforms and architectures:
|
274
|
+
|
275
|
+
### Supported Platforms
|
276
|
+
- **Linux**: x86_64, aarch64 (ARM), musl (Alpine)
|
277
|
+
- **macOS**: Intel (x86_64), ARM (arm64)
|
278
|
+
- **Windows**: x64 (mingw-ucrt)
|
279
|
+
- **Ruby**: Generic Ruby platform
|
280
|
+
|
281
|
+
### Adding Platform Support
|
282
|
+
|
283
|
+
When adding new dependencies that have native extensions, update `Gemfile.lock` for all platforms:
|
284
|
+
|
285
|
+
```bash
|
286
|
+
# Add common platforms
|
287
|
+
bundle lock --add-platform x86_64-linux
|
288
|
+
bundle lock --add-platform x86_64-darwin
|
289
|
+
bundle lock --add-platform arm64-darwin-24
|
290
|
+
bundle lock --add-platform x64-mingw-ucrt
|
291
|
+
bundle lock --add-platform aarch64-linux
|
292
|
+
bundle lock --add-platform x86_64-linux-musl
|
293
|
+
bundle lock --add-platform ruby
|
294
|
+
|
295
|
+
# Verify all platforms are present
|
296
|
+
grep -A 10 "PLATFORMS" Gemfile.lock
|
297
|
+
```
|
298
|
+
|
299
|
+
### CI/CD Testing Matrix
|
300
|
+
|
301
|
+
Our CI tests across multiple platforms and Ruby versions:
|
302
|
+
|
303
|
+
```yaml
|
304
|
+
strategy:
|
305
|
+
matrix:
|
306
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
307
|
+
ruby-version: ['3.2', '3.3', '3.4']
|
308
|
+
```
|
309
|
+
|
310
|
+
This ensures the gem works correctly across all supported environments.
|
311
|
+
|
312
|
+
### Platform-Specific Issues
|
313
|
+
|
314
|
+
Common issues and solutions:
|
315
|
+
|
316
|
+
**Bundle installation fails on CI:**
|
317
|
+
```bash
|
318
|
+
# Error: "Your bundle only supports platforms ['arm64-darwin-24'] but your local platform is x86_64-linux"
|
319
|
+
# Solution: Add the missing platform to Gemfile.lock
|
320
|
+
bundle lock --add-platform x86_64-linux
|
321
|
+
```
|
322
|
+
|
323
|
+
**Native extension compilation fails:**
|
324
|
+
- Check if the gem has platform-specific versions
|
325
|
+
- Ensure all required platforms are in Gemfile.lock
|
326
|
+
- Update gem to a version that supports the target platform
|
327
|
+
|
328
|
+
### HTTP Client Architecture
|
329
|
+
|
330
|
+
This project uses **Faraday** as the HTTP client for maximum compatibility:
|
331
|
+
|
332
|
+
```ruby
|
333
|
+
# ✅ Good - Uses Faraday (built into Ruby)
|
334
|
+
gem 'faraday', '~> 2.0'
|
335
|
+
gem 'faraday-multipart', '~> 1.0'
|
336
|
+
|
337
|
+
# ❌ Avoided - typhoeus (requires libcurl.dll on Windows)
|
338
|
+
# gem 'typhoeus'
|
339
|
+
```
|
340
|
+
|
341
|
+
**Benefits of Faraday:**
|
342
|
+
- **No external dependencies** - Pure Ruby using Net::HTTP
|
343
|
+
- **Windows compatible** - No libcurl.dll required
|
344
|
+
- **Widely adopted** - More stable and mature
|
345
|
+
- **Consistent** - Same HTTP client used in tests and generated client
|
346
|
+
|
347
|
+
**OpenAPI Client Generation:**
|
348
|
+
The generated client uses Faraday via the `--library=faraday` flag:
|
349
|
+
```bash
|
350
|
+
./scripts/generate_client.sh # Automatically uses Faraday
|
351
|
+
```
|
352
|
+
|
353
|
+
## 🚦 CI/CD Pipeline
|
354
|
+
|
355
|
+
All PRs must pass:
|
356
|
+
|
357
|
+
- **Unit Tests** - Ruby tests must pass on Linux, macOS, and Windows
|
358
|
+
- **Linting** - RuboCop with no violations
|
359
|
+
- **OpenAPI Validation** - Spec must be valid
|
360
|
+
- **Security Checks** - No vulnerable dependencies
|
361
|
+
- **Documentation** - Must build successfully
|
362
|
+
|
363
|
+
## 📦 Release Process
|
364
|
+
|
365
|
+
Maintainers handle releases:
|
366
|
+
|
367
|
+
1. **Version Bump**
|
368
|
+
- Use rake tasks to bump version:
|
369
|
+
- `bundle exec rake version:major` - For breaking changes (2.0.0)
|
370
|
+
- `bundle exec rake version:minor` - For new features (1.1.0)
|
371
|
+
- `bundle exec rake version:patch` - For bug fixes (1.0.1)
|
372
|
+
- Regenerate client: `make generate`
|
373
|
+
- This updates `lib/cyber_trackr_client/version.rb` automatically
|
374
|
+
- Commit all changes together
|
375
|
+
|
376
|
+
2. **Update Changelogs**
|
377
|
+
- Add entries to `CHANGELOG-GEM.md` for Ruby/gem changes
|
378
|
+
- Add entries to `CHANGELOG-OPENAPI.md` for API spec changes
|
379
|
+
- Follow [Keep a Changelog](https://keepachangelog.com/) format
|
380
|
+
|
381
|
+
3. **Create Release**
|
382
|
+
- Run: `bundle exec rake prepare_release`
|
383
|
+
- This checks version consistency and creates a tag
|
384
|
+
- Push the tag: `git push origin v{version}`
|
385
|
+
- GitHub Actions automatically:
|
386
|
+
- Publishes gem to RubyGems.org
|
387
|
+
- Deploys docs to GitHub Pages
|
388
|
+
- Creates GitHub release
|
389
|
+
|
390
|
+
### Version Management
|
391
|
+
|
392
|
+
**IMPORTANT**: The version in `openapi/openapi.yaml` is the single source of truth.
|
393
|
+
|
394
|
+
```yaml
|
395
|
+
# openapi/openapi.yaml
|
396
|
+
info:
|
397
|
+
version: 1.0.0 # Update this version
|
398
|
+
```
|
399
|
+
|
400
|
+
Never manually edit `lib/cyber_trackr_client/version.rb` - it's generated!
|
401
|
+
|
402
|
+
## 🔒 Security
|
403
|
+
|
404
|
+
- Never commit credentials or tokens
|
405
|
+
- Report security issues to saf-security@mitre.org
|
406
|
+
- Run `bundle audit` before submitting PRs
|
407
|
+
- Be cautious with user input handling
|
408
|
+
|
409
|
+
## 📚 Resources
|
410
|
+
|
411
|
+
- [OpenAPI 3.1.1 Specification](https://spec.openapis.org/oas/v3.1.0)
|
412
|
+
- [Scalar Documentation](https://github.com/scalar/scalar)
|
413
|
+
- [RuboCop Style Guide](https://rubocop.org/)
|
414
|
+
- [cyber.trackr.live API](https://cyber.trackr.live)
|
415
|
+
|
416
|
+
## 🤝 Code of Conduct
|
417
|
+
|
418
|
+
Please follow our [Code of Conduct](/project/code-of-conduct) in all interactions.
|
419
|
+
|
420
|
+
## 📄 License
|
421
|
+
|
422
|
+
By contributing, you agree that your contributions will be licensed under the Apache-2.0 license.
|
data/LICENSE.md
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
---
|
2
|
+
title: License
|
3
|
+
description: Apache 2.0 license for the cyber-trackr-live project
|
4
|
+
layout: doc
|
5
|
+
sidebar: true
|
6
|
+
---
|
7
|
+
|
8
|
+
Licensed under the apache-2.0 license, except as noted below.
|
9
|
+
|
10
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
11
|
+
|
12
|
+
* Redistributions of source code must retain the above copyright/ digital rights legend, this list of conditions and the following Notice.
|
13
|
+
|
14
|
+
* Redistributions in binary form must reproduce the above copyright copyright/ digital rights legend, this list of conditions and the following Notice in the documentation and/or other materials provided with the distribution.
|
15
|
+
|
16
|
+
* Neither the name of The MITRE Corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
data/NOTICE.md
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
---
|
2
|
+
title: Notice
|
3
|
+
description: Legal notices and government contract information for cyber-trackr-live
|
4
|
+
layout: doc
|
5
|
+
sidebar: true
|
6
|
+
---
|
7
|
+
|
8
|
+
MITRE hereby grants express written permission to use, reproduce, distribute, modify, and otherwise leverage this software to the extent permitted by the licensed terms provided in the LICENSE.md file included with this project.
|
9
|
+
|
10
|
+
This software was produced for the U. S. Government under Contract Number HHSM-500-2012-00008I, and is subject to Federal Acquisition Regulation Clause 52.227-14, Rights in Data-General.
|
11
|
+
|
12
|
+
No other use other than that granted to the U. S. Government, or to those acting on behalf of the U. S. Government under that Clause is authorized without the express written permission of The MITRE Corporation.
|
13
|
+
|
14
|
+
For further information, please contact The MITRE Corporation, Contracts Management Office, 7515 Colshire Drive, McLean, VA 22102-7539, (703) 983-6000.
|
15
|
+
|
16
|
+
©2025 The MITRE Corporation.
|
data/README-GEM.md
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
# cyber_trackr_live
|
2
|
+
|
3
|
+
Ruby client for the cyber.trackr.live API - Access DISA STIGs, SRGs, RMF controls, CCIs, and SCAP data.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'cyber_trackr_live'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle install
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install cyber_trackr_live
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
### Basic Usage
|
24
|
+
|
25
|
+
```ruby
|
26
|
+
require 'cyber_trackr_helper'
|
27
|
+
|
28
|
+
# Initialize the helper client
|
29
|
+
client = CyberTrackrHelper::Client.new
|
30
|
+
|
31
|
+
# List all STIGs
|
32
|
+
stigs = client.list_stigs
|
33
|
+
stigs.each do |name, versions|
|
34
|
+
puts "#{name}: #{versions.first.version}R#{versions.first.release}"
|
35
|
+
end
|
36
|
+
|
37
|
+
# Fetch a complete STIG with all requirements
|
38
|
+
stig = client.fetch_complete_stig('Juniper_SRX_Services_Gateway_ALG', '3', '3')
|
39
|
+
puts "#{stig[:title]} has #{stig[:requirements].count} requirements"
|
40
|
+
|
41
|
+
# Search for documents
|
42
|
+
results = client.search_documents('firewall')
|
43
|
+
```
|
44
|
+
|
45
|
+
### Direct API Client Usage
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
require 'cyber_trackr_client'
|
49
|
+
|
50
|
+
# Configure the client
|
51
|
+
CyberTrackrClient.configure do |config|
|
52
|
+
config.host = 'cyber.trackr.live'
|
53
|
+
config.base_path = '/api'
|
54
|
+
end
|
55
|
+
|
56
|
+
# Use the API directly
|
57
|
+
api = CyberTrackrClient::DocumentsApi.new
|
58
|
+
documents = api.list_all_documents
|
59
|
+
```
|
60
|
+
|
61
|
+
## API Documentation
|
62
|
+
|
63
|
+
Full API documentation is available at: https://mitre.github.io/cyber-trackr-live/
|
64
|
+
|
65
|
+
## Features
|
66
|
+
|
67
|
+
- Full access to cyber.trackr.live API
|
68
|
+
- Helper methods for common workflows
|
69
|
+
- Automatic retry and error handling
|
70
|
+
- Progress callbacks for long operations
|
71
|
+
- Type-safe Ruby objects
|
72
|
+
|
73
|
+
## License
|
74
|
+
|
75
|
+
The gem is available as open source under the terms of the [Apache-2.0 License](https://opensource.org/licenses/Apache-2.0).
|
data/SECURITY.md
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
---
|
2
|
+
title: Security Policy
|
3
|
+
description: Security vulnerability reporting and policies for cyber-trackr-live
|
4
|
+
layout: doc
|
5
|
+
sidebar: true
|
6
|
+
---
|
7
|
+
|
8
|
+
# Security Policy
|
9
|
+
|
10
|
+
## Reporting Security Issues
|
11
|
+
|
12
|
+
The MITRE SAF team takes security seriously. If you discover a security vulnerability in the cyber-trackr-live project, please report it responsibly.
|
13
|
+
|
14
|
+
### Contact Information
|
15
|
+
|
16
|
+
- **Email**: [saf-security@mitre.org](mailto:saf-security@mitre.org)
|
17
|
+
- **GitHub**: Use the [Security tab](https://github.com/mitre/cyber-trackr-live/security) to report vulnerabilities privately
|
18
|
+
|
19
|
+
### What to Include
|
20
|
+
|
21
|
+
When reporting security issues, please provide:
|
22
|
+
|
23
|
+
1. **Description** of the vulnerability
|
24
|
+
2. **Steps to reproduce** the issue
|
25
|
+
3. **Potential impact** assessment
|
26
|
+
4. **Suggested fix** (if you have one)
|
27
|
+
|
28
|
+
### Response Timeline
|
29
|
+
|
30
|
+
- **Acknowledgment**: Within 48 hours
|
31
|
+
- **Initial Assessment**: Within 7 days
|
32
|
+
- **Fix Timeline**: Varies by severity
|
33
|
+
|
34
|
+
## Security Best Practices
|
35
|
+
|
36
|
+
### For Users
|
37
|
+
|
38
|
+
- **Keep Updated**: Use the latest version of the plugin
|
39
|
+
- **Secure Credentials**: Never commit passwords or SSH keys to version control
|
40
|
+
- **Use SSH Keys**: Prefer SSH key authentication over passwords
|
41
|
+
- **Network Security**: Use VPNs and secure networks when connecting to network devices
|
42
|
+
|
43
|
+
### For Contributors
|
44
|
+
|
45
|
+
- **Dependency Scanning**: Run `bundle audit` before submitting PRs
|
46
|
+
- **Credential Handling**: Never log or expose credentials in code
|
47
|
+
- **Input Validation**: Sanitize all user inputs
|
48
|
+
- **Test Security**: Include security tests for new features
|
49
|
+
|
50
|
+
## Supported Versions
|
51
|
+
|
52
|
+
| Version | Supported |
|
53
|
+
|---------|-----------|
|
54
|
+
| 0.1.x | ✅ Yes |
|
55
|
+
|
56
|
+
## Security Testing
|
57
|
+
|
58
|
+
The plugin includes comprehensive security testing:
|
59
|
+
|
60
|
+
```bash
|
61
|
+
# Run security test suite
|
62
|
+
bundle exec ruby test/security/security_test.rb
|
63
|
+
|
64
|
+
# Check for vulnerable dependencies
|
65
|
+
bundle exec bundle-audit check
|
66
|
+
|
67
|
+
# Scan for potential security issues
|
68
|
+
bundle exec brakeman --no-pager
|
69
|
+
```
|
70
|
+
|
71
|
+
## Known Security Considerations
|
72
|
+
|
73
|
+
### Network Device Access
|
74
|
+
- Train-Juniper requires SSH access to network infrastructure
|
75
|
+
- Ensure proper network segmentation and access controls
|
76
|
+
- Use dedicated service accounts with minimal required privileges
|
77
|
+
|
78
|
+
### Credential Management
|
79
|
+
- Plugin supports environment variables for credential management
|
80
|
+
- Consider using secrets management systems in production
|
81
|
+
- Rotate credentials regularly
|
82
|
+
|
83
|
+
### Logging and Debugging
|
84
|
+
- Debug mode may log sensitive command outputs
|
85
|
+
- Review log files for credential exposure
|
86
|
+
- Use `-l debug` sparingly in production environments
|