Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CheckEnableAccessLogging = rules.Register( rules.Rule{ AVDID: "AVD-AWS-0001", Provider: provider.AWSProvider, Service: "api-gateway", ShortCode: "enable-access-logging", Summary: "API Gateway stages for V1 and V2 should have access logging enabled", Impact: "Logging provides vital information about access and usage", Resolution: "Enable logging for API Gateway stages", Explanation: `API Gateway stages should have access log settings block configured to track all access to a particular stage. This should be applied to both v1 and v2 gateway stages.`, Links: []string{ "https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-logging.html", }, Severity: severity.Medium, }, func(s *state.State) (results rules.Results) { for _, api := range s.AWS.APIGateway.APIs { if !api.IsManaged() { continue } for _, stage := range api.Stages { if !stage.IsManaged() { continue } if stage.AccessLogging.CloudwatchLogGroupARN.IsEmpty() { results.Add( "Access logging is not configured.", &stage, stage.AccessLogging.CloudwatchLogGroupARN, ) } else { results.AddPassed(&api) } } } return }, )
View Source
var CheckEnableCacheEncryption = rules.Register( rules.Rule{ AVDID: "AVD-AWS-0002", Provider: provider.AWSProvider, Service: "api-gateway", ShortCode: "enable-cache-encryption", Summary: "API Gateway must have cache enabled", Impact: "Data stored in the cache that is unencrypted may be vulnerable to compromise", Resolution: "Enable cache encryption", Explanation: `Method cache encryption ensures that any sensitive data in the cache is not vulnerable to compromise in the event of interception`, Links: []string{}, Severity: severity.Medium, }, func(s *state.State) (results rules.Results) { for _, api := range s.AWS.APIGateway.APIs { if !api.IsManaged() || api.ProtocolType.NotEqualTo(apigateway.ProtocolTypeREST) { continue } for _, stage := range api.Stages { if !stage.IsManaged() || stage.Version.NotEqualTo(1) { continue } if stage.RESTMethodSettings.CacheDataEncrypted.IsFalse() { results.Add( "Cache data is not encrypted.", &stage, stage.RESTMethodSettings.CacheDataEncrypted, ) } else { results.AddPassed(&stage) } } } return }, )
View Source
var CheckEnableTracing = rules.Register( rules.Rule{ AVDID: "AVD-AWS-0003", Provider: provider.AWSProvider, Service: "api-gateway", ShortCode: "enable-tracing", Summary: "API Gateway must have X-Ray tracing enabled", Impact: "Without full tracing enabled it is difficult to trace the flow of logs", Resolution: "Enable tracing", Explanation: `X-Ray tracing enables end-to-end debugging and analysis of all API Gateway HTTP requests.`, Links: []string{}, Severity: severity.Low, }, func(s *state.State) (results rules.Results) { for _, api := range s.AWS.APIGateway.APIs { if !api.IsManaged() || api.ProtocolType.NotEqualTo(apigateway.ProtocolTypeREST) { continue } for _, stage := range api.Stages { if !stage.IsManaged() || stage.Version.NotEqualTo(1) { continue } if stage.XRayTracingEnabled.IsFalse() { results.Add( "X-Ray tracing is not enabled,", &stage, stage.XRayTracingEnabled, ) } else { results.AddPassed(&stage) } } } return }, )
View Source
var CheckNoPublicAccess = rules.Register( rules.Rule{ AVDID: "AVD-AWS-0004", Provider: provider.AWSProvider, Service: "api-gateway", ShortCode: "no-public-access", Summary: "No unauthorized access to API Gateway methods", Impact: "API gateway methods can be accessed without authorization.", Resolution: "Use and authorization method or require API Key", Explanation: `API Gateway methods should generally be protected by authorization or api key. OPTION verb calls can be used without authorization`, Links: []string{}, Severity: severity.Low, }, func(s *state.State) (results rules.Results) { for _, api := range s.AWS.APIGateway.APIs { if !api.IsManaged() || api.ProtocolType.NotEqualTo(apigateway.ProtocolTypeREST) { continue } for _, method := range api.RESTMethods { if method.HTTPMethod.EqualTo("OPTION") { continue } if method.APIKeyRequired.IsTrue() { continue } if method.AuthorizationType.EqualTo(apigateway.AuthorizationNone) { results.Add( "Authorization is not enabled for this method.", &method, method.AuthorizationType, ) } else { results.AddPassed(&method) } } } return }, )
View Source
var CheckUseSecureTlsPolicy = rules.Register( rules.Rule{ AVDID: "AVD-AWS-0005", Provider: provider.AWSProvider, Service: "api-gateway", ShortCode: "use-secure-tls-policy", Summary: "API Gateway domain name uses outdated SSL/TLS protocols.", Impact: "Outdated SSL policies increase exposure to known vulnerabilities", Resolution: "Use the most modern TLS/SSL policies available", Explanation: `You should not use outdated/insecure TLS versions for encryption. You should be using TLS v1.2+.`, Links: []string{ "https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-custom-domain-tls-version.html", }, Severity: severity.High, }, func(s *state.State) (results rules.Results) { for _, domain := range s.AWS.APIGateway.DomainNames { if domain.SecurityPolicy.NotEqualTo("TLS_1_2") { results.Add( "Domain name is configured with an outdated TLS policy.", &domain, domain.SecurityPolicy, ) } else { results.AddPassed(&domain) } } return }, )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.