-
Notifications
You must be signed in to change notification settings - Fork 82
feat: add xlsx-to-oscal-poam task for poam transformation #2015
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
feat: add xlsx-to-oscal-poam task for poam transformation #2015
Conversation
- Implements xlsx-to-oscal-poam task to transform FedRAMP POA&M Excel templates to OSCAL POAM JSON - Supports all 31 FedRAMP POAM columns with comprehensive field mapping - Creates linked PoamItem, Observation, and Risk objects per row - Includes 34 unit tests with 100% coverage - Adds complete tutorial documentation - Uses deterministic UUIDs for stable updates - Supports validation modes (on/warn/off) Signed-off-by: allanilya <[email protected]>
|
@allanilya Upon first look, this code is very good! Sorry I didn't enable the pipelines sooner. Some initial comments:
If you try For discussion: I'm not sure that validation of fields is needed? The trestle classes employ pydantic, which should enforced some level of validity. I worry that we'll wind up with the transformer and the pydantic classes having different opinions. I'll take a longer look at the code soon. I have not looked at the doc yet... |
XLSX Task Fixes (addressing code review feedback): - Add type hints (-> None) to __init__ methods - Change output filename to plan-of-action-and-milestones.json - Remove FedRAMP and Excel terminology for consistency - Add expected column listing to print_info() output - Remove unused imports in test file - Fix line length issues and comment phrasing for linter CSV Task (new): - Add csv-to-oscal-poam task for CSV file support - Uses csv.DictReader for simple CSV parsing - Shares validation and building logic with XLSX task - Complete test coverage (34 tests) - Test data and configuration files included Both tasks: - 68 tests passing (34 XLSX + 34 CSV) - All code quality checks passing (yapf, flake8) - Follow existing trestle task patterns Signed-off-by: allanilya <[email protected]>
Signed-off-by: allanilya <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Why are so many files changed? (index.nd et. al.)
- Why is there both xlsx and csv tasks?
- make test-cov fails
- make code-lint fails
degenaro
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is the info from a similar trestle xlsx transformation task:
((venv.allanilya) ) degenaro:trestle.ws$ trestle task xlsx-to-oscal-cd -i
trestle.core.commands.task:101 WARNING: Config file was not configured with the appropriate section for the task: "[task.xlsx-to-oscal-cd]"
Help information for xlsx-to-oscal-cd task.
Purpose: From spread sheet and catalog produce OSCAL component_definition file.
Configuration flags sit under [task.xlsx-to-oscal-cd]:
catalog-file = (required) the path of the OSCAL catalog file.
spread-sheet-file = (required) the path of the spread sheet file.
work-sheet-name = (required) the name of the work sheet in the spread sheet file.
column "ControlId" contains control ID.
column "ControlText" contains control text.
columns "NIST Mappings" contain NIST control mappings.
column "ResourceTitle" contains component name.
column "goal_name_id" contains goal name.
column "goal_version" contains goal version.
column "rule_name_id" contains rule name.
column "rule_version" contains rule version.
column "Parameter [optional parameter]" contains parameter name + description, separated by newline.
column "Values default , [alternatives]" contains parameter values.
output-dir = (required) the path of the output directory for synthesized OSCAL .json files.
output-overwrite = (optional) true [default] or false; replace existing output when true.
filter-column = (optional) column heading of yes/no values; process only "yes" rows.
profile-type = (optional) one of ['by-goal', 'by-rule', 'by-control', 'by-check']
The info output from the POAM task should be very similar, please.
|
|
Types of changes
develop->main)Quality assurance (all should be covered).
Summary
This PR implements a new
xlsx-to-oscal-poamtask that transforms FedRAMP Plan of Action and Milestones (POA&M) Excel spreadsheets into OSCAL POAM JSON format.Implemented (Phase 1):
Future Enhancement (Phase 2):
Key links:
Before you merge