Skip to content
Go back

DevSecOps From Zero to Hero

Updated:
Edit Page

I believe DevSecOps engineers should make everyone’s life easier by paving roads for the company and teams, rather than gatekeeping.

Unfortunately, that seems to be a high standard in practice. I decided to try it myself to see how hard it really is. Wish me luck.

Static Application Security Testing (SAST)

SAST is a white-box testing method. It analyzes source code to identify security vulnerabilities before applications are deployed

Opengrep https://www.opengrep.dev/, linters(uv, golangci lint), SonarQube(commercial).

Semgrep https://docs.semgrep.dev/
I don’t find Semgrep’s open source version very useful. Paid version? Maybe. Enlighten me on how you use Semgrep on your team.

Dynamic application security testing (DAST)

Test the running program.

https://www.zaproxy.org/

Software composition analysis(SCA)

Trivy and Dependabot

https://trivy.dev/docs/latest/getting-started/

Very handy tool.

Trivy performs static, presence-based analysis without executing the code. It inspects filesystems, archives, or container image layers and extracts exact package versions using ecosystem-specific metadata:

Common workflows:

trivy fs --scanners vuln app/gradle.lockfile

trivy image app:v1.0.0

trivy rootfs --scanners vuln app/build/libs/app.jar

trivy fs --format cyclonedx --output sbom.json .
trivy sbom sbom.json

trivy k8s --report summary cluster

Software Bill of Materials(SBOM)

A inventory of all components, open-source libraries, and dependencies inside a software product. SPDX is an open standard for that.

https://cyclonedx.org/capabilities/sbom/

Open Policy Agent (OPA)

https://www.openpolicyagent.org/

OWASP Top 10

https://top10.owasp.org/2025/0x00_2025-Introduction/

It lists the top 10 Common Weakness Enumerations(CWE) from the survey reports.

For 2025 they are:

  1. Broken Access Control: bad actors accessing information they don’t have access to.
  2. Security Misconfiguration: as the name suggests, weaknesses such as using default password, unnecessary ports opened, etc.
  3. Software Supply Chain Failures: very common weakness. Monitor CVEs, manage the SBOM, update your systems more often.
  4. Cryptographic Failures: weak security in data transportation and data encryption at rest.
  5. Injection: my advice: assume every user input is bad.
  6. Insecure Design
  7. Authentication Failures
  8. Software or Data Integrity Failures: sign your data and check the signatures
  9. Security Logging & Alerting Failures
  10. Mishandling of Exceptional Conditions

Terraform

From zero to hero.

https://developer.hashicorp.com

HCL

backend is where to store the lock files and state files. It can be a S3 bucket, or local files.

locals the local variables.

variable variables, with type and description fields.

output exposes the values for references. Similar to the function returnings in programming.

module is a group of multiple resources. Like any other abstraction in software engineering, think about whether you really need it.

moved for refactoring. Otherwise terraform can’t recognize them as the same resource.

moved {
  from = aws_instance.a
  to   = aws_instance.b
}

Checkov

Checkov scans cloud infrastructure configurations to find misconfigurations before they’re deployed.

https://www.checkov.io/

checkov -d . --compact

Tried it on my lab project and immediately caught two real issues in my security group module:

By Prisma Cloud | version: 3.4.11

terraform scan results:

Passed checks: 12, Failed checks: 2, Skipped checks: 0

...

Check: CKV_AWS_23: "Ensure every security group and rule has a description"
	PASSED for resource: aws_security_group.app_sg
	File: /main.tf:9-28
	Guide: https://docs.prismacloud.io/en/enterprise-edition/policy-reference/aws-policies/aws-networking-policies/networking-31
Check: CKV_AWS_23: "Ensure every security group and rule has a description"
	FAILED for resource: module.payment_sg.aws_security_group.this
	File: /modules/service-sg/main.tf:1-24
	Calling File: /team/main.tf:1-7
	Guide: https://docs.prismacloud.io/en/enterprise-edition/policy-reference/aws-policies/aws-networking-policies/networking-31
Check: CKV_AWS_382: "Ensure no security groups allow egress from 0.0.0.0:0 to port -1"
	FAILED for resource: module.payment_sg.aws_security_group.this
	File: /modules/service-sg/main.tf:1-24
	Calling File: /team/main.tf:1-7
	Guide: https://docs.prismacloud.io/en/enterprise-edition/policy-reference/aws-policies/aws-networking-policies/bc-aws-382

Edit Page
Share this post on:

Next Post
Debugging 5-Second Latency Spikes in GKE and Why It Was DNS