r/devops • DevOps Engineer & Educator • 27d ago

Discussion Securing local dev environments

With the recent high-stakes security exploits, I think as DevOps engineers it's our responsibility to make the local dev environment secure for devs.

What do you think?

What are you actively doing about it (like adopting devcontainers)

12 Upvotes

16 comments sorted by

View all comments

29

u/LifeNavigator 27d ago

it's our responsibility to make the local dev environment secure for devs.

No, security is a shared responsibility and EVERYONE who is using the environment must be responsible in carrying security best practices and involved in keeping it secure.

The one thing I hate is having to work outside my working hrs to fix other people's stupid mistake. Likewise, so do devs and they will carry out security best practices once they realise they share that responsibility (though they would have limited privileges in some aspects).

1

u/SeaworthinessHour233 DevOps Engineer & Educator 26d ago

Fully agree that security is everyone's responsibility.

What I really want is to establish a framework/guidelines for local dev environments that every dev need to follow.

1

u/g-nice4liief 26d ago

Make it a business rule that no one can access prod or any env without a devcontainer and make sure it is enforceable from for example Azure devops/github actions/flux/argocd

1

u/LifeNavigator 26d ago

Fair enough, that would typically depend on your company size though (budget reasons). We follow OWASP DevSecOps and zero trust principles:

  • Segmented network - Our local environment mirrors prods and devs follow the same security standards as on prod (which they have no access to). This means having strict firewalls in place, limited connectivity amongst VMs and application (inc database) etc.
  • Conditional and temp access - permissions are granted only when required via MFA and are removed when no longer valid. For example, on Azure we require users to sign in via MFA, then use Privileged Identity Management to enable access to servers for limited time and users must give reasons as to why they need it (for auditing purposes).
  • Permissions are tightly scoped - every user of that environment will have least privilege access for what they need. Anything beyond that they will need to request permission.
  • Shifting left and adopting a testing mindset - we run plenty of security tests for PR prior to merging as well as post deployments. Should things go wrong then they should revert the changes.
  • Continuous monitoring and observability - we encouraged devs to use these tools post deployment to evaluate the impact of their deployment. As these environments tend to be exclusively for devs, then they must have the responsibility in monitoring that environment to ensure everything running smoothly and to identify issues.

It's worth having a look at existing frameworks (e,g, NIST Cybersecurity Framework) and resources from bigger companies (Google, Microsoft, Amazon and cross checking what might be possible for your organisation. The one thing I'd stress about is that leadership MUST BE ONBOARD with this and must also encourage it (inc funding training where possible).

1

u/No_Corner8781 25d ago

agree, we can give them guardrails and sane defaults, but you cant babysit what someone installs on their own machine.

1

u/LifeNavigator 25d ago

If you're using a company laptop/PC then yes they can and they should. Free reign comes at significant secuty risks and every software installed should be properly vetted first.

A prime example is Jetbrains having malicious extensions on its marketplace that stole API keys and secrets from env files. Another example I can think of is a prev colleague in a past company using LastPass to store their sensitive testing credentials... when that was breached we had tonnes of sensitive client data stolen...