AWS Code Sample
Catalog

GetFindings.php

GetFindings.php demonstrates how to return results from other AWS Security services like Amazon GuardDuty, Amazon Inspector, and Amazon Macie.

<?php /** * Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * This file is licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. A copy of * the License is located at * * http://aws.amazon.com/apache2.0/ * * This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. * * * * */ require 'vendor/autoload.php'; use Aws\Exception\AwsException; use Aws\SecurityHub\SecurityHubClient; // Create a Securty Hub Client $client = new Aws\SecurityHub\SecurityHubClient([ 'profile' => 'default', 'version' => '2018-10-26', 'region' => 'us-east-2' ]); try { $result = $client->getFindings([]); var_dump($result); } catch (AwsException $e) { // output error message if fails echo $e->getMessage() . "\n"; }

Sample Details

Service: securityhub

Last tested: 2018-12-09

Author: AWS

Type: full-example

On this page: