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,676
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 Add Document as File Link
by  AZHockeyNut   Go to last post Go to first unread
Last post: Today at 3:18:49 PM(UTC)
Lansweeper LsAgent install issue
by  moug  
Go to last post Go to first unread
Last post: Today at 3:12:47 PM(UTC)
Lansweeper Spare Hard Drives
by  brodiemac   Go to last post Go to first unread
Last post: Today at 2:32:31 PM(UTC)
Lansweeper Adding Events via Meeting Request
by  Esben.D   Go to last post Go to first unread
Last post: Today at 10:32:17 AM(UTC)
Lansweeper Same Name and Domain
by  Esben.D  
Go to last post Go to first unread
Last post: Today at 10:26:22 AM(UTC)
Lansweeper Logs of User activity
by  Esben.D   Go to last post Go to first unread
Last post: Today at 9:50:00 AM(UTC)
Lansweeper O365 scanning issue
by  Esben.D  
Go to last post Go to first unread
Last post: Today at 9:44:35 AM(UTC)