This commit is contained in:
@ -73,6 +73,9 @@ export class EC2Imdsv2Check implements BPSet {
|
||||
|
||||
for (const reservation of response.Reservations || []) {
|
||||
for (const instance of reservation.Instances || []) {
|
||||
if (instance.State?.Name === 'terminated')
|
||||
continue
|
||||
|
||||
if (instance.MetadataOptions?.HttpTokens === 'required') {
|
||||
compliantResources.push(instance.InstanceId!);
|
||||
} else {
|
||||
|
@ -74,6 +74,9 @@ export class EC2InstanceDetailedMonitoringEnabled implements BPSet {
|
||||
|
||||
for (const reservation of response.Reservations || []) {
|
||||
for (const instance of reservation.Instances || []) {
|
||||
if (instance.State?.Name === 'terminated')
|
||||
continue
|
||||
|
||||
if (instance.Monitoring?.State === 'enabled') {
|
||||
compliantResources.push(instance.InstanceId!);
|
||||
} else {
|
||||
|
@ -84,6 +84,9 @@ export class EC2InstanceManagedBySystemsManager implements BPSet {
|
||||
|
||||
for (const reservation of response.Reservations || []) {
|
||||
for (const instance of reservation.Instances || []) {
|
||||
if (instance.State?.Name === 'terminated')
|
||||
continue
|
||||
|
||||
if (managedInstanceIds?.includes(instance.InstanceId!)) {
|
||||
compliantResources.push(instance.InstanceId!);
|
||||
} else {
|
||||
|
@ -81,6 +81,9 @@ export class EC2InstanceProfileAttached implements BPSet {
|
||||
|
||||
for (const reservation of response.Reservations || []) {
|
||||
for (const instance of reservation.Instances || []) {
|
||||
if (instance.State?.Name === 'terminated')
|
||||
continue
|
||||
|
||||
if (instance.IamInstanceProfile) {
|
||||
compliantResources.push(instance.InstanceId!);
|
||||
} else {
|
||||
|
@ -68,6 +68,9 @@ export class EC2NoAmazonKeyPair implements BPSet {
|
||||
|
||||
for (const reservation of response.Reservations || []) {
|
||||
for (const instance of reservation.Instances || []) {
|
||||
if (instance.State?.Name === 'terminated')
|
||||
continue
|
||||
|
||||
if (instance.KeyName) {
|
||||
nonCompliantResources.push(instance.InstanceId!);
|
||||
} else {
|
||||
|
@ -75,6 +75,9 @@ export class EC2TokenHopLimitCheck implements BPSet {
|
||||
|
||||
for (const reservation of response.Reservations || []) {
|
||||
for (const instance of reservation.Instances || []) {
|
||||
if (instance.State?.Name === 'terminated')
|
||||
continue
|
||||
|
||||
if (
|
||||
instance.MetadataOptions?.HttpPutResponseHopLimit &&
|
||||
instance.MetadataOptions.HttpPutResponseHopLimit < 2
|
||||
|
Reference in New Issue
Block a user