Improper inventory management occurs when API versions, endpoints, environments, or documentation are not tracked and controlled throughout their lifecycle. Gaps create API sprawl, obscure the attack surface, and leave forgotten assets exposed. section 5.6
A forgotten API version
An organization releases v2, announces v1's retirement, and then forgets to deprovision v1. The old version can be redeployed or re-exposed, becoming a zombie API. Undocumented endpoints can similarly become shadow APIs with weak protection, sensitive data exposure, or poor monitoring. section 5.6
Reduce the risk by:
- Using Deprecation and Sunset headers, optionally linking to a deprecation policy. section 5.6
- Automating retirement with API versioning tools or gateways. section 5.6
- Restricting traffic to documented endpoints and continuously monitoring traffic for undocumented attack surface. section 5.9
Figure 5.7 To upgrade our API version, we release the new version and set the sunset deprecation header in the old version. When the date is due, we retire the old version.
Follow the release, deprecation, and retirement sequence for an API version. section 5.6
