package classify import "tea.karlcom.de/karl/bucketeer/internal/model" // classifyOCIResource handles // .objectstorage..oci.customer-oci.com and the swift variant. // The namespace is in the hostname, so it is resource specific. func classifyOCIResource(s *scanner) (model.Match, bool) { n := s.n if n < 6 || s.label(n-1) != "com" || s.label(n-2) != "customer-oci" || s.label(n-3) != "oci" { return model.Match{}, false } svc := s.label(n - 5) if svc != "objectstorage" && svc != "swiftobjectstorage" { return model.Match{}, false } return model.Match{ Provider: model.ProviderOracle, Service: model.ServiceObjectStorage, ResourceSpecific: true, Region: s.label(n - 4), Resource: s.label(0), }, true } // classifyOCIGeneric handles objectstorage..oraclecloud.com. The bucket // name lives in the URL path rather than the hostname, so resource_specific is // false and these normally do not become findings. func classifyOCIGeneric(s *scanner) (model.Match, bool) { n := s.n if n != 4 || s.label(n-1) != "com" || s.label(n-2) != "oraclecloud" { return model.Match{}, false } svc := s.label(n - 4) if svc != "objectstorage" && svc != "swiftobjectstorage" { return model.Match{}, false } return model.Match{ Provider: model.ProviderOracle, Service: model.ServiceObjectStorage, ResourceSpecific: false, Region: s.label(n - 3), }, true }