Skip to content

Commit

Permalink
feat: Update to V1CS (#21)
Browse files Browse the repository at this point in the history
* add AM

* fix action name
  • Loading branch information
felipecosta09 authored Oct 9, 2023
1 parent 27c3821 commit b589903
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ "main" ]
env:
CONTAINER_NAME: "container-security-scan-action"
CONTAINER_NAME: "tmas-scan-action"
RELEASE: "latest"
permissions:
packages: write
Expand Down
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
# Trend Cloud One Container Security Scan Action
# TMAS Scan Action

![TM Logo](images/tm-logo.jpg)

## Scan your containers with [Trend Cloud One Container Security](https://www.trendmicro.com/en_us/business/products/hybrid-cloud/cloud-one-container-image-security.html)
## Scan your containers with [Vision One Container Security](https://www.trendmicro.com/en_in/business/products/hybrid-cloud/cloud-one-container-image-security.html)

This tool is meant to be used as a [GitHub Action](https://github.com/features/actions).

## Requirements

* Have an [Trend Cloud One Account](https://cloudone.trendmicro.com). [Sign up for free trial now](https://cloudone.trendmicro.com/trial) if it's not already the case!
* [A Trend Cloud One API Key](https://cloudone.trendmicro.com/docs/identity-and-account-management/c1-api-key/#new-api-key) with `Full Access` role
* A [Trend Cloud One Region](https://cloudone.trendmicro.com/docs/identity-and-account-management/c1-regions/) of choice
* Have an [Vision One Account](https://signin.v1.trendmicro.com/). [Sign up for free trial now](www.trendmicro.com/en_us/business/products/trials.html?modal=s1b-hero-vision-one-free-trial-c022c8#detection-response) if it's not already the case!
* [A Vision One API Key](https://automation.trendmicro.com/xdr/Guides/First-Steps-Toward-Using-the-APIs) with `Master Administrator` role
* A Vision One Region of choice (ap-southeast-2, eu-central-1, ap-south-1, ap-northeast-1, ap-southeast-1, us-east-1)
* A container image to be scan.

## Usage

Add an Action in your `.github/workflow` yml file to scan your image with Trend Cloud One Container Security.
Add an Action in your `.github/workflow` yml file to scan your image with Vision One Container Security.

```yml
- name: Trend Cloud One Container Security Scan Action
uses: trendmicro/cloudone-container-security-github-action@version*
- name: Vision One Container Security Scan Action
uses: trendmicro/tmas-scan-action@version*
with:
# Mandatory
CLOUD_ONE_API_KEY: ${{ secrets.API_KEY }}
REGION: us-1
TMAS_API_KEY: ${{ secrets.TMAS_API_KEY }}
REGION: us-east-1

# Optional
SBOM: true # Saves SBOM to SBOM.json so you can export it as an artifact later.
MALWARE_SCAN: true # Enable malware scan.
IMAGE: alpine # The image need to be public or the pipeline need to have access to the private image of choice.
LOCAL_IMAGE_TARBALL: image.tar
# For each threshold below, select the maximum number of vulnerabilities that are acceptable.
Expand Down Expand Up @@ -63,7 +64,7 @@ Artifacts allow you to share data between jobs in a workflow and store data once
## Contributing
If you encounter a bug, think of a useful feature, or find something confusing in the docs, please [create a new issue](https://github.com/trendmicro/cloudone-container-security-github-action/issues/new)!
If you encounter a bug, think of a useful feature, or find something confusing in the docs, please [create a new issue](https://github.com/trendmicro/tmas-scan-action/issues/new)!
We :heart: pull requests. If you'd like to fix a bug, contribute to a feature or just correct a typo, please feel free to do so.
Expand Down
21 changes: 13 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
name: "Trend Cloud One Container Security Scan Action"
description: "Scan container images with Trend Cloud One Container Security"
name: "TMAS Scan Action"
description: "Scan container images with Vision One Container Security"
author: "Trend Micro"
inputs:
CLOUD_ONE_API_KEY:
description: "Cloud One API Key"
TMAS_API_KEY:
description: "Vision One API Key"
required: true
IMAGE:
description: "Image URI to scan. Not required if you are doing pre-registry scanning. See LOCAL_IMAGE_TARBALL."
required: false
REGION:
description: "Cloud One Region"
description: "Vision One Region"
required: true
default: "us-1"
default: "us-east-1"
SBOM:
description: "Decide if you want to save the SBOM file for the image. Default is true."
required: false
default: "true"
MALWARE_SCAN:
description: "Decide if you want to scan the image for malware. Default is true."
required: false
default: "true"
MAX_TOTAL:
description: "Max total of vulnerabilities acceptable in a images"
required: false
Expand Down Expand Up @@ -56,12 +60,13 @@ branding:
color: "red"
runs:
using: "docker"
image: "docker://ghcr.io/trendmicro/container-security-scan-action:latest"
image: "docker://ghcr.io/trendmicro/tmas-scan-action:latest"
env:
CLOUD_ONE_API_KEY: ${{ inputs.CLOUD_ONE_API_KEY }}
TMAS_API_KEY: ${{ inputs.TMAS_API_KEY }}
IMAGE: ${{ inputs.IMAGE }}
REGION: ${{ inputs.REGION }}
SBOM: ${{ inputs.SBOM }}
MALWARE_SCAN: ${{ inputs.MALWARE_SCAN }}
MAX_TOTAL: ${{ inputs.MAX_TOTAL }}
MAX_CRITICAL: ${{ inputs.MAX_CRITICAL }}
MAX_HIGH: ${{ inputs.MAX_HIGH }}
Expand Down
2 changes: 1 addition & 1 deletion pull-scan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ else
fi

# Scans the image
tmas scan --endpoint "https://artifactscan.$REGION.cloudone.trendmicro.com" docker-archive:"$IMAGE_TARBALL" "$(if [ "$SBOM" = true ]; then echo "--saveSBOM"; fi)" > "$SCAN_RESULT_ARTIFACT"
tmas scan "$(if [ "$MALWARE_SCAN" = true ]; then echo "--malwareScan"; fi)" -r "$REGION" docker-archive:"$IMAGE_TARBALL" "$(if [ "$SBOM" = true ]; then echo "--saveSBOM"; fi)" > "$SCAN_RESULT_ARTIFACT"

# If saving SBOM is true
if [ "$SBOM" = true ]; then
Expand Down

0 comments on commit b589903

Please sign in to comment.