Skip to content

Instantly share code, notes, and snippets.

@righettod
Last active February 13, 2021 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save righettod/ee42e6bdba605c09cf2364ef9d61ad54 to your computer and use it in GitHub Desktop.
Save righettod/ee42e6bdba605c09cf2364ef9d61ad54 to your computer and use it in GitHub Desktop.
VENOM sample security tests suite
name: Security authorization test suites
# HOME: https://github.com/ovh/venom
# TEST API: https://gorest.co.in/
vars:
target_host: ""
testcases:
- name: GetUserFromCollection
steps:
- type: http
method: GET
url: https://{{.target_host}}/public-api/users
timeout: 20
vars:
test_user_uid:
from: result.bodyjson.data.data3.id
assertions:
- result.statuscode ShouldEqual 200
- result.bodyjson.code ShouldEqual 200
- name: TestAccessDeniedForAnonymous
steps:
- type: http
method: DELETE
url: https://{{.target_host}}/public-api/users/{{.GetUserFromCollection.test_user_uid}}
timeout: 20
assertions:
- result.statuscode ShouldEqual 200
- result.bodyjson.code ShouldEqual 401
- result.bodyjson.data.message ShouldEqual "Authentication failed"
- type: http
method: PATCH
url: https://{{.target_host}}/public-api/users/{{.GetUserFromCollection.test_user_uid}}
headers: {"Content-Type": "application/json"}
body: |
{
"name":"TEST",
"gender":"Male",
"email":"test@test.com",
"status":"Active"
}
timeout: 20
assertions:
- result.statuscode ShouldEqual 200
- result.bodyjson.code ShouldEqual 401
- result.bodyjson.data.message ShouldEqual "Authentication failed"
@righettod
Copy link
Author

righettod commented Feb 12, 2021

Execution:

$ venom run --var="target_host=gorest.co.in" venom_security_tests_suite.yml 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment