Unrotated access keys detected
Rule Details
Cortex AppSec Rule ID
APPSEC_CICD_8
Category
IAM
Severity
LOW
Impact
Access keys associated with projects have not been rotated for more than 180 days. An attacker who obtains such a key gains direct access to the repository, and if the key has write permissions, can modify the repository content. The longer a key remains active, the higher the risk that a leaked or compromised key could be used maliciously.
Recommended Solution - Buildtime
To minimize the risk of a stolen access key being used by an attacker, it is recommended to rotate access keys within a maximum period of 180 days after creating the key. To achieve this, for each access key:
Create a new private key on the server intended to use it.
Create a new access key using the matching public key in the same project that the current key was created on.
Direct the server to use the new key instead of the key in use.
Delete the older access key from the Bitbucket project.
There are two options for creating and deploying keys:
Create and delete access keys using the console: Browse to the Access Keys tab under the repository settings.
Create and delete deploy keys using the API. Refer to the Bitbucket API documentation: https://docs.gitlab.com/ee/api/deploy_keys.html.
Last updated
Was this helpful?
