DevOps · Senior

DevSecOps: secrets, least privilege, and security shift-left

For a long time, security was the final step: the software was done, a separate team ran an audit and, on the eve of the deploy, pointed out problems that were expensive to fix. DevSecOps flips that. The idea is to bring security to the beginning and spread it across the whole process, making it everyone's responsibility — not a gate at the end of the road. For a senior DevOps engineer, this is no longer optional.

Shift-left security

"Shift-left" means moving security concerns to the left of the timeline — closer to when the code is written. The earlier a problem is found, the cheaper it is to fix. A leaked secret caught in a commit costs seconds; the same secret discovered in production costs an incident.

Security isn't a stamp at the end of the conveyor belt; it's a property built at every step. The further left you catch the problem, the cheaper and less painful it is to fix.

Secrets management

Passwords, tokens and API keys should never go into Git — not in config files, not "temporarily". Once in the history, they stay there forever. The solution is a secrets vault, from which the application fetches credentials at runtime, with audited access and automatic rotation.

# ERRADO — segredo no código, versionado para sempre
db_password = "p@ssw0rd123"

# CERTO — referência a um segredo guardado no cofre
db_password = vault.read("secret/prod/db").password

Least privilege

The principle of least privilege says that every user, service or process should have only the permissions it needs, nothing more. In practice, this is done with IAM (Identity and Access Management): instead of granting admin access "to make things easier", you grant the minimum. That way, if a credential leaks, the damage is contained.

Pipeline scanning: SAST and DAST

The CI/CD pipeline is the ideal place to automate security checks on every change. Three types appear frequently:

TechniqueWhat it analyzesWhen it runs
SASTThe static source codeAt build
DASTThe running applicationIn a test environment
Image scanVulnerabilities in the image's dependenciesAfter the container build
steps:
  - run: trivy image minha-app:1.2   # scan de vulnerabilidades
  - run: gitleaks detect             # procura segredos vazados
  - run: semgrep --config auto       # análise estática (SAST)

Supply chain security

Modern software is assembled from hundreds of third-party dependencies — and each one is a potential entry point. Supply chain attacks exploit exactly that: they compromise a popular library to reach everyone who uses it. Defending against them involves pinning versions, verifying package provenance and keeping an inventory of what you use (SBOM).

Culture: everyone's responsibility

The hardest part of DevSecOps isn't the tooling, it's the culture. Security stops being "the security team's problem" and becomes a quality criterion that every developer and operator carries. Day to day, it shows up in code reviews that look for risks, in architecture choices that assume things will fail, and in treating a security alert as naturally as you treat a bug.

Conclusion

DevSecOps is security that is integrated, continuous and shared. Shifting checks left, keeping secrets out of Git, applying least privilege, automating scans in the pipeline and looking after the supply chain are concrete practices that, combined with a culture where everyone cares, make the system resilient by design. That is what sets a mature senior DevOps engineer apart.

Read also

Back to track