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,982
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 LSPUSH and Group Policy
by  HurricaneDave   Go to last post Go to first unread
Last post: Yesterday at 10:15:12 PM(UTC)
Lansweeper How to see additional info columns on Asset Groups
by  virtualnik8  
Go to last post Go to first unread
Last post: Yesterday at 7:40:41 PM(UTC)
Lansweeper Certificate status & end dates
by  doone128   Go to last post Go to first unread
Last post: Yesterday at 11:43:46 AM(UTC)
Lansweeper O365
by  Azkor  
Go to last post Go to first unread
Last post: 9/18/2020 10:45:23 PM(UTC)
Lansweeper 2012R2: LSAgent: Could not create SSL/TLS secure channel
by  JimL   Go to last post Go to first unread
Last post: 9/18/2020 6:35:00 AM(UTC)
Lansweeper Biometric Devices
by  FrankSc   Go to last post Go to first unread
Last post: 9/17/2020 6:56:05 PM(UTC)
Lansweeper Auto Assign Agent on First Email Response
by  Elwood472  
Go to last post Go to first unread
Last post: 9/17/2020 4:33:16 PM(UTC)