Skip to content

Commit

Permalink
feat: adds support for rules in YAML format
Browse files Browse the repository at this point in the history
Removes CSV based rule examples
Removes CSV automation for rules
Add action to auto-transform when the YAML is edited

Signed-off-by: Jennifer Power <[email protected]>
  • Loading branch information
jpower432 committed Oct 12, 2023
1 parent 27bed2f commit b07dcb0
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 75 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/transform-rules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Transform Rules
on:
push:
paths:
- 'rules/**'

jobs:
transform-rules:
name: Transform rules content
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Transform rules
id: transform
uses: jpower432/trestle-bot/actions/rules-transform@bug/single-rule-failure
with:
rules_view_path: "rules/"
file_pattern: "*.json,rules/*"
4 changes: 1 addition & 3 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
paths:
- 'component-definitions/**'
- 'markdown/components/**'
- 'data/**'

jobs:
test:
name: Evaluate components
Expand All @@ -26,8 +26,6 @@ jobs:
markdown_path: "markdown/components"
oscal_model: "compdef"
check_only: true
- name: CSV sanity check
run: make check-csv

call-autofix:
needs: [test]
Expand Down
13 changes: 0 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,6 @@ update-subtree:
## Component Definition Custom tasks
############################################################################

# $1 - config path
define update-cd
echo $(1)
trestle task csv-to-oscal-cd -c $(1);
endef

update-cds:
@source $(SCRIPTS_DIR)/trestle.sh && $(foreach f,$(CONFIGS),$(call update-cd,$(f)))
.PHONY: update-cd

check-csv:
@bash scripts/csv_sanity_check.sh

trestlebot-install:
@python3 -m pip install --upgrade pip setuptools && python3 -m pip install -r requirements.txt
.PHONY: trestlebot-install
7 changes: 0 additions & 7 deletions data/example.config

This file was deleted.

3 changes: 0 additions & 3 deletions data/example.csv

This file was deleted.

17 changes: 17 additions & 0 deletions rules/example/Example/rule_1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
x-trestle-rule-info:
name: Test-rule_001
description: Ensure all of the services are running these tests
parameter:
name: prm_1
description: prm_1 description
alternative-values: {'default': '5%', '5pc': '5%', '10pc': '10%', '15pc': '15%', '20pc': '20%'}
default-value: '5%'
profile:
description: FedRAMP REV5 High Baseline
href: profiles/fedramp_rev5_high/profile.json
include-controls:
- id: ac-1
x-trestle-component-info:
name: Example
description: Example Application
type: service
27 changes: 0 additions & 27 deletions scripts/csv_sanity_check.sh

This file was deleted.

22 changes: 0 additions & 22 deletions scripts/get_config_updates.sh

This file was deleted.

0 comments on commit b07dcb0

Please sign in to comment.