Security scanning tools (such as Mythos) may flag BOSH pre-start scripts or rendered templates because they contain sensitive secrets but possess standard file permissions (e.g., 0644). Customers often seek to tighten these permissions to 0700 and change ownership to root:root to mitigate unauthorized access.
/var/vcap/jobs/.chmod or chown changes being overwritten after a BOSH deploy or recreate.BOSH rendered templates are generated during the deployment lifecycle. By default, many files are readable by the vcap user to allow processes to start. Because anyone with bosh ssh access can typically escalate to root via sudo -i, simple filesystem permissions provide limited security depth.
Broadcom recommends a two-tiered approach to securing job secrets.
1. Primary Defense: BOSH Process Manager (BPM) The most effective way to secure job files is to utilize BOSH Process Manager (BPM). BPM places a container wrapper around job processes, which:
2. Hardening via os-conf-release (Persistent Permission Changes) If specific file permissions (e.g., 0700) are required for compliance, use the os-conf-release to ensure changes persist across VM recreations.
## yaml
releases:
- name: os-conf
version: 23.0.0
addons:
- name: permission-hardening
jobs:
- name: pre-start-script
release: os-conf
properties:
script: |-
#!/bin/bash
TARGET="/var/vcap/jobs/<JOB_NAME>/bin/pre-start"
if [ -f "$TARGET" ]; then
chown root:root "$TARGET"
chmod 0700 "$TARGET"
fi
include:
instance_groups: [master, worker] # Adjust to your target groups