Skip to content

Instantly share code, notes, and snippets.

View dLobatog's full-sized avatar
🤗

Daniel Lobato García dLobatog

🤗
View GitHub Profile
#<Kafka::FetchedMessage:0x000055bf9cf88480
@message=
#<Kafka::Protocol::Record:0x000055bf9cf88b10
@attributes=0,
@bytesize=729,
@create_time=2019-04-11 15:18:17 +0200,
@headers={},
@is_control_record=false,
@key=nil,
@offset=78,

Host.all.map do |host|
inventory_host = HostInventoryAPI.new(host, Account.find("9f6f30ee-dd69-42e6-bfc0-374e85e3cdc7"), Settings.host_inventory_url, b64identity).host_already_in_inventory
if inventory_host
old_id = host.id
host.update(id: inventory_host.id)
ProfileHost.where(host_id: old_id).update_all(host_id: inventory_host.id)
RuleResult.where(host_id: old_id).update_all(host_id: inventory_host.id)
end
end
Host.all.map do |host|
inventory_host = HostInventoryAPI.new(host, Account.find("9f6f30ee-dd69-42e6-bfc0-374e85e3cdc7"), Settings.host_inventory_url, b64identity).host_already_in_inventory
if inventory_host
old_id = host.id
host.update(id: inventory_host.id)
ProfileHost.update_all(host_id: host.id)
RuleResult.update_all(host_id: host.id)
end
end
Name Profile Names Rules Failed Compliance Score Last Scanned
somehost.lobatolan.home Standard System Security Profile for Fedora 60 0.8365122615803815 2019-01-31 09:08:56 UTC
thirdhost.redhat.com Standard System Security Profile for Fedora 60 0.8365122615803815 2019-03-29 10:38:18 UTC
# frozen_string_literal: true
def list_imagestreams
base_url = imagestream.openshift_connection.api_url
#Pass 'nil' as image_name to get list of image streams
image_stream_object = client.get_image_stream(image_name, namespace)
client = Kubeclient::Client.new(
base_url,
'v1',
ssl_options: { verify_ssl: OpenSSL::SSL::VERIFY_NONE },
auth_options: { bearer_token: token }
# def list_imagestreams
# base_url = imagestream.openshift_connection.api_url
# Pass 'nil' as image_name to get list of image streams
# image_stream_object = client.get_image_stream(image_name, namespace)
# client = Kubeclient::Client.new(
# base_url,
# 'v1',
# ssl_options: { verify_ssl: OpenSSL::SSL::VERIFY_NONE },
# auth_options: { bearer_token: token }
# )
oscap info /usr//share/xml/scap/ssg/content/ssg-rhel7-xccdf.xml
Document type: XCCDF Checklist
Checklist version: 1.1
Imported: 2019-02-22T14:06:15
Status: draft
Generated: 2019-02-22
Resolved: true
Profiles:
Title: Criminal Justice Information Services (CJIS) Security Policy
{
"issues": [
"ssg:rhel7|standard|xccdf_org.ssgproject.content_rule_sshd_set_keepalive",
"ssg:rhel7|standard|xccdf_org.ssgproject.content_rule_sshd_disable_empty_passwords",
"ssg:rhel7|standard|xccdf_org.ssgproject.content_rule_sshd_disable_root_login",
"ssg:rhel7|standard|xccdf_org.ssgproject.content_rule_sshd_set_idle_timeout",
"ssg:rhel7|standard|xccdf_org.ssgproject.content_rule_chronyd_or_ntpd_specify_remote_server",
"ssg:rhel7|standard|xccdf_org.ssgproject.content_rule_service_chronyd_or_ntpd_enabled",
"ssg:rhel7|standard|xccdf_org.ssgproject.content_rule_set_firewalld_default_zone",
"ssg:rhel7|standard|xccdf_org.ssgproject.content_rule_display_login_attempts",
Request URL: https://ci.foo.redhat.com:1337/api/remediations/v1/resolutions
Request Method: POST
Status Code: 500 Internal Server Error
Remote Address: 127.0.0.1:1337
Referrer Policy: no-referrer-when-downgrade
access-control-allow-credentials: true
access-control-allow-headers: x-rh-insights-use-path-prefix
access-control-allow-methods: GET, POST, PUT, DELETE, OPTIONS, HEAD, PATCH
access-control-allow-origin: https://access.ci.cloud.paas.upshift.redhat.com
connection: close
{"issues":["ssg:rhel7|standard|xccdf_org.ssgproject.content_rule_sshd_set_keepalive","ssg:rhel7|standard|xccdf_org.ssgproject.content_rule_sshd_disable_empty_passwords","ssg:rhel7|standard|xccdf_org.ssgproject.content_rule_sshd_disable_root_login","ssg:rhel7|standard|xccdf_org.ssgproject.content_rule_sshd_set_idle_timeout","ssg:rhel7|standard|xccdf_org.ssgproject.content_rule_chronyd_or_ntpd_specify_remote_server","ssg:rhel7|standard|xccdf_org.ssgproject.content_rule_service_chronyd_or_ntpd_enabled","ssg:rhel7|standard|xccdf_org.ssgproject.content_rule_set_firewalld_default_zone","ssg:rhel7|standard|xccdf_org.ssgproject.content_rule_display_login_attempts","ssg:rhel7|standard|xccdf_org.ssgproject.content_rule_no_direct_root_logins","ssg:rhel7|standard|xccdf_org.ssgproject.content_rule_no_empty_passwords","ssg:rhel7|standard|xccdf_org.ssgproject.content_rule_accounts_maximum_age_login_defs","ssg:rhel7|standard|xccdf_org.ssgproject.content_rule_accounts_password_minlen_login_defs","ssg:rhel7|standard|xccdf_org.