Skip to content
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

feat: initial lula report #599

Merged
merged 37 commits into from
Dec 19, 2024
Merged

feat: initial lula report #599

merged 37 commits into from
Dec 19, 2024

Conversation

CloudBeard
Copy link
Collaborator

@CloudBeard CloudBeard commented Aug 14, 2024

Description

Adds report functionality starting with component definition.

Will report how many controls are mapped per source and per framework for each component. There is the possibility that a component-definition file has multiple sources and multiple frameworks. The current report will list how many controls are in each and will give a % mapped based on the source provided for each.

Running lula generate component --catalog-source https://raw.githubusercontent.com/GSA/fedramp-automation/master/dist/content/rev5/baselines/json/FedRAMP_rev5_MODERATE-baseline-resolved-profile_catalog.json --component 'Keycloak' --requirements ac-12,ac-2,ac-2.1,ac-2.3,ac-2.4,ac-2.5,ac-2.7,ac-3,ac-5,ac-6,ac-6.1,ac-6.2,ac-6.5,ac-6.9,ac-6.10,ac-7,ac-8,au-2,au-3,au-3.1,au-8,au-9.4,au-12,cm-5.1,cm-5.5,ia-2,ia-4.4,ia-5.1,ia-5.2,ia-6,ia-8.1,ia-11,sc-13 --remarks assessment-objective --framework il4

Will show that ac-2 is fixed but also show that other controls aren't broken as a side effect of the fix.

Related Issue

Relates to #223 and #247

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (security config, docs update, etc)

Checklist before merging

@CloudBeard CloudBeard changed the title Initial lula report feat: Initial lula report Aug 14, 2024
@brandtkeller
Copy link
Member

Quick feedback loop - I can trace the code but I would always recommend starting with docs on a new feature.

Capture the purpose - let people challenge that intent.

I don't believe this needs an ADR - so docs would be sufficient.

At the same time I think we should keep challenging if we know enough to pursue it further. Does this provide enough value to be of use or does some infrastructure require more maturation first. Transparently I do not know if we have enough context to make the result meaningful.

@CloudBeard CloudBeard changed the title feat: Initial lula report feat: initial lula report Aug 20, 2024
@CloudBeard
Copy link
Collaborator Author

Still need to add tests but want to figure out where/what packages to create to tidy up the main report code.

Copy link
Member

@brandtkeller brandtkeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trending in the right direction now that we're getting to core of what we need (or can provide currently).

I think we're still missing a bit of big picture vision -> Which I/the team can help define.

See my comment about the context that drives the reporting (as we see it today). Ideally we as a team need to provide a clearer deliverable on our issues (WIP) - but I appreciate you pursuing this nonetheless.

My current take:
Reporting should be a function of collecting available context and reporting accordingly.

  • First iteration starts with component-definition and reports controls available.
  • With the presence of a catalog/profile -> we can overlay that control information to calculate percentages.
  • with the presence of assessment-results we can check satisfied/not-satisfied

Given that - we can start migrating functionality to the oscal model libraries for each model as applicable to get the context we need to return here for collective reporting.

My opinion is that reporting is not singly-model focused and rather total context driven. I may be very wrong - let's chat as a team if anyone feels otherwise.

src/cmd/report/report.go Outdated Show resolved Hide resolved
src/cmd/report/report.go Show resolved Hide resolved
src/cmd/report/report.go Outdated Show resolved Hide resolved
src/cmd/report/report.go Outdated Show resolved Hide resolved
@brandtkeller brandtkeller mentioned this pull request Sep 4, 2024
4 tasks
@brandtkeller brandtkeller added this to the OSCAL Reporting data milestone Sep 4, 2024
@brandtkeller brandtkeller linked an issue Sep 4, 2024 that may be closed by this pull request
6 tasks
@CloudBeard CloudBeard marked this pull request as ready for review September 18, 2024 22:02
Copy link
Member

@brandtkeller brandtkeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues with the current direction.

I would remove the current documentation and run a lula internal gen-cli-docs in order to generate the new CLI docs for this command. Iterate as necessary to try and capture all context in the CLI command code as possible. If you need additional docs place them outside the docs/cli-commands directory.

Otherwise this gets us moving in the right direction - as I mentioned previously, I expect future iterations to be less of a model-by-model reporting structure and rather wholistic reporting of all models - but that is out of scope currently.

src/cmd/report/report.go Outdated Show resolved Hide resolved
src/test/e2e/report_test.go Outdated Show resolved Hide resolved
src/test/e2e/report_test.go Outdated Show resolved Hide resolved
src/cmd/report/report.go Outdated Show resolved Hide resolved
@CloudBeard CloudBeard marked this pull request as draft September 20, 2024 14:19
@meganwolf0
Copy link
Collaborator

Just tested locally - is this il4 supposed to be down in the framework table?
CleanShot 2024-10-11 at 09 07 58

@CloudBeard
Copy link
Collaborator Author

Just tested locally - is this il4 supposed to be down in the framework table? CleanShot 2024-10-11 at 09 07 58

Yea that would make sense. Ill fix that real quick-ish

src/internal/reporting/helpers.go Outdated Show resolved Hide resolved
src/internal/reporting/helpers.go Outdated Show resolved Hide resolved
@CloudBeard CloudBeard marked this pull request as draft October 11, 2024 20:41
@CloudBeard CloudBeard marked this pull request as ready for review December 4, 2024 18:11
src/cmd/report/report.go Outdated Show resolved Hide resolved
src/test/e2e/report_test.go Outdated Show resolved Hide resolved
Copy link
Member

@brandtkeller brandtkeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you might have removed the wrong test.

src/test/e2e/repor_test.go feels redundant while the test that was in src/internal/reporting might still be valid.

@CloudBeard CloudBeard marked this pull request as draft December 11, 2024 16:34
@CloudBeard CloudBeard marked this pull request as ready for review December 13, 2024 18:32
Copy link
Member

@brandtkeller brandtkeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appreciative of you running point here and exposing this as an area of importance for users to give us feedback on.

@brandtkeller brandtkeller merged commit 27e9f25 into main Dec 19, 2024
10 checks passed
@brandtkeller brandtkeller deleted the initial-lula-report branch December 19, 2024 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Reporting of number of controls met by component definitions
3 participants