Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
002b6ec
Create CODEOWNERS
nandeesh-gajula Oct 13, 2021
de325dc
Create codeql-analysis.yml
contentstack-admin Jun 14, 2022
9745697
Add files via upload
contentstack-admin Jun 14, 2022
dbae073
Delete sca-monitor.yml
aravindbuilt Sep 15, 2022
d9e4085
codeql-analysis.yml
aravindbuilt Sep 15, 2022
c128618
sast-scan.yml
aravindbuilt Sep 15, 2022
6d66e24
sca-scan.yml
aravindbuilt Sep 15, 2022
7f7f507
secrets-scan.yml
aravindbuilt Sep 15, 2022
95a9456
codeql-analysis.yml
aravindbuilt Sep 21, 2022
38f9e26
sast-scan.yml
aravindbuilt Sep 21, 2022
7fbc645
sca-scan.yml
aravindbuilt Sep 21, 2022
0721c60
secrets-scan.yml
aravindbuilt Sep 21, 2022
39df977
jira.yml
aravindbuilt Oct 3, 2022
e361cb9
jira.yml
aravindbuilt Oct 4, 2022
e7fe2b1
jira.yml
aravindbuilt Nov 4, 2022
1c4b5e4
sca-scan.yml
aravindbuilt Jan 24, 2023
d280298
jira.yml
aravindbuilt Jan 24, 2023
7f19405
codeql-analysis.yml
aravindbuilt Jan 24, 2023
9e91d2f
sast-scan.yml
aravindbuilt Jan 24, 2023
10ac33a
secrets-scan.yml
aravindbuilt Jan 24, 2023
faff481
CODEOWNERS update
aravindbuilt May 6, 2023
5326c02
sca-scan.yml
aravindbuilt Sep 5, 2023
d278472
jira.yml
aravindbuilt Sep 5, 2023
7d8250c
Delete sast-scan.yml
aravindbuilt Sep 5, 2023
ceae630
Delete secrets-scan.yml
aravindbuilt Sep 5, 2023
cb7e83b
codeql-analysis.yml
aravindbuilt Sep 5, 2023
362601e
sca-scan.yml
aravindbuilt Jun 18, 2024
f66b11e
jira.yml
aravindbuilt Jun 18, 2024
2e3a956
sast-scan.yml
aravindbuilt Jun 18, 2024
669497a
codeql-analysis.yml
aravindbuilt Jun 18, 2024
a0193bd
sca-scan.yml
aravindbuilt Oct 22, 2024
0cb6d68
jira.yml
aravindbuilt Oct 22, 2024
2fc01cf
sast-scan.yml
aravindbuilt Oct 22, 2024
4d18a42
codeql-analysis.yml
aravindbuilt Oct 22, 2024
89f9cda
Updated codeowners
aravindbuilt Oct 22, 2024
54db5eb
sca-scan.yml
aravindbuilt Jan 19, 2025
b22189e
jira.yml
aravindbuilt Jan 19, 2025
4d2f693
sast-scan.yml
aravindbuilt Jan 19, 2025
21da6bd
codeql-analysis.yml
aravindbuilt Jan 19, 2025
3263dee
Updated codeowners
aravindbuilt Jan 19, 2025
50a010c
policy-scan.yml
aravindbuilt Apr 16, 2025
a93863f
issues-jira.yml
aravindbuilt Apr 16, 2025
762331c
Delete jira.yml
aravindbuilt Apr 16, 2025
01a7c8b
Delete sast-scan.yml
aravindbuilt Apr 16, 2025
c65e206
codeql-analysis.yml
aravindbuilt Apr 16, 2025
a3d5233
Updated codeowners
aravindbuilt Apr 16, 2025
d648c92
policy-scan.yml
aravindbuilt Apr 23, 2025
c04246c
policy-scan.yml
aravindbuilt May 6, 2025
fe3863d
issues-jira.yml
aravindbuilt May 6, 2025
fe2967c
secrets-scan.yml
aravindbuilt May 6, 2025
9bd9188
talismanrc file updated
aravindbuilt May 6, 2025
f4333b2
Updated codeowners
aravindbuilt May 6, 2025
317bd9a
feat: adding tls capability on epicurous
Ilankumaran-developer May 13, 2025
2453de5
Update LICENSE
aravindbuilt May 15, 2025
108e679
Create .snyk
aravindbuilt May 15, 2025
530a47a
adding policy file
Ilankumaran-developer May 15, 2025
f36b349
Merge branch 'AUTH-75' into feature/OAA-2926
Ilan-kumaran May 19, 2025
894fb23
amending talisman
Ilankumaran-developer May 19, 2025
dfdb0a4
bumping package.json to reflect adaption of redis tls
Ilankumaran-developer May 19, 2025
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
68 changes: 68 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
pull_request:
# The branches below must be a subset of the branches above
branches: '*'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
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 }}"
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
15 changes: 15 additions & 0 deletions .github/workflows/sca-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Source Composition Analysis Scan
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
security-sca:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Run Snyk to check for vulnerabilities
uses: snyk/actions/node@master
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
with:
args: --all-projects --fail-on=all
29 changes: 29 additions & 0 deletions .github/workflows/secrets-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Secrets Scan
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
security-secrets:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '2'
ref: '${{ github.event.pull_request.head.ref }}'
- run: |
git reset --soft HEAD~1
- name: Install Talisman
run: |
# Download Talisman
wget https://github.com/thoughtworks/talisman/releases/download/v1.37.0/talisman_linux_amd64 -O talisman

# Checksum verification
checksum=$(sha256sum ./talisman | awk '{print $1}')
if [ "$checksum" != "8e0ae8bb7b160bf10c4fa1448beb04a32a35e63505b3dddff74a092bccaaa7e4" ]; then exit 1; fi

# Make it executable
chmod +x talisman
- name: Run talisman
run: |
# Run Talisman with the pre-commit hook
./talisman --githook pre-commit
10 changes: 10 additions & 0 deletions .snyk
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.25.0
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
ignore:
SNYK-JS-REDIS-1255645:
- '*':
reason: 'High Severity - https://contentstack.atlassian.net/browse/IS-1224'
expires: 2025-06-15T05:52:48.301Z
created: 2025-05-15T05:52:48.306Z
patch: {}
7 changes: 7 additions & 0 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fileignoreconfig:
- filename: .github/workflows/secrets-scan.yml
ignore_detectors:
- filecontent
- filename: package-lock.json
checksum: 8dae940d01a846b804a410f9c59b8b173866342950ec0e75026640326bdb8b8c
version: "1.0"
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @contentstack/security-admin
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 ABX
Copyright (c) 2018-2025 ABX

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
25 changes: 25 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Security
Contentstack takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations.

If you believe you have found a security vulnerability in any Contentstack-owned repository, please report it to us as described below.

Reporting Security Issues
Please do not report security vulnerabilities through public GitHub issues.

Send email to security@contentstack.com.

You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message.

Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:

Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
Full paths of source file(s) related to the manifestation of the issue
The location of the affected source code (tag/branch/commit or direct URL)
Any special configuration required to reproduce the issue
Step-by-step instructions to reproduce the issue
Proof-of-concept or exploit code (if possible)
Impact of the issue, including how an attacker might exploit the issue
This information will help us triage your report more quickly.

https://www.contentstack.com/trust/
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/epicurus-node",
"version": "0.3.7",
"version": "0.3.8",
"description": "Redis request/response and PubSub sugar",
"main": "js/index.js",
"types": "js/index.d.ts",
Expand Down
19 changes: 17 additions & 2 deletions ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,21 @@ import {

bluebird.promisifyAll(redis.RedisClient.prototype)
bluebird.promisifyAll(redis.Multi.prototype)
const REDIS_TLS_HOST = 'rediss'

function getConfig(redisConfig: EpicurusRedisConfig) {
if (redisConfig.url && redisConfig.url.includes(REDIS_TLS_HOST)) {
return {
tls: {
...redisConfig,
rejectUnauthorized: true
}
}
} else {
return redisConfig
}

}

export default function Epicurus (
redisConfig: EpicurusRedisConfig = {
Expand All @@ -36,8 +51,8 @@ export default function Epicurus (
// A separate subscription Redis client is required as once a client has
// called SUBSCRIBE, it is put into a slave mode the does not allow any other
// kind of action
const redisClient = redis.createClient(redisConfig)
const redisSub = redis.createClient(redisConfig)
const redisClient = redis.createClient(getConfig(redisConfig))
const redisSub = redis.createClient(getConfig(redisConfig))
const requestValidityPeriod = requestTimeout || config.requestValidityPeriod

setupSubscriptionListener(redisSub)
Expand Down
5 changes: 3 additions & 2 deletions ts/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface EpicurusResponse {
}

export interface EpicurusRedisConfig {
host: string
port: number
host?: string
port?: number,
url?: string
}
Loading