Skip to content

Commit 6b2aed7

Browse files
authored
Add explanation and one example to 3-1-4-Infastructure-as-code.md
1 parent 0edc624 commit 6b2aed7

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

documents/3-Commit-CI/3-1-Static-analysis/3-1-4-Infastructure-as-code.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
### Infrastructure as Code scanning
2-
TBD
2+
IaC scanning means checking the code used to set up and manage infrastructure. This code, written in tools like Terraform or Ansible, defines how servers, networks, and other parts of the infrastructure are created. The aim of IaC scanning is to find security problems and mistakes early on, before deploying the infrastructure. By doing this, teams can make sure that the infrastructure follows security rules and company policies right from the start. These checks happen as part of the development process before the code is used in live systems.
3+
4+
Let's consider a scenario where a development team is using Terraform to automate the provisioning of cloud resources in AWS. Here's a simplified example:
5+
```terraform
6+
# Terraform script to create an S3 bucket
7+
8+
provider "aws" {
9+
region = "us-east-1"
10+
}
11+
12+
resource "aws_s3_bucket" "example_bucket" {
13+
bucket = "example-bucket"
14+
acl = "public-read"
15+
}
16+
```
17+
In this example, the Terraform script creates an S3 bucket named "example-bucket" with public read access (acl = "public-read").
18+
19+
During the IaC scanning process, a scanning tool might detect this configuration and flag it as a security risk because it allows public access to the bucket. This could potentially expose sensitive data stored in the bucket to unauthorized users.
20+
21+
As a result of the IaC scan findings, the development team might revise the Terraform script to ensure that the bucket is not publicly accessible.
22+
23+
In the next part, you will find a list of tools that can help you address different types of IaC scanning at various phases of your application development and deployment.
24+
325
---
426
### Tools
527
- #### Infrastructure as Code Scanning Tools:
@@ -10,4 +32,4 @@ TBD
1032
+ [terrascan](https://github.com/accurics/terrascan) - Detect compliance and security violations across Infrastructure as Code to mitigate risk before provisioning cloud native infrastructure
1133
+ [tflint](https://github.com/terraform-linters/tflint) - A Pluggable Terraform Linter
1234
+ [Trivy](https://github.com/aquasecurity/trivy) - Provide built-in policies to detect configuration issues in Docker, Kubernetes, Terraform and CloudFormation. Also, you can write your own policies in Rego to scan JSON, YAML, etc, like Conftest.
13-
+ [KICS](https://github.com/Checkmarx/kics) - Find security vulnerabilities, compliance issues, and infrastructure misconfigurations early in the development cycle of your infrastructure-as-code with KICS by Checkmarx.
35+
+ [KICS](https://github.com/Checkmarx/kics) - Find security vulnerabilities, compliance issues, and infrastructure misconfigurations early in the development cycle of your infrastructure-as-code with KICS by Checkmarx.

0 commit comments

Comments
 (0)