Configuring Thresholds¶
Overview¶
Security Emphasis
Threshold configuration is a critical security control that determines which security issues are acceptable in your environment. Properly implemented thresholds prevent insecure containers from being deployed while allowing operations to continue when minor issues are detected.
This task guides you through configuring security scan thresholds for Kube CINC Secure Scanner. Thresholds define the boundaries between acceptable and unacceptable security postures, enabling automated quality gates in your CI/CD pipelines.
Time to complete: 15-20 minutes
Security risk: 🟢 Low - Configuration activity without direct system access
Security approach: Implements customizable security boundaries, multi-dimensional compliance criteria, and balanced risk management controls
Security Architecture¶
Understanding Permission Layers
Threshold configuration involves managing permissions across several layers:
1. Threshold Definition Permissions * Control: Who can define and modify threshold values * Risk area: Overly permissive thresholds could allow insecure containers to pass checks * Mitigation: Store threshold files in version-controlled repositories with proper review processes
2. Threshold Implementation Permissions * Control: How thresholds are applied during scanning operations * Risk area: Bypassing threshold checks could undermine security controls * Mitigation: Enforce threshold validation in CI/CD pipelines with proper separation of duties
3. Threshold Override Permissions * Control: Who can bypass threshold requirements in exceptional cases * Risk area: Excessive overrides could weaken security posture * Mitigation: Implement audit logging for all threshold overrides and require documented justification
Security Prerequisites¶
- Basic understanding of compliance requirements for your containers
- CINC Auditor profiles selected for scanning
- SAF-CLI installed for threshold evaluation
- Permission to update CI/CD pipeline configurations (if implementing automated gates)
Step-by-Step Instructions¶
Step 1: Understanding Threshold Components¶
Security Consideration
Different components of your infrastructure may require different threshold configurations based on their risk profile and exposure.
Thresholds in Kube CINC Secure Scanner can be defined across multiple dimensions:
- Overall Compliance Score: A percentage of passing controls
- Severity-Based Limits: Maximum number of failures by severity level
- Impact-Based Limits: Thresholds based on the impact score of findings
- Control-Specific Overrides: Allow/deny lists for specific controls
Step 2: Create a Basic Threshold Configuration¶
Security Consideration
Start with strict thresholds and allow exceptions only where necessary, rather than starting with lenient thresholds.
- Create a file named
threshold.yml
with the following content:
- This configuration enforces:
- At least 80% overall compliance
- Zero critical severity findings
- Limited number of less severe findings
Step 3: Implement Advanced Threshold Configurations¶
Security Consideration
Different environments (development, testing, production) should have appropriate threshold levels to balance security and operational needs.
For more granular control, create environment-specific threshold files:
development-threshold.yml:
production-threshold.yml:
Step 4: Create Control-Specific Configurations¶
Security Consideration
Some security controls may be temporarily acceptable to fail due to business constraints, but these exceptions should be documented and time-limited.
For scenarios where specific controls need exceptions:
Step 5: Integrate with SAF-CLI¶
Security Consideration
Automated threshold validation ensures consistent application of security standards across all scans.
- Use SAF-CLI to evaluate scan results against your threshold configuration:
- For command-line thresholds without a file:
Step 6: Implement in CI/CD Pipelines¶
Security Consideration
CI/CD pipelines should enforce thresholds automatically to prevent manual override of security controls.
Add threshold checking to your CI/CD pipeline:
GitHub Actions example:
GitLab CI example:
Security Best Practices¶
- Version control all threshold configurations to track changes over time
- Implement a review process for threshold modifications, especially exceptions
- Document all control exceptions with clear justification and expiration dates
- Use progressively stricter thresholds moving from development to production
- Gradually increase threshold requirements over time as security posture improves
- Regularly review threshold compliance reports to identify systemic issues
- Update thresholds when new security controls or compliance requirements emerge
Verification Steps¶
- Test your threshold configuration with a known scan result
- Verify that appropriate thresholds are being applied in different environments
- Validate exception handling by testing with scan results containing known exceptions
Troubleshooting¶
Issue | Solution |
---|---|
Threshold always fails regardless of configuration | Verify the format of your threshold.yml file and ensure it follows the correct schema |
Exceptions not being recognized | Check that control IDs match exactly with those in scan results |
SAF-CLI not recognizing the threshold file | Ensure you're using the latest version of SAF-CLI with npm update -g @mitre/saf |
CI/CD pipeline ignoring threshold failures | Verify that the pipeline is configured to properly use the exit code from saf threshold |
Inconsistent threshold behavior | Check for multiple threshold configurations being applied and standardize where needed |
Next Steps¶
After completing this task, consider:
- Integrate with GitHub Actions to automatically enforce thresholds in GitHub workflows
- Integrate with GitLab CI to automatically enforce thresholds in GitLab pipelines
- Define custom scanning profiles to better align with your threshold requirements
- Implement reporting procedures for threshold violations