Coder Social home page Coder Social logo

schindlerd / mwgcs-logpuller-pub Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 3.0 39 KB

McAfee Web Gateway Cloud Service (WGCS) Logpuller Script - including forwarding to remote syslog/Log-Management/SIEM

License: GNU General Public License v3.0

Python 100.00%
wgcs mcafee graylog rest-api siem logmanagement saas python

mwgcs-logpuller-pub's Introduction

McAfee Web Gateway Cloud Services (WGCS) Logpuller Script

Script to get McAfee Web Gateway Cloud Service logs from McAfee SaaS-API. Logs are downloaded to 'OutputLog.$NowUnixEpoch$.csv' and can be forwarded to a remote syslog host or SIEM when syslogEnable is set to 'True'.

Note:

When forwarding is used the downloaded CSV is transformed into a JSON stream. Configure your syslog/SIEM input correspondingly.

Timestamp is automatically adjusted with the last successful time of request. The corresponding configuration option requestTimestampFrom is updated after each run of the script.

The script is using McAfee SaaS Message API ver. 5

Field reference: https://success.myshn.net/Skyhigh_Secure_Web_Gateway_(Cloud)/Reporting/Using_a_REST_API_for_Reporting/Reporting_Fields

General API reference: https://success.myshn.net/Skyhigh_Secure_Web_Gateway_(Cloud)/Reporting/Using_a_REST_API_for_Reporting/About_Working_with_the_REST_API

Usage

  • Download script and configuration file.
  • Make script executable and adjust the configuration file to your needs.
  • Run it periodically via cron for example.

Configuration

This table explains the necessary configuration options:

Section Option Value Type Description Example
saas saasCustomerID INT (Mandatory) Your WGCS customer ID without the leading 'c' 123456789
saasUserID STR (mandatory) Usually your tenant e-mail address [email protected]
saasPassword STR (mandatory) Your WGCS tenant password my53cr37p455
saasHost STR (mandatory) Europe: eu.msg.mcafee / US: msg.mcafeesaas.com eu.msg.mcafeesaas.com
request requestTimestampFrom INT (mandatory) Epoch timestamp of last successful request; dynamically set to last execution time; if initially set to 0 value is dynamically adjusted to Now - 24h 1588458908
chunkIncrement INT (mandatory) Requests are splitted into chunks if time between last request and execution is bigger than this value (seconds) 3600
connectionTimeout INT (mandatory) Time to wait for request response (seconds) 180
outputDirCSV STR (optional) Specify different output directory for downloaded CSV file 'OutputLog.$NowUnixEpoch$.csv' IMPORTANT: directoy must exist! /var/tmp/wgcslogs
proxy proxyURL STR (optional) If you are behind a proxy you can configure a corresponding URL here (format: http://PROXY_SERVER:PORT or http://USER:PASSWORD@PROXY_SERVER:PORT) http://proxy.example.com:8080
syslog syslogEnable BOOL (mandatory) Enable message forwarding in form of a JSON stream; either 'True' or 'False' True
syslogHost STR (mandatory) IP or hostname of remote syslog host/Log Management/SIEM graylog.example.com
syslogPort INT (mandatory) Port for remote syslog input 5555
syslogProto STR (mandatory) Must be either 'TCP' or 'UDP' UDP
syslogKeepCSV BOOL (mandatory) Keep the downloaded CSV ('True') or delete after forwarding ('False') False

Disclaimer

This is an UNOFFICIAL project and is NOT sponsored or supported by McAfee, Inc.

Credits and Links

Special thanks go to @tux78, Jeff Ebeling and Erik Elsasser from McAfee for providing the codebase for my reworked implementation.

mwgcs-logpuller-pub's People

Contributors

schindlerd avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

gauge73 1ce8erg0

mwgcs-logpuller-pub's Issues

Python Version

Hi Schindlerd, I noticed that this script only supports Python Version 2. Will there be an upgrade to support Python Version 3?

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.