Giter VIP home page Giter VIP logo

soc-faker's Introduction

soc-faker

soc-faker is used to generate fake data for use by Security Operation Centers, Information security professionals, product teams, and many more.

Getting Started

soc-faker works with Python 3.6 or greater. You can install soc-faker using pip as well as cloning this repository directly.

At the time of writing this document, soc-faker has the ability to fake data for the following main categories. You can find specific details for each category by selecting the links below:

Installing soc-faker

pip install soc-faker --user

Installing from source

git clone https://github.com/swimlane/soc-faker.git
cd soc-faker
python setup.py install

Prerequisites

The following libraries are required and installed by soc-faker

requests==2.23.0
pendulum==2.1.2
ipaddress==1.0.23
bs4==0.0.1
xmltodict==0.12.0
netaddr==0.7.20
fire==0.3.1

Usage

soc-faker is a Python package that can be imported or be used via the command line utility to generate fake data related to security tools, products, and general data related to security.

Importing soc-faker

After you have installed soc-faker from source or using pip you can import and instantiate it by doing the following:

from socfaker import SocFaker

sc = SocFaker()

Once you have instantiated an instance of soc-faker you can then access any of the different properties and methods avaialble based on your needs. If you would like to see soc-faker in action, then please see the bin/test.py script in the repository under the bin folder for an example of all avaialble properties and methods.

Additionally, please read the documentation for more details about each avaialble property and method.

Command-Line Usage

When soc-faker is installed, it automatically creates a command-line utility for your use. This utility can be accessed by simply typing soc-faker in your shell of choice.

To see soc-faker help type:

soc-faker
# or
soc-faker --help

You can access each property just like you can from the library, the only difference is you replace a . between properties with a space. For example, if you wanted to get some randomly generated hashes quickly you can run:

soc-faker file hashes

This will return the following to your shell:

md5:    aa3150ac34ee6a5911e61ab6a5052a6d
sha1:   de5c15f64d979ed84bac340c334a63d94401059d
sha256: 118a9f9de8f3dd6471ef113959485ecbaf66368dea16758eab4e22da182d0e9f

If you run into any issues, just type what you think is correct and the built-in help will guide you through all available groups, commands, etc. for each data point within soc-faker.

Development

You can use the provided Dockerfile to get a development and testing environment up and running for soc-faker.

To use the Dockerfile run, cd to this repositories directory and run:

docker build --force-rm -t socfaker .

Once it is built, then run the docker container:

docker run -p 7001:7001 -ti socfaker

Running this will call the test python file in bin\test.py. Modify this file for additional testing and development.

Running the tests

Tests within this project should cover all available properties and methods. As this project grows the tests will become more robust but for now we are testing that they exist and return outputs.

Built With

  • carcass - Python packaging template

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning.

Change Log

Please read CHANGELOG.md for details on features for a specific version of soc-faker

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details

Credits

soc-faker is a Swimlane open-source project; we believe in giving back to the open-source community by sharing some of the projects we build for our application. Swimlane is an automated cyber security operations and incident response platform that enables cyber security teams to leverage threat intelligence, speed up incident response and automate security operations.

SecOps Hub is an open, product-agnostic, online community for security professionals to share ideas, use cases, best practices, and incident response strategies.

Acknowledgments

  • This project utilizes data from the OSSEM project by hunters-forge

soc-faker's People

Contributors

dselig11235 avatar joshswimlane avatar msadministrator avatar nikkuman avatar youngcm2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

soc-faker's Issues

soc-faker logs windows eventlog (errors out)

running soc-faker logs windows eventlog doesn't work. Tracedump is as follows;
Test on Python 3.6, 3.10, and 3.17 on Windows Server 2016 and Windows Server 2022
Using Pip-installed and github source versions of soc-faker

C:\Users\Administrator\Downloads>soc-faker logs windows eventlog
Traceback (most recent call last):
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return run_code(code, main_globals, None,
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\Scripts\soc-faker.exe_main
.py", line 7, in
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\socfaker_main
.py", line 5, in main
fire.Fire(SocFaker())
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\fire\core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\fire\core.py", line 466, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\fire\core.py", line 681, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\socfaker\windows.py", line 18, in eventlog
return WindowsEventLog(json=json).get(count=count, computer_name=computer_name, os_version=os_version)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python310\lib\site-packages\socfaker\windowseventlog.py", line 41, in get
md_file.rsplit('/', 1)[1].split('-')[1].strip('.md'),
IndexError: list index out of range

Add ability to generate multiple logs that all match a single network/environment

It would be great if soc-faker could take parameters or read an optional config file that would enable it to create logs that all appear to come from a single environment.

for example:
subnet: 10.10.10.0/24
orgname: Faker
users: first.last
timeframe: 1300 - 1600

would generate logs where IPs (source or destination depending on the type of log generated) would only be in the 10.10.10.0/24 subnet, the machine/host names would be some variation of Faker, the usernames would be random but all have a format of first.last and the logs would only take place between 1300 - 1600 (up to the user to manipulate the timezones)

That would be great.

Ability to add known malicious data into soc-faker

As a user of soc-faker I would like to provide a list or pool of data that I want soc-faker to use when selecting random data so that I can trigger integrations or workflows when a malicious ip, hash, etc. is identified.

Example or original thought idea was the ability to provide a Pool object with specified names of keys and list values to use.

from socfaker import SocFaker, Pool

pool = Pool(
    'md5': [],
    'ipv4': [],
    # etc.
)

sc = SocFaker(pool=pool)

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.