Loading...
Loading...
Use when user asks about fixing security vulnerabilities, composer audit failures, vulnerable Drupal packages, or CVE advisories in a Drupal codebase.
npx skill4agent add acquia/acquia-skills security-updatescomposer auditThis step is mandatory. Do not run any composer commands until a new branch is created and confirmed. Never update packages directly onormain.master
git branch --show-currentmainmastersecurity/drupal-updates-YYYY-MM-DDgit checkout -b <branch-name>git branch --show-currentcomposer auditcomposer audit --format=jsoncomposer audit --no-devcomposer update drupal/package --with-all-dependencies--with-all-dependenciesdrupal/corecomposer update drupal/core-recommended drupal/core-composer-scaffold --with-all-dependenciescomposer.jsoncomposer update --with-all-dependencies $(composer audit --format=json 2>/dev/null \
| python3 -c "import sys,json; data=json.load(sys.stdin); print(' '.join(set(a['packageName'] for a in data.get('advisories', {}).values() if isinstance(a, dict)) or [v[0]['packageName'] for v in data.get('advisories', {}).values()]))" 2>/dev/null)# List vulnerable packages from audit output, then update each
composer update drupal/package1 drupal/package2 --with-all-dependenciescomposer auditNo security vulnerability advisories found.After the audit is clean, always ask the user these questions in order:1. "Do you want to commit these changes?"
- If yes:
bashgit add composer.json composer.lock git commit -m "Apply Drupal security updates"- If no → remind the user that
andcomposer.jsonare uncommitted before proceeding.composer.lock2. "Do you want to deploy these changes to an Acquia environment?"
- If yes → follow the Drupal Update and Deploy playbook to push code, switch the environment, and optionally trigger a pipeline build.
- If no → done.
# Check what requires the package
composer why drupal/package
# Check what prevents the update
composer why-not drupal/package 2.x
# Relax the constraint in composer.json if safe, then retry
composer update drupal/package --with-all-dependenciescomposer audit --update-cache
composer audit# Check the full dependency tree
composer depends drupal/conflicting-packagecomposer.jsoncomposer audit--with-all-dependenciescomposer.lock