Navigating Compliance in a CoreOS World Paul Querna | @pquerna - - PowerPoint PPT Presentation

navigating compliance in a coreos world
SMART_READER_LITE
LIVE PREVIEW

Navigating Compliance in a CoreOS World Paul Querna | @pquerna - - PowerPoint PPT Presentation

Navigating Compliance in a CoreOS World Paul Querna | @pquerna CTO, ScaleFT May 10, 2016 Has 200+ Page Questionnaires Runs CoreOS Fun! New! Not Fun! Old! Many Standards for Many Purposes


slide-1
SLIDE 1

Navigating Compliance in a CoreOS World

Paul Querna | @pquerna CTO, ScaleFT May 10, 2016

slide-2
SLIDE 2
slide-3
SLIDE 3

Runs CoreOS Has 200+ Page Questionnaires

slide-4
SLIDE 4
slide-5
SLIDE 5

Fun! New! Not Fun! Old!

slide-6
SLIDE 6
slide-7
SLIDE 7

Many Standards for Many Purposes

https://www.microsoft.com/en-us/trustcenter/Compliance

slide-8
SLIDE 8
slide-9
SLIDE 9
  • Controls (think: things to reduce

risk): ○ Policies / documentation ○ Technical

slide-10
SLIDE 10

User Management on CoreOS

slide-11
SLIDE 11

User Management Controls

  • Unique User IDs
  • Role based Permissions
  • Lifecycle Management
slide-12
SLIDE 12

First Strategy

1. Put everything into cloud-config

slide-13
SLIDE 13

Put everything into cloud-config

#cloud-config users:

  • name: paul.querna

shell: /bin/bash groups:

  • sudo
  • docker

sudo:

  • ALL=(ALL) NOPASSWD:ALL

ssh-authorized-keys: [ssh-rsa AAAAB…. pquerna@GraphiteModerated.local]

slide-14
SLIDE 14

"cloud-init... there are a number of hurdles..."

Alex Crawford 2015 CoreOS Fest

slide-15
SLIDE 15

Hurdles

  • Go code to generate YAML

○ Users, fetching keys from git ○ Inline script rendering ○ systemd unit files

  • Reboots

○ Deleted user, comes back!

  • Changes

○ Lifecycle of configurations (including users) != lifecycle of servers

slide-16
SLIDE 16

Attempt Two

1. Put “bootstrap” script in cloud-config (from zero today, try Ignition?) 2. Use Ansible for post-boot management

slide-17
SLIDE 17

Bootstrap

#cloud-config write_files:

  • path: /opt/bin/bootstrap-cc.sh

permissions: "0755"

  • wner: root

content: |- #!/bin/bash ... coreos: units:

  • name: bootstrap-cc.service

command: start content: | [Unit] Description=bootstrap runcmd [Service] Type=oneshot RemainAfterExit=yes ExecStart=/opt/bin/bootstrap-cc.sh

slide-18
SLIDE 18

Ansible on CoreOS Linux

  • Python…. Is not in the base system.

○ PyPy portable: github.com/squeaky-pl/portable-pypy ○ ln -s bin/pypy /opt/bin/python ○ Tell ansible where python is:

[coreos:vars] ansible_python_interpreter="/opt/bin/python"

  • Ansible basically* works!

○ Shell, Users, File

  • Future: rkt fly?
slide-19
SLIDE 19

Agents on CoreOS

slide-20
SLIDE 20

First Strategy

1. Docker in systemd

  • Namespaces
  • Mounting the universe
  • Systemd integration (lack of)
slide-21
SLIDE 21

Outside of containers

1. Ansible: untar into /opt 2. Ansible: creates systemd unit file

  • Great for Go & self contained things
slide-22
SLIDE 22

Round 3: rkt (fly)

  • Tried 12 months ago for all uses: Pain
  • Tried 60 days ago w/ fly stage1: Yay!
slide-23
SLIDE 23

acbuild: pretty easy?

# Start the build with an empty ACI acbuild --debug begin # Name the ACI acbuild --debug set-name scaleft.com/sftd # Copy the app to the ACI acbuild --debug copy "${INPUT_SFTD}" /scaleft/bin/sftd # Set correct file permissions and owner chmod 0755 .acbuild/currentaci/rootfs/scaleft/bin/sftd chown 0:0 .acbuild/currentaci/rootfs/scaleft/bin/sftd # Run sftd acbuild --debug set-exec -- /scaleft/bin/sftd for m in ${MOUNT_DIRS}; do acbuild mount add "${m}" "/${m}" done acbuild --debug write --overwrite "${OUTPUT_FILE}"

slide-24
SLIDE 24

User Management: Via Agent

  • Dogfooding our own Agent
  • ScaleFT Server Daemon manages users
  • Runs via rkt fly and a systemd unit
  • www.scaleft.com/docs/sftd-coreos
slide-25
SLIDE 25

Logs on CoreOS

slide-26
SLIDE 26

Log Controls

  • User identification (see User Management)
  • Action
  • Timestamp
  • Prevent modification
  • Ship to central server
slide-27
SLIDE 27

Log Management

  • systemd-journald: yay
  • This is mostly about journal vs classic syslog
  • More systemd journal integrations happening every day
slide-28
SLIDE 28

First Strategy

1. journalctl -o json 2. shell script to upload to s3

slide-29
SLIDE 29

Round 2: In progress

  • journalbeat in rkt fly:

○ Pulls from journal using CGO bindings ○ Cursor integration ○ github.com/mheese/journalbeat

  • ACI build:

○ github.com/authclub/journalbeat-aci

slide-30
SLIDE 30

Updates on CoreOS

slide-31
SLIDE 31

Updates Controls

  • Change control / documented approval procedures
  • If Anti-virus, auto-updates: +1
  • If not: Anti-virus: ?
slide-32
SLIDE 32

Auto Updates

Here’s how you turn off CoreOS Linux’s original feature: echo REBOOT_STRATEGY=off | sudo tee -a /etc/coreos/update.conf See also: update_engine_client -status update_engine_client -update CoreUpdate by CoreOS

slide-33
SLIDE 33

Thanks!

@pquerna paul@scaleft.com paul.querna.org/slides