Package: satori-ci
What is Satori CI?Satori allows you to assert how systems and software behave. Automatize software and system testing using three different approaches:On demand: you need to execute the test one time (ie, Security Testing, Stress Testing, etc)Scheduled: you need to know on a regular basis what is the status of something (ie, Monitoring live systems every five minutes, Auditing weekly/monthly/yearly systems, etc)CI/CD: you need to execute it every time you are pushing new code (ie, Security Testing, System Testing, etc)Setup Satori CLIThree steps:Execute on your command line terminal:pip3 install satori-ciWith Satori CLI installed, now we need to get a Satori Token to use it:Log in the Satori website using Github credentials:https://satori.ci/loginOn the Satori website go to User SettingsCopy your User API TokenReplace the string YOUR_TOKEN with your clipboard on the next command:satori config token YOUR_TOKENActionsYou can take actions on:run: whenever you are launching on demand scans for playbook files or directoriesrepo: whenever you are taking actions on repositoriesmonitor: visualize your scheduled playbooksteam: actions related to your team settingsNow, lets test software.satori runConsider the following example "Hello World" program written in Python:print("Hello World")If save that into a file namedhello_world.pyand we execute this program, we would see the following on the console:foo@bar:~$pythonhello_world.pyHello WorldHow can you test aumatically that that piece of software behaves according to specification? You can write a Satori Playbook using a simple and practical notation:foo@bar:~$cat.satori.ymltest:assertStdoutEqual: "Hello World\n"python:- [ python hello_world.py ]Lets test the code with the playbookfoo@bar:~$satorirun./--syncSatori CI 1.2.3 - Automated Software Testing PlatformUploading... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 331/331 bytes 0:00:00UUID: AOQxDWDkXpZpReport: https://satori.ci/report_details/?n=AOQxDWDkXpZp- Report status: Completed | Result: Pass | Elapsed time: 62.6s• test: test > python• asserts:░ assert: assertStdoutEqual░ status: Pass░ expected: Hello World- - - - - - - - - - - - - - - - - - - -• testcases: 1• test_status: Pass• total_fails: 0- - - - - - - - - - - - - - - - - - - -The code and the Satori playbook instructions were executed on a new Docker instance hosted by AWS. Satori asserts that this piece of software output "Hello World". You can assert several things:assertStdout: True|FalseIs output produced?assertStdoutEqual: String*Is the output equal to the String?assertStdoutNotEquals: StringIs the output different than String?assertStdoutContains: StringDoes the output contains the String?assertStdoutNotContains: StringDoes the output not contain the String?assertStdoutSHA256: SHA256ChecksumIs the output equal to this SHA256 hash?assertStdoutRegex: RegexDoes the output matches your regexp?assertStdoutNotRegex: RegexDoes the output not match your regexp?The previos can also be applied toassertStderr. Finally, you can assert the return code of your the execution usingassertReturnCode.Please let us know if you need to assert something else that we is not covered by them.Setup Satori CI Github AppWe tested on demand. Now let's do it as part of your regular Github CI process.Go tohttps://github.com/apps/satoriciClick on InstallSelect the repositories where you will be installing it or select all repositoriesBy default you can get notifications via email and Github issues. If you want to get notified in slack, discord or telegram go tohttps://satori.ci/user-settings/to define their details.If you want to detail in your playbook to be notified when the scans are ready, add the following to them:settings:
  log|logOnFail|logOnPass: slack|email|issue|discord|telegramFor example:settings:
    logOnFail: slack

test:
    assertStdoutEqual: Hello World
    python:
    - [ python hello_world.py ]and put it on a file named .satori.yml inside your repository.satori repoYou can check which repositories you connected with a playbook by runningfoo@bar:~$ satori repoYou can scan all your commits from your repository to see if there were any discrepancies at some point:foo@bar:~$satorirepogithubusername/repositoryscan-c100--syncsatori playbookAre used to assert software behaviors, wether they are source code files or live systems. You can see a list of public playbooks by runningPublic playbooksThey can be imported by playbooks that you have in your CI or on assets being Monitored.foo@bar:~$satoriplaybook--publicURI                          | Namesatori://code/trufflehog.yml | Trufflehog will search for secrets in your codesatori://code/semgrep.yml    | Static source code analysis with semgrep...You can check your private playbooks executed just by runningsatori playbookImport PlaybooksPlaybooks can import other local or remote playbooks. We keep at TBC a list of playbooks that can be referenced with theimport:
    - satori://code/trufflehog.yml
    - satori://code/semgrep.yml

test:
    assertStdoutEqual: Hello World
    python:
    - [ python hello_world.py ]Private PlaybooksWe will store a copy of the playbooks that you have executed and show them to you whenever you execute the command:foo@bar:~$satoriplaybooksprivateType    | URI                                                     | Name           | ImportsCI      | github://satorici/satori/.satori.yml                |                |Monitor | github://satorici/playbooks/test/satori/monitor.yml     | Monitor Assets | monitorBlog.ymlRun     | github://satorici/playbooks/test/satori/monitorBlog.yml | Monitor Blog   |...Is there a playbook that you would like us to add? Drop us a line atsupport@satori.cisatori monitorAssert that your systems are running as expected by setting a schedule for your playbook. Playbooks that define a schedule can be monitored with:satori monitorFor example, you can define schedule a crontab rate to a playbook just as in the following exmaple to verify the Hello World website from Satori every hour:settings:
  - name: Monitor Blog
  - schedule: "0 * * * *"
  - logOnFail: slack

test:
  assertStdout: "Hello World"
  blog:
  - [ curl -s https://satori.ci/hello-world/ ]