pub struct OwaspApiConfig {Show 20 fields
pub categories: HashSet<OwaspCategory>,
pub auth_header: String,
pub admin_paths_file: Option<PathBuf>,
pub admin_paths: Vec<String>,
pub id_fields: Vec<String>,
pub valid_auth_token: Option<String>,
pub alt_auth_tokens: Vec<AuthToken>,
pub report_path: PathBuf,
pub report_format: ReportFormat,
pub min_severity: Severity,
pub rate_limit_config: RateLimitConfig,
pub ssrf_config: SsrfConfig,
pub discovery_config: DiscoveryConfig,
pub verbose: bool,
pub concurrency: usize,
pub timeout_ms: u64,
pub insecure: bool,
pub iterations: usize,
pub base_path: Option<String>,
pub custom_headers: HashMap<String, String>,
}Expand description
Configuration for OWASP API Security Top 10 testing
Fields§
§categories: HashSet<OwaspCategory>Categories to test (empty = all categories)
auth_header: StringAuthorization header name for auth bypass tests
admin_paths_file: Option<PathBuf>File containing admin/privileged paths to test
admin_paths: Vec<String>List of admin/privileged paths to test
id_fields: Vec<String>Fields containing resource IDs for BOLA testing
valid_auth_token: Option<String>Valid authorization token for baseline requests
alt_auth_tokens: Vec<AuthToken>Alternative authorization tokens for testing (e.g., different user roles)
report_path: PathBufOutput report file path
report_format: ReportFormatReport format (json, sarif)
min_severity: SeverityMinimum severity level to report
rate_limit_config: RateLimitConfigRate limiting configuration for API4 tests
ssrf_config: SsrfConfigSSRF-specific configuration for API7 tests
discovery_config: DiscoveryConfigDiscovery-specific configuration for API9 tests
verbose: boolEnable verbose output during testing
concurrency: usizeNumber of concurrent test requests
timeout_ms: u64Request timeout in milliseconds
insecure: boolSkip TLS certificate verification (for testing with self-signed certs)
iterations: usizeNumber of iterations per VU (default: 1)
base_path: Option<String>Base path to prepend to all API paths (e.g., “/api”)
custom_headers: HashMap<String, String>Custom headers to include in all requests (e.g., Cookie, X-Custom-Header)
Implementations§
Source§impl OwaspApiConfig
impl OwaspApiConfig
Sourcepub fn categories_to_test(&self) -> Vec<OwaspCategory>
pub fn categories_to_test(&self) -> Vec<OwaspCategory>
Get the categories to test (all if none specified)
Sourcepub fn should_test_category(&self, category: OwaspCategory) -> bool
pub fn should_test_category(&self, category: OwaspCategory) -> bool
Check if a specific category should be tested
Sourcepub fn load_admin_paths(&mut self) -> Result<(), Error>
pub fn load_admin_paths(&mut self) -> Result<(), Error>
Load admin paths from file if specified
Sourcepub fn all_admin_paths(&self) -> Vec<&str>
pub fn all_admin_paths(&self) -> Vec<&str>
Get all admin paths (from file and explicit list)
Sourcepub fn with_categories(
self,
categories: impl IntoIterator<Item = OwaspCategory>,
) -> Self
pub fn with_categories( self, categories: impl IntoIterator<Item = OwaspCategory>, ) -> Self
Builder method to set categories
Sourcepub fn with_auth_header(self, header: impl Into<String>) -> Self
pub fn with_auth_header(self, header: impl Into<String>) -> Self
Builder method to set auth header
Sourcepub fn with_valid_auth_token(self, token: impl Into<String>) -> Self
pub fn with_valid_auth_token(self, token: impl Into<String>) -> Self
Builder method to set valid auth token
Sourcepub fn with_admin_paths(self, paths: impl IntoIterator<Item = String>) -> Self
pub fn with_admin_paths(self, paths: impl IntoIterator<Item = String>) -> Self
Builder method to add admin paths
Sourcepub fn with_id_fields(self, fields: impl IntoIterator<Item = String>) -> Self
pub fn with_id_fields(self, fields: impl IntoIterator<Item = String>) -> Self
Builder method to set ID fields
Sourcepub fn with_report_path(self, path: impl Into<PathBuf>) -> Self
pub fn with_report_path(self, path: impl Into<PathBuf>) -> Self
Builder method to set report path
Sourcepub fn with_report_format(self, format: ReportFormat) -> Self
pub fn with_report_format(self, format: ReportFormat) -> Self
Builder method to set report format
Sourcepub fn with_verbose(self, verbose: bool) -> Self
pub fn with_verbose(self, verbose: bool) -> Self
Builder method to set verbosity
Sourcepub fn with_insecure(self, insecure: bool) -> Self
pub fn with_insecure(self, insecure: bool) -> Self
Builder method to set insecure TLS mode
Sourcepub fn with_concurrency(self, concurrency: usize) -> Self
pub fn with_concurrency(self, concurrency: usize) -> Self
Builder method to set concurrency (number of VUs)
Sourcepub fn with_iterations(self, iterations: usize) -> Self
pub fn with_iterations(self, iterations: usize) -> Self
Builder method to set iterations per VU
Sourcepub fn with_base_path(self, base_path: Option<String>) -> Self
pub fn with_base_path(self, base_path: Option<String>) -> Self
Builder method to set base path for API endpoints
Sourcepub fn with_custom_headers(self, headers: HashMap<String, String>) -> Self
pub fn with_custom_headers(self, headers: HashMap<String, String>) -> Self
Builder method to set custom headers for all requests
Trait Implementations§
Source§impl Clone for OwaspApiConfig
impl Clone for OwaspApiConfig
Source§fn clone(&self) -> OwaspApiConfig
fn clone(&self) -> OwaspApiConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OwaspApiConfig
impl Debug for OwaspApiConfig
Source§impl Default for OwaspApiConfig
impl Default for OwaspApiConfig
Source§impl<'de> Deserialize<'de> for OwaspApiConfig
impl<'de> Deserialize<'de> for OwaspApiConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for OwaspApiConfig
impl RefUnwindSafe for OwaspApiConfig
impl Send for OwaspApiConfig
impl Sync for OwaspApiConfig
impl Unpin for OwaspApiConfig
impl UnwindSafe for OwaspApiConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more