Automated Security Scanning Schedule: Best Practices
A workable scanning schedule assigns each scan type its own trigger: code and dependency checks on every commit, image scans on every build, dynamic application tests nightly or per release, infrastructure scans weekly, and cloud configuration checks continuously. Add event triggers for new CVEs and major changes, then judge the schedule by fix times and coverage, not by the number of scans run.
Continuous AI-powered penetration testing by Penetrify - find and fix vulnerabilities before attackers do.
A baseline cadence for each scan type
There is no single frequency for security scanning. Each kind of scan has a natural trigger, set by how fast its subject changes and how long the scan takes.
- Secrets detection and SAST: on every commit or pull request. They are fast, and the cheapest moment to fix a finding is before merge.
- Dependency scanning (SCA): on every build, plus a daily run against the default branch. New advisories are published against code you have not touched, so a build-only trigger misses them.
- Container image scanning: on every image build, plus a recurring rescan of images that are still deployed or still in the registry.
- Infrastructure-as-code checks: on every pull request that touches Terraform, CloudFormation or Kubernetes manifests.
- DAST and automated penetration testing: nightly against staging or on every release candidate, and on a slower cadence against production if your rules of engagement allow it.
- Network and host vulnerability scans: weekly for internet-facing ranges, at least monthly for internal ones.
- Cloud configuration (CSPM): continuously, or as often as the tool polls. Configuration changes with a single click.
- Manual penetration test: at least annually and after significant architectural change, where a framework or customer requires it.
Use this as a starting grid, then tighten the cadence for assets that are internet-facing or hold regulated data, and relax it for internal tools with no sensitive data.
Why calendar-only schedules fall short
A quarterly or annual scan assumes the system stays the same between scans. It does not. Three things change independently of your calendar:
- Your code. A team that deploys several times a week ships dozens of changes between quarterly scans. Each scan describes a version that has already been replaced.
- The vulnerability landscape. A library that was clean on Monday can have a critical advisory on Tuesday. Nothing in your repository changed, so nothing triggered a scan.
- Your exposure. A new subdomain, an opened port or a storage bucket made public alters the attack surface without a release.
Periodic checks also batch the work. A quarterly report with two hundred findings arrives all at once, competes with the roadmap and gets partially fixed. The same findings delivered a few at a time, next to the change that caused them, get fixed by the person who still remembers the code.
Stop Finding Vulnerabilities After Attackers Do
Penetrify runs AI-powered penetration tests on every deployment. Get production-ready fixes in minutes, not weeks.
Start a scan →Event triggers to add on top of the calendar
- Merge to the main branch: the full pipeline set, including a dynamic test of the deployed staging build.
- New critical advisory for a component you use: an immediate dependency and image rescan across all repositories, not just the active ones.
- New asset: any new domain, public IP or cloud account is added to scan scope automatically. Drive scope from DNS and cloud inventory, not from a spreadsheet.
- Change to authentication, authorization or payment flows: a targeted application test of those flows before release.
- A fix is deployed: a re-test of that specific finding, so that closed means verified and not merely merged.
Wiring the schedule into the pipeline
Keep the schedule in version control next to the code it protects. In GitHub Actions a nightly dynamic test is a few lines:
on:
schedule:
- cron: '0 2 * * 1-5' # 02:00 UTC, Monday to Friday
workflow_dispatch:
Scheduled workflows run on the default branch, times are in UTC, and start times can slip when the platform is busy, so do not design anything that depends on an exact minute. GitLab offers the same through pipeline schedules. The broader pattern is described in the CI/CD integration guide.
Some operating rules prevent the schedule from becoming a nuisance:
- Split fast and slow scans. Anything that takes longer than the rest of the pipeline runs nightly, not on every pull request.
- Block merges only on findings that are high severity and confirmed. Report the rest without blocking.
- Run active scans against staging by default. If you scan production, agree a window, exclude destructive checks and tell whoever is on call.
- Give every scan an owner who receives the output. A scan whose results reach nobody is not part of the schedule.
For the application layer, Penetrify can be started from a GitHub Action, GitLab CI or its CLI and can also run on its own schedule. It tests web applications and APIs, returns results in minutes and re-tests fixed findings for free, which covers the nightly and post-fix triggers above. It does not scan hosts, images or cloud configuration, so those rows of the grid need their own tools.
What compliance frameworks actually require
Frameworks set a floor, and the floor is lower than a sensible engineering cadence. PCI DSS requires internal and external vulnerability scans at least once every three months, with the external ones performed by an Approved Scanning Vendor, and penetration testing at least once every twelve months and after significant change. Details are in the guide to PCI DSS penetration testing. SOC 2 does not prescribe a scan frequency; the auditor checks that you follow the cadence you documented. Write a policy you can keep, then exceed it in the pipeline.
Metrics that show the schedule works
- Time to remediate by severity. Median days from first detection to verified fix, tracked against the targets in your policy.
- Scan coverage. Share of known assets (repositories, images, domains, hosts) scanned within their target interval. This is the metric that exposes forgotten systems.
- Detection delay. Time between a change being deployed, or an advisory being published, and the first scan that could have caught it.
- Open findings past deadline. Count and age of findings that exceeded their target, per team.
- Reopen rate. Share of findings marked fixed that reappear. A high rate means fixes are not being re-tested.
- Noise. Share of findings dismissed as false positives or accepted without action. If it climbs, tune the tool before people stop reading the output.
Review these monthly. Number of scans run is not on the list: it measures activity, and a schedule can run thousands of scans while fix times get worse.
Frequently Asked Questions
How often should automated security scans run?
It depends on the scan type. Code, secrets and dependency checks belong on every commit or build, with a daily dependency rescan. Dynamic application tests fit a nightly or per-release cadence. Internet-facing infrastructure deserves at least a weekly scan, and cloud configuration should be checked continuously. Tighten the cadence for systems holding sensitive data.
Is a quarterly vulnerability scan enough?
It can satisfy a compliance minimum, such as the quarterly scans PCI DSS requires, but it is rarely enough for security. Code, dependencies and exposure all change between quarterly scans, so issues can sit undetected for months. Treat the quarterly scan as the formal evidence and run faster automated checks in between.
What is the difference between scheduled and continuous scanning?
Scheduled scanning runs at fixed times, such as nightly or weekly. Continuous scanning is triggered by events: a commit, a build, a new asset or a newly published advisory. In practice a good programme combines both, because event triggers catch changes quickly and scheduled runs catch whatever the events missed.
Should automated scans run against production or staging?
Run active tests against staging by default, since they send unusual input and can create data. Production should still be covered by non-intrusive checks and by external scans, because staging never matches production exactly. If you run active tests in production, agree on a window, exclude destructive checks and inform the on-call team.
Which metrics show whether a scanning schedule is effective?
Track time to remediate by severity, the share of assets scanned within their target interval, the delay between a change and the first scan that covers it, the number of findings past their deadline and the reopen rate. These measure outcomes. The raw number of scans or findings only measures activity.
Ready to Secure Your Application?
Continuous, AI-powered penetration testing for web apps and APIs.
Run your first scan →