Skip to content

Duplicate controls when importing from resolved profile #360

Description

@selenaxiao-nist

Cloning usnistgov/oscal-cli#315
ProfileResolver doesn't resolve profiles correctly in the following case:

Describe the bug

A produced profile can have multiple copies of controls

When does this occur?

When importing from a resolved profile.

How do we replicate the issue?

The specific steps I used to find this issue were:

  1. oscal-cli profile resolve --to=xml liboscal-java/src/test/resources/content/test-oscal-version-profile.xml source-profile.xml
  2. Create another profile (say, derived-profile.xml)
  3. Have <import href="source-profile.xml> <include-all /> </import> inside derived-profile.xml
  4. oscal-cli profile resolve --to=xml derived-profile.xml
  5. Lo and behold, the generated profile has duplicates of the controls in it

source-profile.xml
derived-profile.xml

Expected behavior (i.e. solution)

Only one set of controls from the imported profile in the resolved profile

Activity

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

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions