Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance terrascan docker to support all terrascan run modes #748

Closed
amirbenv opened this issue May 6, 2021 · 2 comments
Closed

Enhance terrascan docker to support all terrascan run modes #748

amirbenv opened this issue May 6, 2021 · 2 comments
Assignees

Comments

@amirbenv
Copy link
Contributor

amirbenv commented May 6, 2021

No description provided.

@Rchanger
Copy link
Contributor

Nothing need to be changed in current Docker image. We can run it in any mode and it works. Just for files and directory we have to use volume.
Example.

   ~ % docker run --rm -it  accurics/terrascan:latest version
   version: v1.5.1
~ % docker run --rm -it  --volume /Users/suvarna/testfolder/:/data accurics/terrascan:latest  scan -d /data/ -i k8s -o json
{
  "results": {
    "violations": [
      {
        "rule_name": "containersAsHighUID",
        "description": "Containers Should Run as a High UID to Avoid Host Conflict",
        "rule_id": "AC-K8-NS-PO-M-0182",
        "severity": "MEDIUM",
        "category": "Infrastructure Security",
        "resource_name": "terrascan-hook-",
        "resource_type": "kubernetes_job",
        "file": "presynchook-webhook.yml",
        "line": 1
      },
      {
        "rule_name": "imageWithLatestTag",
        "description": "No tag or container image with :Latest tag makes difficult to rollback and track",
        "rule_id": "AC-K8-OE-PO-L-0134",
        "severity": "LOW",
        "category": "Security Best Practices",
        "resource_name": "terrascan-hook-",
        "resource_type": "kubernetes_job",
        "file": "presynchook-webhook.yml",
        "line": 1
      },
      {
        "rule_name": "runAsNonRootCheck",
        "description": "Minimize Admission of Root Containers",
        "rule_id": "AC-K8-IA-PO-H-0168",
        "severity": "HIGH",
        "category": "Identity and Access Management",
        "resource_name": "terrascan-hook-",
        "resource_type": "kubernetes_job",
        "file": "presynchook-webhook.yml",
        "line": 1
      },
      {
        "rule_name": "noReadinessProbe",
        "description": "No readiness probe will affect automatic recovery in case of unexpected errors",
        "rule_id": "AC-K8-OE-PO-L-0130",
        "severity": "LOW",
        "category": "Security Best Practices",
        "resource_name": "terrascan-hook-",
        "resource_type": "kubernetes_job",
        "file": "presynchook-webhook.yml",
        "line": 1
      },
      {
        "rule_name": "privilegeEscalationCheck",
        "description": "Containers Should Not Run with AllowPrivilegeEscalation",
        "rule_id": "AC-K8-CA-PO-H-0165",
        "severity": "HIGH",
        "category": "Compliance Validation",
        "resource_name": "terrascan-hook-",
        "resource_type": "kubernetes_job",
        "file": "presynchook-webhook.yml",
        "line": 1
      },
      {
        "rule_name": "imageWithoutDigest",
        "description": "Image without digest affects the integrity principle of image security",
        "rule_id": "AC-K8-NS-PO-M-0133",
        "severity": "MEDIUM",
        "category": "Infrastructure Security",
        "resource_name": "terrascan-hook-",
        "resource_type": "kubernetes_job",
        "file": "presynchook-webhook.yml",
        "line": 1
      },
      {
        "rule_name": "CpuRequestsCheck",
        "description": "CPU Request Not Set in config file.",
        "rule_id": "AC-K8-OE-PK-M-0155",
        "severity": "Medium",
        "category": "Security Best Practices",
        "resource_name": "terrascan-hook-",
        "resource_type": "kubernetes_job",
        "file": "presynchook-webhook.yml",
        "line": 1
      },
      {
        "rule_name": "MemoryRequestsCheck",
        "description": "Memory Request Not Set in config file.",
        "rule_id": "AC-K8-OE-PK-M-0157",
        "severity": "Medium",
        "category": "Security Best Practices",
        "resource_name": "terrascan-hook-",
        "resource_type": "kubernetes_job",
        "file": "presynchook-webhook.yml",
        "line": 1
      },
      {
        "rule_name": "readOnlyFileSystem",
        "description": "Container images with readOnlyRootFileSystem set as false mounts the container root file system with write permissions",
        "rule_id": "AC-K8-IA-PO-M-0140",
        "severity": "MEDIUM",
        "category": "Identity and Access Management",
        "resource_name": "terrascan-hook-",
        "resource_type": "kubernetes_job",
        "file": "presynchook-webhook.yml",
        "line": 1
      },
      {
        "rule_name": "nolivenessProbe",
        "description": "No liveness probe will ensure there is no recovery in case of unexpected errors",
        "rule_id": "AC-K8-OE-PO-L-0129",
        "severity": "LOW",
        "category": "Security Best Practices",
        "resource_name": "terrascan-hook-",
        "resource_type": "kubernetes_job",
        "file": "presynchook-webhook.yml",
        "line": 1
      }
    ],
    "skipped_violations": null,
    "scan_summary": {
      "file/folder": "/data",
      "iac_type": "k8s",
      "scanned_at": "2021-05-10 08:31:53.394547685 +0000 UTC",
      "policies_validated": 607,
      "violated_policies": 10,
      "low": 3,
      "medium": 5,
      "high": 2
    }
  }
}

@kanchwala-yusuf
Copy link
Contributor

I believe, there is nothing more left in this ticket. Please reopen if more action is required on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants