Skip to content
This repository has been archived by the owner on Aug 20, 2021. It is now read-only.

Revamp project to work with latest OSCAL #88

Merged
merged 110 commits into from
Feb 5, 2020

Commits on Feb 4, 2020

  1. Fix metaschema generation capabilities

    Some file locations changed in the latest OSCAL repo.
    
    Addressing:
    $ go generate
    2019/12/16 14:03:57 open OSCAL/schema/metaschema/oscal-catalog-metaschema.xml: no such file or directory
    exit status 1
    metaschema.go:9: running "go": exit status 1
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    09190f0 View commit details
    Browse the repository at this point in the history
  2. Improve error message

    When generating go out of xml schema errors are likely to occur. It is handy to
    see generated file along the errors as that's exactly what's needed for diagnosis.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    67d76da View commit details
    Browse the repository at this point in the history
  3. Allow multiple import elements in metaschema XML

    Latest OSCAL content uses multiple imports.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    09a858f View commit details
    Browse the repository at this point in the history
  4. Allow multiple import in Metaschema struct

    and process them correctly.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    d992881 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    84a169a View commit details
    Browse the repository at this point in the history
  6. Avoid using '-' character in go package name

    It would be invalid.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    2a6614e View commit details
    Browse the repository at this point in the history
  7. Parse @ref attribute from field

    Newest oscal repo contains references to field definitions instead of direct
    fields. For instance see:
    
             <field ref="description"/>
             <field ref="remarks" in-xml="WITH_WRAPPER"/>
             <field ref="party-id"/>
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    e5a5981 View commit details
    Browse the repository at this point in the history
  8. Implement indirection from field to define-field

    Some types may be defined using <field ref="x"/> element. In that case, we have
    to find relevant <define-field name="x"> element and fetch definition from there.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    69dcbc0 View commit details
    Browse the repository at this point in the history
  9. Remove Assemblies metaschema element

    Assemblies no longer appear in the OSCAL metaschema
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    71c49b8 View commit details
    Browse the repository at this point in the history
  10. Parse @ref attribute from assembly

    Newest oscal repo contains references to assembly definitions instead of direct
    assembly. For instance see:
    
             <assembly ref="metadata"/>
             <assembly ref="back-matter"/>
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    aac0300 View commit details
    Browse the repository at this point in the history
  11. Refactor: Use existing method instead of expanding it

    This will one day allow us to work well with multiple inherited metaschemas.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    b2a8bc1 View commit details
    Browse the repository at this point in the history
  12. Implement indirection from assembly to define-assembly

    Some types may be defined using <assembly ref="x"/> element. In that case, we
    have to find relevant <define-assembly name="x"> element and fetch definition
    from there.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    ebb1e54 View commit details
    Browse the repository at this point in the history
  13. Implement plural of assemblies

    If some assembly is allowed to repeat we have to implement it as slice not as
    pointer. Example may be:
    
             <assembly ref="responsible-party" max-occurs="unbounded">
                <group-as name="responsible-parties" in-json="BY_KEY"/>
             </assembly>
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    2b57abb View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    d4592a6 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    70b63d3 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    b3ea5a7 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    337c1d3 View commit details
    Browse the repository at this point in the history
  18. Implement plural of define-fields

    If some field is allowed to repeat we have to implement it as a slice not as a
    pointer. Example may be:
    
             <field ref="doc-id" max-occurs="unbounded">
                <group-as name="document-ids"/>
             </field>
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    1ad7f08 View commit details
    Browse the repository at this point in the history
  19. Remove support for <fields> elements in OSCAL schema

    These are no longer used.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    19ec205 View commit details
    Browse the repository at this point in the history
  20. Refactor: Pass whole metaschema to the helper method

    instead of list of define-flags. This will later allow us to clean-up a bit.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    0b474ab View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    425cdd8 View commit details
    Browse the repository at this point in the history
  22. Fill in metaschema model tree with references to the particular eleme…

    …nt definitions
    
    This will surely end-up less tedious than getting Def in template.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    bfd0453 View commit details
    Browse the repository at this point in the history
  23. Fix broken comments for flag values

    Previously, for some reason, this was not returning any comments on latest OSCAL
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    def7ed2 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    7643bb4 View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    a83d9d3 View commit details
    Browse the repository at this point in the history
  26. Drop dependency on github.com/mitchellh/go-wordwrap

    no longer needed
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    df0cacc View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    b236af2 View commit details
    Browse the repository at this point in the history
  28. Fix missing flag name

    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    a227c8e View commit details
    Browse the repository at this point in the history
  29. Formatting

    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    12e1ae8 View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    83b6eaa View commit details
    Browse the repository at this point in the history
  31. Configuration menu
    Copy the full SHA
    b74fb7a View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    54a373e View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    0ce377d View commit details
    Browse the repository at this point in the history
  34. Configuration menu
    Copy the full SHA
    dc398b8 View commit details
    Browse the repository at this point in the history
  35. Configuration menu
    Copy the full SHA
    55ea4bd View commit details
    Browse the repository at this point in the history
  36. Configuration menu
    Copy the full SHA
    a5bdb66 View commit details
    Browse the repository at this point in the history
  37. Make PackageName resolution more robust

    To work well with multiple imports at the same time.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    0c051fd View commit details
    Browse the repository at this point in the history
  38. Configuration menu
    Copy the full SHA
    917b56b View commit details
    Browse the repository at this point in the history
  39. Configuration menu
    Copy the full SHA
    613a6fb View commit details
    Browse the repository at this point in the history
  40. Do not override xml root

    Learn how to handle special characters consistently, instead.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    2489e95 View commit details
    Browse the repository at this point in the history
  41. Configuration menu
    Copy the full SHA
    b0a71f7 View commit details
    Browse the repository at this point in the history
  42. Configuration menu
    Copy the full SHA
    fa035b2 View commit details
    Browse the repository at this point in the history
  43. Configuration menu
    Copy the full SHA
    9486666 View commit details
    Browse the repository at this point in the history
  44. Configuration menu
    Copy the full SHA
    4e24577 View commit details
    Browse the repository at this point in the history
  45. Configuration menu
    Copy the full SHA
    c826450 View commit details
    Browse the repository at this point in the history
  46. Remove previous ssp go files

    Previously, it was generated by different name.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    8afa5f7 View commit details
    Browse the repository at this point in the history
  47. Always use original xml name to name struct items in go

    This will not only allow us to have naming consistent, further it will make all
    slices to be named in plural form.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    f69d6c9 View commit details
    Browse the repository at this point in the history
  48. Configuration menu
    Copy the full SHA
    86fffa4 View commit details
    Browse the repository at this point in the history
  49. Configuration menu
    Copy the full SHA
    efe2a9c View commit details
    Browse the repository at this point in the history
  50. Configuration menu
    Copy the full SHA
    f871cf9 View commit details
    Browse the repository at this point in the history
  51. Import types to catalog, profile, and SSP files

    That way users do not need to remember where a particular item is defined and
    users do not need to import nominal_catalog package and validation_root package,
    hence these become internal implementation detail.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    63e02e1 View commit details
    Browse the repository at this point in the history
  52. r/Subcontrol/Control/g

    OSCAL standard went from Controls having Subcontrols to have recursive
    relationship between Controls and hence each Control may have child Controls.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    2e474c9 View commit details
    Browse the repository at this point in the history
  53. Remove dead code

    Latest OSCAL metaschema does not contain <prose> element as first class citizen.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    138fbfd View commit details
    Browse the repository at this point in the history
  54. Replace <as> element with @as-type attribute on define-field

    This is what they did in usnistgov/OSCAL repo as well.
    
    Also update the constraints to the latest list of as-types that appear in there.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    ba7a7e4 View commit details
    Browse the repository at this point in the history
  55. Prose should be Markup instead of simple string

    as it may contain xhtml markup.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    483a3a3 View commit details
    Browse the repository at this point in the history
  56. Fix compilation issues around Prose handling

    We will have to re-implement Prose manipulation later on. Project will be better
    served if we just remove the current implementation and re-implement once the
    project compiles with the latest oscal.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    8f4f307 View commit details
    Browse the repository at this point in the history
  57. Markup field has to be referred to by pointer

    Even though it is just a string for now. We will later need to have struct built
    around the string.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    8d6164e View commit details
    Browse the repository at this point in the history
  58. Fix compilation - SetParam has been renamed to Param

    in master OSCAL repo.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    62816f7 View commit details
    Browse the repository at this point in the history
  59. Fix compilation - Href is no longer struct

    It feels we don't need to over complicate this.
    
    Also, refactor ValidateHref to proper public instance method.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    82b52e5 View commit details
    Browse the repository at this point in the history
  60. Configuration menu
    Copy the full SHA
    ba40798 View commit details
    Browse the repository at this point in the history
  61. Configuration menu
    Copy the full SHA
    456a679 View commit details
    Browse the repository at this point in the history
  62. Fix compilation - misc fixes

    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    dd92442 View commit details
    Browse the repository at this point in the history
  63. Remove hard-coded over abundant items

    Not sure why these were added, but they certainly are no longer needed.
    
    Addressing:
    
    oscal generate catalogs --profile profile.xml
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    3a60dfa View commit details
    Browse the repository at this point in the history
  64. Provide initial oscalkit info command

    With growing number of formats/components, users will be surely confused at
    start. Let's provide them with info command.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    52b8ce9 View commit details
    Browse the repository at this point in the history
  65. Configuration menu
    Copy the full SHA
    512f550 View commit details
    Browse the repository at this point in the history
  66. Configuration menu
    Copy the full SHA
    0d63e6a View commit details
    Browse the repository at this point in the history
  67. Configuration menu
    Copy the full SHA
    b765050 View commit details
    Browse the repository at this point in the history
  68. Refactor: Extract constants

    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    dc18037 View commit details
    Browse the repository at this point in the history
  69. Support parsing SSPs

    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    d56c6c5 View commit details
    Browse the repository at this point in the history
  70. Do not bind plural method to metaschema template

    It is not used.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    d049c32 View commit details
    Browse the repository at this point in the history
  71. Configuration menu
    Copy the full SHA
    5074661 View commit details
    Browse the repository at this point in the history
  72. Drop dependency on github.com/jinzhu/inflection

    It is no longer used.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    466ffe2 View commit details
    Browse the repository at this point in the history
  73. Do not pluralize names of the XML elements

    OSCAL XML elements remain in singular form like
    
        <responsible-party .../>
    
    while on the other hand, JSON contains pluralized items, like
    
        responsible-parties: [
            ...
        ],
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    f48dc7d View commit details
    Browse the repository at this point in the history
  74. Fix golang camelCase naming

    Co-Authored-By: anweiss <2326106+anweiss@users.noreply.github.com>
    isimluk and anweiss committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    9d80bd3 View commit details
    Browse the repository at this point in the history
  75. Refactor: Extract method DocumentType()

    With growing number of document types in OSCAL standard, we will need to
    recognize the document type more often than not.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    84b265a View commit details
    Browse the repository at this point in the history
  76. Introduce oscal convert html

    to covert oscal file to human readable html
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    7815d74 View commit details
    Browse the repository at this point in the history
  77. Remove bundled FedRAMP profiles

    These files are already dated and none of them conform to the latest
    oscal.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    dd0e05e View commit details
    Browse the repository at this point in the history
  78. Remove bundled NIST profiles

    These files are already dated and none of them conform to the latest
    oscal.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    67d3d3d View commit details
    Browse the repository at this point in the history
  79. Remove NIST bundled catalog

    This file is already dated and it does not conform to the latest oscal.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    e2c58b1 View commit details
    Browse the repository at this point in the history
  80. Configuration menu
    Copy the full SHA
    c1d0dc1 View commit details
    Browse the repository at this point in the history
  81. Handle the validation errors more diligently

    This will result in more quality output in cases like xmllint missing.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    b1a1510 View commit details
    Browse the repository at this point in the history
  82. Do not check file existence before validation

    Firstly, with improved error handling, we will get nice error anyway (in case
    the file does not exist). Secondly, cli/cmd/validate already checks the file existence.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    32258f3 View commit details
    Browse the repository at this point in the history
  83. Drop oscalLoader workaround

    It is no longer needed, with the latest oscal json schema.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    16caf97 View commit details
    Browse the repository at this point in the history
  84. Configuration menu
    Copy the full SHA
    68033c7 View commit details
    Browse the repository at this point in the history
  85. OscalSource should be able to tell format of the given resource

    Although, getting the file format out file extension is rather lame, it is what
    other parts of the code so far do. I envision, we will have to rewrite the
    format heuristic with look ahead parser one day. However, at this early stage it
    is good enough.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    2391a0e View commit details
    Browse the repository at this point in the history
  86. Configuration menu
    Copy the full SHA
    a919816 View commit details
    Browse the repository at this point in the history
  87. Configuration menu
    Copy the full SHA
    afce7d0 View commit details
    Browse the repository at this point in the history
  88. Improve oscalkit validate to automatically select relevant OSCAL sc…

    …hema
    
    This will highly improve usability of the tool and thus increase chances that
    people will validate their own files.
    
    Further, validating file automatically shall turn out beneficial to the tool
    itself, once we start validating file oscalkit itself produces.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    436c745 View commit details
    Browse the repository at this point in the history
  89. Configuration menu
    Copy the full SHA
    fdc40ac View commit details
    Browse the repository at this point in the history
  90. Do not hardcode "validation_common_root" package to be skipped

    Even though it is not used in SSP and shall not be imported. It may be used by
    other metaschemas (like component) and thus we should reason about the need of
    importing it.
    
    As a side effect this re-shuffles some of the existing imports.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    3998c70 View commit details
    Browse the repository at this point in the history
  91. Configuration menu
    Copy the full SHA
    1a0e853 View commit details
    Browse the repository at this point in the history
  92. Configuration menu
    Copy the full SHA
    134ef80 View commit details
    Browse the repository at this point in the history
  93. Configuration menu
    Copy the full SHA
    f1e498f View commit details
    Browse the repository at this point in the history
  94. Configuration menu
    Copy the full SHA
    885f07a View commit details
    Browse the repository at this point in the history
  95. Configuration menu
    Copy the full SHA
    dcee3d4 View commit details
    Browse the repository at this point in the history
  96. Convert Opencontrols to OSCAL

    This is skeleton for converting opencontrols. It will be completed in following
    commits.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    efa43df View commit details
    Browse the repository at this point in the history
  97. Marshall Markup correctly

    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    82a5a36 View commit details
    Browse the repository at this point in the history
  98. More metadata for the oscal:ssp generated out of opencontrol

    This completes the required metadata in oscal:ssp. Next step is to actually
    convert each control one by one.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    088a963 View commit details
    Browse the repository at this point in the history
  99. Spill out proper <implemented-requirement/> elements

    for each open control on the input
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    4b614d5 View commit details
    Browse the repository at this point in the history
  100. Configuration menu
    Copy the full SHA
    1283ae8 View commit details
    Browse the repository at this point in the history
  101. Notify user of which filename is actually malformed

    This is especially useful when processing multiple files at once by `oscalkit
    validate`.
    isimluk committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    5ea6957 View commit details
    Browse the repository at this point in the history
  102. Configuration menu
    Copy the full SHA
    9f15df5 View commit details
    Browse the repository at this point in the history
  103. Configuration menu
    Copy the full SHA
    e12fdd8 View commit details
    Browse the repository at this point in the history
  104. Configuration menu
    Copy the full SHA
    7cb53d0 View commit details
    Browse the repository at this point in the history
  105. Update README.md

    Co-Authored-By: anweiss <2326106+anweiss@users.noreply.github.com>
    isimluk and anweiss committed Feb 4, 2020
    Configuration menu
    Copy the full SHA
    bd69de9 View commit details
    Browse the repository at this point in the history

Commits on Feb 5, 2020

  1. Configuration menu
    Copy the full SHA
    f7163f0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5c1cade View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    41bf562 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6699b3c View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    97c7ad1 View commit details
    Browse the repository at this point in the history