Skip to content
Closed
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
129 changes: 129 additions & 0 deletions docs/docs/api/exclusions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
**Exclusion APIs**
===

- Prancer supports crawl and compliance execution for cloud and IAC resources. The process runs for all resources. Exclusions enables to exclude resources during the processes. Exclusions are applied at the collection level, not globally for all compliances across different types like azure, aws etc. Eg: for a given type of collection could be IAC, azure cloud etc, the resources, tests or a combination of test and resource can be excluded.

curl -X GET https://portaldev.prancer.io/prancer-shahin/api/exclusions/resources/?container=Aws -H "authorization: Bearer $tk" -H 'content-type: application/json'

** List of the exclusions for a container **
---
- API to get the list of exclusions for a container.

**CURL Sample**
```
curl -H "Authorization: Bearer <JWT Bearer Token>" -H "Content-Type:application/json" -X GET "https://portal.prancer.io/prancer-liquware/api/exclusions/resources/?container=aws"
```

- **URL:** https://portal.prancer.io/api/exclusions/resources/
- **Method:** GET
- **Header:**
```
- content-type: application/json
- Authorization: Bearer <JWT Bearer Token>
```
- **Param:**
```
- container: <container name>
- exclusionType: [test, resource, single], otherwise ignored and all are sent.
```

**Response:**
```
{
"status" : 200,
"message" : "",
"error" : "",
"data" : {
"container" : "Aws",
"exclusions" : [
{
"paths" : [
"/crawler-test/service-definition.yaml"
],
"exclusionType" : "resource"
},
{
"masterTestID" : "TEST_POD_2",
"exclusionType" : "test"
},
{
"masterTestID" : "TEST_POD_1",
"paths" : [
"/crawler-test/pod-creation.yaml"
],
"exclusionType" : "single"
}
]
},
"metadata" : {}
}
```

** API to Exclude Resource for all tests API.**
---
- API to exclude a specific resource (either not ready or low-risk resource) for all tests in the compliance suite.

**CURL Sample**
```
curl -H "Authorization: Bearer <JWT Bearer Token>" -H "Content-Type:application/json" -X POST https://portal.prancer.io/prancer-liquware/api/exclusions/resources/ -d'{"container": "Aws", "exclusions": [{"exclusionType": "resource", "paths": ["/crawler-test/service-definition.yaml"]}]}'

```

- **URL:** https://portal.prancer.io/prancer-liquware/api/exclusions/resources/
- **Method:** POST

- **Header:**
```
- content-type: application/json
- Authorization: Bearer <JWT Bearer Token>
```
- **Param:**
```
- container: <container name>
- exclusions: [{"exclusionType": "resource", "paths": ["<resource path>"]}, {}]
valid exclusionTypes are "resource", "test", "single"
```

**Response:**
```
{
"status" : 200,
"message" : "Added exclusion successfully.",
"error" : "",
"metadata" : {}
}
```

** API to delete an Excluded Resource for all tests API.**
---
- API to delete an excluded resource for all tests in the compliance suite.

**CURL Sample**
```
curl -H "Authorization: Bearer <JWT Bearer Token>" -H "Content-Type:application/json" -X DELETE https://portal.prancer.io/prancer-liquware/api/exclusions/resources/ -d'{"container": "Aws", "exclusions": [{"exclusionType": "resource", "paths": ["/crawler-test/service-definition.yaml"]}]}'

```

- **URL:** https://portal.prancer.io/prancer-liquware/api/exclusions/resources/
- **Method:** DELETE

- **Header:**
```
- content-type: application/json
- Authorization: Bearer <JWT Bearer Token>
```
- **Param:**
```
- container: <container name>
- exclusions: [{"exclusionType": "resource", "paths": ["<resource path>"]}, {}]
```

**Response:**
```
{
"status" : 200,
"message" : "Deleted exclusion successfully.",
"error" : "",
"metadata" : {}
}
```
Loading