Skip to content

Commit

Permalink
Merge pull request #652 from tenable/feature/vulns-scan-uuid
Browse files Browse the repository at this point in the history
Support for scan_uuid, Removal of search_host_audit()
  • Loading branch information
dandamudi1414 authored Nov 23, 2022
2 parents a39fa10 + b0fc3e4 commit df6736d
Show file tree
Hide file tree
Showing 9 changed files with 1,328 additions and 114 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

[1.4.10]

### Added
- Support for `scan_uuid` filter for vulnerability exports.

### Fixed
- Bug in `tenable/io/scanners.py` that invoked the `/settings/{}` endpoint instead of the correct `/scanners/{}` endpoint.
- Error in the documentation of the `sc.scans.edit()` method. The property - `policy` was renamed to `policy_id`.
- tests module getting into the pypi package. Now, the module will no longer be part of pypi package.

### Removed
- `plugin_id` param from the `sc.scans.create()` method as it is no longer supported by Tenable.sc.
- Python 3.6 references from all documentation.
- `search_host_audit()` method from `io/v3/explore/findings`.

[1.4.10]: https://github.com/tenable/pyTenable/compare/1.4.9...1.4.10

## [1.4.9]
### Added

Expand Down
2 changes: 2 additions & 0 deletions tenable/io/exports/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,8 @@ def vulns(self, **kwargs) -> Union[ExportsIterator, UUID]:
Only return findings from the specified plugin ids.
plugin_type (str, optional):
Only return findings with the specified plugin type.
scan_uuid (uuid, optional):
Only return findings with the specified scan UUID.
severity (list[str], optional):
Only return findings with the specified severities.
state (list[str], optional):
Expand Down
1 change: 1 addition & 0 deletions tenable/io/exports/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class VulnExportSchema(Schema):
severity = fields.List(LowerCase(fields.Str()))
state = fields.List(LowerCase(fields.Str()))
vpr_score = fields.Nested(VPRSchema())
scan_uuid = fields.Str()

# Asset fields
tags = fields.List(fields.Tuple((fields.Str(), fields.Str())))
Expand Down
78 changes: 0 additions & 78 deletions tenable/io/v3/explore/findings/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,84 +183,6 @@ def search_cloud_resource(self,
**kw
)

def search_host_audit(self,
**kw
) -> Union[SearchIterator, CSVChunkIterator, Response]:
'''
Search and retrieve the Host Audits Vulnerabilities based on supported conditions.
Args:
fields (list, optional):
The list of field names to return from the Tenable API.
Example:
>>> ['field1', 'field2']
filter (tuple, dict, optional):
A nestable filter object detailing how to filter the results
down to the desired subset.
Examples:
>>> ('or', ('and', ('test', 'oper', '1'),
... ('test', 'oper', '2')
... ),
... 'and', ('test', 'oper', 3)
... )
>>> {
... 'or': [{
... 'and': [{
... 'value': '1',
... 'operator': 'oper',
... 'property': '1'
... },
... {
... 'value': '2',
... 'operator': 'oper',
... 'property': '2'
... }
... ]
... }],
... 'and': [{
... 'value': '3',
... 'operator': 'oper',
... 'property': 3
... }]
... }
sort (list[tuple], optional):
A list of dictionaries describing how to sort the data
that is to be returned.
Examples:
>>> [('field_name_1', 'asc'),
... ('field_name_2', 'desc')]
limit (int, optional):
Number of objects to be returned in each request.
Default and max_limit is 200.
next (str, optional):
The pagination token to use when requesting the next page of
results. This token is presented in the previous response.
return_resp (bool, optional):
If set to true, will override the default behavior to return
a requests.Response Object as is to the user.
return_csv (bool, optional):
If set to true, it will return the CSV response or
iterable (based on return_resp flag). Iterator returns all
rows in text/csv format for each call with row headers.
Returns:
Iterable:
The iterable that handles the pagination for the job.
requests.Response:
If ``return_resp`` is set to ``True``, then a response
object is returned instead of an iterable.
Examples:
>>> tio.v3.explore.findings.search_host_audit(
... fields=['finding_id'], limit=2)
'''
iclass = SearchIterator
if kw.get('return_csv', False):
iclass = CSVChunkIterator
return super()._search(iterator_cls=iclass,
sort_type=self._sort_type.property_based,
resource='findings',
api_path=f'{self._path}/host_audit/search',
**kw
)

def search_host(self,
**kw
) -> Union[SearchIterator, CSVChunkIterator, Response]:
Expand Down
2 changes: 1 addition & 1 deletion tenable/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = '1.4.9'
version = '1.4.10'
version_info = tuple(int(d) for d in version.split("-")[0].split("."))
Loading

0 comments on commit df6736d

Please sign in to comment.