Giter VIP home page Giter VIP logo

stigman-watcher's People

Contributors

cd-rite avatar csmig avatar dependabot[bot] avatar matte22 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

stigman-watcher's Issues

Token acquisition failure - develop approach and handling

Current behavior:
preflight request failure - leaves a log entry, does not retry on failure, watcher stops.
subsequent token failure has no effect on other processing (but will show lots of errors in the log)

subsequent token acquisition failure modes:

  • Identity provider unavailable (timeout):
    • throw error, stop processing, retry
  • client credentials no longer working
    • throw error, stop processing, retry

retry behavior:

  • scan mode: suspend scanning and file parsing while retrying
  • event mode: continue capturing file add/remove events, suspend file parsing
  • retry every 60 seconds
    • Log initial failure
    • Log every (hour? day? thereafter)
    • Log success
    • log: every attempt at debug level
    • continue trying indefinitely

Add additional logging, especially in error handling

Add additional log statements, perhaps at the "silly" level, for logging each attempted request, whether a response was received, etc.

Several places are overly optimistic and could benefit from more logging or tweaks to error handling. (try/catch block starting at line 74 in authenticateSignedJwt [auth.js] assumes a response object)

WATCHER_CARGO_SIZE=1 fails

This line in cargo.js expects this.parsedResults to be an Array. However, if the cargo size is 1, then this.parsedResults is an Object and the attempt to iterate it fails.

Token is unsuited for purpose - develop approach and handling

Current behavior:
preflight auth failure - leaves a log entry, does not retry on failure, watcher stops.
subsequent auth failures - keeps processing, adds log entries

subsequent auth failure modes:

  • user does not have required grant for collection

    • throw error, stop processing, retry
  • user can't create assets or assign stigs, when Watcher is configured to do so.

    • throw error, stop processing, retry
  • user can't approve reviews, when watcher is configured to do so.

    • note: double-check API behavior when given status that does not conform with Collection grants/settings
    • log error, continue processing, mark file complete?

retry behavior:

  • scan mode: suspend scanning and file parsing while retrying
  • event mode: continue capturing file add/remove events, suspend file parsing
  • retry every 60 seconds
    • Log initial failure
    • Log every (hour? day? thereafter)
    • Log success
    • log: every attempt at debug level
    • continue trying indefinitely

XCCDF Import Not Working

Hello. We've got STIG Man Watcher working and importing CKL files placed in the watched directory, however, XCCDF imports do not work. I've increased the log file logging level to 'silly' and don't even see the XCCDF file being discovered by Watcher. Any thoughts?

Unit tests for .ckl/.cklb/xccdf parser

