Template Scanner API Integration
Integrate the AUTOMATE+ Template Scanner with your pipeline via API
β¦Ώ Step 1 : Navigate to Template Scanner
https://app.6pillars.ai/template-scanner
Click on Tab on How to generate token tab
Read through the instructions
or else follow these steps
Before using template scanner you need to create a new API user. This is same as creating app user. Go to Manage users page (Manage Users )
On top right corner of the page you can see βGenerate API Tokenβ click this
Then you would be able to see the API token this is valid only for 3 months. Please make sure you safely secure this token.
Once Everything Setup and you have the access token you can now follow step 2 End-point: Get all template results
β¦Ώ Step 2 : REST API endpoints
API End-point: Get all template results
Method - POST
URL - https://api.app.6pillars.ai/templatescanner/results
Header π- Authorization : Bearer: {token}
Request Body - None
Response Body: (JSON)
{
β β β β "status": 1,
β β β β "msg": "success",
β β β β "results": {
β β β β β β β β "ec2.tf": {
β β β β β β β β β β β β "results": [
β β β β β β β β β β β β β β β β {
β β β β β β β β β β β β β β β β β β β β "id": "TSN_SECRET_2",
β β β β β β β β β β β β β β β β β β β β "check_type": "secrets",
β β β β β β β β β β β β β β β β β β β β "finding": "FAILED",
β β β β β β β β β β β β β β β β β β β β "resource": "fc3f784491eba6121c3bfcc1652a2c",
β β β β β β β β β β β β β β β β β β β β "description": "AWS Access Key",
β β β β β β β β β β β β β β β β β β β β "file_line_range": "15-16",
β β β β β β β β β β β β β β β β β β β β "severity": "N/A"
β β β β β β β β β β β β β β β β },
β β β β β β β β β β β β β β β β {
β β β β β β β β β β β β β β β β β β β β "id": "TSN_SECRET_6",
β β β β β β β β β β β β β β β β β β β β "check_type": "secrets",
β β β β β β β β β β β β β β β β β β β β "finding": "FAILED",
β β β β β β β β β β β β β β β β β β β β "resource": "c00f1a6e4b20aa64691d50781b8107",
β β β β β β β β β β β β β β β β β β β β "description": "Base64 High Entropy String",
β β β β β β β β β β β β β β β β β β β β "file_line_range": "16-17",
β β β β β β β β β β β β β β β β β β β β "severity": "N/A"
β β β β β β β β β β β β β β β β }
β β β β β β ββ β β β β β β],
β β β β β β ββ β β β β β β"summary": {
β β β β β β β β β β β β β β β β "filename": "ec2.tf",
β β β β β β β β β β β β β β β β "alias": "N/A",
β β β β β β β β β β β β β β β β "created_at": "2023-09-26 03:46:14",
β β β β β β β β β β β β β β β β "passed": 0,
β β β β β β β β β β β β β β β β "failed": 2,
β β β β β β β β β β β β β β β β "critical": 0,
β β β β β β β β β β β β β β β β "high": 0,
β β β β β β β β β β β β β β β β "medium": 0,
β β β β β β β β β β β β β β β β "low": 0
β β β β β β ββ β β β β β }
β β β β β β ββ β β}
β β β β }
}
cURL:
curl --location --request POST 'https://api.app.6pillars.ai/templatescanner/results' \
--header 'Authorization: Bearer {token}'
β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β
API End-point: Upload Template
Method: POST
URL: https://api.app.6pillars.ai/templatescanner/upload-template
Request Body (JSON)
{
β β β β β"fileName": "main.tf",
β β β β β"fileAlias": "MainTemplate",
β β β β β"fileString": "cHJvdmlkZXIgImF3cyIge1xuICBhY2Nlc3Nfa2V5ID0gIkFLSUFJT1NGT0ROTjdFWEFNUExFIlxuICBzZWNyZXRfa2V5ID0gIndKYWxyWFV0bkZFTUkvSzdNREVORy9iUHhSZmlDWUVYQU1BQUFLRVkiXG59"
}
{
β β β β β"status": 1,
β β β β β"msg": "success"
}
Request Body Parameters:
fileName: String
fileAlias [optional]: String
fileString [base64 encoded file contents]: String
Response Body:
cURL:
curl --location 'https://api.app.6pillars.ai/templatescanner/upload-template' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {token}' \
--data '{
β β β β β"fileName": "main.tf",
β β β β β"fileAlias": "MainTemplate",
β β β β β"fileString": "cHJvdmlkZXIgImF3cyIge1xuICBhY2Nlc3Nfa2V5ID0gIkFLSUFJT1NGT0ROTjdFWEFNUExFIlxuICBzZWNyZXRfa2V5ID0gIndKYWxyWFV0bkZFTUkvSzdNREVORy9iUHhSZmlDWUVYQU1BQUFLRVkiXG59"
}'
β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β
End-point: Get single result
Method: POST
URL: https://api.app.6pillars.ai/templatescanner/result
Request Body (JSON)
Header - Authorization : Bearer: {token}
{
β β β β β"fileName": "main.tf",
β β β β β"fileAlias": "Main File Alias"
}
{
β β β β β"status": 1,
β β β β β"msg": "success",
β β β β β"summary": {
β β β β ββ β β β β"filename": "main.tf",
β β β β ββ β β β β"alias": "N/A",
β β β β ββ β β β β"passed": 0,
β β β β ββ β β β β"critical": 0,
β β β β ββ β β β β"high": 0,
β β β β ββ β β β β"medium": 0,
β β β β ββ β β β β"low": 0,
β β β β ββ β β β β"created_at": "2023-09-26 03:46:37",
β β β β ββ β β β β"failed": 2
β β β β β},
β β β β β"results": [
β β β β ββ β β β β{
β β β β ββ β β β ββ β β β β"id": "TSN_SECRET_2",
β β β β ββ β β β ββ β β β β"check_type": "secrets",
β β β β ββ β β β ββ β β β β"finding": "FAILED",
β β β β ββ β β β ββ β β β β"resource": "25910f981e85ca04baf359199dd0bd",
β β β β ββ β β β ββ β β β β"description": "AWS Access Key",
β β β β ββ β β β ββ β β β β"file_line_range": "1-2",
β β β β ββ β β β ββ β β β β"severity": "N/A"
β β β β ββ β β β β},
β β β β ββ β β β β{
β β β β ββ β β β ββ β β β β"id": "TSN_SECRET_6",
β β β β ββ β β β ββ β β β β"check_type": "secrets",
β β β β ββ β β β ββ β β β β"finding": "FAILED",
β β β β ββ β β β ββ β β β β"resource": "c00f1a6e4b20aa64691d50781b8107",
β β β β ββ β β β ββ β β β β"description": "Base64 High Entropy String",
β β β β ββ β β β ββ β β β β"file_line_range": "1-2",
β β β β ββ β β β ββ β β β β"severity": "N/A"
β β β β ββ β β β β}
β β β β β]
}
cURL:
curl --location 'https://api.app.6pillars.ai/templatescanner/result' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {token}' \
--data '{
β β β β "fileName": "main.tf"
}'
Postman Collection
(available on request)
β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β β