
Security News
Feross on the 10 Minutes or Less Podcast: Nobody Reads the Code
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.
A TypeScript library that uses Ollama to parse SSH output into structured data using Zod schemas.
npm install ssh-llama
First, define your Zod schema for the data structure you want to parse:
import { z } from 'zod';
import { parseSSHWithSchema } from './sshTransformer';
const schema = z.object({
hostname: z.string(),
uptime: z.number(),
users: z.array(z.string()),
});
// Example SSH output
const sshOutput = `Linux webserver-prod-01 5.15.0-1054-aws
14:23:02 up 14 days, 6:42, 3 users
USER TTY FROM LOGIN@ IDLE
ubuntu pts/0 172.31.45.2 14:20 1.00s
jenkins pts/1 172.31.45.2 10:15 3:12
deploy pts/2 172.31.45.2 13:45 2.00s`;
// Parse the output
const result = await parseSSHWithSchema(schema, 'llama2', sshOutput);
console.log(result);
// {
// hostname: 'webserver-prod-01',
// uptime: 1209600,
// users: ['ubuntu', 'jenkins', 'deploy']
// }
parseSSHWithSchema<T>(schema: ZodSchema<T>, model: string, rawSSHString: string): Promise<T | null>Parses raw SSH output into a structured object based on a given Zod schema.
schema: A Zod schema that defines the structure of the outputmodel: The Ollama model to use (e.g., "llama2")rawSSHString: The raw SSH output to parsenull if parsing failsnpm run build
# Run tests once
npm test
# Run tests in watch mode
npm run test:watch
npm run example
The library has been tested with various network device outputs:
ISC
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)FAQs
Parse SSH output with Zod and Ollama
We found that ssh-llama demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

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.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.