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)
⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃ ⁃