google.cloud.forseti.services.scanner.service module

Scanner gRPC service.

class GrpcScanner(scanner_api, service_config)[source]

Bases: google.cloud.forseti.services.scanner.scanner_pb2_grpc.ScannerServicer

IAM Scanner gRPC implementation.

HANDLE_KEY = 'handle'
Ping(request, _)[source]

Provides the capability to check for service availability.

Parameters:
  • request (PingRequest) – The ping request.
  • _ (object) – Context of the request.
Returns:

The response to the ping request.

Return type:

PingReply

Run(request, context)[source]

Run scanner.

Parameters:
  • request (RunRequest) – The run request.
  • context (object) – Context of the request.
Yields:

Progress – The progress of the scanner.

_get_handle(context)[source]

Return the handle associated with the gRPC call.

Parameters:context (object) – Context of the request.
Returns:The model handle.
Return type:str
_run_scanner(model_name, progress_queue, scanner_name=None)[source]

Run scanner.

Parameters:
  • model_name (str) – Model name.
  • progress_queue (Queue) – Progress queue.
  • scanner_name (str) – name of the specified scanner to run
class GrpcScannerFactory(config)[source]

Bases: object

Factory class for Scanner service gRPC interface

create_and_register_service(server)[source]

Create and register the IAM Scanner service.

Parameters:server (object) – The server object.
Returns:The service object.
Return type:object