Include test cases for:

  • all import setting combinations
  • files with invalid xml
  • files with 0 reviews
  • files with multiple STIGs
  • files with duplicate Review Ids
  • "normal" files (expected # of reviews, etc.)

Breakout Watcher auth functions into their own libraries

Breakout Watcher auth functions into their own re-usable libraries, which could become part of a resource repo providing a scaffold for building other clients.

  • Remove keycloak-specific elements
  • Add support for Device Code flow.

STIGMan behind nginx/CAC, unable to verify the first certificate

STIG Manager instance behind nginx rev proxy with CAC enabled. DoD certificate issued to system correctly. STIGMan Watcher errors with "..."level":"error","component":"api","message":"unable to verify the first certificate","request":{"method":"GET","url":"https://..."

Determine when API is not responding - develop approach and handling

Current behavior:
preflight request failure - leaves a log entry, does not retry on failure, watcher stops.
Subsequent failures - keeps trying, adds log entries.

API unavailable after preflight (timeout):

  • throw error, stop processing, retry

retry behavior:

  • scan mode: suspend scanning and file parsing while retrying
  • event mode: continue capturing file add/remove events, suspend file parsing
  • retry every 60 seconds
    • Log initial failure
    • Log every (hour? day? thereafter)
    • Log success
    • log: every attempt at debug level
    • continue trying indefinitely

Obey new Collection Import setting preferences returned from STIGMan API.

STIGMan API will soon be able to return Collection Import setting preferences that are specified at the Collection level.
Watcher should pay attention to these settings, and post reviews in accordance with them, in order to minimize rejected reviews.

Watcher will also need access to the /user endpoint (and thus the stig-manager:user:read scope), to determine if it is allowed to Accept reviews.

Use dynamic Import for 'got' ESM.

Latest versions of got only available as ESM, rather than CommonJS modules.

Consider:
converting Watcher project as a whole to ESM, rather than CommonJS
or
Switch to build-in Node fetch

Rollup - Gracefully handle scenarios where API is no longer available/accessible, or responds with failure messages.

Log Rotation enhancement

Hello,
Been using stigman-watcher for almost a year now and we still love it. Kudos to everyone involed. When I first set it up I forgot and left logging on and by defualt debug mode was enabled so I happen to notice a 7GB on our file server today..lol So I wanted to reach out and see if there could be a way to incorporate a log rotation feature in the future releases. I am working on possibly injesting our logs into Graylog and alerting on specific systems when the STIGs are pulled into STIG Manager. This way our assigned teams will know when to log in and review them.

Running STIGMan Watcher on Windows is not using Environment Variables

Hello,
I'm trying to deploy STIGMan watcher in our enviornment but it seems I am stuck with using only the command line options. When I try to run the stigman-watcher-win.exe I get the following: error: required option '--api ' not specified

 I have specified all of the required variables here:

image

 And also I edited the .env sample provided with the source code within the same directory. I had to name the file env.env since Windows does not allow me to rename a file with just an extension.
 I would personally love to just deploy this on Linux where the STIG Manager runs natively but we are not allowed SAMBA in our environment so the Linux servers cannot talk to the file share. 
 
 What I want to do is just setup the stigman-watcher-win.exe as a service to monitor the folders. I can run the command with all the cli options and get it to connect and successully pull in the .ckl. However, I have to use the --prompt command and provide the key each time since it is not actually looking for the variables. Im not sure if i am doing something wrong or if STIGMan Watcher just doesn't support environmental variables on Windows. Thanks!!

Watcher uploading files multiple times

Hi there!

I have been using STIGMAN watcher for a few months now. I have noticed one interesting behavior.

Sometimes watcher will reupload a file to STIGMAN, even though the file has not been changed, modified, or updated at all. Is there a reason this could be happening?

See picture below:
image

Any help would be appreciated.

Thanks!

Add Option to Exclude Files by Name

There is currently an environment variable to tell watcher to ignore specified directories (nice!).

Evaluate-STIG recently added a new file in the top level folder, named SummaryReport.xml. This file is being parsed and produces the following message:

{"timestamp":"2022-05-26T13:29:39.559Z","level":"warn","component":"parser","message":"No Benchmark element","file":"<my-output-path>/<hostname>/SummaryReport.xml"}

Additionally, this file is logged in the history.txt file which is unnecessary.

Requesting a new option to specify file names to ignore in the watched directory.

Thanks!

Develop testing approach and workflow for Watcher

Possible avenue:
Develop a github actions workflow that can verify Watcher functions with latest version of the STIGMan API.
Create sets of .ckls (and/or xccdf) that, on import, will pass an appropriate subset of the Newman tests from the STIGMan repo.

BUG: events mode fails to initialize

When running in events mode, the following error stops the process:

{"timestamp":"2022-07-20T13:02:34.506Z","level":"error","component":"main","message":"ignored is not defined","error":{"name":"ReferenceError","message":"ignored is not defined","stack":"ReferenceError: ignored is not defined\n    at Object.module.exports.startFsEventWatcher (/home/csmig/dev/stigman-watcher/lib/events.js:11:25)\n    at run (/home/csmig/dev/stigman-watcher/index.js:28:15)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)"}}

Feature Request: Allow Watcher to Add Labels to New Assets

We have several instances of watcher used by different groups posting results to a shared collection. It would be handy to be able to apply a label to all assets posted by a specific watcher; This would help sorting a large collection by using labels to identify the originating department/division/etc.

Add code.mil required documentation

Using STIG Manager repo as a model, add these files:
CONTRIBUTORS.md
CONTRIBUTING.md
INTENT.md

refactor:
LICENSE.md
to reference company name instead of individual contributors (which should be added to CONTRIBUTORS.md)

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.