vulcan icon indicating copy to clipboard operation
vulcan copied to clipboard

Move to modern SAF JS/TS libs for code genreation

Open rlakey opened this issue 2 years ago • 1 comments

Example

control "VCEM-70-000001" do
  title "ESX Agent Manager must limit the amount of time that each TCP connection is kept alive."
  desc  "
    Denial of service is one threat against web servers.  Many DoS attacks attempt to consume web server resources in such a way that no more resources are available to satisfy legitimate requests. 
    
    In Tomcat, the \"connectionTimeout\" attribute sets the number of milliseconds the server will wait after accepting a connection for the request URI line to be presented. This timeout will also be used when reading the request body (if any). This prevents idle sockets that are not sending HTTP requests from consuming system resources and potentially denying new connections.
  "
  desc  "rationale", ""
  desc  "check", "
    At the command prompt, execute the following command:
    
    # xmllint --xpath '/Server/Service/Connector/@connectionTimeout' /usr/lib/vmware-eam/web/conf/server.xml
    
    Expected result:
    
    connectionTimeout=\"60000\"
    
    If the output does not match the expected result, this is a finding.
  "
  desc  "fix", "
    Navigate to and open:
    
    /usr/lib/vmware-eam/web/conf/server.xml
    
    Configure the <Connector> node with the value:
    
    connectionTimeout=\"60000\"
    
    Restart the service with the following command:
    
    # vmon-cli --restart eam
  "
  impact 0.5
  tag severity: "medium"
  tag gtitle: "SRG-APP-000001-WSR-000001"
  tag gid: nil
  tag rid: nil
  tag stig_id: "VCEM-70-000001"
  tag cci: ["CCI-000054"]
  tag nist: ["AC-10"]
end```


Cookstyle output


Offenses:

controls/VCEM-70-000001.rb:1:1: C: [Correctable] Style/Encoding: Unnecessary utf-8 encoding comment. (https://rubystyle.guide#utf-8)
# -*- encoding : utf-8 -*-
^^^^^^^^^^^^^^^^^^^^^^^^^^
controls/VCEM-70-000001.rb:2:9: C: [Correctable] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. (https://rubystyle.guide#consistent-string-literals)
control "VCEM-70-000001" do
        ^^^^^^^^^^^^^^^^
controls/VCEM-70-000001.rb:3:9: C: [Correctable] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. (https://rubystyle.guide#consistent-string-literals)
  title "ESX Agent Manager must limit the amount of time that each TCP connection is kept alive."
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
controls/VCEM-70-000001.rb:5:198: C: [Correctable] Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)
    Denial of service is one threat against web servers.  Many DoS attacks attempt to consume web server resources in such a way that no more resources are available to satisfy legitimate requests.

                                            ^
controls/VCEM-70-000001.rb:6:1: C: [Correctable] Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)
controls/VCEM-70-000001.rb:9:9: C: [Correctable] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. (https://rubystyle.guide#consistent-string-literals)
  desc  "rationale", ""
        ^^^^^^^^^^^
controls/VCEM-70-000001.rb:9:22: C: [Correctable] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. (https://rubystyle.guide#consistent-string-literals)
  desc  "rationale", ""
                     ^^
controls/VCEM-70-000001.rb:10:9: C: [Correctable] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. (https://rubystyle.guide#consistent-string-literals)
  desc  "check", "
        ^^^^^^^
controls/VCEM-70-000001.rb:12:1: C: [Correctable] Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)
controls/VCEM-70-000001.rb:14:1: C: [Correctable] Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)
controls/VCEM-70-000001.rb:16:1: C: [Correctable] Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)
controls/VCEM-70-000001.rb:18:1: C: [Correctable] Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)
controls/VCEM-70-000001.rb:21:7: C: [Correctable] Layout/ExtraSpacing: Unnecessary spacing detected.
  desc  "fix", "
      ^
controls/VCEM-70-000001.rb:21:9: C: [Correctable] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. (https://rubystyle.guide#consistent-string-literals)
  desc  "fix", "
        ^^^^^
controls/VCEM-70-000001.rb:23:1: C: [Correctable] Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)
controls/VCEM-70-000001.rb:25:1: C: [Correctable] Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)
controls/VCEM-70-000001.rb:27:1: C: [Correctable] Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)
controls/VCEM-70-000001.rb:29:1: C: [Correctable] Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)
controls/VCEM-70-000001.rb:31:1: C: [Correctable] Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)
controls/VCEM-70-000001.rb:35:17: C: [Correctable] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. (https://rubystyle.guide#consistent-string-literals)
  tag severity: "medium"
                ^^^^^^^^
controls/VCEM-70-000001.rb:36:15: C: [Correctable] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. (https://rubystyle.guide#consistent-string-literals)
  tag gtitle: "SRG-APP-000001-WSR-000001"
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
controls/VCEM-70-000001.rb:39:16: C: [Correctable] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. (https://rubystyle.guide#consistent-string-literals)
  tag stig_id: "VCEM-70-000001"
               ^^^^^^^^^^^^^^^^
controls/VCEM-70-000001.rb:40:13: C: [Correctable] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. (https://rubystyle.guide#consistent-string-literals)
  tag cci: ["CCI-000054"]
            ^^^^^^^^^^^^
controls/VCEM-70-000001.rb:41:14: C: [Correctable] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. (https://rubystyle.guide#consistent-string-literals)
  tag nist: ["AC-10"]
             ^^^^^^^
controls/VCEM-70-000001.rb:42:1: C: Layout/EndOfLine: Carriage return character detected. (https://rubystyle.guide#crlf)
controls/VCEM-70-000001.rb:42:1: C: [Correctable] Layout/TrailingWhitespace: Trailing whitespace detected. (https://rubystyle.guide#no-trailing-whitespace)
controls/VCEM-70-000001.rb:57:4: C: [Correctable] Layout/TrailingEmptyLines: Final newline missing. (https://rubystyle.guide#newline-eof)
end


1 file inspected, 27 offenses detected, 26 offenses auto-correctable

rlakey avatar Apr 29 '22 14:04 rlakey