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