Skip to content

Conversation

@allanilya
Copy link

  • 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)

Types of changes

  • Hot fix (emergency fix and release)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation (change which affects the documentation site)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Release (develop -> main)

Quality assurance (all should be covered).

  • My code follows the code style of this project.
  • Documentation for my change is up to date?
  • My PR meets testing requirements.
  • All new and existing tests passed.
  • All commits are signed-off.

Summary

This PR implements a new xlsx-to-oscal-poam task that transforms FedRAMP Plan of Action and Milestones (POA&M) Excel spreadsheets into OSCAL POAM JSON format.

Implemented (Phase 1):

  • Transforms FedRAMP POAM Excel templates to OSCAL POAM JSON
  • Supports all 31 FedRAMP POAM template columns
  • Creates linked PoamItem, Observation, and Risk objects per row
  • Includes 34 comprehensive unit tests (100% coverage)
  • Complete tutorial documentation
  • Deterministic UUID generation for stable updates
  • Configurable validation modes (on/warn/off)
  • Creates new POAM files from scratch

Future Enhancement (Phase 2):

  • Update/merge support for existing POAM files (similar to csv-to-oscal-cd)
  • This will allow reading existing POAM JSON, calculating changes, and preserving UUIDs

Key links:

Before you merge

  • Ensure it is a 'squash commit' if not a release.
  • Ensure CI is currently passing
  • Check sonar. If you are working for a fork a maintainer will reach out, if required.

- 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 allanilya requested a review from a team as a code owner December 12, 2025 18:33
@allanilya allanilya changed the title feat: Add xlsx-to-oscal-poam task for FedRAMP POAM transformation feat: add xlsx-to-oscal-poam task for fedramp poam transformation Dec 12, 2025
@degenaro
Copy link
Collaborator

degenaro commented Dec 16, 2025

@allanilya Upon first look, this code is very good! Sorry I didn't enable the pipelines sooner. Some initial comments:

  • run make code-format
  • run make code-lint
  • the output file name should be plan-of-action-and-milestones.json (not poam.json); I ran trestle validate against the renamed file and it worked!
  • just a few signatures are missing typing: lines 78, 188, 338 should have -> None
  • Please remove mentions of "FedRAMP" and (for consistency with other tasks) "Excel", such as:
    • Transform FedRAMP POAM Excel spreadsheets to OSCAL POAM JSON format.
    • Transform POAM spreadsheet to OSCAL POAM JSON format.

If you try trestle task xlsx-to-oscal-cd -i you'll see that the expected columns are listed. POAM should have likewise, I think.

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...
I suppose that we are stuck with xlsx because the sample data is xlsx. I had in my mind that this would be csv-to-oscal-poam.
@vikas-agarwal76 comments?

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]>
@allanilya allanilya changed the title feat: add xlsx-to-oscal-poam task for fedramp poam transformation feat: add xlsx-to-oscal-poam task for poam transformation Dec 17, 2025
Copy link
Collaborator

@degenaro degenaro left a 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

Copy link
Collaborator

@degenaro degenaro left a 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.

@degenaro
Copy link
Collaborator

degenaro commented Jan 7, 2026

make mdformat is failing in the lint pipeline. Please try running make mdfomat locally on you laptop, then deliver the handful of updated files as part of this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants