Skip to content

Commit

Permalink
Merge pull request #151 from carbonblack/develop
Browse files Browse the repository at this point in the history
Release v1.2.1
  • Loading branch information
avanbrunt-cb authored Mar 31, 2021
2 parents 5453602 + 5277be0 commit 216ddfc
Show file tree
Hide file tree
Showing 70 changed files with 1,826 additions and 254 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 Carbon Black
Copyright (c) 2020-2021 Carbon Black

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# VMware Carbon Black Cloud Python SDK

**Latest Version:** 1.2.0
**Latest Version:** 1.2.1
<br>
**Release Date:** 9 March 2021
**Release Date:** 31 March 2021

[![Coverage Status](https://coveralls.io/repos/github/carbonblack/carbon-black-cloud-sdk-python/badge.svg?t=Id6Baf)](https://coveralls.io/github/carbonblack/carbon-black-cloud-sdk-python)
[![Codeship Status for carbonblack/carbon-black-cloud-sdk-python](https://app.codeship.com/projects/9e55a370-a772-0138-aae4-129773225755/status?branch=develop)](https://app.codeship.com/projects/402767)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.0
1.2.1
2 changes: 1 addition & 1 deletion bin/cbc-sdk-help.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

# *******************************************************
# Copyright (c) VMware, Inc. 2020. All Rights Reserved.
# Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved.
# SPDX-License-Identifier: MIT
# *******************************************************
# *
Expand Down
2 changes: 1 addition & 1 deletion bin/set-windows-registry.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

# *******************************************************
# Copyright (c) VMware, Inc. 2020. All Rights Reserved.
# Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved.
# SPDX-License-Identifier: MIT
# *******************************************************
# *
Expand Down
2 changes: 1 addition & 1 deletion docs/cbc_sdk.workload.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cbc\_sdk.workload package
Workload
=========================

Submodules
Expand Down
20 changes: 18 additions & 2 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,31 @@
Changelog
================================

CBC SDK 1.2.1 - Released March 31, 2021
--------------------------------------

New Features

* Add `__str__` functions for Process.Tree and Process.Summary
* Add `get_details` for Process
* Add `set_max_rows` to DeviceQuery

Bug Fixes

* Modify base class for EnrichedEventQuery to Query from cbc_sdk.base to support entire feature set for searching
* Document fixes for changelog and Workload
* Fix `_spawn_new_workers` to correctly find active devices for Carbon Black Cloud



CBC SDK 1.2.0 - Released March 9, 2021
--------------------------------------

New Features

* VMware Carbon Black Cloud Workload support for managing workloads:

* Appliance Installation
* Appliance Service
* Vulnerability Assessment
* Sensor Lifecycle Management
* VM Workloads Search

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
# -- Project information -----------------------------------------------------

project = 'Carbon Black Cloud Python SDK'
copyright = '2020, Developer Relations'
copyright = '2020-2021, Developer Relations'
author = 'Developer Relations'

# The full version, including alpha/beta/rc tags
release = '1.2.0'
release = '1.2.1'


# -- General configuration ---------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion examples/audit_remediation/manage_run.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# *******************************************************
# Copyright (c) VMware, Inc. 2020. All Rights Reserved.
# Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved.
# SPDX-License-Identifier: MIT
# *******************************************************
# *
Expand Down
79 changes: 79 additions & 0 deletions examples/endpoint_standard/enriched_events_query.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/usr/bin/env python
# *******************************************************
# Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved.
# SPDX-License-Identifier: MIT
# *******************************************************
# *
# * DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
# * WARRANTIES OR CONDITIONS OF ANY KIND, WHETHER ORAL OR WRITTEN,
# * EXPRESS OR IMPLIED. THE AUTHOR SPECIFICALLY DISCLAIMS ANY IMPLIED
# * WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY,
# * NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.

"""Example script retrieving process events."""

import sys
from cbc_sdk.helpers import build_cli_parser, get_cb_cloud_object
from cbc_sdk.endpoint_standard import EnrichedEvent


def parse_key_value_pairs(kvlist):
"""Parse the key=value strings into a dict of lists of values"""
output = {}
if kvlist:
for kvpair in kvlist:
(key, value) = kvpair.split('=')
if not (key and value):
raise RuntimeError(f"invalid exclusion specified: {kvpair}")
if key in output:
output[key].append(value)
else:
output[key] = [value]
return output


def main():
"""Main function of the process events script."""
parser = build_cli_parser()
parser.add_argument("--query", "-q", type=str, help="Query string for the search", default=None)
parser.add_argument("--include", "-i", action='append', type=str,
help="Specifies included event field values, as key=value")
parser.add_argument("--exclude", "-x", action='append', type=str,
help="Specifies excluded event field values, as key=value")
parser.add_argument("--fields", "-f", action='append', type=str, help="Specifies names of fields to include")
parser.add_argument("--numrows", "-n", type=int, help="Maximum number of rows to be returned", default=None)
parser.add_argument("--group", "-g", type=str, help="Field to group by, either device_id or process_sha256",
default=None)
parser.add_argument("--timeout", "-T", type=int, help="Timeout for the search in milliseconds", default=None)

args = parser.parse_args()
cb = get_cb_cloud_object(args)

query = cb.select(EnrichedEvent)
if args.query:
query.where(args.query)
inclusions = parse_key_value_pairs(args.include)
for (key, value) in inclusions:
query.update_criteria(key, value)
exclusions = parse_key_value_pairs(args.exclude)
for (key, value) in exclusions:
query.add_exclusion(key, value)
if args.fields:
query.set_fields(args.fields)
if args.numrows:
query.set_rows(args.numrows)
if args.group:
query.aggregation(args.group)
if args.timeout:
query.timeout(args.timeout)

separator = False
for event in query:
if separator:
print("------------------------------------------------------------------------\n")
separator = True
print(f"{event}\n")


if __name__ == "__main__":
sys.exit(main())
2 changes: 1 addition & 1 deletion examples/endpoint_standard/live_response_cli.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python

# *******************************************************
# Copyright (c) VMware, Inc. 2020. All Rights Reserved.
# Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved.
# SPDX-License-Identifier: MIT
# *******************************************************
# *
Expand Down
2 changes: 1 addition & 1 deletion examples/endpoint_standard/policy_operations.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# *******************************************************
# Copyright (c) VMware, Inc. 2020. All Rights Reserved.
# Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved.
# SPDX-License-Identifier: MIT
# *******************************************************
# *
Expand Down
2 changes: 1 addition & 1 deletion examples/enterprise_edr/feed_operations.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# *******************************************************
# Copyright (c) VMware, Inc. 2020. All Rights Reserved.
# Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved.
# SPDX-License-Identifier: MIT
# *******************************************************
# *
Expand Down
4 changes: 2 additions & 2 deletions examples/enterprise_edr/threat_intelligence/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ cybox==2.1.0.18
dataclasses>=0.6
cabby==0.1.20
stix==1.2.0.7
lxml==4.6.2
lxml==4.6.3
urllib3>=1.24.2
python_dateutil==2.8.1
PyYAML==5.1.2
PyYAML==5.4
schema
carbon-black-cloud-sdk
2 changes: 1 addition & 1 deletion examples/platform/device_actions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# *******************************************************
# Copyright (c) VMware, Inc. 2020. All Rights Reserved.
# Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved.
# SPDX-License-Identifier: MIT
# *******************************************************
# *
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/device_processes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# *******************************************************
# Copyright (c) VMware, Inc. 2020. All Rights Reserved.
# Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved.
# SPDX-License-Identifier: MIT
# *******************************************************
# *
Expand Down
2 changes: 1 addition & 1 deletion examples/platform/list_devices.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# *******************************************************
# Copyright (c) VMware, Inc. 2020. All Rights Reserved.
# Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved.
# SPDX-License-Identifier: MIT
# *******************************************************
# *
Expand Down
2 changes: 1 addition & 1 deletion src/cbc_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
__author__ = 'Carbon Black Developer Network'
__license__ = 'MIT'
__copyright__ = 'Copyright 2020-2021 VMware Carbon Black'
__version__ = '1.2.0'
__version__ = '1.2.1'

from .rest_api import CBCloudAPI
from .cache import lru
2 changes: 1 addition & 1 deletion src/cbc_sdk/audit_remediation/base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

# *******************************************************
# Copyright (c) VMware, Inc. 2020. All Rights Reserved.
# Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved.
# SPDX-License-Identifier: MIT
# *******************************************************
# *
Expand Down
2 changes: 1 addition & 1 deletion src/cbc_sdk/base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

# *******************************************************
# Copyright (c) VMware, Inc. 2020. All Rights Reserved.
# Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved.
# SPDX-License-Identifier: MIT
# *******************************************************
# *
Expand Down
2 changes: 1 addition & 1 deletion src/cbc_sdk/cache/lru.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

# *******************************************************
# Copyright (c) VMware, Inc. 2020. All Rights Reserved.
# Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved.
# SPDX-License-Identifier: MIT
# *******************************************************
# *
Expand Down
2 changes: 1 addition & 1 deletion src/cbc_sdk/connection.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

# *******************************************************
# Copyright (c) VMware, Inc. 2020. All Rights Reserved.
# Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved.
# SPDX-License-Identifier: MIT
# *******************************************************
# *
Expand Down
2 changes: 1 addition & 1 deletion src/cbc_sdk/credential_providers/default.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# *******************************************************
# Copyright (c) VMware, Inc. 2020. All Rights Reserved.
# Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved.
# SPDX-License-Identifier: MIT
# *******************************************************
# *
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# *******************************************************
# Copyright (c) VMware, Inc. 2020. All Rights Reserved.
# Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved.
# SPDX-License-Identifier: MIT
# *******************************************************
# *
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# *******************************************************
# Copyright (c) VMware, Inc. 2020. All Rights Reserved.
# Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved.
# SPDX-License-Identifier: MIT
# *******************************************************
# *
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# *******************************************************
# Copyright (c) VMware, Inc. 2020. All Rights Reserved.
# Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved.
# SPDX-License-Identifier: MIT
# *******************************************************
# *
Expand Down
2 changes: 1 addition & 1 deletion src/cbc_sdk/credentials.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# *******************************************************
# Copyright (c) VMware, Inc. 2020. All Rights Reserved.
# Copyright (c) VMware, Inc. 2020-2021. All Rights Reserved.
# SPDX-License-Identifier: MIT
# *******************************************************
# *
Expand Down
Loading

0 comments on commit 216ddfc

Please sign in to comment.