Skip to content

Commit

Permalink
Unify more of the aws resources on createdAt
Browse files Browse the repository at this point in the history
createdAt is what Amazon uses in most of their SDK. Some of the older
APIs use different values and in many cases we copied those over into
our resources. This continues the work to unify all of the AWS resources
on createdAt so it's easier to explore fields on resources without
looking at the docs.

Signed-off-by: Tim Smith <[email protected]>
  • Loading branch information
tas50 committed Dec 27, 2024
1 parent 2b40eec commit bf3bb89
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 7 deletions.
26 changes: 19 additions & 7 deletions providers/aws/resources/aws.lr
Original file line number Diff line number Diff line change
Expand Up @@ -768,20 +768,24 @@ private aws.iam.usercredentialreportentry @defaults("arn") {

// IAM user
user() aws.iam.user
// Time when user was created
// Time when user was created: deprecated, use createdAt
userCreationTime() time
// Time when user was created
createdAt() time
}

// AWS IAM user
private aws.iam.user @defaults("arn name") {
private aws.iam.user @defaults("arn name createdAt") {
// ARN of the IAM user
arn string
// ID of the IAM user
id string
// Name of the user
name string
// Time when user was created
// Time when user was created: deprecated, use createdAt
createDate time
// Time when user was created
createdAt time
// Time when password was last used
passwordLastUsed time
// Tags for the IAM user
Expand All @@ -802,8 +806,10 @@ private aws.iam.user @defaults("arn name") {
private aws.iam.instanceProfile @defaults("arn instanceProfileId") {
// ARN of the instance profile
arn string
// Time when the instance profile was created
// Time when the instance profile was created: deprecated, use createdAt
createDate time
// Time when the instance profile was created
createdAt time
// ID of the IAM instance profile
instanceProfileId string
// Name of the instance profile
Expand Down Expand Up @@ -836,8 +842,10 @@ private aws.iam.policy @defaults("arn name") {
isAttachable() bool
// Number of principal entities (users, groups, and roles) that the policy is attached to
attachmentCount() int
// Time when the policy was created
// Time when the policy was created: deprecated, use createdAt
createDate() time
// Time when the policy was created
createdAt() time
// Time when the policy was updated
updateDate() time
// Scope of the policy
Expand Down Expand Up @@ -865,8 +873,10 @@ private aws.iam.policyversion @defaults("arn isDefaultVersion") {
isDefaultVersion bool
// JSON statements for this policy version
document() dict
// Time when this policy version was created
// Time when this policy version was created: deprecated, use createdAt
createDate time
// Time when this policy version was created
createdAt time
}

// AWS IAM role
Expand All @@ -881,8 +891,10 @@ private aws.iam.role @defaults("arn name") {
description string
// Tags associated with the role
tags map[string]string
// Time when the role was created
// Time when the role was created: deprecated, use createdAt
createDate time
// Time when the role was created
createdAt time
// Policy document that grants an entity permission to assume the role
assumeRolePolicyDocument dict
}
Expand Down
76 changes: 76 additions & 0 deletions providers/aws/resources/aws.lr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions providers/aws/resources/aws.lr.manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2022,6 +2022,7 @@ resources:
fields:
arn: {}
createDate: {}
createdAt: {}
iamRoles: {}
instanceProfileId: {}
instanceProfileName: {}
Expand Down Expand Up @@ -2050,6 +2051,8 @@ resources:
attachedUsers: {}
attachmentCount: {}
createDate: {}
createdAt:
min_mondoo_version: 9.0.0
defaultVersion: {}
description: {}
id: {}
Expand All @@ -2072,6 +2075,8 @@ resources:
fields:
arn: {}
createDate: {}
createdAt:
min_mondoo_version: 9.0.0
document: {}
isDefaultVersion: {}
versionId: {}
Expand All @@ -2088,6 +2093,8 @@ resources:
arn: {}
assumeRolePolicyDocument: {}
createDate: {}
createdAt:
min_mondoo_version: 9.0.0
description: {}
id: {}
name: {}
Expand All @@ -2106,6 +2113,8 @@ resources:
arn: {}
attachedPolicies: {}
createDate: {}
createdAt:
min_mondoo_version: 9.0.0
groups: {}
id: {}
loginProfile:
Expand Down Expand Up @@ -2139,6 +2148,8 @@ resources:
cert1LastRotated: {}
cert2Active: {}
cert2LastRotated: {}
createdAt:
min_mondoo_version: 9.0.0
mfaActive: {}
passwordEnabled: {}
passwordLastChanged: {}
Expand Down
Loading

0 comments on commit bf3bb89

Please sign in to comment.