Giter Site home page Giter Site logo

ggbecker / content-navigator Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 8.09 MB

Content Navigator is a VSCode/Codium extension which helps security content authors to create content for https://github.com/ComplianceAsCode/content

Home Page: https://content-navigator.net

License: MIT License

TypeScript 91.65% JavaScript 8.35%
vscode-extension

content-navigator's People

Contributors

dependabot[bot] avatar ggbecker avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

polymath-is

content-navigator's Issues

new template `bls_bootloader_option`

bls_bootloader_option::

  • Checks kernel command line arguments in BLS-compatible (Boot Loader Specification) boot loader configuration.
  • Parameters:
    ** arg_name - argument name, eg. audit
    ** arg_value - argument value, eg. '1'
  • Languages: OVAL

[RFE] Show templated content from rule id

Detect that rule.yml contains template: tag (use name: to identify templated file) and show respective template file according to requested content.

Template (bash, ansible, oval) - show template file associated?

Open variable file

Use same shortcut command as opening rule to open a variable file when the text selected belongs to a variable file. Variable files are usually contain the extension .var

Strip new lines when using content from clipboard

Sometimes the content from the clipboard can contain some disposable characters which would led us to a valid content. Remove special characters from the string if the first attempt to open a content is unsuccessful

Clipboard should take precedence when opening a content

With the introduction of navigation between content from a given rule, it may happen that when trying to open a content for a different rule from clipboard, the extension will try first to navigate between using rule id from current content. So one would need to open a different file, rather than a content file, before activating the option to jump into content.

Improve rule id detection

Identify this as a rule

if the string ends with rule.yml and others variations, try to guess the the rule id.

linux_os/guide/system/permissions/files/permissions_within_important_dirs/dir_group_ownership_library_dirs/rule.yml

[RFE] Copy rule id in full prefixed format

The function is similar to Copy Rule ID but would append the full prefix xccdf_org.ssgproject.content_rule_. It helps when scanning a particular rule using OpenSCAP as oscap still does not support short rule id and using the full prefixed rule id is mandatory.

Add tests using code from ComplianceAsCode/content

Implement tests based on ComplianceAsCode/content. Fetch latest version of content and run tests against it. This way the latest version of content project will be tested.

Test mainly functions to open content from a given rule.

Sanitize input of clipboard

Accept input only if contains alphanumeric and _, -

{{{ ansible_sshd_set(parameter="MACs", value="{{ sshd_approved_macs }}") }}}

command failed with error code 2: error parsing glob '**/ {{{ ansible_sshd_set(parameter="MACs", value="{{ sshd_approved_macs }}") }}}/ansible/shared.yml': nested alternate groups are not allowed

new template yamlfile_value

yamlfile_value::

  • Check if value(s) of certain type is (are) present in a YAML (or JSON) file at a given path.
  • Parameters:
    ** filepath - full path to the file to check
    ** yamlpath - OVAL's link:https://github.com/OpenSCAP/yaml-filter/wiki/YAML-Path-Definition[YAML Path] expression.
    ** value - the value to check.
    ** type (SimpleDatatypeEnumeration) - datatype for state's value_of, optional.
    ** entity_check (CheckEnumeration) - entity_check value for state's value_of, optional.
    ** pattern_check - if set to "true", the value is handled as a pattern match for state's value_of, optional.
    ** negate - if set to "true" the meaning of the value check criterion would be inverted, optional.
    ** ocp_data - if set to "true" then the filepath would be treated as a part of the dump of OCP configuration with the ocp_data_root prefix; optional.
  • Languages: OVAL

Open content does not work when there is no active editor

Bring this piece of code outside the if(active) block so it probably will work to open content when there is no active editor but there are valid content in the clipboard:

rule_id = await vscode.env.clipboard.readText();
// sometimes huge amount of nonsense text can be in the clipboard so lets reduce the scope here with length < 120
if(rule_id.length > 0 && rule_id.length < 120)
{
let index_full_prefix = rule_id.indexOf('xccdf_org.ssgproject.content_rule_');
let index_short_prefix = rule_id.indexOf('content_rule_');
if(index_full_prefix == 0)
{
rule_id = rule_id.slice('xccdf_org.ssgproject.content_rule_'.length)
}
else if(index_short_prefix == 0)
{
rule_id = rule_id.slice('content_rule_'.length)
}
if(await openFile(rule_id, location)){
return;
}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.