Notification

Icon
Error

AWS: Instance Security Group Permissions (Built-in)

Posted: Tuesday, March 5, 2019 1:20:06 PM(UTC)
Esben.D

Esben.D

Member Administration Original PosterPosts: 1,977
0
Like
The report below gives back a list of AWS Instances and their security group permissions.

The report will only list permissions when the following criteria are met:
  • You have Lansweeper 7.1 or higher.
  • There is AWS Instance data scanned.
  • The asset has the active state.

Code:
Select Top 1000000 tblAssets.AssetID,
  tblAssets.AssetName,
  tsysAssetTypes.AssetTypeIcon10 As icon,
  tblAssets.IPAddress,
  tsysIPLocations.IPLocation,
  tblAssetCustom.Manufacturer,
  tblAWSInstance.InstanceId,
  tblAWSInstance.InstanceType,
  tblAWSInstance.Platform,
  tblAWSInstance.Region,
  tblAWSInstance.State,
  tblAWSSecurityGroup.GroupId As SecurityGroupId,
  tblAWSSecurityGroup.Name,
  tblAWSSecurityGroup.OwnerId,
  tblAWSSecurityGroup.Description,
  tblAWSSecurityGroupPermission.FromPort,
  tblAWSSecurityGroupPermission.ToPort,
  tblAWSSecurityGroupPermission.IpProtocol,
  tblAWSSecurityGroupPermissionIpRange.CidrIp,
  tblAWSSecurityGroupPermissionIpRange.Description As RangeDescription
From tblAssets
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
  Inner Join tsysIPLocations On tsysIPLocations.LocationID =
    tblAssets.LocationID
  Inner Join tblState On tblState.State = tblAssetCustom.State
  Inner Join tblAWSInstance On tblAWSInstance.AssetId = tblAssets.AssetID
  Inner Join tblAWSInstanceSecurityGroup On
    tblAWSInstanceSecurityGroup.AWSInstanceId = tblAWSInstance.AWSInstanceId
  Inner Join tblAWSSecurityGroup On tblAWSSecurityGroup.AWSSecurityGroupId =
    tblAWSInstanceSecurityGroup.AWSSecurityGroupId
  Inner Join tblAWSSecurityGroupPermission On
    tblAWSSecurityGroupPermission.AWSSecurityGroupId =
    tblAWSSecurityGroup.AWSSecurityGroupId
  Inner Join tblAWSSecurityGroupPermissionIpRange On
    tblAWSSecurityGroupPermissionIpRange.AWSSecurityGroupPermissionId =
    tblAWSSecurityGroupPermission.AWSSecurityGroupPermissionId
Where tblState.Statename = 'Active'
Order By tblAWSInstance.Region,
  tblAssets.IPNumeric,
  SecurityGroupId,
  tblAWSSecurityGroupPermission.FromPort

Active Discussions

Lansweeper Report on clients with no LSAgent
by  RobertB   Go to last post Go to first unread
Last post: Yesterday at 6:55:32 PM(UTC)
Lansweeper Lansweeper report to match computer name
by  RC62N   Go to last post Go to first unread
Last post: 2/19/2020 5:02:27 PM(UTC)
Lansweeper Distinct user logins per PC
by  Bruce Garoutte   Go to last post Go to first unread
Last post: 2/17/2020 6:36:29 PM(UTC)
Lansweeper Software version report issue
by  RC62N  
Go to last post Go to first unread
Last post: 2/17/2020 4:07:20 PM(UTC)
Lansweeper Patch Tuesday - Exclude Win 2008 & Win7
by  doone128   Go to last post Go to first unread
Last post: 2/17/2020 1:34:36 PM(UTC)
Lansweeper Performance statistics combined into one report
by  djs1789  
Go to last post Go to first unread
Last post: 2/15/2020 1:50:32 AM(UTC)