Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CheckNoPasswordReuse = rules.Register( rules.Rule{ AVDID: "AVD-AWS-0056", Provider: provider.AWSProvider, Service: "iam", ShortCode: "no-password-reuse", Summary: "IAM Password policy should prevent password reuse.", Impact: "Password reuse increase the risk of compromised passwords being abused", Resolution: "Prevent password reuse in the policy", Explanation: `IAM account password policies should prevent the reuse of passwords. The account password policy should be set to prevent using any of the last five used passwords.`, Links: []string{ "https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_passwords_account-policy.html#password-policy-details", }, Severity: severity.Medium, }, func(s *state.State) (results rules.Results) { policy := s.AWS.IAM.PasswordPolicy if !policy.IsManaged() { return } if policy.ReusePreventionCount.LessThan(5) { results.Add( "Password policy allows reuse of recent passwords.", &policy, policy.ReusePreventionCount, ) } else { results.AddPassed(&policy) } return }, )
View Source
var CheckNoPolicyWildcards = rules.Register( rules.Rule{ AVDID: "AVD-AWS-0057", Provider: provider.AWSProvider, Service: "iam", ShortCode: "no-policy-wildcards", Summary: "IAM policy should avoid use of wildcards and instead apply the principle of least privilege", Impact: "Overly permissive policies may grant access to sensitive resources", Resolution: "Specify the exact permissions required, and to which resources they should apply instead of using wildcards.", Explanation: `You should use the principle of least privilege when defining your IAM policies. This means you should specify each exact permission required without using wildcards, as this could cause the granting of access to certain undesired actions, resources and principals.`, Links: []string{ "https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html", }, Severity: severity.High, }, func(s *state.State) (results rules.Results) { var documents []iam.PolicyDocument for _, policy := range s.AWS.IAM.Policies { documents = append(documents, policy.Document) } for _, policy := range s.AWS.IAM.GroupPolicies { documents = append(documents, policy.Document) } for _, policy := range s.AWS.IAM.UserPolicies { documents = append(documents, policy.Document) } for _, policy := range s.AWS.IAM.RolePolicies { documents = append(documents, policy.Document) } for _, document := range documents { for _, statement := range document.Statements { results = checkStatement(document, statement, results) } } return }, )
View Source
var CheckRequireLowercaseInPasswords = rules.Register( rules.Rule{ AVDID: "AVD-AWS-0058", Provider: provider.AWSProvider, Service: "iam", ShortCode: "require-lowercase-in-passwords", Summary: "IAM Password policy should have requirement for at least one lowercase character.", Impact: "Short, simple passwords are easier to compromise", Resolution: "Enforce longer, more complex passwords in the policy", Explanation: `IAM account password policies should ensure that passwords content including at least one lowercase character.`, Links: []string{ "https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_passwords_account-policy.html#password-policy-details", }, Severity: severity.Medium, }, func(s *state.State) (results rules.Results) { policy := s.AWS.IAM.PasswordPolicy if !policy.IsManaged() { return } if policy.RequireLowercase.IsFalse() { results.Add( "Password policy does not require lowercase characters.", &policy, policy.RequireLowercase, ) } else { results.AddPassed(&policy) } return }, )
View Source
var CheckRequireNumbersInPasswords = rules.Register( rules.Rule{ AVDID: "AVD-AWS-0059", Provider: provider.AWSProvider, Service: "iam", ShortCode: "require-numbers-in-passwords", Summary: "IAM Password policy should have requirement for at least one number in the password.", Impact: "Short, simple passwords are easier to compromise", Resolution: "Enforce longer, more complex passwords in the policy", Explanation: `IAM account password policies should ensure that passwords content including at least one number.`, Links: []string{ "https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_passwords_account-policy.html#password-policy-details", }, Severity: severity.Medium, }, func(s *state.State) (results rules.Results) { policy := s.AWS.IAM.PasswordPolicy if !policy.IsManaged() { return } if policy.RequireNumbers.IsFalse() { results.Add( "Password policy does not require numbers.", &policy, policy.RequireNumbers, ) } else { results.AddPassed(&policy) } return }, )
View Source
var CheckRequireSymbolsInPasswords = rules.Register( rules.Rule{ AVDID: "AVD-AWS-0060", Provider: provider.AWSProvider, Service: "iam", ShortCode: "require-symbols-in-passwords", Summary: "IAM Password policy should have requirement for at least one symbol in the password.", Impact: "Short, simple passwords are easier to compromise", Resolution: "Enforce longer, more complex passwords in the policy", Explanation: `IAM account password policies should ensure that passwords content including a symbol.`, Links: []string{ "https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_passwords_account-policy.html#password-policy-details", }, Severity: severity.Medium, }, func(s *state.State) (results rules.Results) { policy := s.AWS.IAM.PasswordPolicy if !policy.IsManaged() { return } if policy.RequireSymbols.IsFalse() { results.Add( "Password policy does not require symbols.", &policy, policy.RequireSymbols, ) } else { results.AddPassed(&policy) } return }, )
View Source
var CheckRequireUppercaseInPasswords = rules.Register( rules.Rule{ AVDID: "AVD-AWS-0061", Provider: provider.AWSProvider, Service: "iam", ShortCode: "require-uppercase-in-passwords", Summary: "IAM Password policy should have requirement for at least one uppercase character.", Impact: "Short, simple passwords are easier to compromise", Resolution: "Enforce longer, more complex passwords in the policy", Explanation: `, IAM account password policies should ensure that passwords content including at least one uppercase character.`, Links: []string{ "https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_passwords_account-policy.html#password-policy-details", }, Severity: severity.Medium, }, func(s *state.State) (results rules.Results) { policy := s.AWS.IAM.PasswordPolicy if !policy.IsManaged() { return } if policy.RequireUppercase.IsFalse() { results.Add( "Password policy does not require uppercase characters.", &policy, policy.RequireUppercase, ) } else { results.AddPassed(&policy) } return }, )
View Source
var CheckSetMaxPasswordAge = rules.Register( rules.Rule{ AVDID: "AVD-AWS-0062", Provider: provider.AWSProvider, Service: "iam", ShortCode: "set-max-password-age", Summary: "IAM Password policy should have expiry less than or equal to 90 days.", Impact: "Long life password increase the likelihood of a password eventually being compromised", Resolution: "Limit the password duration with an expiry in the policy", Explanation: `IAM account password policies should have a maximum age specified. The account password policy should be set to expire passwords after 90 days or less.`, Links: []string{ "https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_passwords_account-policy.html#password-policy-details", }, Severity: severity.Medium, }, func(s *state.State) (results rules.Results) { policy := s.AWS.IAM.PasswordPolicy if !policy.IsManaged() { return } if policy.MaxAgeDays.GreaterThan(90) { results.Add( "Password policy allows a maximum password age of greater than 90 days.", &policy, policy.MaxAgeDays, ) } else { results.AddPassed(&policy) } return }, )
View Source
var CheckSetMinimumPasswordLength = rules.Register( rules.Rule{ AVDID: "AVD-AWS-0063", Provider: provider.AWSProvider, Service: "iam", ShortCode: "set-minimum-password-length", Summary: "IAM Password policy should have minimum password length of 14 or more characters.", Impact: "Short, simple passwords are easier to compromise", Resolution: "Enforce longer, more complex passwords in the policy", Explanation: `IAM account password policies should ensure that passwords have a minimum length. The account password policy should be set to enforce minimum password length of at least 14 characters.`, Links: []string{ "https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_passwords_account-policy.html#password-policy-details", }, Severity: severity.Medium, }, func(s *state.State) (results rules.Results) { policy := s.AWS.IAM.PasswordPolicy if !policy.IsManaged() { return } if policy.MinimumLength.LessThan(14) { results.Add( "Password policy has a minimum password length of less than 14 characters.", &policy, policy.MinimumLength, ) } else { results.AddPassed(&policy) } return }, )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.