For auditing purpose, need to provide all the patches applied through zypper patch command. How to list all the patches installed in last 3 months - opensuse

We are using below command to install patches regularly
zypper patch -g security
Now we need to audit all the installed patches in last 3 months. Is there a way to get a list of all installed patches in the system. We are using Suse 12 Sp5. Thanks in advance

tux > zypper list-patches --all --cve
Issue | No. | Patch | Category | Severity | Status
------+---------------+-------------------+-------------+-----------+----------
cve | CVE-2015-0287 | SUSE-SLE-Module.. | recommended | moderate | needed
cve | CVE-2014-3566 | SUSE-SLE-SERVER.. | recommended | moderate | not needed
[...]
Source is chapter 6.1.3.2 / page 49 of Administration Guide - SUSE Linux Enterprise Server 12 SP5
Not sure of this apply to opensuse also.

To list all available patches, you could use
zypper search --type patch
and to limit these results to installed patches only, please use
zypper search --type patch --installed-only
Due to missing hints in the docs, I doubt that it's currently possible to limit the results to "security" patches only, so checking the type of a patch would need to be done in a separate step.

Related

ng command not found everytime i logged to GCP Cloud Shell

I noticed everytime i login Google Cloud Shell, my 'ng' command is not recognized
weilies#cloudshell:~/dev (cloud-xp)$ cd sunny-app/
weilies#cloudshell:~/dev/sunny-app (cloud-xp)$ ng serve -disable-host-check
-bash: ng: command not found
I have to reinstall them with command then i got back my ng command.
weilies#cloudshell:~ (cloud-xp)$ ng --version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 9.1.7
Node: 10.14.2
OS: linux x64
Angular:
...
Ivy Workspace:
Package Version
------------------------------------------------------
#angular-devkit/architect 0.901.7
#angular-devkit/core 9.1.7
#angular-devkit/schematics 9.1.7
#schematics/angular 9.1.7
#schematics/update 0.901.7
rxjs 6.5.4
But one thing i noticed, the installation return with error (but it doesn't stop me running my angular app, so i simply ignored)
weilies#cloudshell:~ (cloud-xp)$ npm install -g #angular/cli
npm WARN deprecated request#2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
/usr/local/nvm/versions/node/v10.14.2/bin/ng -> /usr/local/nvm/versions/node/v10.14.2/lib/node_modules/#angular/cli/bin/ng
> #angular/cli#9.1.7 postinstall /usr/local/nvm/versions/node/v10.14.2/lib/node_modules/#angular/cli
> node ./bin/postinstall/script.js
+ #angular/cli#9.1.7
added 271 packages from 206 contributors in 15.296s
It is just annoying i need to install angular/cli everytime i login GCP Clould shell. Isn't ng installed globally with a -g flag?
This is due to the fact that, when you run npm install -g #angular/cli, it is installed globally (in the /usr/local/ directory).
Cloud Shell, however, has some limitations, one of them being that it is a "volatile" instance and any modifications that you made to it outside your $HOME are lost after the session is terminated.
Cloud Shell is meant for quick testing or administrative commands. You may rather use a Compute Engine instance (you can have 1 F1-micro instance for free) for development needs.
Cloud Shell VMs are ephemeral and are discarded at the end of each session (your Cloud Shell home directory, however, is persistent). However, it is possible to add a script to customize the Cloud Shell environment on startup. Please follow the directions in Cloud Shell documentation.

Composer outdated shows drupal/core has a newer version, but composer update says "nothing to update"

This is similar to an unanswered question from a year ago. Supposedly I have an update for drupal/core:
$ composer outdated "drupal/*"
drupal/core 8.6.10 8.6.12 Drupal is an open source content ...
But when I run update ...
$ composer update drupal/core --with-dependencies
Dependency "asm89/stack-cors" is also a root requirement, but is not explicitly whitelisted. Ignoring.
Dependency "composer/semver" is also a root requirement, but is not explicitly whitelisted. Ignoring.
[ ... ]
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
> Drupal\Core\Composer\Composer::preAutoloadDump
> Drupal\Core\Composer\Composer::ensureHtaccess
I'm trying to follow the instructions to update drupal 8 via composer found here: https://www.drupal.org/docs/8/update/update-core-via-composer
I had the same issue today with updating Drupal and the following process helped me solve the issue.
Run the composer update command using the specific version you are trying to update to. In this instance it would be composer require drupal/core:8.6.12 --update-with-dependencies If there is an issue blocking the update this should show you a list of problems. in my case I tried to update to version 8.6.11 and it output the following.
Problem 1
. Installation request for drupal/core 8.6.11 -> satisfiable by
drupal/core[8.6.11].
. Can only install one of: twig/twig[1.x-dev, v1.35.3].
. Can only install one of: twig/twig[v1.35.3, 1.x-dev].
. Can only install one of: twig/twig[1.x-dev, v1.35.3].
. drupal/core 8.6.11 requires twig/twig ^1.38.2 -> satisfiable by
twig/twig[1.x-dev, v1.38.2].
. Conclusion: don't install twig/twig v1.38.2
. Installation request for twig/twig (locked at v1.35.3, required as
^1.35.0) -> satisfiable by twig/twig[v1.35.3].
If there is no problem listed try clearing the composer cache composer clearcache and then try the update command again.
you can also try running the why-not composer command to see if that highlights any issues composer why-not drupal/core:8.6.12
In my case the issue was that the twig component required for 8.6.12 was v1.38.2 but was capped at a lower version 1.35 in the composer file. I used the following command to update the twig version and that allowed me to update to Drupal 8.6.12 using my normal update process.
composer require twig/twig:1.35.2
I hope this helps.

Is it possible to pull the build number from a running Google Container-Optimized OS?

According to this page, one can pull the kernel sources from the following location in Google Cloud Storage.
gs://cos-tools/<build-number>/
I am trying to find the source for a running instance of the Container-Optimized OS, but I have not found documentation describing how to extract a build number from the running instance. The output of uname -r is 4.4.111+ but I do not know how to map this to a build number that I can use for pulling the source.
How does one find the build number?
Inside the running COS instance, you can find the version in /etc/lsb-release.
$ cat /etc/lsb-release | grep CHROMEOS_RELEASE_VERSION
CHROMEOS_RELEASE_VERSION=10452.101.0
Then, in a machine with gsutil installed and configured
$ gsutil ls gs://cos-tools/10452.101.0/
gs://cos-tools/10452.101.0/kernel-src.tar.gz
gs://cos-tools/10452.101.0/kernel-src.tar.gz.md5
The best way would be to look at /etc/os-release:
$ cat /etc/os-release | grep BUILD_ID
BUILD_ID=12607.7.0
See this Chromium OS design doc for more details of the meaning of all the fields in /etc/lsb-release and /etc/os-release in Chromium OS, and whether you can rely on it or not. Container-optimized OS is based on Chromium OS.

Startup script logs location

In Google Cloud Platform's Ubuntu 16.04.1 instance, the output of my startup script was written to /var/log/startupscript.log.
Since they upgraded to 16.04.02 I can't find the logs anymore.
Any idea?
UPDATE from the official documentation:
Startup script output is written to the following log files:
CentOS and RHEL: /var/log/messages
Debian: /var/log/daemon.log
Ubuntu 14.04, 16.04, and 16.10: /var/log/syslog
SLES 11 and 12: /var/log/messages
The correct answer (by now) is to use journalctl:
sudo journalctl -u google-startup-scripts.service
You can re-run a startup script like this:
sudo google_metadata_script_runner startup
See also: https://cloud.google.com/compute/docs/instances/startup-scripts/linux
There are two ways to search for the log file probably a lot more but i know the below.
locate -i startupscript.log - you may need to update your indexes periodically for this option to be optimal.
From root find / -iname startupscript.log -print .

gcloud compute no longer available after migration to v2beta2

After running: gcloud components update beta
It seems I lost compute commands:
gcloud -h
Usage: gcloud [optional flags] <group | command>
group may be auth | beta | components | config | dns | preview |
topic
command may be docker | help | info | init | version
How do I get compute back in order to run simple things like: gcloud compute images list --project google-containers | grep container-vm?
I followed migration path from: https://cloud.google.com/deployment-manager/latest/migration-guide
This is my gcloud -v:
Google Cloud SDK 0.9.67
beta 2015.06.30
bq 2.0.18
bq-nix 2.0.18
core 2015.06.30
core-nix 2015.06.02
gcloud 2015.06.30
gcutil-msg 2015.06.09
gsutil 4.13
gsutil-nix 4.12
preview 2015.06.30
Everytime I run the compute command, console gets in loop until I kill with ctrl+c:
[gcloud _19:33:01 $]]^_^ gcloud compute -h
You do not currently have this command group installed. Using it
requires the installation of components: [compute]
WARNING: Component [compute] no longer exists.
All components are up to date.
Restarting gcloud command:
$ gcloud compute -h
You do not currently have this command group installed. Using it
requires the installation of components: [compute]
WARNING: Component [compute] no longer exists.
All components are up to date.
Restarting gcloud command:
$ gcloud compute -h
^C
Is there anything I missed?
cheers
Leo
I had same error after updating my gcloud tools. I had to replace the current one by re-installing the gcloud kit to make it work.