Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/issues-jira.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Create Jira Ticket for Github Issue

on:
issues:
types: [opened]

jobs:
issue-jira:
runs-on: ubuntu-latest
steps:

- name: Login to Jira
uses: atlassian/gajira-login@master
env:
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}

- name: Create Jira Issue
id: create_jira
uses: atlassian/gajira-create@master
with:
project: ${{ secrets.JIRA_PROJECT }}
issuetype: ${{ secrets.JIRA_ISSUE_TYPE }}
summary: Github | Issue | ${{ github.event.repository.name }} | ${{ github.event.issue.title }}
description: |
*GitHub Issue:* ${{ github.event.issue.html_url }}

*Description:*
${{ github.event.issue.body }}
fields: "${{ secrets.ISSUES_JIRA_FIELDS }}"
33 changes: 0 additions & 33 deletions .github/workflows/jira.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/policy-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Checks the security policy and configurations
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
security-policy:
if: github.event.repository.visibility == 'public'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@master
- name: Checks for SECURITY.md policy file
run: |
if ! [[ -f "SECURITY.md" || -f ".github/SECURITY.md" ]]; then exit 1; fi
security-license:
if: github.event.repository.visibility == 'public'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@master
- name: Checks for License file
run: |
expected_license_files=("LICENSE" "LICENSE.txt" "LICENSE.md" "License.txt")
license_file_found=false
current_year=$(date +"%Y")

for license_file in "${expected_license_files[@]}"; do
if [ -f "$license_file" ]; then
license_file_found=true
# check the license file for the current year, if not exists, exit with error
if ! grep -q "$current_year" "$license_file"; then
echo "License file $license_file does not contain the current year."
exit 2
fi
break
fi
done

if [ "$license_file_found" = false ]; then
echo "No license file found. Please add a license file to the repository."
exit 1
fi
11 changes: 0 additions & 11 deletions .github/workflows/sast-scan.yml

This file was deleted.

5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ _contents
# Private examples
example/filesystem.js
example/s3.js
example/mongodb.js
example/mongodb.js

talisman_output.log
snyk_output.log
69 changes: 69 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/usr/bin/env sh
# Pre-commit hook to run Talisman and Snyk scans, completing both before deciding to commit

# Function to check if a command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}

# Check if Talisman is installed
if ! command_exists talisman; then
echo "Error: Talisman is not installed. Please install it and try again."
exit 1
fi

# Check if Snyk is installed
if ! command_exists snyk; then
echo "Error: Snyk is not installed. Please install it and try again."
exit 1
fi

# Allow bypassing the hook with an environment variable
if [ "$SKIP_HOOK" = "1" ]; then
echo "Skipping Talisman and Snyk scans (SKIP_HOOK=1)."
exit 0
fi

# Initialize variables to track scan results
talisman_failed=false
snyk_failed=false

# Run Talisman secret scan
echo "Running Talisman secret scan..."
talisman --githook pre-commit > talisman_output.log 2>&1
talisman_exit_code=$?

if [ $talisman_exit_code -eq 0 ]; then
echo "Talisman scan passed: No secrets found."
else
echo "Talisman scan failed (exit code $talisman_exit_code). See talisman_output.log for details."
talisman_failed=true
fi

# Run Snyk vulnerability scan (continues even if Talisman failed)
echo "Running Snyk vulnerability scan..."
snyk test --all-projects --fail-on=all > snyk_output.log 2>&1
snyk_exit_code=$?

if [ $snyk_exit_code -eq 0 ]; then
echo "Snyk scan passed: No vulnerabilities found."
elif [ $snyk_exit_code -eq 1 ]; then
echo "Snyk found vulnerabilities. See snyk_output.log for details."
snyk_failed=true
else
echo "Snyk scan failed with error (exit code $snyk_exit_code). See snyk_output.log for details."
snyk_failed=true
fi

# Evaluate results after both scans
if [ "$talisman_failed" = true ] || [ "$snyk_failed" = true ]; then
echo "Commit aborted due to issues found in one or both scans."
[ "$talisman_failed" = true ] && echo "- Talisman issues: Check talisman_output.log"
[ "$snyk_failed" = true ] && echo "- Snyk issues: Check snyk_output.log"
exit 1
fi

# If both scans pass, allow the commit
echo "All scans passed. Proceeding with commit."
rm -f talisman_output.log snyk_output.log
exit 0
3 changes: 3 additions & 0 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
fileignoreconfig:
- filename: .github/workflows/secrets-scan.yml
ignore_detectors:
- filecontent
- filename: package-lock.json
checksum: 46ccbe3ef0599c039caa8ff9723fa7aa0f3584c434c24fb9a95ec8f415fc3565
version: ""
12 changes: 11 additions & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
* @contentstack/security-admin
* @contentstack/devex-pr-reviewers

.github/workflows/sca-scan.yml @contentstack/security-admin

.github/workflows/codeql-anaylsis.yml @contentstack/security-admin

**/.snyk @contentstack/security-admin

.github/workflows/policy-scan.yml @contentstack/security-admin

.github/workflows/issues-jira.yml @contentstack/security-admin
2 changes: 1 addition & 1 deletion LICENCE → LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License

Copyright (c) 2022 Contentstack LLC <https://www.contentstack.com/>
Copyright (c) 2025 Contentstack LLC <https://www.contentstack.com/>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
43 changes: 30 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "contentstack-content-store-aws-s3",
"author": "Contentstack Ecosystem",
"version": "0.0.2",
"version": "0.0.3",
"description": "Backup data published from Contentstack onto AWS S3 buckets",
"main": "dist",
"dependencies": {
Expand All @@ -19,6 +19,7 @@
"@types/node": "10.12.12",
"@types/request": "^2.48.1",
"@types/rimraf": "^2.0.2",
"husky": "^9.1.7",
"jest": "^29.0.3",
"mkdirp": "^0.5.1",
"nock": "^10.0.6",
Expand All @@ -34,7 +35,8 @@
"watch-ts": "npm run clean && tsc -w",
"start": "dist",
"tslint": "npx tslint -c tslint.json 'src/**/*.ts' --fix",
"test": "jest --colors --coverage --verbose"
"test": "jest --colors --coverage --verbose",
"pre-commit": "husky install && husky && chmod +x .husky/pre-commit"
},
"engines": {
"node": ">=22"
Expand Down
Loading