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

Update inspect_profile #3247

Open
3 tasks
georgedias opened this issue Jan 29, 2025 · 0 comments
Open
3 tasks

Update inspect_profile #3247

georgedias opened this issue Jan 29, 2025 · 0 comments

Comments

@georgedias
Copy link
Contributor

Need to determine the directory name where to output the skeleton profile based on the STIG or CIS XCCDF benchmark file.

  • remove line 79
      logger.info(`Processing Benchmark Type: ${(benchmarkType === 'cis') ? 'CIS' : 'STIG'}`)
    
  • Replace code block 115-125 with this code
      const isSTIG = (_.get(xmlDoc, 'xccdf:Benchmark.xccdf:title.#text') === undefined)
      logger.info(`Processing Benchmark Type: ${(isSTIG) ? 'STIG' : 'CIS'}`)
      if (flags.output === 'profile') {
        const benchmarkTitle = isSTIG ? _.get(xmlDoc, 'Benchmark.title') : _.get(xmlDoc, 'xccdf:Benchmark.xccdf:title.#text')
        outDir = (benchmarkTitle === undefined)
          ? flags.output
          : benchmarkTitle.replace('Security Technical Implementation Guide', 'stig-baseline').replaceAll(' ', '-').toLowerCase()
      } else {
        outDir = flags.output
      }
    
  • Replace code block 181-183 with this code:
        const readmeObj = (isSTIG)
          ?  getDISAReadmeContent(xmlDoc)
          :  getCISReadmeContent(xmlDoc)
    

Note

All code block numbers are for the current code before any replacements of code.

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

No branches or pull requests

1 participant