Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sophos_central_api

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sophos_central_api

  • 0.2.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Sophos Central Partner API

Version Maintainability Test Coverage

This is a wrapper for the Sophos Central Partner API. You can see the API endpoints here https://developer.sophos.com/getting-started

Currently only the GET requests to customers, endpoints and alerts are implemented (readonly).

Installation

Add this line to your application's Gemfile:

gem 'sophos_central_api'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install sophos_central_api

Usage

Before you start making the requests to API provide the client id and client secret and email/password using the configuration wrapping.

require 'sophos_central_api'

Sophos.configure do |config|
  config.client_id = ENV["SOPHOS_CLIENT_ID"]
  config.client_secret = ENV["SOPHOS_CLIENT_SECRET"]
end
@client = Sophos.client()
@client.login

tenants = @client.tenants

tenants.each do |t|
  puts "#{t.name}"
end

Resources

Authentication

# setup configuration
#
client.login
ResourceAPI endpointDescription
.login

Partner

Endpoint for partner related requests

roles = client.roles
ResourceAPI endpoint
.tenants, .tenant(id)/partner/v1/tenants/{id}
.roles, .role(id)/partner/v1/roles/{id}
.admins, .admin(id)/partner/v1/admins/{id}
.admin_role_assignments(admin_id)/partner/v1/admins/{admin_id}/role-assignments
.admin_role_assignment(admin_id,assignment_id)/partner/v1/admins/{admin_id}/role-assignments/{assignment_id}
.permission_sets/partner/v1/roles/permission-sets
.billing_usage(year, month)/partner/v1/billing-usage/{year}/{month}

Common

This is the OAS 3.0 specification for the Common API in Sophos Central.

@client = Sophos.client()
@client.login
 :
tenant = @client.tenant(id)
# create client for tenant
@client.client(tenant).endpoints

ResourceAPI endpoint
.alerts, .alert(id).../alerts/
.directory_user_groups, .directory_user_groups(id).../directory/user-groups
.directory_user_group_users(id).../directory/user-groups/{id}/users
.directory_users, .directory_user(id).../directory/users
.directory_user_groups(id).../directory/users/{id}/groups

Endpoints

Returns endpoint for a provided tenant

@client = Sophos.client()
@client.login
 :
tenant = @client.tenant(id)
@client.tenant(tenant).endpoints

ResourceAPI endpoint
.downloads.../downloads/
.endpoint_groups, .endpoint_group(id).../endpoint-groupss/
.migrations, .migration(id).../migrations
.migration_endpoints(migration_id).../migrations/{migration_id}/endpoints
.policies, .policy(id).../policies/{id}
.endpoints.../endpoints
.endpoint_isolation(endpoint_id).../endpoints/{id}/isolation
.endpoint_tamper_protection(endpoint_id).../endpoints/{id}/tamper-protection

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/jancotanis/sophos.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 17 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc