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

added validation for suppress regex #46

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

added validation for suppress regex #46

wants to merge 7 commits into from

Conversation

NxPKG
Copy link
Collaborator

@NxPKG NxPKG commented Feb 6, 2025

User description

Notes for Reviewers

This PR fixes #

Signed commits

  • Yes, I signed my commits.

PR Type

Enhancement, Bug fix


Description

  • Added validation for suppression format in suppress.js.

  • Introduced detailed error messages for invalid suppression inputs.

  • Enhanced regex handling by escaping special characters properly.

  • Improved robustness of suppression creation logic.


Changes walkthrough 📝

Relevant files
Enhancement
suppress.js
Added validation and improved regex handling in suppressions

postprocess/suppress.js

  • Added a validateSuppression function to validate suppression format.
  • Introduced regex patterns for pluginId, region, and resourceId.
  • Enhanced error handling with detailed messages for invalid inputs.
  • Improved regex escaping logic for suppression expressions.
  • +42/-1   

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • Copy link

    sourcery-ai bot commented Feb 6, 2025

    Reviewer's Guide by Sourcery

    This PR adds validation for the suppress regex to ensure that the suppression format is valid. It checks for the correct number of parts, and validates the pluginId, region, and resourceId against specific patterns.

    Sequence diagram for suppression validation flow

    sequenceDiagram
        participant C as Client
        participant V as Validator
        participant R as Regex Generator
    
        C->>V: Send suppression expression
        activate V
        Note over V: Split expression into parts
        V->>V: Validate pluginId pattern
        V->>V: Validate region pattern
        V->>V: Validate resourceId pattern
        alt Invalid format
            V-->>C: Throw validation error
        else Valid format
            V->>R: Create regex pattern
            R-->>V: Return compiled regex
            V-->>C: Return validation result
        end
        deactivate V
    
    Loading

    Flow diagram for suppression validation process

    flowchart TD
        A[Start] --> B[Split expression by :]
        B --> C{Check parts length}
        C -->|!= 3| D[Throw Error: Invalid format]
        C -->|= 3| E[Validate pluginId]
        E --> F{pluginId valid?}
        F -->|No| G[Throw Error: Invalid pluginId]
        F -->|Yes| H[Validate region]
        H --> I{region valid?}
        I -->|No| J[Throw Error: Invalid region]
        I -->|Yes| K[Validate resourceId]
        K --> L{resourceId valid?}
        L -->|No| M[Throw Error: Invalid resourceId]
        L -->|Yes| N[Escape special regex chars]
        N --> O[Replace * with .*]
        O --> P[Create RegExp]
        P --> Q[End]
    
    Loading

    File-Level Changes

    Change Details Files
    Added validation for the suppression format.
    • Added a validateSuppression function to check the format of the suppression expression.
    • The validateSuppression function checks if the expression has three parts separated by colons.
    • The validateSuppression function validates the pluginId, region, and resourceId against specific regex patterns.
    • The pluginId is validated to only contain letters and numbers and be between 1-255 characters.
    • The region is validated to only contain letters, numbers, hyphen (-), and underscore (_) and be between 1-255 characters.
    • The resourceId is validated against a specific pattern and must be between 1-255 characters.
    postprocess/suppress.js
    Modified the regex creation to escape special characters.
    • Escaped special regex characters in the suppression expression except for '' which is handled specially.
    • Replaced '' with '.*' to allow wildcard matching.
    postprocess/suppress.js

    Tips and commands

    Interacting with Sourcery

    • Trigger a new review: Comment @sourcery-ai review on the pull request.
    • Continue discussions: Reply directly to Sourcery's review comments.
    • Generate a GitHub issue from a review comment: Ask Sourcery to create an
      issue from a review comment by replying to it. You can also reply to a
      review comment with @sourcery-ai issue to create an issue from it.
    • Generate a pull request title: Write @sourcery-ai anywhere in the pull
      request title to generate a title at any time. You can also comment
      @sourcery-ai title on the pull request to (re-)generate the title at any time.
    • Generate a pull request summary: Write @sourcery-ai summary anywhere in
      the pull request body to generate a PR summary at any time exactly where you
      want it. You can also comment @sourcery-ai summary on the pull request to
      (re-)generate the summary at any time.
    • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
      request to (re-)generate the reviewer's guide at any time.
    • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
      pull request to resolve all Sourcery comments. Useful if you've already
      addressed all the comments and don't want to see them anymore.
    • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
      request to dismiss all existing Sourcery reviews. Especially useful if you
      want to start fresh with a new review - don't forget to comment
      @sourcery-ai review to trigger a new review!
    • Generate a plan of action for an issue: Comment @sourcery-ai plan on
      an issue to generate a plan of action for it.

    Customizing Your Experience

    Access your dashboard to:

    • Enable or disable review features such as the Sourcery-generated pull request
      summary, the reviewer's guide, and others.
    • Change the review language.
    • Add, remove or edit custom review instructions.
    • Adjust other review settings.

    Getting Help

    Copy link

    coderabbitai bot commented Feb 6, 2025

    Warning

    Rate limit exceeded

    @NxPKG has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 12 minutes and 6 seconds before requesting another review.

    ⌛ How to resolve this issue?

    After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

    We recommend that you space out your commits to avoid hitting the rate limit.

    🚦 How do rate limits work?

    CodeRabbit enforces hourly rate limits for each developer per organization.

    Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

    Please see our FAQ for further information.

    📥 Commits

    Reviewing files that changed from the base of the PR and between 9f43b38 and f4ca978.

    📒 Files selected for processing (7)
    • collectors/aws/accessanalyzer/listFindingsV2.js (1 hunks)
    • helpers/aws/api.js (1 hunks)
    • plugins/aws/accessanalyzer/accessAnalyzerActiveFindings.js (3 hunks)
    • plugins/aws/accessanalyzer/accessAnalyzerActiveFindings.spec.js (5 hunks)
    • plugins/azure/advisor/checkAdvisorRecommendations.js (1 hunks)
    • postprocess/suppress.js (1 hunks)
    • postprocess/suppress.spec.js (1 hunks)

    Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

    ❤️ Share
    🪧 Tips

    Chat

    There are 3 ways to chat with CodeRabbit:

    • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
      • I pushed a fix in commit <commit_id>, please review it.
      • Generate unit testing code for this file.
      • Open a follow-up GitHub issue for this discussion.
    • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
      • @coderabbitai generate unit testing code for this file.
      • @coderabbitai modularize this function.
    • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
      • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
      • @coderabbitai read src/utils.ts and generate unit testing code.
      • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
      • @coderabbitai help me debug CodeRabbit configuration file.

    Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

    CodeRabbit Commands (Invoked using PR comments)

    • @coderabbitai pause to pause the reviews on a PR.
    • @coderabbitai resume to resume the paused reviews.
    • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
    • @coderabbitai full review to do a full review from scratch and review all the files again.
    • @coderabbitai summary to regenerate the summary of the PR.
    • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
    • @coderabbitai resolve resolve all the CodeRabbit review comments.
    • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
    • @coderabbitai help to get help.

    Other keywords and placeholders

    • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
    • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
    • Add @coderabbitai anywhere in the PR title to generate the title automatically.

    CodeRabbit Configuration File (.coderabbit.yaml)

    • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
    • Please see the configuration documentation for more information.
    • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

    Documentation and Community

    • Visit our Documentation for detailed information on how to use CodeRabbit.
    • Join our Discord Community to get help, request features, and share feedback.
    • Follow us on X/Twitter for updates and announcements.

    @gitworkflows
    Copy link
    Contributor

    gitworkflows commented Feb 6, 2025

    🎉 Snyk checks have passed. No issues have been found so far.

    security/snyk check is complete. No issues have been found. (View Details)

    Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 Security concerns

    Input Validation:
    While the PR adds validation, the resourceId pattern allows several special characters that could potentially be used for injection attacks if the suppression values are used in sensitive contexts like file paths or database queries. Consider further restricting allowed characters based on the actual usage context.

    ⚡ Recommended focus areas for review

    Regex Pattern

    The resourcePattern regex allows some potentially problematic characters like quotes and backslashes. Consider if these need to be more strictly limited for the resourceId field.

    const resourcePattern = /^[ A-Za-z0-9._~()'!*:@,;+?#$%^&={}\\[\]\\|\"/-]{1,255}$/;  // eslint-disable-line
    Error Handling

    The validateSuppression function throws errors but there's no try-catch block where it's called. Consider adding error handling when validating expressions.

    validateSuppression(expr);

    Copy link

    codiumai-pr-agent-free bot commented Feb 6, 2025

    CI Feedback 🧐

    (Feedback updated until commit d0ea77a)

    A test triggered by this PR failed. Here is an AI-generated analysis of the failure:

    Action: build

    Failed stage: NPM Test [❌]

    Failure summary:

    The action failed due to incompatible Node.js version requirements:

  • Several npm packages require Node.js version 18.0.0 or higher, but the current Node.js version is
    12.22.12
  • Specifically:
    - @azure/[email protected] requires Node.js >= 18.0.0
    - @azure/[email protected]
    requires Node.js >= 18.0.0
    - @octokit/[email protected] requires Node.js >= 18.0.0
    -
    [email protected] requires Node.js >= 14.0.0

  • Relevant error logs:
    1:  ##[group]Operating System
    2:  Ubuntu
    ...
    
    688:  npm WARN notsup Unsupported engine for [email protected]: wanted: {"node":">= 14"} (current: {"node":"12.22.12","npm":"6.14.16"})
    689:  npm WARN notsup Not compatible with your version of node/npm: [email protected]
    690:  npm WARN notsup Unsupported engine for @azure/[email protected]: wanted: {"node":">=18.0.0"} (current: {"node":"12.22.12","npm":"6.14.16"})
    691:  npm WARN notsup Not compatible with your version of node/npm: @azure/[email protected]
    692:  npm WARN notsup Unsupported engine for @azure/[email protected]: wanted: {"node":">=18.0.0"} (current: {"node":"12.22.12","npm":"6.14.16"})
    693:  npm WARN notsup Not compatible with your version of node/npm: @azure/[email protected]
    694:  npm WARN notsup Unsupported engine for @wolfy1339/[email protected]: wanted: {"node":"18 >=18.20 || 20 || >=22"} (current: {"node":"12.22.12","npm":"6.14.16"})
    695:  npm WARN notsup Not compatible with your version of node/npm: @wolfy1339/[email protected]
    696:  npm WARN notsup Unsupported engine for @octokit/[email protected]: wanted: {"node":">= 18"} (current: {"node":"12.22.12","npm":"6.14.16"})
    697:  npm WARN notsup Not compatible with your version of node/npm: @octokit/[email protected]
    ...
    
    744:  For more information, check the blog post at https://a.co/cUPnyil
    745:  engine
    746:  INFO: Determining API calls to make...
    747:  INFO: Found 357 API calls to make for aws plugins
    748:  INFO: Collecting metadata. This may take several minutes...
    749:  ✓ should run with no arguments (63ms)
    750:  exports
    751:  ✓ should use the proper format for each test (259ms)
    752:  [INFO][REGIONS] Could not load all regions from EC2: {"message":"Missing region in config","code":"ConfigError","time":"2025-02-06T10:15:00.952Z"}
    ...
    
    761:  ✓ should NOT traverse objects without allKeys option
    762:  ✓ should NOT travers objects in standard keywords which value is not a schema
    763:  pre and post
    764:  ✓ should traverse schema in pre-order
    765:  ✓ should traverse schema in post-order
    766:  ✓ should traverse schema in pre- and post-order at the same time
    767:  ackPrivateClusterEnabled
    768:  run
    769:  ✓ should FAIL if Cluster does not have Private Cluster enabled
    770:  ✓ should PASS if Cluster have Private Cluster enabled
    771:  ✓ should PASS if No ACK clusters found
    772:  ✓ should UNKNOWN if unable to query ACK clusters
    773:  ✓ should UNKNOWN if unable no Master_url is found for  ACK clusters
    774:  cloudMonitorEnabled
    775:  run
    776:  ✓ should FAIL if Cluster does not have Cloud Monitor Enabled
    777:  ✓ should PASS if Cluster has Cloud Monitor enabled
    778:  ✓ should PASS if No ACK clusters found
    779:  ✓ should UNKNOWN if unable to query ACK clusters
    780:  logServiceEnabled
    781:  run
    782:  ✓ should FAIL if Cluster does not have Log Service enabled
    783:  ✓ should PASS if Cluster has Log Service enabled
    784:  ✓ should PASS if No ACK clusters found
    785:  ✓ should UNKNOWN if unable to query ACK clusters
    786:  ENImultipleIPmode
    787:  run
    788:  ✓ should FAIL if Cluster does not have NetworkPolicy Terway enabled
    789:  ✓ should PASS if Cluster has NetworkPolicy Terway enabled
    790:  ✓ should PASS if No ACK clusters found
    791:  ✓ should UNKNOWN if unable to query ACK clusters
    792:  networkPolicyEnabled
    793:  run
    794:  ✓ should FAIL if Cluster does not have NetworkPolicy enabled
    795:  ✓ should PASS if Cluster has NetworkPolicy enabled
    796:  ✓ should PASS if No ACK clusters found
    797:  ✓ should UNKNOWN if unable to query ACK clusters
    798:  webDashboardDisabled
    799:  run
    800:  ✓ should FAIL if Cluster has web dashboard enabled
    801:  ✓ should PASS if Cluster does not have  web dashboard enabled
    802:  ✓ should PASS if No ACK clusters found
    803:  ✓ should UNKNOWN if unable to query ACK clusters
    804:  actiontrailBucketPrivate
    805:  run
    806:  ✓ should FAIL if ActionTrail trail Bucket ACL allows public access
    807:  ✓ should PASS if ActionTrail trail Bucket ACL allows private access
    808:  ✓ should PASS if no ActionTrail trail found
    809:  ✓ should PASS if no ActionTrail trail with OSS bucket destination found
    810:  ✓ should UNKNOWN if unable to query ActionTrail trails
    811:  ✓ should UNKNOWN if unable to query OSS bucket info
    812:  actiontrailGlobalExportLogs
    813:  run
    814:  ✓ should FAIL if ActionTrail does not have global trail to log all events
    815:  ✓ should FAIL if ActionTrail has global trail to log all events but does not export logs to OSS bucket
    816:  ✓ should PASS if ActionTrail has global trails to log all events
    817:  ✓ should UNKNOWN if unable to query ActionTrail trails
    818:  apiGroupTlsVersion
    819:  run
    820:  ✓ should PASS if API has latest TLS version
    821:  ✓ should FAIL if API does not have latest TLS version
    822:  ✓ should FAIL if API response does not have HttpsPolicy
    823:  ✓ should PASS if no api groups found
    824:  ✓ should UNKNOWN if unable to describe API groups
    825:  ✓ should not return anything if response not received
    826:  apiProtocol
    827:  run
    828:  ✓ should PASS if API has HTTPS protocol configured
    829:  ✓ should FAIL if API does not HTTPS protocol configured
    830:  ✓ should FAIL if API response does not have RequestConfig property
    831:  ✓ should PASS if no APIs are found
    832:  ✓ should UNKNOWN if unable to describe APIs
    833:  ✓ should not return anything if response not received
    834:  dataDisksEncrypted
    835:  run
    836:  ✓ should FAIL if disk is not encrypted
    837:  ✓ should FAIL if Data disk is not encrypted to target encryption level
    838:  ✓ should PASS if data disks are encrypted
    839:  ✓ should PASS if no ECS disks found
    840:  ✓ should UNKNOWN if unable to query ECS disks
    841:  openAllPortsProtocols
    842:  run
    843:  ✓ should PASS if no public open ports found
    844:  ✓ should FAIL if security group has all ports and protocols open to public
    845:  ✓ should PASS if no security groups found
    846:  ✓ should UNKNWON unable to describe security groups
    847:  openCIFS
    848:  run
    849:  ✓ should PASS if no public open ports found
    850:  ✓ should FAIL if security group has CIFS UDP 445 port open to public
    851:  ✓ should PASS if no security groups found
    852:  ✓ should UNKNWON unable to describe security groups
    853:  openCustomPorts
    854:  run
    855:  ✓ should PASS if no public open ports found
    856:  ✓ should FAIL if security group has custom ports open to public
    857:  ✓ should PASS if no security groups found
    858:  ✓ should UNKNWON unable to describe security groups
    859:  openDNS
    860:  run
    861:  ✓ should PASS if no public open ports found
    862:  ✓ should FAIL if security group has RDP TCP 53 port open to public
    863:  ✓ should PASS if no security groups found
    864:  ✓ should UNKNWON unable to describe security groups
    865:  openDocker
    866:  run
    867:  ✓ should PASS if no public open ports found
    868:  ✓ should FAIL if security group has Docker TCP 2375 port open to public
    869:  ✓ should PASS if no security groups found
    870:  ✓ should UNKNWON unable to describe security groups
    871:  openElasticsearch
    872:  run
    873:  ✓ should PASS if no public open ports found
    874:  ✓ should FAIL if security group has Elasticsearch TCP 9200 port open to public
    875:  ✓ should PASS if no security groups found
    876:  ✓ should UNKNWON unable to describe security groups
    877:  openFTP
    878:  run
    879:  ✓ should PASS if no public open ports found
    880:  ✓ should FAIL if security group has FTP TCP 20 port open to public
    881:  ✓ should PASS if no security groups found
    882:  ✓ should UNKNWON unable to describe security groups
    883:  openHadoopNameNode
    884:  run
    885:  ✓ should PASS if no public open ports found
    886:  ✓ should FAIL if security group has HDFSNameNodeMetadataService TCP 8020 port open to public
    887:  ✓ should PASS if no security groups found
    888:  ✓ should UNKNWON unable to describe security groups
    889:  openHadoopNameNodeWebUI
    890:  run
    891:  ✓ should PASS if no public open ports found
    892:  ✓ should FAIL if security group has NameNodeWebUI TCP 50070 port open to public
    893:  ✓ should PASS if no security groups found
    894:  ✓ should UNKNWON unable to describe security groups
    895:  openKibana
    896:  run
    897:  ✓ should PASS if no public open ports found
    898:  ✓ should FAIL if security group has Kibana TCP 5601 port open to public
    899:  ✓ should PASS if no security groups found
    900:  ✓ should UNKNWON unable to describe security groups
    901:  openMySQL
    902:  run
    903:  ✓ should PASS if no public open ports found
    904:  ✓ should FAIL if security group has MySQL TCP 3306 port open to public
    905:  ✓ should PASS if no security groups found
    906:  ✓ should UNKNWON unable to describe security groups
    907:  openNetBIOS
    908:  run
    909:  ✓ should PASS if no public open ports found
    910:  ✓ should FAIL if security group has NetBIOS UDP 137 port open to public
    911:  ✓ should PASS if no security groups found
    912:  ✓ should UNKNWON unable to describe security groups
    913:  openOracle
    914:  run
    915:  ✓ should PASS if no public open ports found
    916:  ✓ should FAIL if security group has Oracle TCP 1521 port open to public
    917:  ✓ should PASS if no security groups found
    918:  ✓ should UNKNWON unable to describe security groups
    919:  openOracleAutoDataWarehouse
    920:  run
    921:  ✓ should PASS if no public open ports found
    922:  ✓ should FAIL if security group has Oracle Auto Data Warehouse TCP 1522 port open to public
    923:  ✓ should PASS if no security groups found
    924:  ✓ should UNKNWON unable to describe security groups
    925:  openPostgreSQL
    926:  run
    927:  ✓ should PASS if no public open ports found
    928:  ✓ should FAIL if security group has PostgreSQL TCP 5432 port open to public
    929:  ✓ should PASS if no security groups found
    930:  ✓ should UNKNWON unable to describe security groups
    931:  openRDP
    932:  run
    933:  ✓ should PASS if no public open ports found
    934:  ✓ should FAIL if security group has RDP TCP 3389 port open to public
    935:  ✓ should PASS if no security groups found
    936:  ✓ should UNKNWON unable to describe security groups
    937:  openSalt
    938:  run
    939:  ✓ should PASS if no public open ports found
    940:  ✓ should FAIL if security group has Salt TCP 4505 port open to public
    941:  ✓ should PASS if no security groups found
    942:  ✓ should UNKNWON unable to describe security groups
    943:  openSMBoTCP
    944:  run
    945:  ✓ should PASS if no public open ports found
    946:  ✓ should FAIL if security group has SMBoTCP TCP 445 port open to public
    947:  ✓ should PASS if no security groups found
    948:  ✓ should UNKNWON unable to describe security groups
    949:  openSMTP
    950:  run
    951:  ✓ should PASS if no public open ports found
    952:  ✓ should FAIL if security group has SMTP TCP 25 port open to public
    953:  ✓ should PASS if no security groups found
    954:  ✓ should UNKNWON unable to describe security groups
    955:  openSQLServer
    956:  run
    957:  ✓ should PASS if no public open ports found
    958:  ✓ should FAIL if security group has SQL Server TCP 1433 port open to public
    959:  ✓ should PASS if no security groups found
    960:  ✓ should UNKNWON unable to describe security groups
    961:  openSSH
    962:  run
    963:  ✓ should PASS if no public open ports found
    964:  ✓ should FAIL if security group has SSH TCP 22 port open to public
    965:  ✓ should PASS if no security groups found
    966:  ✓ should UNKNWON unable to describe security groups
    967:  openTelnet
    968:  run
    969:  ✓ should PASS if no public open ports found
    970:  ✓ should FAIL if security group has Telnet TCP 23 port open to public
    971:  ✓ should PASS if no security groups found
    972:  ✓ should UNKNWON unable to describe security groups
    973:  openVNCClient
    974:  run
    975:  ✓ should PASS if no public open ports found
    976:  ✓ should FAIL if security group has VNC Client TCP 5500 port open to public
    977:  ✓ should PASS if no security groups found
    978:  ✓ should UNKNWON unable to describe security groups
    979:  openVNCServer
    980:  run
    981:  ✓ should PASS if no public open ports found
    982:  ✓ should FAIL if security group has VNC Server TCP 5900 port open to public
    983:  ✓ should PASS if no security groups found
    984:  ✓ should UNKNWON unable to describe security groups
    985:  systemDisksEncrypted
    986:  run
    987:  ✓ should PASS if System disks are encrypted
    988:  ✓ should PASS if System disks are encrypted to target encryption level
    989:  ✓ should FAIL if disk is not encrypted
    990:  ✓ should FAIL if System disk is not encrypted to target encryption level
    991:  ✓ should PASS if no ECS disks found
    992:  ✓ should UNKNOWN if unable to query ECS disks
    993:  bucketCmkEncrypted
    994:  run
    995:  ✓ should FAIL if OSS bucket is not encrypted to required encryption level
    996:  ✓ should FAIL if OSS bucket is not encrypted
    997:  ✓ should PASS if OSS bucket is encrypted to required encryption level
    998:  ✓ should PASS if no OSS buckets found
    999:  ✓ should UNKNOWN if unable to query for OSS buckets
    1000:  ✓ should UNKNOWN if unable to query OSS bucket info
    1001:  bucketCrossRegionReplication
    1002:  run
    1003:  ✓ should FAIL if bucket does not have cross region replication enabled
    1004:  ✓ should FAIL if bucket info does not have cross region replication property
    1005:  ✓ should PASS if bucket has cross region replication enabled
    1006:  ✓ should PASS if no OSS buckets found
    1007:  ✓ should UNKNOWN if unable to query for OSS buckets
    1008:  ✓ should UNKNOWN if unable to query OSS bucket info
    1009:  bucketLoggingEnabled
    1010:  run
    1011:  ✓ should FAIL if bucket does not have logging enabled
    1012:  ✓ should PASS if bucket has logging enabled
    1013:  ✓ should PASS if no OSS buckets found
    1014:  ✓ should UNKNOWN if unable to query for OSS buckets
    1015:  ✓ should UNKNOWN if unable to query OSS bucket info
    1016:  bucketRequestPayment
    1017:  run
    1018:  ✓ should FAIL if bucket does not have pay per requester enabled
    1019:  ✓ should FAIL if payer property is not returned
    1020:  ✓ should PASS if bucket has pay per requester enabled
    1021:  ✓ should PASS if no OSS buckets found
    1022:  ✓ should UNKNOWN if unable to query for OSS buckets
    1023:  ✓ should UNKNOWN if unable to query OSS bucket info
    1024:  ossBucketIpRestriction
    1025:  run
    1026:  ✓ should PASS if OSS bucket has IP restrictions configured
    1027:  ✓ should FAIL if OSS bucket does not have IP restrictions configured
    1028:  ✓ should FAIL if no OSS bucket policy found
    1029:  ✓ should PASS if no OSS buckets found
    1030:  ✓ should UNKNOWN if unable to query for OSS buckets
    1031:  ✓ should UNKNOWN if unable to query OSS bucket policy
    1032:  bucketLifecycle
    1033:  run
    1034:  ✓ should FAIL if bucket does not have lifecycle policies
    1035:  ✓ should PASS if bucket has lifecycle policies enabled
    1036:  ✓ should PASS if bucket has lifecycle policies disabled
    1037:  ✓ should PASS if no OSS buckets found
    1038:  ✓ should UNKNOWN if unable to query for OSS buckets
    1039:  ✓ should UNKNOWN if Unable to query OSS bucket lifecycle policy info
    1040:  ossBucketPrivate
    1041:  run
    1042:  ✓ should FAIL if bucket ACL allows public-read-write access
    1043:  ✓ should PASS if bucket ACL allows private access
    1044:  ✓ should PASS if no OSS buckets found
    1045:  ✓ should UNKNOWN if unable to query for OSS buckets
    1046:  ✓ should UNKNOWN if unable to query OSS bucket info
    1047:  ossBucketSecureTransport
    1048:  run
    1049:  ✓ should PASS if OSS bucket has secure transport enabled
    1050:  ✓ should FAIL if OSS bucket does not have secure transport enabled
    1051:  ✓ should FAIL if no OSS bucket policy found
    1052:  ✓ should PASS if no OSS buckets found
    1053:  ✓ should UNKNOWN if unable to query for OSS buckets
    1054:  ✓ should UNKNOWN if unable to query OSS bucket policy
    1055:  bucketTransferAcceleration
    1056:  run
    1057:  ✓ should FAIL if bucket does not have transfer acceleration enabled
    1058:  ✓ should FAIL if bucket info does not have transfer acceleration property
    1059:  ✓ should PASS if bucket has transfer acceleration enabled
    1060:  ✓ should PASS if no OSS buckets found
    1061:  ✓ should UNKNOWN if unable to query for OSS buckets
    1062:  ✓ should UNKNOWN if unable to query OSS bucket info
    1063:  ossBucketVersioning
    1064:  run
    1065:  ✓ should FAIL if bucket versioning is not enabled
    1066:  ✓ should PASS if bucket versioning is enabled
    1067:  ✓ should PASS if no OSS buckets found
    1068:  ✓ should UNKNOWN if unable to query for OSS buckets
    1069:  ✓ should UNKNOWN if unable to query OSS bucket info
    1070:  accessKeysRotation
    1071:  run
    1072:  ✓ should FAIL if RAM user access keys are not rotated every 90 days or less
    1073:  ✓ should PASS if RAM user access keys are not rotated every 90 days or less
    1074:  ✓ should PASS if RAM user does not have any access keys
    1075:  ✓ should PASS if No RAM users found
    1076:  ✓ should UNKNOWN if unable to query user access keys
    1077:  ✓ should UNKNOWN if unable to query RAM users
    1078:  inactiveUserDisabled
    1079:  run
    1080:  ✓ should FAIL if RAM user is enabled on being inactive for 90 or more days
    1081:  ✓ should PASS if RAM user is disabled on being inactive for 90 or more days
    1082:  ✓ should PASS if RAM user last activity was before 90 days
    1083:  ✓ should PASS if No RAM users found
    1084:  ✓ should UNKNOWN if Unable to query login profile
    1085:  ✓ should UNKNOWN if Unable to query RAM users
    1086:  passwordBlockLogon
    1087:  run
    1088:  ✓ should FAIL if RAM password security policy does not require logon to be blocked after 5 attempts
    1089:  ✓ should PASS if RAM password security policy requires logon to be blocked after 5 attempts
    1090:  ✓ should UNKNOWN if unable to query RAM password policy
    1091:  passwordExpiry
    1092:  run
    1093:  ✓ should FAIL if RAM password security policy does not require password to be expired after 90 days
    1094:  ✓ should PASS if RAM password security policy requires password to be expired after set days
    1095:  ✓ should UNKNOWN if unable to query RAM password policy
    1096:  passwordMinLength
    1097:  run
    1098:  ✓ should FAIL if RAM password security policy does not require minimum length of 14 or greater
    1099:  ✓ should PASS if RAM password security policy require minimum length of 14 or greater
    1100:  ✓ should UNKNOWN if unable to query RAM password policy
    1101:  passwordNoReuse
    1102:  run
    1103:  ✓ should FAIL if RAM password security policy does not requires to prevent reusing 5 previous passwords
    1104:  ✓ should PASS if RAM password security policy requires to prevent reusing 5 previous passwords
    1105:  ✓ should UNKNOWN if unable to query RAM password policy
    1106:  passwordRequiresLowercase
    1107:  run
    1108:  ✓ should FAIL if RAM password security policy does not require lowercase characters
    1109:  ✓ should PASS if RAM password security policy requires lowercase characters
    1110:  ✓ should UNKNOWN if unable to query RAM password policy
    1111:  passwordRequiresNumbers
    1112:  run
    1113:  ✓ should FAIL if RAM password security policy does not require numbers
    1114:  ✓ should PASS if RAM password security policy requires numbers
    1115:  ✓ should UNKNOWN if unable to query RAM password policy
    1116:  passwordRequiresSymbols
    1117:  run
    1118:  ✓ should FAIL if RAM password security policy does not require symbols
    1119:  ✓ should PASS if RAM password security policy requires symbols
    1120:  ✓ should UNKNOWN if unable to query RAM password policy
    1121:  passwordRequiresUppercase
    1122:  run
    1123:  ✓ should FAIL if RAM password security policy does not require uppercase characters
    1124:  ✓ should PASS if RAM password security policy requires uppercase characters
    1125:  ✓ should UNKNOWN if unable to query RAM password policy
    1126:  ramAdminPolicy
    1127:  run
    1128:  ✓ should FAIL if Policy provides admin (*:*) access and attachment count is greater than 0
    1129:  ✓ should PASS if Policy provides admin (*:*) access but attachment count is 0
    1130:  ✓ should PASS if Policy does not provide admin (*:*) access
    1131:  ✓ should PASS if No RAM policies found
    1132:  ✓ should UNKNOWN if Unable to query RAM policies
    1133:  ✓ should UNKNOWN if Unable to get RAM policy
    1134:  ramPolicyAttachments
    1135:  run
    1136:  ✓ should FAIL if User has policies attached
    1137:  ✓ should PASS if no policies are attached to user
    1138:  ✓ should PASS if No RAM users found
    1139:  ✓ should UNKNOWN if Unable to query RAM users
    1140:  usersMfaEnabled
    1141:  run
    1142:  ✓ should FAIL if RAM user does not have MFA device configured
    1143:  ✓ should PASS if RAM user has MFA device configured
    1144:  ✓ should PASS if No RAM users found
    1145:  ✓ should UNKNOWN if Unable to query RAM users
    1146:  rdsAuditingEnabled
    1147:  run
    1148:  ✓ should FAIL if RDS DB instance does not have sql auditing enabled
    1149:  ✓ should PASS if RDS DB instance have sql auditing enabled
    1150:  ✓ should PASS if no RDS DB instances found
    1151:  ✓ should UNKNOWN if unable to query RDS DB instances
    1152:  ✓ should UNKNOWN if unable to query DB sql auditing policy
    1153:  rdsLogConnectionEnabled
    1154:  run
    1155:  ✓ should FAIL if RDS DB instance does not have log_connections parameter enabled
    1156:  ✓ should PASS if RDS DB instance has log_connections parameter enabled
    1157:  ✓ should PASS if no RDS DB instances found
    1158:  ✓ should UNKNOWN if unable to query RDS DB instances
    1159:  ✓ should UNKNOWN if unable to query DB parameters
    1160:  rdsLogDisconnectionsEnabled
    1161:  run
    1162:  ✓ should FAIL if RDS DB instance does not have log_disconnections parameter enabled
    1163:  ✓ should PASS if RDS DB instance has log_disconnections parameter enabled
    1164:  ✓ should PASS if no RDS DB instances found
    1165:  ✓ should UNKNOWN if unable to query RDS DB instances
    1166:  ✓ should UNKNOWN if unable to query DB parameters
    1167:  rdsLogDuration
    1168:  run
    1169:  ✓ should FAIL if RDS DB instance does not have log_duration parameter enabled
    1170:  ✓ should PASS if RDS DB instance has log_duration parameter enabled
    1171:  ✓ should PASS if no RDS DB instances found
    1172:  ✓ should UNKNOWN if unable to query RDS DB instances
    1173:  ✓ should UNKNOWN if unable to query DB parameters
    1174:  rdsPublicAccess
    1175:  run
    1176:  ✓ should FAIL if RDS DB instance is publicly accessible
    1177:  ✓ should PASS if RDS DB instance is not publicly accessible
    1178:  ✓ should PASS if no RDS DB instances found
    1179:  ✓ should UNKNOWN if unable to query RDS DB instances
    1180:  ✓ should UNKNOWN if Unable to query DB IP Array List
    1181:  rdsSqlAuditRetentionPeriod
    1182:  run
    1183:  ✓ should FAIL if RDS DB instance does not have sql audit log retention greater than 180 days
    1184:  ✓ should FAIL if RDS DB instance does not have sql audit log retention greater than set days limit
    1185:  ✓ should PASS if RDS DB instance have sql audit log retention greater than 180 days
    1186:  ✓ should PASS if RDS DB instance have sql audit log retention greater than set days limit
    1187:  ✓ should PASS if no RDS DB instances found
    1188:  ✓ should UNKNOWN if unable to query RDS DB instances
    1189:  ✓ should UNKNOWN if unable to query DB sql audit log retention
    1190:  rdsSslEncryptionEnabled
    1191:  run
    1192:  ✓ should FAIL if RDS instance does not have SSL encryption enabled
    1193:  ✓ should PASS if RDS instance has SSL encryption enabled
    1194:  ✓ should PASS if no RDS DB instances found
    1195:  ✓ should UNKNOWN if unable to query RDS DB instances
    1196:  ✓ should UNKNOWN if unable to query RDS instance SSL info
    1197:  rdsTdeEnabled
    1198:  run
    1199:  ✓ should FAIL if RDS DB instance does not have TDE enabled
    1200:  ✓ should PASS if RDS DB instance have TDE enabled
    1201:  ✓ should PASS if RDS DB instance have engine type other MySQL 5.6 and SQL Server Enterprise Edition
    1202:  ✓ should PASS if no RDS DB instances found
    1203:  ✓ should UNKNOWN if unable to query RDS DB instances
    1204:  ✓ should UNKNOWN if unable to query RDS DB instance TDE
    1205:  securityAgentInstalled
    1206:  run
    1207:  ✓ should FAIL if there are unprotected assets
    1208:  ✓ should PASS if there are no unprotected assets
    1209:  ✓ should UNKNOWN if Unable to query TDS field statistics
    1210:  securityCenterEdition
    1211:  run
    1212:  ✓ should FAIL if Security Center edition is Basic or Anti-virus
    1213:  ✓ should PASS if Security Center edition is Advanced or plus
    1214:  ✓ should UNKNOWN if Unable to query Security Center version config
    1215:  securityNotificationsEnabled
    1216:  run
    1217:  ✓ should FAIL if security notifications are not enabled
    1218:  ✓ should PASS if security notifications are enabled for all alerts
    1219:  ✓ should PASS if no TDS notice config found
    1220:  ✓ should UNKNOWN if Unable to query TDS notice config
    1221:  vulnerabilityScanEnabled
    1222:  run
    1223:  ✓ should FAIL if Vulnerability scan is not enabled on all servers
    1224:  ✓ should PASS if Vulnerability scan is enabled on all servers
    1225:  ✓ should PASS if no vulnerabity config found 
    1226:  ✓ should UNKNOWN if Unable to query 
    1227:  accessAnalyzerActiveFindings
    1228:  run
    1229:  ✓ should FAIL if Amazon IAM access analyzer has active findings.
    1230:  ✓ should PASS if Amazon IAM access analyzer have no active findings.
    1231:  ✓ should PASS if no analyzers found
    1232:  ✓ should UNKNOWN if Unable to query for IAM access analyzers
    1233:  accessAnalyzerEnabled
    1234:  run
    1235:  ✓ should PASS if Access Analyzer is enabled
    1236:  ✓ should FAIL if Access Analyzer is not enabled
    1237:  ✓ should FAIL if Access Analyzer not configured
    1238:  ✓ should UNKNOWN if unable to list Access analyzer
    1239:  ✓ should not return anything if list Access Analyzers response is not found
    1240:  acmCertificateExpiry
    1241:  run
    1242:  ✓ should PASS if certificate expiration date exceeds set PASS number of days in the future
    1243:  ✓ should FAIL if certificate expiration date does not exceed set WARN number of days in the future
    1244:  ✓ should FAIL if certificate has already expired
    ...
    
    1248:  ✓ should UNKNOWN if unable to list ACM certificates
    1249:  ✓ should UNKNOWN if unable to describe ACM certificate
    1250:  acmCertificateHasTags
    1251:  run
    1252:  ✓ should give unknown result if unable to list acm certificates
    1253:  ✓ should give passing result if acm certificates not found.
    1254:  ✓ should give unknown result if unable to query resource group tagging api
    1255:  ✓ should give passing result if acm certificates have tags
    1256:  ✓ should give failing result if eks cluster does not have tags
    1257:  acmSingleDomainNameCertificate
    1258:  run
    1259:  ✓ should PASS if ACM certificate is a single domain name certificate
    1260:  ✓ should FAIL if ACM certificate is a wildcard certificate
    1261:  ✓ should PASS if No ACM certificates found
    1262:  ✓ should UNKNOWN if unable to list ACM certificates
    1263:  ✓ should UNKNOWN if unable to describe ACM certificate
    1264:  acmValidation
    1265:  run
    1266:  ✓ should PASS if ACM certificate is using DNS validations
    1267:  ✓ should FAIL if ACM certificate has failed validations
    1268:  ✓ should WARN if ACM certificate is using EMAIL validation
    1269:  ✓ should PASS if No ACM certificates found
    1270:  ✓ should UNKNOWN if unable to list ACM certificates
    1271:  ✓ should UNKNOWN if unable to describe ACM certificate
    1272:  apigatewayAuthorization
    1273:  run
    1274:  ✓ should return UNKNOWN if unable to query for API Gateway Rest APIs
    1275:  ✓ should return PASS if no API Gateway Rest APIs found
    1276:  ✓ should return FAIL if no authorizers exist for API Gateway Rest API
    1277:  ✓ should return PASS if authorizers exist for API Gateway Rest API
    1278:  ✓ should not return anything if get Rest APIs response is not found
    1279:  apigatewayCertificateRotation
    1280:  run
    1281:  ✓ should PASS if API Gateway API stages do not need client certificate rotation
    1282:  ✓ should FAIL if API Gateway API stage needs client certificate rotation
    1283:  ✓ should FAIL if API Gateway API stage client certificate has already expired
    ...
    
    1285:  ✓ should PASS if No API Gateway Rest API stages found
    1286:  ✓ should PASS if No API Gateway Rest API stage client certificate found
    1287:  ✓ should UNKNOWN if unable to get API Gateway Rest APIs
    1288:  ✓ should UNKNOWN if unable to get API Gateway Rest API stages
    1289:  ✓ should not return anything if get Rest APIs response is not found
    1290:  apigatewayClientCertificate
    1291:  run
    1292:  ✓ should PASS if API Gateway API use client certificate for all stages
    1293:  ✓ should FAIL if API Gateway API does not use client certificate for all stages
    1294:  ✓ should PASS if No API Gateway Rest APIs found
    1295:  ✓ should PASS if No API Gateway Rest API Stages found
    1296:  ✓ should UNKNOWN if unable to get API Gateway Rest APIs
    1297:  ✓ should UNKNOWN if unable to get API Gateway Rest API Stages
    1298:  ✓ should not return anything if get Rest APIs response is not found
    1299:  apigatewayCloudwatchLogs
    1300:  run
    1301:  ✓ should PASS if API Gateway API has CloudWatch Logs enabled for all stages
    1302:  ✓ should FAIL if API Gateway API does not have CloudWatch Logs enabled for stages
    1303:  ✓ should PASS if No API Gateway Rest APIs found
    1304:  ✓ should PASS if No API Gateway Rest API Stages found
    1305:  ✓ should UNKNOWN if unable to get API Gateway Rest APIs
    1306:  ✓ should UNKNOWN if unable to get API Gateway Rest API Stages
    1307:  ✓ should not return anything if get Rest APIs response is not found
    1308:  apigatewayContentEncoding
    1309:  run
    1310:  ✓ should PASS if API Gateway API stage has content encoding enabled
    1311:  ✓ should FAIL if API Gateway API stage does not have content encoding enabled
    1312:  ✓ should PASS if No API Gateway Rest APIs found
    1313:  ✓ should UNKNOWN if unable to get API Gateway Rest APIs
    1314:  ✓ should not return anything if get Rest APIs response is not found
    1315:  apigatewayTlsDefaultEndpoint
    1316:  run
    1317:  ✓ should PASS if No API Gateway rest APIs found
    1318:  ✓ should PASS if API Gateway is not accessible through default endpoint
    1319:  ✓ should FAIL if API Gateway is accessible through default endpoint
    1320:  ✓ should UNKNOWN if unable to query for API Gateways
    1321:  apigatewayPrivateEndpoints
    1322:  run
    1323:  ✓ should PASS if API Gateway API is only accessible through private endpoints
    1324:  ✓ should FAIL if API Gateway API is accessible through public endpoints
    1325:  ✓ should PASS if No API Gateway Rest APIs found
    1326:  ✓ should UNKNOWN if unable to get API Gateway Rest APIs
    1327:  ✓ should not return anything if get Rest APIs response is not found
    1328:  apigatewayRequestValidation
    1329:  run
    1330:  ✓ should return UNKNOWN if unable to query for API Gateway Rest APIs
    1331:  ✓ should return PASS if no API Gateway Rest APIs found
    1332:  ✓ should return FAIL if no request validators exist for API Gateway Rest API
    1333:  ✓ should return PASS if validators exist for API Gateway Rest API
    1334:  ✓ should not return anything if get Rest APIs response is not found
    1335:  apigatewayResponseCaching
    1336:  run
    1337:  ✓ should PASS if Response caching is enabled for API Gateway API stage
    1338:  ✓ should FAIL if Response caching is not enabled for API Gateway API stage
    1339:  ✓ should PASS if No API Gateway Rest APIs found
    1340:  ✓ should PASS if No API Gateway Rest API Stages found
    1341:  ✓ should UNKNOWN if unable to get API Gateway Rest APIs
    1342:  ✓ should UNKNOWN if unable to get API Gateway Rest API Stages
    1343:  ✓ should not return anything if get Rest APIs response is not found
    1344:  apigatewayTracingEnabled
    1345:  run
    1346:  ✓ should PASS if API Gateway API has tracing enabled for all stages
    1347:  ✓ should FAIL if API Gateway API does not have tracing enabled for stages
    ...
    
    1360:  ✓ should return UNKNOWN if unable to query for api stages
    1361:  apigatewayV2Authorization
    1362:  run
    1363:  here
    1364:  ✓ should return UNKNOWN if unable to query for API Gateway v2 APIs
    1365:  here
    1366:  ✓ should return PASS if no API Gateway Rest APIs found
    1367:  here
    1368:  ✓ should return FAIL if no authorizers exist for API Gateway Rest API
    1369:  here
    1370:  ✓ should return PASS if authorizers exist for API Gateway V2 API
    1371:  here
    1372:  ✓ should not return anything if get Rest APIs response is not found
    1373:  apigatewayWafEnabled
    1374:  run
    1375:  ✓ should PASS if API Gateway API has WAF enabled for all stages
    1376:  ✓ should FAIL if API Gateway API does not have WAF enabled for stages
    1377:  ✓ should PASS if No API Gateway Rest APIs found
    1378:  ✓ should PASS if No API Gateway Rest API Stages found
    1379:  ✓ should UNKNOWN if unable to get API Gateway Rest APIs
    1380:  ✓ should UNKNOWN if unable to get API Gateway Rest API Stages
    1381:  ✓ should not return anything if get Rest APIs response is not found
    1382:  apiStageLevelCacheEncryption
    1383:  run
    1384:  ✓ should PASS if API Gateway stage encrypts cache data
    1385:  ✓ should FAIL if API Gateway stage does not encrypt cache data
    ...
    
    1387:  ✓ should PASS if No API Gateway Rest APIs found
    1388:  ✓ should PASS if No API Gateway Rest API Stages found
    1389:  ✓ should UNKNOWN if unable to get API Gateway Rest APIs
    1390:  ✓ should UNKNOWN if unable to get API Gateway Stages
    1391:  apigatewayCustomDomainDeprecatedProtocol
    1392:  run
    1393:  ✓ should PASS if No API Gateway Custom Domains found
    1394:  ✓ should PASS if API Gateway Custom Domain is using current minimum TLS version
    1395:  ✓ should FAIL if API Gateway Custom Domain is using deprecated TLS version
    1396:  ✓ should UNKNOWN if unable to query for API Gateways
    1397:  detailedCloudWatchMetrics
    1398:  run
    1399:  ✓ should PASS if API Gateway API has detailed CloudWatch metrics enabled for all stages
    1400:  ✓ should FAIL if API Gateway API does not have detailed CloudWatch metrics enabled for stages
    1401:  ✓ should PASS if No API Gateway Rest APIs found
    1402:  ✓ should PASS if No API Gateway Rest API Stages found
    1403:  ✓ should UNKNOWN if unable to get API Gateway Rest APIs
    1404:  ✓ should UNKNOWN if unable to get API Gateway Rest API Stages
    1405:  ✓ should not return anything if get Rest APIs response is not found
    1406:  flowEncrypted
    1407:  run
    1408:  ✓ should PASS if AppFlow flow is encrypted with desired encryption level
    1409:  ✓ should FAIL if AppFlow flow is not encrypted with desired encryption level
    1410:  ✓ should PASS if no AppFlow flows found
    1411:  ✓ should UNKNOWN if unable to list AppFlow flows
    1412:  ✓ should UNKNOWN if unable to list KMS keys
    1413:  appmeshTLSRequired
    1414:  run
    1415:  ✓ should PASS if App Mesh virtual gateway listeners restrict TLS enabled connections
    1416:  ✓ should FAIL if App Mesh vitual gateway listeners does not restrict TLS enabled connections
    1417:  ✓ should PASS if no App Mesh meshes found
    1418:  ✓ should UNKNOWN if Unable to list App Mesh meshes
    1419:  ✓ should UNKNOWN if unable to list App Mesh virtual gateways
    1420:  ✓ should not return anything if list App Mesh meshes response not found
    1421:  appmeshVGAccessLogging
    1422:  run
    1423:  ✓ should PASS if access logging is enabled and configured for Amazon App Mesh virtual gateways
    1424:  ✓ should FAIL if access logging is not enabled for Amazon App Mesh virtual gateways
    1425:  ✓ should PASS if No App Meshes found
    1426:  ✓ should UNKNOWN if unable to query for App Mesh meshes
    1427:  ✓ should UNKNOWN if unable to query for App Mesh virtual gateways
    1428:  ✓ should not return anything if list App Meshes response not found
    1429:  appmeshVGHealthChecks
    1430:  run
    1431:  ✓ should PASS if health check policies are configured for Amazon App Mesh virtual gateways
    1432:  ✓ should FAIL if health check policies are not configured for Amazon App Mesh virtual gateways
    1433:  ✓ should PASS if No App Meshes found
    1434:  ✓ should UNKNOWN if unable to query for App Mesh meshes
    1435:  ✓ should UNKNOWN if unable to query for App Mesh virtual gateways
    1436:  ✓ should not return anything if list App Meshes response not found
    1437:  restrictExternalTraffic
    1438:  run
    1439:  ✓ should PASS if App Mesh mesh does not allow access to external services
    1440:  ✓ should FAIL if App Mesh mesh allows access to external services
    1441:  ✓ should PASS if no App Meshes found
    1442:  ✓ should UNKNOWN if Unable to query for App Mesh meshes
    1443:  ✓ should UNKNOWN if Unable to describe App Mesh mesh
    1444:  serviceEncrypted
    1445:  run
    1446:  ✓ should PASS if App Runner service is encrypted with desired encryption level
    1447:  ✓ should FAIL if App Runner service not encrypted with desired encryption level
    1448:  ✓ should PASS if no App Runner service found
    1449:  ✓ should UNKNOWN if unable to list Services
    1450:  ✓ should UNKNOWN if unable to list KMS keys
    1451:  workgroupEncrypted
    1452:  run
    1453:  ✓ should PASS if Athena workgroup is using encryption
    1454:  ✓ should PASS if Athena primary workgroup does not have encryption enabled but is not in use.
    1455:  ✓ should FAIL if Athena workgroup is not using encryption
    1456:  ✓ should PASS if no Athena workgroups found
    1457:  ✓ should UNKNOWN if unable to list Athena workgroups
    1458:  ✓ should UNKNOWN if unable to describe Athena workgroup
    1459:  ✓ should not return any results if list workgroups response not found
    1460:  workgroupEnforceConfiguration
    1461:  run
    1462:  ✓ should PASS if Athena workgroup is enforcing configuration options
    1463:  ✓ should PASS if Athena primary workgroup is not enforcing configuration options but is not in use
    1464:  ✓ should FAIL if Athena workgroup is not enforcing configuration options
    1465:  ✓ should PASS if no Athena workgroups found
    1466:  ✓ should UNKNOWN if unable to list Athena workgroups
    1467:  ✓ should UNKNOWN if unable to describe Athena workgroup
    1468:  ✓ should not return any results if list workgroups response not found
    1469:  auditmanagerDataEncrypted
    1470:  run
    1471:  ✓ should PASS if Audit Manager data is encrypted with desired encryption level
    1472:  ✓ should FAIL if Audit Manager data is not encrypted with desired encryption level
    1473:  ✓ should PASS if Audit Manager is not setup for the region
    1474:  ✓ should UNKNOWN if unable to get Audit Manager settings
    1475:  ✓ should UNKNOWN if unable to list KMS keys
    1476:  appTierAsgApprovedAmi
    1477:  run
    1478:  ✓ should PASS if Launch Configuration for App-Tier Auto Scaling group is using approved AMIs
    1479:  ✓ should FAIL if Launch Configuration for App-Tier Auto Scaling group is not using active AMIs
    1480:  ✓ should FAIL if Launch Configuration for App-Tier Auto Scaling group is not using any AMI
    ...
    
    1482:  ✓ should PASS if no App-Tier Auto Scaling groups found
    1483:  ✓ should PASS if no Auto Scaling groups found
    1484:  ✓ should UNKNOWN if unable to describe Auto Scaling groups
    1485:  ✓ should not return anything if describe Auto Scaling groups response not found
    1486:  ✓ should not return anything if App-Tier tag key is not provided in settings
    1487:  appTierAsgCloudWatchLogs
    1488:  run
    1489:  ✓ should PASS if App-Tier Auto Scaling launch configuration is using CloudWatch Logs agent
    1490:  ✓ should FAIL if App-Tier Auto Scaling launch configuration is not using CloudWatch Logs agent
    1491:  ✓ should UNKNOWN if unable to describe launch configuration for App-Tier Auto Scaling group
    1492:  ✓ should PASS if no App-Tier Auto Scaling groups found
    1493:  ✓ should PASS if no Auto Scaling groups found
    1494:  ✓ should UNKNOWN if unable to describe Auto Scaling groups
    1495:  ✓ should not return anything if no Auto Scaling groups found
    1496:  appTierIamRole
    1497:  run
    1498:  ✓ should PASS if launch configuration for App-Tier group has customer IAM role configured
    1499:  ✓ should FAIL if launch configuration for App-Tier group does not have customer IAM role configured
    ...
    
    1502:  ✓ should PASS if no App-Tier Auto Scaling groups found
    1503:  ✓ should PASS if no Auto Scaling launch configurations found
    1504:  ✓ should UNKNOWN if unable to describe Auto Scaling groups
    1505:  ✓ should UNKNOWN if unable to describe Auto Scaling launch configurations
    1506:  ✓ should not return anything if no response for describe Auto Scaling groups
    1507:  asgActiveNotifications
    1508:  run
    1509:  ✓ should PASS if notification are active for auto scaling group
    1510:  ✓ should FAIL if notification are not active for auto scaling group
    1511:  ✓ should UNKNOWN if unable to describe auto scaling group found
    1512:  ✓ should not return anything if no auto scaling group found
    1513:  ✓ should FAIL if No auto scaling group notification configurations found
    1514:  asgCooldownPeriod
    1515:  run
    1516:  ✓ should PASS if Amazon Auto Scaling Groups are utilizing cool down period
    1517:  ✓ should FAIL if the cool down period setting is not properly configured for the selected Amazon ASG
    1518:  ✓ should PASS if no AutoScaling groups found
    1519:  ✓ should UNKNOWN if an error occurs while describing AutoScaling groups
    1520:  ✓ should not return anything if unable to query for AutoScaling groups
    1521:  asgMissingELB
    1522:  run
    1523:  ✓ should PASS if AutoScaling group utilizes active load balancer
    1524:  ✓ should FAIL if AutoScaling group utilizes inactive load balancer
    1525:  ✓ should FAIL if AutoScaling group does not have any ELB associated
    1526:  ✓ should PASS if AutoScaling group does not utilize a load balancer
    1527:  ✓ should UNKNOWN if unable to describe AutoScaling group found
    1528:  ✓ should not return anything if no AutoScaling group found
    1529:  asgMissingSecurityGroups
    1530:  run
    1531:  ✓ should PASS if Auto Scaling launch configuration does not reference any missing EC2 security group
    1532:  ✓ should FAIL if Auto Scaling launch configuration references missing EC2 security group(s)
    1533:  ✓ should PASS if no Auto Scaling launch configurations found
    1534:  ✓ should PASS if Auto Scaling launch configuration does not have any security groups associated
    1535:  ✓ should FAIL if no EC2 security groups found
    1536:  ✓ should UNKNOWN if unable to describe Auto Scaling launch configurations
    1537:  ✓ should not return anything if describe Auto Scaling launch configurations response not found
    1538:  asgMultiAz
    1539:  run
    1540:  ✓ should PASS if Auto Scaling group utilizes multiple availability zones
    1541:  ✓ should FAIL if Auto Scaling group utilizes one availability zone
    1542:  ✓ should PASS if no Auto Scaling groups found 
    1543:  ✓ should UNKNOWN if error describing Auto Scaling groups
    1544:  ✓ should not return anything if unable to describe Auto Scaling groups
    1545:  asgSuspendedProcesses
    1546:  run
    1547:  ✓ should PASS if AutoScaling group does not have any suspended process
    1548:  ✓ should FAIL if AutoScaling group has suspended processes
    1549:  ✓ should PASS if no AutoScaling groups found 
    1550:  ✓ should UNKNOWN if an error occurs while describing AutoScaling groups
    1551:  ✓ should not return anything if unable to query for AutoScaling groups
    1552:  asgUnusedLaunchConfiguration
    1553:  run
    1554:  ✓ should PASS if Auto Scaling launch configuration is being used
    1555:  ✓ should FAIL if Auto Scaling launch configuration is not being used
    1556:  ✓ should PASS if no Auto Scaling launch configurations found
    1557:  ✓ should UNKNOWN if Unable to query for Auto Scaling launch configurations
    1558:  elbHealthCheckActive
    1559:  run
    1560:  ✓ should PASS if Auto Scaling group does not use ELBs
    1561:  ✓ should PASS if Auto Scaling group has ELB health check active
    1562:  ✓ should PASS if Auto Scaling group does not use ELBs
    1563:  ✓ should FAIL if Auto Scaling group does not have ELB health check active
    1564:  ✓ should PASS if no Auto Scaling groups found
    1565:  ✓ should UNKNOWN if unable to describe Auto Scaling groups
    1566:  ✓ should not return anything if no response found for describe Auto Scaling groups
    1567:  emptyASG
    1568:  run
    1569:  ✓ should PASS if autoscaling group contains instance(s)
    1570:  ✓ should FAIL if autoscaling group does not contain instance(s)
    1571:  ✓ should PASS if no autoscaling group data found 
    1572:  ✓ should UNKNOWN if unable to describe autoscaling group found
    1573:  ✓ should not return anything if no autoscaling group found
    1574:  sameAzElb
    1575:  run
    1576:  ✓ should PASS if load balancer is in the same Availability Zone as of AutoScaling group
    1577:  ✓ should PASS if AutoScaling does not utilizes load balancer as HealthCheckType
    1578:  ✓ should FAIL if load balancer is not in the same Availability Zone as of AutoScaling group
    1579:  ✓ should FAIL if autoscaling group utilizes an inactive load balancer
    1580:  ✓ should UNKOWN if unable to query for load balancers
    1581:  ✓ should UNKNOWN if unable to describe autoscaling groups
    1582:  ✓ should not return anything if no autoscaling group found
    1583:  webTierAsgApprovedAmi
    1584:  run
    1585:  ✓ should PASS if Launch Configuration for Web-Tier Auto Scaling group is using approved AMIs
    1586:  ✓ should FAIL if Launch Configuration for Web-Tier Auto Scaling group is not using active AMIs
    1587:  ✓ should FAIL if Launch Configuration for Web-Tier Auto Scaling group is not using any AMI
    ...
    
    1589:  ✓ should PASS if no Web-Tier Auto Scaling groups found
    1590:  ✓ should PASS if no Auto Scaling groups found
    1591:  ✓ should UNKNOWN if unable to describe Auto Scaling groups
    1592:  ✓ should not return anything if describe Auto Scaling groups response not found
    1593:  ✓ should not return anything if Web-Tier tag key is provided in settings
    1594:  webTierAssociatedElb
    1595:  run
    1596:  ✓ should PASS if Web-Tier Auto Scaling group has ELB associated
    1597:  ✓ should FAIL if Web-Tier Auto Scaling group does not have ELB associated
    1598:  ✓ should PASS if no Auto Scaling groups found
    1599:  ✓ should PASS if no Web-Tier Auto Scaling groups found
    1600:  ✓ should UNKNOWN if unable to describe Auto Scaling groups
    1601:  ✓ should not return anything if describe Auto Scaling groups response not found
    1602:  webTierAsgCloudWatchLogs
    1603:  run
    1604:  ✓ should PASS if Web-Tier Auto Scaling launch configuration has CloudWatch logs enabled
    1605:  ✓ should FAIL if Web-Tier Auto Scaling launch configuration does not have CloudWatch logs enabled
    1606:  ✓ should UNKNOWN if unable to describe launch configuration for Web-Tier Auto Scaling group
    1607:  ✓ should PASS if no Web-Tier Auto Scaling groups found
    1608:  ✓ should PASS if no Auto Scaling groups found
    1609:  ✓ should UNKNOWN if unable to describe Auto Scaling groups
    1610:  ✓ should not return anything if no Auto Scaling groups found
    1611:  webTierIamRole
    1612:  run
    1613:  ✓ should PASS if launch configuration for Web-Tier group has customer IAM role configured
    1614:  ✓ should FAIL if launch configuration for Web-Tier group does not have customer IAM role configured
    ...
    
    1617:  ✓ should PASS if no Web-Tier Auto Scaling groups found
    1618:  ✓ should PASS if no Auto Scaling launch configurations found
    1619:  ✓ should UNKNOWN if unable to describe Auto Scaling groups
    1620:  ✓ should UNKNOWN if unable to describe Auto Scaling launch configurations
    1621:  ✓ should not return anything if no response for describe Auto Scaling groups
    1622:  backupDeletionProtection
    1623:  run
    1624:  ✓ should PASS if Backup vault has deletion protection enabled
    1625:  ✓ should FAIL if Backup vault does not have deletion protection enabled
    1626:  ✓ should FAIL if no access policy found for Backup vault
    1627:  ✓ should PASS if no Backup vault list found
    1628:  ✓ should UNKNOWN if Unable to query for Backup vault list
    1629:  ✓ should UNKNOWN if Unable to get Backup vault policy
    1630:  backupInUseForRDSSnapshots
    1631:  run
    1632:  ✓ should PASS if Backup service is in use for RDS snapshots
    1633:  ✓ should FAIL if Backup service is not in use for RDS snapshots
    1634:  ✓ should PASS if no RDS snapshots found
    1635:  ✓ should UNKNOWN if Unable to query for RDS snapshots
    1636:  backupNotificationEnabled
    1637:  run
    1638:  ✓ should PASS if Backup vault is configured to send alert notifications for failed Backup job events
    1639:  ✓ should FAIL if Backup vault is not configured to send alert notifications for failed Backup job events
    1640:  ✓ should FAIL if Backup vault does not have any notifications configured
    1641:  ✓ should PASS if no Backup vault list found
    1642:  ✓ should UNKNOWN if Unable to query for Backup vault list
    1643:  ✓ should UNKNOWN if Unable to get event notifications for selected Amazon Backup vault
    1644:  backupResourceProtection
    1645:  run
    1646:  ✓ should PASS if All desired resource types are protected by Backup service
    1647:  ✓ should FAIL if These desired resource types are not protected by Backup service
    1648:  ✓ should UNKNOWN Unable to query for Backup resource type opt in preference
    1649:  backupVaultEncrypted
    1650:  run
    1651:  ✓ should PASS if Backup Vault is encrypted with desired encryption level
    1652:  ✓ should FAIL if Backup Vault is not encrypted with desired encyption level
    1653:  ✓ should PASS if no Backup vault  found
    1654:  ✓ should UNKNOWN if unable to list Backup vault
    1655:  ✓ should UNKNOWN if unable to list KMS keys
    1656:  backupVaultHasTags
    1657:  run
    1658:  ✓ should PASS if Backup vault have tags
    1659:  ✓ should FAIL if Backup vault does not have tags
    1660:  ✓ should PASS if no Backup vault list found
    1661:  ✓ should UNKNOWN if Unable to query for Backup vault list
    1662:  ✓ should give unknown result if unable to query resource group tagging api
    1663:  backupVaultPolicies
    1664:  run
    1665:  ✓ should PASS if Backup vault does not allow  global access to the action
    1666:  ✓ should FAIL if Backup vault allow global access to the action
    1667:  ✓ should PASS if no Backup vault list found
    1668:  ✓ should UNKNOWN if Unable to query for Backup vault list
    1669:  ✓ should UNKNOWN if Unable to get Backup vault policy
    1670:  compliantLifecycleConfigured
    1671:  run
    1672:  ✓ should PASS if Backup plan has lifecycle configuration enabled
    1673:  ✓ should FAIL if Backup plan does not have lifecycle configuration enabled
    1674:  ✓ should PASS if no Backup plans found
    1675:  ✓ should UNKNOWN if Unable to list Backup plans
    1676:  bedrockInUse
    1677:  run
    1678:  ✓ should PASS if Bedrock service is in use
    1679:  ✓ should FAIL if Bedrock service is not in use
    1680:  ✓ should UNKNOWN if unable to query Bedrock custom model
    1681:  customModelEncryptionEnabled
    1682:  run
    1683:  ✓ should PASS if Bedrock Custom Model is Encrypted using CMK
    1684:  ✓ should FAIL if Bedrock Custom Model is encrypted with AWS owned key
    1685:  ✓ should PASS if the desired encryption level for bedrock custom model is awskms
    1686:  ✓ should PASS if no Bedrock custom model found
    1687:  ✓ should UNKNOWN if unable to list Bedrock custom model
    1688:  customModelHasTags
    1689:  run
    1690:  ✓ should PASS if Bedrock custom model has tags
    1691:  ✓ should FAIL if Bedrock custom model doesnot have tags
    1692:  ✓ should PASS if no Bedrock custom model found
    1693:  ✓ should UNKNOWN if unable to query Bedrock custom model
    1694:  ✓ should give unknown result if unable to query resource group tagging api
    1695:  customModelInVpc
    1696:  run
    1697:  ✓ should PASS if Bedrock Custom Model has Vpc configured
    1698:  ✓ should FAIL if Bedrock Custom Model have not Vpc configured
    1699:  ✓ should PASS if no Bedrock custom model found
    1700:  ✓ should UNKNOWN if unable to list Bedrock custom model
    1701:  modelInvocationLoggingEnabled
    1702:  run
    1703:  ✓ should PASS if model invocation logging is enabled for bedrock models
    1704:  ✓ should FAIL if model invocation logging is disabled for bedrock models
    1705:  ✓ should UNKNOWN if unable to query for model invocation logging
    1706:  privateCustomModel
    1707:  run
    1708:  ✓ should PASS if Bedrock Custom Model is a private model
    1709:  ✓ should FAIL if Bedrock Custom Model have not Vpc configured
    1710:  ✓ should FAIL if Bedrock Custom Model is not a private model
    1711:  ✓ should PASS if no Bedrock custom model found
    1712:  ✓ should UNKNOWN if unable to list Bedrock custom model
    1713:  cloudformationAdminPriviliges
    1714:  run
    1715:  ✓ should PASS if CloudFormation stack does not have admin privileges
    1716:  ✓ should FAIL if CloudFormation stack has admin privileges
    ...
    
    1720:  ✓ should UNKNOWN if unable to list role policies
    1721:  ✓ should not return anything if list CloudFormation stacks response not found
    1722:  CloudFormation Deletion Policy in Use
    1723:  run
    1724:  ✓ should return unknown result if unable to list the CloudFormation stacks
    1725:  ✓ should return passing result if unable to list CloudFormation stacks information
    1726:  ✓ should return unknown result if no CloudFormation stacks found in region
    1727:  ✓ should return passing result if deletion policy is used for CloudFormation stack
    1728:  ✓ should return failing result if deletion policy is not used for CloudFormation stack
    1729:  cloudformationInUse
    1730:  run
    1731:  ✓ should PASS if Amazon CloudFormation service is currently in use
    1732:  ✓ should FAIL if Amazon CloudFormation service is not currently in use
    1733:  ✓ should UNKNOWN if Unable to query CloudFormation stacks
    1734:  driftDetection
    1735:  run
    1736:  ✓ should PASS if CloudFormation stack is not in drifted state
    1737:  ✓ should FAIL if CloudFormation stack is in drifted state
    1738:  ✓ should PASS if no CloudFormation stacks found
    1739:  ✓ should UNKNOWN if unable to list stacks
    1740:  ✓ should not return any results if list stacks response not found
    1741:  plaintextParameters
    1742:  run
    1743:  ✓ should PASS if template does not contain any potentially-sensitive parameters
    1744:  ✓ should PASS if template contains any potentially-sensitive parameters but with NoEcho enabled
    1745:  ✓ should FAIL if template contains any potentially-sensitive parameters
    1746:  ✓ should PASS if no CloudFormation stacks found
    1747:  ✓ should UNKNOWN if unable to list stacks
    1748:  ✓ should UNKNOWN if unable to describe stacks
    1749:  ✓ should UNKNOWN if no CloudFormation stack details found
    1750:  ✓ should not return any results if list stacks response is not found
    1751:  stackFailedStatus
    1752:  run
    1753:  ✓ should PASS if CloudFormation stack is not in failed state
    1754:  ✓ should PASS if CloudFormation stack is in failed state for less than the failed hours limit
    1755:  ✓ should FAIL if CloudFormation stack is in failed state for more than the failed hours limit
    1756:  ✓ should PASS if no CloudFormation stacks found
    1757:  ✓ should UNKNOWN if unable to describe stacks
    1758:  ✓ should not return any results if describe stacks response is not found
    1759:  stackNotifications
    1760:  run
    1761:  ✓ should PASS if CloudFormation stack has SNS topic associated
    1762:  ✓ should FAIL if CloudFormation stack does not have SNS topic associated
    1763:  ✓ should PASS if no CloudFormation stacks found
    1764:  ✓ should UNKNOWN if No stack details found
    1765:  ✓ should UNKNOWN if unable to list stacks
    1766:  ✓ should UNKNOWN if unable to describe stacks
    1767:  ✓ should not return any results if list stacks response is not found
    1768:  stackTerminationProtection
    1769:  run
    1770:  ✓ should PASS if CloudFormation stack has SNS topic associated
    1771:  ✓ should FAIL if CloudFormation stack does not have SNS topic associated
    ...
    
    1773:  ✓ should UNKNOWN if No stack details found
    1774:  ✓ should UNKNOWN if unable to list stacks
    1775:  ✓ should UNKNOWN if unable to describe stacks
    1776:  ✓ should not return any results if list stacks response is not found
    1777:  cloudfrontCustomOriginHttpsOnly
    1778:  run
    1779:  ✓ should PASS if CloudFront distributions is using https only
    1780:  ✓ should PASS if CloudFront distributions has no origins
    1781:  ✓ should FAIL if CloudFront Distribution is not https only
    1782:  ✓ should PASS if no CloudFront distributions found
    1783:  ✓ should UNKNOWN if unable to list distributions
    1784:  cloudfrontFieldLevelEncryption
    1785:  run
    1786:  ✓ should PASS if distribution has field level encryption enabled
    1787:  ✓ should FAIL if distribution does not have field level encryption enabled
    1788:  ✓ should PASS if no CloudFront distributions found
    1789:  ✓ should UNKNOWN if unable to list distributions
    1790:  ✓ should not return any results if list distributions response not found
    1791:  cloudfrontGeoRestriction
    1792:  run
    1793:  ✓ should PASS if CloudFront distribution is whitelisting required geographic locations
    1794:  ✓ should PASS if Geo restriction feature is enabled within CloudFront distribution
    1795:  ✓ should FAIL if geo restriction is not enabled within CloudFront distribution
    1796:  ✓ should FAIL if CloudFront distribution does not have required locations whitelisted
    1797:  ✓ should PASS if no CloudFront distributions found
    1798:  ✓ should UNKNOWN if unable to query for CloudFront distributions
    1799:  ✓ should not return any results if list distributions response not found
    1800:  cloudfrontHttpsOnly
    1801:  run
    1802:  ✓ should PASS if CloudFront distribution is set to use HTTPS only
    1803:  ✓ should PASS if CloudFront distribution is configured to redirect non-HTTPS traffic to HTTPS
    1804:  ✓ should FAIL if CloudFront distribution is not configured to use HTTPS
    1805:  ✓ should PASS if no CloudFront distributions found
    1806:  ✓ should UNKNOWN if unable to list distributions
    1807:  ✓ should not return any results if list distributions response not found
    1808:  cloudfrontInUse
    1809:  run
    1810:  ✓ should PASS if AWS CloudFront service is in use
    1811:  ✓ should FAIL if CloudFront service is not in use
    1812:  ✓ should UNKNOWN if unable to list distributions
    1813:  ✓ should not return any results if list distributions response not found
    1814:  cloudfrontLoggingEnabled
    1815:  run
    1816:  ✓ should PASS if Request logging is enabled
    1817:  ✓ should FAIL if Request logging is not enabled
    1818:  ✓ should PASS if no CloudFront distributions found
    1819:  ✓ should UNKNOWN if unable to list distributions
    1820:  ✓ should UNKNOWN if unable to get distributions
    1821:  ✓ should not return any results if list distributions response not found
    1822:  cloudfrontOriginTLSVersion
    1823:  run
    1824:  ✓ should PASS if CloudFront distributions custom origin TLS version is not deprecated
    1825:  ✓ should PASS if CloudFront distributions has no origins
    1826:  ✓ should FAIL if CloudFront Distribution custom origin TLS version is deprecated
    1827:  ✓ should PASS if no CloudFront distributions found
    1828:  ✓ should UNKNOWN if unable to list distributions
    1829:  cloudfrontTLSVersion
    1830:  run
    1831:  ✓ should PASS if CloudFront distributions TLS version is not deprecated
    1832:  ✓ should FAIL if CloudFront DistributionTLS version is deprecated
    1833:  ✓ should PASS if no CloudFront distributions found
    1834:  ✓ should UNKNOWN if unable to list distributions
    1835:  cloudfrontTLSWeakCipher
    1836:  run
    1837:  ✓ should PASS if CloudFront distributions TLS version is not weak cipher suite
    1838:  ✓ should FAIL if CloudFront Distribution TLS version is weak cipher suite
    1839:  ✓ should PASS if no CloudFront distributions found
    1840:  ✓ should UNKNOWN if unable to list distributions
    1841:  cloudfrontWafEnabled
    1842:  run
    1843:  ✓ should PASS if CloudFront distributions has WAF enabled
    1844:  ✓ should FAIL if CloudFront Distribution does not have WAF enabled
    1845:  ✓ should PASS if no CloudFront distributions found
    1846:  ✓ should UNKNOWN if unable to list distributions
    1847:  ✓ should not return any results if list distributions response not found
    1848:  compressObjectsAutomatically
    1849:  run
    1850:  ✓ should PASS if CloudFront web distribution is currently configured to compress files (objects) automatically
    1851:  ✓ should FAIL if CloudFront web distribution is currently configured to compress files (objects) automatically.
    1852:  ✓ should PASS if no CloudFront distributions found
    1853:  ✓ should UNKNOWN if unable to list distributions
    1854:  ✓ should not return any results if list distributions response not found
    1855:  enableOriginFailOver
    1856:  run
    1857:  ✓ should PASS if CloudFront distribution have origin failover enabled.
    1858:  ✓ should FAIL if CloudFront distribution does not have origin failover enabled.
    1859:  ✓ should PASS if no CloudFront distributions found
    1860:  ✓ should UNKNOWN if query for CloudFront distributions
    1861:  ✓ should not return any results if list distributions response not found
    1862:  insecureProtocols
    1863:  run
    1864:  ✓ should PASS if Distribution is not configured for SSL delivery
    1865:  ✓ should PASS if Distribution is using secure default certificate
    1866:  ✓ should FAIL if Distribution is using the insecure default CloudFront TLS certificate
    1867:  ✓ should FAIL if Distribution is using insecure SSLv3
    1868:  ✓ should FAIL if Distribution is using insecure TLSv1.0
    1869:  ✓ should FAIL if Distribution is using insecure TLSv1_2016
    1870:  ✓ should PASS if Distribution is using secure TLSv1.1_2016
    1871:  ✓ should PASS if Distribution is using secure TLSv1.2_2018
    1872:  ✓ should PASS if no CloudFront distributions found
    1873:  ✓ should UNKNOWN if unable to list distributions
    1874:  ✓ should not return any results if list distributions response not found
    1875:  publicS3Origin
    1876:  run
    1877:  ✓ should PASS if CloudFront distribution origin is not setup without an origin access identity
    1878:  ✓ should FAIL if CloudFront CloudFront distribution is using an S3 origin without an origin access identity
    1879:  ✓ should PASS if no CloudFront distributions found
    1880:  ✓ should UNKNOWN if unable to list distributions
    1881:  ✓ should not return any results if list distributions response not found
    1882:  secureOrigin
    1883:  run
    1884:  ✓ should PASS if CloudFront origin is using https-only
    1885:  ✓ should WARN if CloudFront origin is using match-viewer
    1886:  ✓ should FAIL if CloudFront origin is using http-only
    1887:  ✓ should FAIL if CloudFront origin is using SSLv3 and TLSv1 protocols
    1888:  ✓ should FAIL if CloudFront origin is using SSLv3 protocols
    1889:  ✓ should WARN if CloudFront origin is using TLSv1 protocol
    1890:  ✓ should PASS if no CloudFront distributions found
    1891:  ✓ should UNKNOWN if unable to list distributions
    1892:  ✓ should not return any results if list distributions response not found
    1893:  cloudtrailBucketAccessLogging
    1894:  run
    1895:  ✓ should PASS if bucket has S3 access logs enabled
    1896:  ✓ should WARN if bucket has S3 access logs disabled
    1897:  ✓ should FAIL if Unable to locate S3 bucket, it may have been deleted
    1898:  ✓ should PASS if no S3 bucket to check
    1899:  ✓ should UNKNOWN if unable to query for trails
    1900:  ✓ should UNKNOWN if unable to query for bucket policy
    1901:  ✓ should PASS if bucket gets whitelisted
    1902:  cloudtrailBucketDelete
    1903:  run
    1904:  ✓ should PASS if bucket has MFA delete enabled
    1905:  ✓ should WARN if bucket has MFA delete enabled
    1906:  ✓ should FAIL if Unable to locate S3 bucket, it may have been deleted
    1907:  ✓ should PASS if no S3 bucket to check
    1908:  ✓ should UNKNOWN if unable to query for trails
    1909:  ✓ should UNKNOWN if unable to query for bucket policy
    1910:  ✓ should PASS if bucket gets whitelisted
    1911:  cloudtrailBucketPrivate
    1912:  run
    1913:  ✓ should PASS if bucket does not allow global access
    1914:  ✓ should FAIL if bucket allows global access
    1915:  ✓ should FAIL if Unable to locate S3 bucket, it may have been deleted
    1916:  ✓ should PASS if no S3 bucket to check
    1917:  ✓ should UNKNOWN if unable to query for trails
    1918:  ✓ should UNKNOWN if unable to query for bucket policy
    1919:  ✓ should PASS if bucket gets whitelisted
    1920:  cloudtrailDataEvents
    1921:  run
    1922:  ✓ should PASS if CloudTrail trail has data events configured
    1923:  ✓ should FAIL if CloudTrail trail does not have data events configured
    1924:  ✓ should PASS if no CloudTrail trails found
    1925:  ✓ should UNKNOWN if unable to query trails
    1926:  ✓ should not return any results describe trail response not found
    1927:  cloudtrailDeliveryFailing
    1928:  run
    1929:  ✓ should PASS if logs for CloudTrail trail are being delivered
    1930:  ✓ should PASS if CloudTrail trail is set to pass without checking logs delivery status
    1931:  ✓ should FAIL if logs for CloudTrail trail are not being delivered
    1932:  ✓ should FAIL if CloudTrail is not enabled
    1933:  ✓ should UNKNOWN if unable to describe CloudTrail trails
    1934:  ✓ should UNKNOWN if unable to get CloudTrail trail status
    1935:  ✓ should not return anything if describe CloudTrail trails response not found
    1936:  cloudtrailEnabled
    1937:  run
    1938:  ✓ should PASS if CloudTrail is enabled and monitoring regional and global services
    1939:  ✓ should PASS if CloudTrail is configured and enabled to monitor global services
    1940:  ✓ should PASS if CloudTrail is enabled and monitoring regional services
    1941:  ✓ should FAIL if CloudTrail is configured for regional monitoring but is not logging API calls
    1942:  ✓ should FAIL if CloudTrail is configured for regional monitoring but is not logging API calls
    1943:  ✓ should FAIL if CloudTrail is not enabled
    1944:  ✓ should FAIL if CloudTrail is not conf...

    Copy link

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    Possible issue
    Fix regex wildcard escaping logic

    The regex escaping doesn't handle the case where '' appears after a character
    that needs escaping. Add escaping for '
    ' and handle it separately.

    postprocess/suppress.js [48-51]

     const escapedExpr = expr
    -    .replace(/[.+?^${}()|[\]\\]/g, '\\$&') // Escape special regex chars
    -    .split('*')
    -    .join('.*'); // Replace * with .*
    +    .replace(/[.+?^${}()|[\]\\*]/g, '\\$&') // Escape all special regex chars including *
    +    .replace(/\\\*/g, '.*'); // Replace escaped * with .*
    • Apply this suggestion
    Suggestion importance[1-10]: 9

    __

    Why: The current regex escaping logic could fail when '*' appears after characters that need escaping, potentially causing incorrect pattern matching. This fix ensures proper handling of all special characters.

    High
    Remove leading/trailing space validation

    The regex pattern for resourceId allows spaces at the start/end which could lead
    to matching issues. Add string trimming before validation or update pattern to
    disallow leading/trailing spaces.

    postprocess/suppress.js [20]

    -const resourcePattern = /^[ A-Za-z0-9._~()'!*:@,;+?#$%^&={}\\[\]\\|\"/-]{1,255}$/;
    +const resourcePattern = /^[A-Za-z0-9._~()'!*:@,;+?#$%^&={}\\[\]\\|\"/-]{1,255}$/;

    [To ensure code accuracy, apply this suggestion manually]

    Suggestion importance[1-10]: 8

    __

    Why: Allowing spaces at the start/end of resourceId could lead to inconsistent matching and potential security issues. The suggestion correctly identifies a significant validation flaw.

    Medium

    Copy link

    @sourcery-ai sourcery-ai bot left a comment

    Choose a reason for hiding this comment

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

    Hey @NxPKG - I've reviewed your changes - here's some feedback:

    Overall Comments:

    • The logic for escaping regex special characters and replacing '' with '.' is applied inline. Consider refactoring this transformation into a helper function to avoid duplication and improve maintainability.
    • The error messages currently describe the format requirements but don't provide context. Adding an example (or two) for valid suppression strings—especially for resourceId—could help users quickly understand the expected format.
    Here's what I looked at during the review
    • 🟡 General issues: 1 issue found
    • 🟢 Security: all looks good
    • 🟢 Testing: all looks good
    • 🟢 Complexity: all looks good
    • 🟢 Documentation: all looks good

    Sourcery is free for open source - if you like our reviews please consider sharing them ✨
    Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

    throw new Error(`Invalid suppression format: ${expr}. Expected format: pluginId:region:resourceId`);
    }

    const pluginPattern = /^[A-Za-z0-9]{1,255}$/; // eslint-disable-line
    Copy link

    Choose a reason for hiding this comment

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

    suggestion (performance): Consider defining regex patterns at module level to improve performance

    These regex patterns are constant and could be defined once at the module level rather than being recreated on each function call.

    Suggested implementation:

    const PLUGIN_PATTERN = /^[A-Za-z0-9]{1,255}$/; // eslint-disable-line
    const REGION_PATTERN = /^[A-Za-z0-9\-_]{1,255}$/; // eslint-disable-line
    const RESOURCE_PATTERN = /^[ A-Za-z0-9._~()'!*:@,;+?#$%^&={}\\[\]\\|\"/-]{1,255}$/;  // eslint-disable-line
    
            if (!suppressions) suppressions = [];
    
                const [pluginId, region, resourceId] = parts;
    
                // Validate pluginId
                if (!PLUGIN_PATTERN.test(pluginId)) {
                if (!REGION_PATTERN.test(region)) {

    You'll also need to:

    1. Update any other usage of resourcePattern in the code that we can't see (likely used to validate resourceId)
    2. Replace it with RESOURCE_PATTERN

    Comment on lines 42 to 57
    var expressions = suppressions
    .map(function(expr) {
    // Validate the expression format
    validateSuppression(expr);

    // Escape special regex characters except * which we handle specially
    const escapedExpr = expr
    .replace(/[.+?^${}()|[\]\\]/g, '\\$&') // Escape special regex chars
    .split('*')
    .join('.*'); // Replace * with .*

    return [
    expr,
    new RegExp('^' + expr.split('*').join('.*') + '$')
    new RegExp('^' + escapedExpr + '$')
    ];
    });
    Copy link

    Choose a reason for hiding this comment

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

    issue (code-quality): Use const or let instead of var. (avoid-using-var)

    Explanation`const` is preferred as it ensures you cannot reassign references (which can lead to buggy and confusing code). `let` may be used if you need to reassign references - it's preferred to `var` because it is block- rather than function-scoped.

    From the Airbnb JavaScript Style Guide

    Copy link

    sonarqubecloud bot commented Feb 6, 2025

    Quality Gate Failed Quality Gate failed

    Failed conditions
    20.7% Duplication on New Code (required ≤ 3%)

    See analysis details on SonarQube Cloud

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

    Successfully merging this pull request may close these issues.

    2 participants